Class UniformSpaceSampling
java.lang.Object
cz.fidentis.analyst.engines.sampling.impl.PointSamplingVisitorImpl
cz.fidentis.analyst.engines.sampling.impl.UniformSpaceSampling
- All Implemented Interfaces:
MeshVisitor
,PointSamplingVisitor
- Direct Known Subclasses:
UniformSurfaceSampling
This downsampling algorithm divides the space uniformly using 3D grid.
Then, it computes and returns average position (centroid) of points in grid cells.
The number of samples is often slightly higher the required number.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected UniformGrid3d
<MeshPoint> protected double
getAvgDist
(Collection<MeshPoint> vertices, javax.vecmath.Point3d centroid) Computes the average distance between vertices and their centroid.Returns a list of vertices reduced according to the strategy.boolean
Iftrue
, then the returned points samples are points from the original mesh.toString()
void
visitMeshFacet
(MeshFacet facet) The inspection method to be implemented by specific visitors.Methods inherited from class cz.fidentis.analyst.engines.sampling.impl.PointSamplingVisitorImpl
getRequiredSamples, setRealSamples, setRequiredSamples
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface cz.fidentis.analyst.data.mesh.MeshVisitor
dispose, isThreadSafe
-
Constructor Details
-
UniformSpaceSampling
public UniformSpaceSampling(int max) Constructor.- Parameters:
max
- Required number of samples. Must be bigger than zero- Throws:
IllegalArgumentException
- if the input parameter is wrong
-
-
Method Details
-
isBackedByOrigMesh
public boolean isBackedByOrigMesh()Description copied from interface:PointSamplingVisitor
Iftrue
, then the returned points samples are points from the original mesh. Therefore, the transformation of the original mesh also transform these samples. Iffalse
, then new points are returned that are independent on the original mesh.- Specified by:
isBackedByOrigMesh
in interfacePointSamplingVisitor
- Specified by:
isBackedByOrigMesh
in classPointSamplingVisitorImpl
- Returns:
true
if the point samples include points of the original mesh
-
visitMeshFacet
Description copied from interface:MeshVisitor
The inspection method to be implemented by specific visitors.- Specified by:
visitMeshFacet
in interfaceMeshVisitor
- Specified by:
visitMeshFacet
in interfacePointSamplingVisitor
- Specified by:
visitMeshFacet
in classPointSamplingVisitorImpl
- Parameters:
facet
- Mesh facet to be visited.
-
getSamples
Description copied from interface:PointSamplingVisitor
Returns a list of vertices reduced according to the strategy. The returned mesh points are backed by original points.- Specified by:
getSamples
in interfacePointSamplingVisitor
- Specified by:
getSamples
in classPointSamplingVisitorImpl
- Returns:
- selected vertices of inspected meshes
-
toString
- Overrides:
toString
in classPointSamplingVisitorImpl
-
getOrigPoints
-
getAvgDist
Computes the average distance between vertices and their centroid.- Parameters:
vertices
- verticescentroid
- their centroid- Returns:
- the average distance between vertices and their centroid.
-
createGrid
-