jvx.volume
Class PwTetraSet
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.project.PjWorkshop
-
- jvx.volume.PwTetraSet
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PjWorkshopIf
public class PwTetraSet extends PjWorkshop
Workshop for tetrahedron related works.- See Also:
- Serialized Form
- Author:
- Samy Khadem-Al-Charieh, Ulrich Reitebuch
- Version:
- 09.03.15, 2.00 revised (kp) Moved to jvx.volume from dev.volume.
10.12.10, 1.20 revised (ur) Allow computing level surfaces from scalar data.
08.03.10, 1.10 revised (ur) Super class changed to PjWorkshop, computation of intersection completely rewritten, function moved to this class.
06.11.00, 1.00 created (separated and modified from PgTetraSet).
-
-
Field Summary
Fields Modifier and Type Field and Description static intINPUT_FUNCTIONIdentifier for computing level surface from a scalar function, which will be evaluated at vertices and along edges.static intINPUT_SCALAR_DATAIdentifier for computing level surface from scalar data on vertices.intm_inputTypeFlag to select input data.-
Fields inherited from class jv.object.PsObject
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
-
Fields inherited from interface jv.project.PjWorkshopIf
MODE_BUG, MODE_STANDARD, MODE_VALIDATE
-
-
Constructor Summary
Constructors Constructor and Description PwTetraSet()Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static PgVectorField[]addTestFrameField(PgTetraSet tetraSet, boolean addFieldsToGeometry)Add a test frame field to the given PgTetraSet.static voidaddTestTexture(PgTetraSet tetraSet)Add a test tetra-based texture.static voidaddTestVectorField(PgTetraSet tetraSet)Test for using element based vector field in PgTetraSet.voidcolorVertices()Color the vertices of the workshop's PgTetraSet by function values.static float[]colorVertices(PgPointSet geom, float[] data)Colors the vertices according to the ind-th data set.static PgEdgeStarcomputeEdgeStar(PgTetraSet tetraSet, int tetIndex, int vertexIndex1, int vertexIndex2, PgEdgeStar edgeStar)Compute the edge star.static PgEdgeStarcomputeEdgeStar(PgTetraSet tetraSet, int tetIndex, int edgeIndex, PgEdgeStar edgeStar)Compute the edge star.PgElementSetcomputeLevelSurface()Compute the level surface in the Workshop's PgTetraSet volume.static PgElementSetconvertFacesToElementSet(PgTetraSet geom)Compute a polygon set with a polygon for each edge in this tetra set.static PgElementSetconvertToElementSet(PgTetraSet tetraSet)Store tetrahedra to quadrilaterals in a PgElementSet.static PgPolygonSetconvertToPolygonSet(PgTetraSet geom)Compute a polygon set with a polygon for each edge in this tetra set.static PgVectorField[]deriveTexture(PgTetraSet geom)Compute two vector fields as the gradients of the actual textures.static booleanedgeStarIsClosed(PgTetraSet tetraSet, PgEdgeStar edgeStar)Check if an edge star is closed.intgetInputType()Get the kind of data for computing level surfaces.static PgElementSetgetLevelSurface(PgTetraSet tetraSet, PgElementSet surface, PdVector scalarData, double levelValue)Scan the tetrahedra of the geometry for intersections with the level surface of the passed function.static PgElementSetgetLevelSurface(PgTetraSet tetraSet, PgElementSet surface, PuFunction function, double levelValue)Scan the tetrahedra of the geometry for intersections with the level surface of the passed function.doublegetLevelValue()Get current level value.static intgetLocalEdgeIndex(PgTetraSet tetraSet, int tetIndex, int vertexIndex1, int vertexIndex2)Get the local edge index in a tetrahedron.voidgetNegativeTetraSet()Add the negative part of the workshops tetraSet as new PgetraSet to the displayvoidgetPositiveTetraSet()Add the positive part of the workshops tetraSet as new PgetraSet to the displayPdVectorgetScalarData()Get Scalar Data per PgTetraSet Vertex.PgElementSetgetSurface()Get the computed level surface.PiVector[]getTetToBndIndices(PgBndElementSet bnd)Generate the inverse information to PgBndELementSet.m_tetraInd.static PdVectorgetVertex(PdVector vertex, PgTetraSet geom, PdBary bary)Get vertex from barycentric coordinates on a tetraset.voidglobalRefine()Refine the workshop's PgTetraSet globally.static java.util.VectorgrepValue(PgTetraSet tetra, PdVector scalarData, double value)Find all tetrahedra that have an intersection with the level surface with given value of a given function.static java.util.VectorgrepValue(PgTetraSet tetra, PuFunction function, double value)Find all tetrahedra that have an intersection with the level surface with given value of a given function.voidinit()Initialization.static voidintersect(PgTetraSet tetra, PgElementSet surface, PuFunction func)Scans the tetrahedron of the geometry for intersections with the zero surface of the passed function.static voidintersect(PgTetraSet tetra, PgElementSet surface, PuFunction func, double levelValue)Scan all tetrahedra of the geometry for intersections with a level surface of the passed function.static PgTetraSetintersectTetraSet(PgTetraSet tetraSet, PgTetraSet partTetraSet, PdVector scalarData, double levelValue, boolean bPositive)Compute a PgTetraSet showing the lower or upper part of the workshop's PgTetraSet, evaluated by scalar data.static PgTetraSetintersectTetraSet(PgTetraSet tetraSet, PgTetraSet partTetraSet, PuFunction function, double levelValue, boolean bPositive)Compute a PgTetraSet showing the lower or upper part of the workshop's PgTetraSet, evaluated by the function.static booleanis3Dim(double[][] vertex)Checks if four vertices span a three dimensional volume.static voidmakeBoundary(PgTetraSet tetraSet)Compute the boundary connectivity.static PiVector[]makeBoundaryFaces(PgTetraSet tetraSet)Compute list of boundary triangles, keep original vertex indices.static PdVectormakeFaceNormal(PgTetraSet geom, int tet, int locFaceInd)Compute the normal on a face of a given tetrahedron.intremoveNonIntersectingTetrahedra(boolean bRemovePositive)Remove tetrahedra not intersecting the level set.static intremoveNonIntersectingTetrahedra(PgTetraSet tetraSet, PuFunction function, double levelValue, boolean bRemovePositive)voidrivaraRefine()In the workshop's PgTetraSet refine all tetrahedra intersected by the level surface.voidsetGeometry(PgGeometry geom)Set the geometry to work on.voidsetInputType(int inputType)Define the kind of data for computing level surfaces.voidsetLevelValue(double value)Set level value.voidsetScalarData(PdVector scalarData)Set Scalar Data per PgTetraSet Vertex.static PiVectorsplitNonManifoldVertices(PgTetraSet geom)Search for vertices with more than one coherent link of adjacent elements and disconnect those to good discrete manifold vertices, each belonging to one of the element links.static voidtestEdgeStars(PgTetraSet tetraSet)Test ComputeEdgeStar method.static voidtestVertexStars(PgTetraSet tetraSet)Test PgTetraVertexSTar.makeVertexStar method.static voidunfoldByTexture(PgTetraSet geom)Copies texture coordinates into vertex coordinates.booleanupdate(java.lang.Object event)Update the class whenever a child has changed.-
Methods inherited from class jvx.project.PjWorkshop
cancel, close, getDisplay, getDisplays, getGeometry, getMode, getSavedGeometry, getViewer, isModal, isStandalone, ok, removeGeometry, reset, setDisplay, setDisplays, setModal, setMode, setStandalone, setViewer
-
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jv.object.PsUpdateIf
getFather, getName, setParent
-
-
-
-
Field Detail
-
INPUT_FUNCTION
public static final int INPUT_FUNCTION
Identifier for computing level surface from a scalar function, which will be evaluated at vertices and along edges.- See Also:
- Constant Field Values
-
INPUT_SCALAR_DATA
public static final int INPUT_SCALAR_DATA
Identifier for computing level surface from scalar data on vertices.- See Also:
- Constant Field Values
-
m_inputType
public int m_inputType
Flag to select input data.
-
-
Method Detail
-
init
public void init()
Initialization.- Overrides:
initin classPjWorkshop
-
update
public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPjWorkshop- Parameters:
event- sender of this update.- Returns:
- true if update was correctly handled by superclass.
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
getSurface
public PgElementSet getSurface()
Get the computed level surface.
-
setGeometry
public void setGeometry(PgGeometry geom)
Set the geometry to work on.- Specified by:
setGeometryin interfacePjWorkshopIf- Overrides:
setGeometryin classPjWorkshop- Parameters:
geom- the workshop modifies this geometry.
-
setInputType
public void setInputType(int inputType)
Define the kind of data for computing level surfaces.
-
getInputType
public int getInputType()
Get the kind of data for computing level surfaces.
-
setScalarData
public void setScalarData(PdVector scalarData)
Set Scalar Data per PgTetraSet Vertex.
-
getScalarData
public PdVector getScalarData()
Get Scalar Data per PgTetraSet Vertex.
-
setLevelValue
public void setLevelValue(double value)
Set level value.
-
getLevelValue
public double getLevelValue()
Get current level value.
-
getPositiveTetraSet
public void getPositiveTetraSet()
Add the positive part of the workshops tetraSet as new PgetraSet to the display
-
getNegativeTetraSet
public void getNegativeTetraSet()
Add the negative part of the workshops tetraSet as new PgetraSet to the display
-
computeLevelSurface
public PgElementSet computeLevelSurface()
Compute the level surface in the Workshop's PgTetraSet volume.- Returns:
- Level surface as PgElementSet.
-
globalRefine
public void globalRefine()
Refine the workshop's PgTetraSet globally.
-
rivaraRefine
public void rivaraRefine()
In the workshop's PgTetraSet refine all tetrahedra intersected by the level surface.
-
colorVertices
public void colorVertices()
Color the vertices of the workshop's PgTetraSet by function values.
-
grepValue
public static java.util.Vector grepValue(PgTetraSet tetra, PuFunction function, double value)
Find all tetrahedra that have an intersection with the level surface with given value of a given function.- Parameters:
tetra- APgTetraSetto scan.value- Adoublewith the wanted value.- Returns:
- A
Vectorwith the indices of the matching tetrahedra.
-
grepValue
public static java.util.Vector grepValue(PgTetraSet tetra, PdVector scalarData, double value)
Find all tetrahedra that have an intersection with the level surface with given value of a given function.- Parameters:
tetra- APgTetraSetto scan.value- Adoublewith the wanted value.- Returns:
- A
Vectorwith the indices of the matching tetrahedra.
-
getLevelSurface
public static PgElementSet getLevelSurface(PgTetraSet tetraSet, PgElementSet surface, PuFunction function, double levelValue)
Scan the tetrahedra of the geometry for intersections with the level surface of the passed function.- Parameters:
tetraSet- APgTetraSetto be scanned.surface- APgElementSetthat gets the intersection (may be null).function- APuFunctionto be used.levelValue- Alevel valueto be used.- Author:
- Ulrich Reitebuch
- Version:
- 21.02.10, 1.00 created (ur).
-
getLevelSurface
public static PgElementSet getLevelSurface(PgTetraSet tetraSet, PgElementSet surface, PdVector scalarData, double levelValue)
Scan the tetrahedra of the geometry for intersections with the level surface of the passed function.- Parameters:
tetraSet- APgTetraSetto be scanned.surface- APgElementSetthat gets the intersection (may be null).scalarData- APdVectorto be used.levelValue- Alevel valueto be used.- Author:
- Ulrich Reitebuch
- Version:
- 10.12.10, 1.00 created (ur).
-
intersectTetraSet
public static PgTetraSet intersectTetraSet(PgTetraSet tetraSet, PgTetraSet partTetraSet, PuFunction function, double levelValue, boolean bPositive)
Compute a PgTetraSet showing the lower or upper part of the workshop's PgTetraSet, evaluated by the function.
-
intersectTetraSet
public static PgTetraSet intersectTetraSet(PgTetraSet tetraSet, PgTetraSet partTetraSet, PdVector scalarData, double levelValue, boolean bPositive)
Compute a PgTetraSet showing the lower or upper part of the workshop's PgTetraSet, evaluated by scalar data.
-
intersect
public static void intersect(PgTetraSet tetra, PgElementSet surface, PuFunction func)
Scans the tetrahedron of the geometry for intersections with the zero surface of the passed function.- Parameters:
tetra- APgTetraSetto be scanned.surface- APgElementSetthat gets the intersection.func- APuFunctionto be used.
-
intersect
public static void intersect(PgTetraSet tetra, PgElementSet surface, PuFunction func, double levelValue)
Scan all tetrahedra of the geometry for intersections with a level surface of the passed function.- Parameters:
tetra- APgTetraSetto be scanned.surface- APgElementSetthat gets the intersection.func- APuFunctionto be used.levelValue- value for level surface.
-
is3Dim
public static boolean is3Dim(double[][] vertex)
Checks if four vertices span a three dimensional volume. If more then four vertices are passed only the first ones are checked!- Parameters:
vertex- Adouble[][]with the vertices coordinates.- Returns:
- A
booleanindicating if spanned volume is three dimensional.
-
removeNonIntersectingTetrahedra
public int removeNonIntersectingTetrahedra(boolean bRemovePositive)
Remove tetrahedra not intersecting the level set.- Parameters:
bRemovePositive- Flag to remove strict positive or strict negative tetrahedra.- Returns:
- number of removed tetrahedra.
- Author:
- Ulrich Reitebuch
- Version:
- 09.03.10, 1.00 (ur) created
-
removeNonIntersectingTetrahedra
public static int removeNonIntersectingTetrahedra(PgTetraSet tetraSet, PuFunction function, double levelValue, boolean bRemovePositive)
-
colorVertices
public static float[] colorVertices(PgPointSet geom, float[] data)
Colors the vertices according to the ind-th data set. First the maximal and minimal values are searched for. Values are coded starting from blue for the minimal value and linearly growing while passing cyan, green and yellow till red for the maximal value. Vertices with unset data entries are colored black and supernumerary data is ignored.- Parameters:
geom- APgPointSetwith the geometry to color.data- APdVector[]with the data sets.- Returns:
- float[] A
float[]with the minimum and maximum.
-
makeBoundary
public static void makeBoundary(PgTetraSet tetraSet)
Compute the boundary connectivity. Here all boundary triangles of a given PgTetraSet are put into one PgBndElementSet.- Author:
- Ulrich Reitebuch
- Version:
- 24.03.10, 1.00 (ur) created
-
makeBoundaryFaces
public static PiVector[] makeBoundaryFaces(PgTetraSet tetraSet)
Compute list of boundary triangles, keep original vertex indices.- Author:
- Ulrich Reitebuch
- Version:
- 29.11.12, 1.00 (ur) created
-
getTetToBndIndices
public PiVector[] getTetToBndIndices(PgBndElementSet bnd)
Generate the inverse information to PgBndELementSet.m_tetraInd.- Author:
- Ulrich Reitebuch
- Version:
- 25.03.10, 1.00 (ur) created
-
convertToElementSet
public static PgElementSet convertToElementSet(PgTetraSet tetraSet)
Store tetrahedra to quadrilaterals in a PgElementSet.- Author:
- Ulrich Reitebuch
- Version:
- 25.03.10, 1.00 (ur) created
-
addTestVectorField
public static void addTestVectorField(PgTetraSet tetraSet)
Test for using element based vector field in PgTetraSet.- Author:
- Ulrich Reitebuch
- Version:
- 25.03.10, 1.00 (ur) created
-
addTestFrameField
public static PgVectorField[] addTestFrameField(PgTetraSet tetraSet, boolean addFieldsToGeometry)
Add a test frame field to the given PgTetraSet.- Author:
- Ulrich Reitebuch
- Version:
- 22.04.10, 1.00 (ur) created
-
computeEdgeStar
public static PgEdgeStar computeEdgeStar(PgTetraSet tetraSet, int tetIndex, int vertexIndex1, int vertexIndex2, PgEdgeStar edgeStar)
Compute the edge star. Tetrahedra will be added in cyclic order.- Author:
- Ulrich Reitebuch
- Version:
- 29.03.10, 1.00 (ur) created
-
computeEdgeStar
public static PgEdgeStar computeEdgeStar(PgTetraSet tetraSet, int tetIndex, int edgeIndex, PgEdgeStar edgeStar)
Compute the edge star. Tetrahedra will be added in cyclic order.- Author:
- Ulrich Reitebuch
- Version:
- 26.03.10, 1.00 (ur) created
-
testEdgeStars
public static void testEdgeStars(PgTetraSet tetraSet)
Test ComputeEdgeStar method.- Author:
- Ulrich Reitebuch
- Version:
- 26.03.10, 1.00 (ur) created
-
getLocalEdgeIndex
public static int getLocalEdgeIndex(PgTetraSet tetraSet, int tetIndex, int vertexIndex1, int vertexIndex2)
Get the local edge index in a tetrahedron.- Author:
- Ulrich Reitebuch
- Version:
- 29.03.10, 1.00 (ur) created
-
edgeStarIsClosed
public static boolean edgeStarIsClosed(PgTetraSet tetraSet, PgEdgeStar edgeStar)
Check if an edge star is closed. The edgeStar is supposed to be given in cyclic order (as computed bycomputeEdgeStar.- Author:
- Ulrich Reitebuch
- Version:
- 29.03.10, 1.00 (ur) created
-
testVertexStars
public static void testVertexStars(PgTetraSet tetraSet)
Test PgTetraVertexSTar.makeVertexStar method.- Author:
- Ulrich Reitebuch
- Version:
- 30.03.10, 1.00 (ur) created
-
addTestTexture
public static void addTestTexture(PgTetraSet tetraSet)
Add a test tetra-based texture.- Parameters:
tetraSet-
-
deriveTexture
public static PgVectorField[] deriveTexture(PgTetraSet geom)
Compute two vector fields as the gradients of the actual textures.- Author:
- Matthias Nieser
- Version:
- 09.07.10, 1.00 created (mn) Created from existing method PgUtil.deriveTexture.
-
unfoldByTexture
public static void unfoldByTexture(PgTetraSet geom)
Copies texture coordinates into vertex coordinates.- Author:
- Matthias Nieser
- Version:
- 18.08.10, 1.00 created (mn)
-
splitNonManifoldVertices
public static PiVector splitNonManifoldVertices(PgTetraSet geom)
Search for vertices with more than one coherent link of adjacent elements and disconnect those to good discrete manifold vertices, each belonging to one of the element links. This method requires correct neighbourhood information.- Returns:
- PiVector containing the index map new vertex index to old vertex index.
- Author:
- Matthias Nieser
- Version:
- 19.08.10, 1.00 created (mn)
-
convertToPolygonSet
public static PgPolygonSet convertToPolygonSet(PgTetraSet geom)
Compute a polygon set with a polygon for each edge in this tetra set.
-
convertFacesToElementSet
public static PgElementSet convertFacesToElementSet(PgTetraSet geom)
Compute a polygon set with a polygon for each edge in this tetra set.
-
getVertex
public static PdVector getVertex(PdVector vertex, PgTetraSet geom, PdBary bary)
Get vertex from barycentric coordinates on a tetraset.- Parameters:
vertex- Output vector for the coordinates of the point, may be null.geom- Given tetra set.bary- Barycentric coordinates, must be of dimension 4.- Returns:
- either argument vertex, or newly created vertex if argument was null.
- Author:
- Matthias Nieser
- Version:
- 11.01.11, 1.00 created (mn)
- ToDo:
- Move to PwBary, when dev.volume moves to jvx.
-
makeFaceNormal
public static PdVector makeFaceNormal(PgTetraSet geom, int tet, int locFaceInd)
Compute the normal on a face of a given tetrahedron.- Parameters:
geom- Tetra set.tet- Index of a tetrahedron.locFaceInd- Local index of a face in tet.- Returns:
- The normal vector on the face, pointing inward the tet.
- Author:
- Matthias Nieser
- Version:
- 11.01.11, 1.00 created (mn)
-
-
"