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 int` | `INPUT_FUNCTION` Identifier for computing level surface from a scalar function, which will be evaluated at vertices and along edges.
    `static int` | `INPUT_SCALAR_DATA` Identifier for computing level surface from scalar data on vertices.
    `int` | `m_inputType` Flag 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 void` | `addTestTexture(PgTetraSet tetraSet)` Add a test tetra-based texture.
    `static void` | `addTestVectorField(PgTetraSet tetraSet)` Test for using element based vector field in PgTetraSet.
    `void` | `colorVertices()` 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 PgEdgeStar` | `computeEdgeStar(PgTetraSet tetraSet, int tetIndex, int vertexIndex1, int vertexIndex2, PgEdgeStar edgeStar)` Compute the edge star.
    `static PgEdgeStar` | `computeEdgeStar(PgTetraSet tetraSet, int tetIndex, int edgeIndex, PgEdgeStar edgeStar)` Compute the edge star.
    `PgElementSet` | `computeLevelSurface()` Compute the level surface in the Workshop's PgTetraSet volume.
    `static PgElementSet` | `convertFacesToElementSet(PgTetraSet geom)` Compute a polygon set with a polygon for each edge in this tetra set.
    `static PgElementSet` | `convertToElementSet(PgTetraSet tetraSet)` Store tetrahedra to quadrilaterals in a PgElementSet.
    `static PgPolygonSet` | `convertToPolygonSet(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 boolean` | `edgeStarIsClosed(PgTetraSet tetraSet, PgEdgeStar edgeStar)` Check if an edge star is closed.
    `int` | `getInputType()` Get the kind of data for computing level surfaces.
    `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.
    `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.
    `double` | `getLevelValue()` Get current level value.
    `static int` | `getLocalEdgeIndex(PgTetraSet tetraSet, int tetIndex, int vertexIndex1, int vertexIndex2)` Get the local edge index in a tetrahedron.
    `void` | `getNegativeTetraSet()` Add the negative part of the workshops tetraSet as new PgetraSet to the display
    `void` | `getPositiveTetraSet()` Add the positive part of the workshops tetraSet as new PgetraSet to the display
    `PdVector` | `getScalarData()` Get Scalar Data per PgTetraSet Vertex.
    `PgElementSet` | `getSurface()` Get the computed level surface.
    `PiVector[]` | `getTetToBndIndices(PgBndElementSet bnd)` Generate the inverse information to PgBndELementSet.m_tetraInd.
    `static PdVector` | `getVertex(PdVector vertex, PgTetraSet geom, PdBary bary)` Get vertex from barycentric coordinates on a tetraset.
    `void` | `globalRefine()` Refine the workshop's PgTetraSet globally.
    `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.
    `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.
    `void` | `init()` Initialization.
    `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.
    `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.
    `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.
    `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.
    `static boolean` | `is3Dim(double[][] vertex)` Checks if four vertices span a three dimensional volume.
    `static void` | `makeBoundary(PgTetraSet tetraSet)` Compute the boundary connectivity.
    `static PiVector[]` | `makeBoundaryFaces(PgTetraSet tetraSet)` Compute list of boundary triangles, keep original vertex indices.
    `static PdVector` | `makeFaceNormal(PgTetraSet geom, int tet, int locFaceInd)` Compute the normal on a face of a given tetrahedron.
    `int` | `removeNonIntersectingTetrahedra(boolean bRemovePositive)` Remove tetrahedra not intersecting the level set.
    `static int` | `removeNonIntersectingTetrahedra(PgTetraSet tetraSet, PuFunction function, double levelValue, boolean bRemovePositive)`
    `void` | `rivaraRefine()` In the workshop's PgTetraSet refine all tetrahedra intersected by the level surface.
    `void` | `setGeometry(PgGeometry geom)` Set the geometry to work on.
    `void` | `setInputType(int inputType)` Define the kind of data for computing level surfaces.
    `void` | `setLevelValue(double value)` Set level value.
    `void` | `setScalarData(PdVector scalarData)` Set Scalar Data per PgTetraSet Vertex.
    `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.
    `static void` | `testEdgeStars(PgTetraSet tetraSet)` Test ComputeEdgeStar method.
    `static void` | `testVertexStars(PgTetraSet tetraSet)` Test PgTetraVertexSTar.makeVertexStar method.
    `static void` | `unfoldByTexture(PgTetraSet geom)` Copies texture coordinates into vertex coordinates.
    `boolean` | `update(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.

  - ### Constructor Detail

    - #### PwTetraSet

          public PwTetraSet()

      Constructor

  - ### Method Detail

    - #### init

          public void init()

      Initialization.
      Overrides:
        `init` in class `PjWorkshop`

    - #### 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:
        `update` in interface `PsUpdateIf`
      Overrides:
        `update` in class `PjWorkshop`
      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:
        `setGeometry` in interface `PjWorkshopIf`
      Overrides:
        `setGeometry` in class `PjWorkshop`
      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` - A `PgTetraSet` to scan.
        `value` - A `double` with the wanted value.
      Returns:
        A `Vector` with 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` - A `PgTetraSet` to scan.
        `value` - A `double` with the wanted value.
      Returns:
        A `Vector` with 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` - A `PgTetraSet` to be scanned.
        `surface` - A `PgElementSet` that gets the intersection (may be null).
        `function` - A `PuFunction` to be used.
        `levelValue` - A `level value` to 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` - A `PgTetraSet` to be scanned.
        `surface` - A `PgElementSet` that gets the intersection (may be null).
        `scalarData` - A `PdVector` to be used.
        `levelValue` - A `level value` to 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` - A `PgTetraSet` to be scanned.
        `surface` - A `PgElementSet` that gets the intersection.
        `func` - A `PuFunction` to 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` - A `PgTetraSet` to be scanned.
        `surface` - A `PgElementSet` that gets the intersection.
        `func` - A `PuFunction` to 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` - A `double[][]` with the vertices coordinates.
      Returns:
        A `boolean` indicating 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` - A `PgPointSet` with the geometry to color.
        `data` - A `PdVector[]` 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 by `computeEdgeStar`.
      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)

"

The software JavaView? is copyright protected. All Rights Reserved.
"