Class MiPointProbeUnstructured
- java.lang.Object
-
- com.openinventor.meshvizxlm.extractors.pointprobe.MiPointProbeUnstructured
-
public abstract class MiPointProbeUnstructured extends java.lang.Object
Probe at a given location in an unstructured mesh.This class can be used to evaluate the value of a data set in the given mesh at any location. The probe is internally building an octree onto volume meshes.
This octree can be optimized by setting three environment variables (seeSoPreferences
):-
SoPreferences.MESHVIZ_OCTREE_CACHE_CELLBBOX
allows to cache cell bounding boxes in order to speed up the search for cells in the octree, thus probing faster. The default is 0 (not cached) -
SoPreferences.MESHVIZ_OCTREE_MAX_CELL_PER_TILE
specifies the maximum number of cells that can belong to a tile in the octree. Note that only leaves can contain cells. Hence, this is the breaking criteria to split up a leaf and distribute its cells into the new-born children. The smaller this number, the deeper the octree, which will speed up probing but slow down the initialization stage. The default is 40. -
SoPreferences.MESHVIZ_OCTREE_MAX_DEPTH
specifies the depth limit of the octree to prevent from using too much memory. Note that when reaching the depth limit, tiles at this level can exceed the number of cells allowed. The default is 6.
-
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract long
getCellId()
Gets the id of the cell of the mesh containing the current location of the probe.abstract double[]
getCoord()
Gets the coordinates of the current location of the probe.static <C extends MiSurfaceCell,T extends MiSurfaceTopologyExplicitI<C>,G extends MiGeometryI>
MiPointProbeUnstructuredgetNewInstance(MiSurfaceMeshUnstructured<C,T,G> mesh)
Create an instance of a probe for unstructured surface mesh.static <C extends MiVolumeCell,T extends MiVolumeTopologyExplicitI<C>,G extends MiGeometryI>
MiPointProbeUnstructuredgetNewInstance(MiVolumeMeshUnstructured<C,T,G> mesh)
Create an instance of a probe for unstructured volume mesh.double
getValue(MiScalardSetI dataset)
Gets the scalar value at the current probe location in the given scalar set.double[]
getValue(MiVec3dSetI dataset)
Gets the vector value at the current probe location in the given vector set.abstract boolean
isFound()
Checks if the current probe location is inside the mesh.abstract boolean
moveLocation(double[] point, long cellId, MiCellFilterI cellFilter)
Moves the current probe location at the given point.abstract boolean
setLocation(double[] point, MiCellFilterI cellFilter)
Sets the current probe location at the given point and looks for the cell containing this point.
-
-
-
Method Detail
-
getNewInstance
public static <C extends MiVolumeCell,T extends MiVolumeTopologyExplicitI<C>,G extends MiGeometryI> MiPointProbeUnstructured getNewInstance(MiVolumeMeshUnstructured<C,T,G> mesh)
Create an instance of a probe for unstructured volume mesh.- Parameters:
mesh
- the input mesh- Returns:
- a probe for unstructured volume mesh
-
getNewInstance
public static <C extends MiSurfaceCell,T extends MiSurfaceTopologyExplicitI<C>,G extends MiGeometryI> MiPointProbeUnstructured getNewInstance(MiSurfaceMeshUnstructured<C,T,G> mesh)
Create an instance of a probe for unstructured surface mesh.- Parameters:
mesh
- the input mesh- Returns:
- a probe for unstructured surface mesh
-
setLocation
public abstract boolean setLocation(double[] point, MiCellFilterI cellFilter)
Sets the current probe location at the given point and looks for the cell containing this point.
If the probe location is inside a cell not accepted by the optional filter, this methods returnsfalse
- Parameters:
point
- the destination point of the probecellFilter
- the cell filter- Returns:
true
if this location is inside the mesh,false
otherwise
-
moveLocation
public abstract boolean moveLocation(double[] point, long cellId, MiCellFilterI cellFilter)
Moves the current probe location at the given point.This method is similar and gives the same result as
setLocation(double[], MiCellFilterI)
. But, first it looks for the containing cell in the neighborhood of the cell having idcellId
. Then, if the neighborhood of this given cell does not contain the given point this method searches in the whole mesh like the methodsetLocation
.For instance,
moveLocation
could be used instead ofsetLocation
when the cell containing the point is already known, or when the displacement of the probe is not too large compared to the cell's size at the previous location of the probe. In this case, usegetCellId()
as inputcellId
argument.- Parameters:
point
- the destination point of the probecellId
- input cell used as initial search criteria. IfMxMeshViz.UNDEFINED_ID
, this method is equivalent tosetLocation
.cellFilter
- the cell filter- Returns:
true
if this location is inside the mesh,false
otherwise
-
isFound
public abstract boolean isFound()
Checks if the current probe location is inside the mesh.- Returns:
true
if the current probe location is inside the mesh,false
otherwise
-
getCellId
public abstract long getCellId()
Gets the id of the cell of the mesh containing the current location of the probe.- Returns:
MxMeshViz.UNDEFINED_ID
if the current location of the probe is outside the mesh
-
getCoord
public abstract double[] getCoord()
Gets the coordinates of the current location of the probe.- Returns:
- coordinates array {x,y,z} of the current location of the probe
-
getValue
public double getValue(MiScalardSetI dataset)
Gets the scalar value at the current probe location in the given scalar set.
The returned value is meaningless if the probe location is outside the mesh (whenisFound()
isfalse
- Parameters:
dataset
- the input scalar set- Returns:
- scalar value at the current probe location
-
getValue
public double[] getValue(MiVec3dSetI dataset)
Gets the vector value at the current probe location in the given vector set.
The returned value isnull
if the probe location is outside the mesh (whenisFound()
isfalse
).- Parameters:
dataset
- the input vector set- Returns:
- the vector coordinates {x,y,z} at the current probe location or null if the probe location is outside the mesh
-
-