JavaView® v2.00.008

jv.geom
Class PgTetraSet

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.project.PgGeometry
              |
              +--jv.geom.PgPointSet
                    |
                    +--jv.geom.PgTetraSet
All Implemented Interfaces:
java.lang.Cloneable, PgGeometryIf, PsUpdateIf, java.io.Serializable

public class PgTetraSet
extends PgPointSet

Basic class for volumes consisting of tetrahedrons. The class contains an array with tetrahedrons. Additional instance variables for properties such as face normals and face colors.

Version:
1.09, 31 Oct 2000, Merged into jv.geom.
1.08, 13 Aug 2000, Finished work on refine(Vector).
1.07, 10 Aug 2000, getSurface now only gets surface elements of tetrahedron set.
1.06, 7 Aug 2000, Surface became intersection, m_refinementEdge added.
1.05, 6 Jul 2000, makeNeighbour corrected.
1.04, 2 Jul 2000, makeNeighbour completed.
1.03, 30 Sep 1999, m_refinementEdges added.
1.03, 30 Sep 1999, getEdgeList added.
1.03, 29 Sep 1999, makeNeighbour, getFaceList now working.
1.02, 31 Aug 1999, makeQuadrConn method corrected (produced degenerated tetrahedron #2) and alphabetically rearranged.
1.01, 27 Aug 1999, makeSurface method added.
1.00, 27 Aug 1999, Derived from PgElementSet.
Author:
Samy Khadem-Al-Charieh
See Also:
Serialized Form

Field Summary
protected  boolean m_bShowElementColors
          Flag if global color of elements used in display, applied if no individual element coloring available.
protected static int m_dimOfElements
          Number of vertices per tetrahedron.
protected  java.awt.Color[] m_elementColor
          Array with a color for each element.
protected  PdColor m_globalBndColor
           
protected  PuDouble m_globalBndSize
           
protected  PdColor m_globalBndTagColor
           
protected  PdColor m_globalEdgeColor
           
protected  PuDouble m_globalEdgeSize
           
protected  PdColor m_globalEdgeTagColor
           
protected  PdColor m_globalElementColor
           
protected  PdColor m_globalElementTagColor
           
protected  int m_maxNumElements
          Number of allocated vertices.
protected  PiVector[] m_neighbour
          Array with neighbours of all elements.
protected static int m_numEdgesPerTetra
          Number of edges per tetrahedron.
protected static int m_numFacesPerTetra
          Number of faces per tetrahedron.
protected  int m_numTetras
          Number of (used) tetrahedrons.
protected static int m_numVerticesPerTetra
          Constant number of vertices per tetrahedron.
protected  boolean m_showBoundary
          Array with boundary polygons.
protected  boolean m_showEdges
           
protected  boolean m_showElementNormals
           
protected  boolean m_showElements
           
protected  boolean m_showTaggedBoundary
           
protected  boolean m_showTaggedEdges
           
protected  boolean m_showTaggedElements
           
protected  PiVector[] m_tetra
          Array with all tetrahedrons.
protected  boolean m_useGlobalEdgeColor
           
 
Fields inherited from class jv.geom.PgPointSet
m_bDefaultLabelEnabled, m_bShowIndices, m_bShowTaggedVertices, m_bShowTransparency, m_bShowVectorArrow, m_bShowVectorColors, m_bShowVectorFields, m_bShowVertexColors, m_bShowVertexLabels, m_bShowVertexNormalArrow, m_bShowVertexNormals, m_bShowVertexTexture, m_bShowVertices, m_dimOfColors, m_dimOfTextures, m_dimOfVectors, m_globalVectorColor, m_globalVectorLength, m_globalVectorSize, m_globalVertexColor, m_globalVertexNormalColor, m_globalVertexNormalLength, m_globalVertexNormalSize, m_globalVertexSize, m_globalVertexTagColor, m_maxNumVertices, m_numVectorFields, m_numVertices, m_texture, m_transparency, m_vectorField, m_vertex, m_vertexColor, m_vertexNormal, m_vertexTexture
 
Fields inherited from class jv.project.PgGeometry
m_ambientProj, m_ambientSpace, m_authorInfo, m_bShowBndBox, m_bShowCenter, m_bShowing, m_bShowTitle, m_center, m_dim, m_dimOfSimplex, m_displayList, m_geometryInfo, m_labelAttribute, m_methodMenu, m_modelMatrix, m_title, m_version, m_versionType
 
Fields inherited from class jv.object.PsObject
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS
 
Fields inherited from interface jv.project.PgGeometryIf
AMBIENT_H3_HYPERBOLIC, AMBIENT_PROJECTIONS, AMBIENT_R3_EUCLIDEAN, AMBIENT_R4_EUCLIDEAN, AMBIENT_S3_SPHERE, AMBIENT_SPACES, INSPECTOR_CONTROL, INSPECTOR_CONTROL_EXT, INSPECTOR_MATERIAL, INSPECTOR_MATERIAL_EXT, LABEL_BASE, LABEL_CENTER, LABEL_HEAD, LABEL_MIDDLE, LABEL_TAIL, LABEL_TOP, METHOD_EXT, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE
 
Constructor Summary
PgTetraSet()
          Default constructor setting the vertex dimension to 3.
PgTetraSet(int aVertexDim)
          Constructor with specified vertex dimension.
 
Method Summary
 int addElement(PiVector anElement)
          Add new element to the end of the element list.
 boolean addElement(PiVector anElement, int anIndex)
          Add new element to the end of the element list.
 void assureElementColors()
          Assures correct length of neighbour array and initializes with -1.
 void assureNeighbours()
          Assures correct length of neighbour array and initializes with -1.
 boolean blend(double s, PgGeometry ag, double t, PgGeometry bg)
          Blend between two elementSets, used in interpolation and computing the associate surfaces this = s*a + t*b.
 void buildQuadr(PdVector[] quadr, int uDiscr, int vDiscr, int wDiscr)
          Creates a volume by trilinear interpolation of eight given vertices and given discretization.
 boolean checkNeighbour()
          Check correct neighbour connectivity.
 boolean checkNeighbour(java.util.Vector neighbours)
          Check correct neighbour connectivity.
 void computeBox(int numULines, int numVLines, int numWLines, double uMin, double vMin, double wMin, double uMax, double vMax, double wMax)
          Generates rectangular volume with given min/max values.
 void copy(PgGeometry aGeom)
          Copy instance variables by duplication, not by copying a reference.
 double getArea()
          Compute total area of boundary surface of tetrahedral volume.
 PiVector getElement(int elemInd)
          Method does nothing and may be overriden by subclasses.
 java.awt.Color getElementColor(int elemInd)
           
 java.awt.Color[] getElementColors()
           
 PiVector[] getElements()
           
 PdVector[] getElementVertices(int elemInd)
          Get an array with pointers to all vertices of an element.
 int getElementWithEdge(int vertexInd1, int vertexInd2)
          Find first element with an edge whose two vertex indices are given.
 java.util.Vector[] getFaceArray()
          Gets all faces of the tetrahedron set.
 PiVector[] getFaceList()
          Gets all faces of the tetrahedron set.
 void getGlobalBndColor()
          Get global boundary color (used if no local colors are available).
 void getGlobalEdgeColor()
          Get global edge color (used if no local colors are available).
 void getGlobalElementColor()
          Get global element color (used if no local colors are available).
 int getMaxNumElements()
           
 PiVector getNeighbour(int elemInd)
           
 PiVector[] getNeighbours()
           
 int getNumBoundaryVertices()
          Count number of boundary vertices assuming vertices have been previously marked.
 int getNumEdges()
          Calculate number of edges.
 int getNumElements()
           
 int getOppVertexLocInd(int elemInd, int locInd)
          In the adjacent element find the vertex containing the neighbourhood information for the original element.
 int getOtherVertexLocInd(int elemInd, int vInd, int wInd)
          For a given edge return the local index of the vertex containing the neighbourhood information.
 PgElementSet getSurface()
          Gets the surface elements of the tetrahedron set.
 double getVertexAngle(int elemInd, int locInd)
          Compute length of triangle edge specified by element index and vertex index.
 double getVolume()
          Compute total volume of tetraSet.
 double getVolumeOfElement(int elemInd)
          Compute volume of single tetrahedron.
 void init()
          Initialize and reset instance variables after call to super.init().
 PvPickEvent intersectionWithLine(PdVector rayBase, PdVector rayDir)
          Method used for picking, should be overriden by subclasses.
 boolean isShowingElementColors()
          Return flag whether global element color is used.
 boolean makeNeighbour()
          Generates the neighbourhood information for all tetrahedrons including refinement edges and types.
 void makeQuadrConn(int uDiscr, int vDiscr, int wDiscr)
          Generates element and neighbourhood information for a quadrilateral volume.
 void markBoundary()
          Tag all boundary vertices as those.
 boolean merge(PgTetraSet geom)
          Merge element set with current object and store union of both objects in 'this'.
 void paint(PvGeometryIf dc)
          Major rendering method fills an internal container class supplied by the display.
 void refineGlobalIntoEight()
          Refines by dividing each tetrahedron into eight children.
 int[] removeElement(int ind)
          Remove element with given index, and decrement index of all elements with higher index.
 int[] removeMarkedElements()
          Remove all elements which have been marked PsObject.IS_DELETED.
 int[] removeMarkedVertices()
          Remove vertices marked with tag PsObject#IS_DELETED from elements.
 boolean removeUnusedVertices()
          Remove all points not referenced by elements.
 boolean setElement(int elemInd, int[] anIndArray)
           
 boolean setElement(int elemInd, int a, int b, int c, int d)
           
 boolean setElement(int elemInd, PiVector aPoint)
          Method does nothing and may be overriden by subclasses.
 boolean setElementColor(int elemInd, java.awt.Color aColor)
           
 void setElementColors(java.awt.Color[] color)
           
 void setElements(PiVector[] element)
           
 boolean setElementVertices(int elemInd, PdVector[] aVectorArray)
           
 void setGlobalBndColor(java.awt.Color color)
          Set global boundary color to be used if no local colors are available.
 void setGlobalEdgeColor(java.awt.Color color)
          Set global edge color to be used if no local colors are available.
 void setGlobalElementColor(java.awt.Color color)
          Set global element color to be used if no local colors are available.
 void setJvx(PgJvxSrc src)
          Fill this instance with data from a geometry source, for example, previously read from file.
protected  void setMaxNumElements(int aNumTetras)
          Sets the maximum number of tetrahedrons.
 void setNumElements(int aNumTetras)
          Sets the number of tetrahedrons.
 void setTagElement(int anIndex, int aTag)
          Set a tag of a tetrahedron.
 void showBoundary(boolean flag)
           
 void showEdges(boolean flag)
           
 void showElementColors(boolean flag)
          Set flag of using global element color instead of coloring each element individually.
 void showElementNormals(boolean flag)
           
 void showElements(boolean flag)
           
 java.lang.String toString()
          Create a multi-line string representation with detailed information about all instance variables.
 boolean update(java.lang.Object event)
          Update the class whenever a child has changed.
 
Methods inherited from class jv.geom.PgPointSet
addVectorField, addVertex, assureVertexColors, assureVertexNormals, assureVertexTextures, clearTagVertex, clone, computeCylinder, computeDisk, computePlane, computeRotation, computeSnail, computeSphere, computeTorus, flipOrientation, getBounds, getCenterOfBndBox, getCenterOfGravity, getDimOfColors, getDimOfTextures, getDimOfVectors, getGlobalVectorColor, getGlobalVectorLength, getGlobalVectorSize, getGlobalVertexColor, getGlobalVertexNormalColor, getGlobalVertexNormalLength, getGlobalVertexNormalSize, getGlobalVertexSize, getGlobalVertexTagColor, getIndexOfVectorField, getJvx, getMaxNumVertices, getNumVectorFields, getNumVertices, getTexture, getTextureImage, getTextureImageName, getVectorField, getVectorField, getVectorField, getVertex, getVertexColor, getVertexColors, getVertexNormal, getVertexNormals, getVertexTextures, getVertices, hasTagVertex, hasVertex, hasVertex, hasVertexColors, hasVertexNormals, hasVertexTextures, isDefaultLabelEnabled, isShowingIndices, isShowingTaggedVertices, isShowingVectorArrow, isShowingVectorColors, isShowingVectorField, isShowingVertexColors, isShowingVertexLabels, isShowingVertexNormalArrow, isShowingVertexNormals, isShowingVertexTexture, isShowingVertices, makeColorFromVectorLength, makeVertexColorsFromXYZ, makeVertexColorsFromZ, makeVertexColorsFromZHue, makeVertexNormals, makeVertexTextureFromBndBox, merge, projectToSphere, reflect, removeAllVectorFields, removeVectorField, removeVertex, scale, scale, setCenterOfBndBox, setDefaultLabelEnabled, setDimOfColors, setDimOfTextures, setDimOfVectors, setGlobalVectorColor, setGlobalVectorLength, setGlobalVectorSize, setGlobalVertexColor, setGlobalVertexNormalColor, setGlobalVertexNormalLength, setGlobalVertexNormalSize, setGlobalVertexSize, setGlobalVertexTagColor, setMaxNumVertices, setNumVertices, setTagVertex, setTexture, setTextureImage, setTextureImageName, setTransparency, setVertex, setVertex, setVertex, setVertex, setVertexColor, setVertexColors, setVertexNormal, setVertexNormals, setVertexTextures, setVertices, showIndices, showTaggedVertices, showVectorArrow, showVectorColors, showVectorField, showVertexColors, showVertexLabels, showVertexNormalArrow, showVertexNormals, showVertexTexture, showVertices, translate
 
Methods inherited from class jv.project.PgGeometry
addDisplay, addPolygon, clearTagElement, clearTagPolygon, fillMethodMenu, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplays, getGeometryInfo, getLabelAttribute, getMaterialPanel, getModelMatrix, getPolygon, getTitle, getVersion, getVersionType, hasDisplay, hasModelMatrix, hasTagElement, hasTagPolygon, isConfigurable, isShowingBndBox, isShowingCenter, isShowingTitle, isVisible, removeDisplay, removePolygon, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setGeometryInfo, setLabelAttribute, setLabelAttribute, setModelMatrix, setPolygon, setTagPolygon, setTitle, setVersion, setVersionType, setVisible, showBndBox, showCenter, showTitle
 
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, clearTag, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, updatePanels
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jv.project.PgGeometryIf
getInfoPanel, getName, setName
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent
 

Field Detail

m_dimOfElements

protected static final int m_dimOfElements
Number of vertices per tetrahedron.

m_elementColor

protected java.awt.Color[] m_elementColor
Array with a color for each element. Used in display if this array is not null.

m_globalBndColor

protected PdColor m_globalBndColor

m_globalBndSize

protected PuDouble m_globalBndSize

m_globalBndTagColor

protected PdColor m_globalBndTagColor

m_globalEdgeColor

protected PdColor m_globalEdgeColor

m_globalEdgeSize

protected PuDouble m_globalEdgeSize

m_globalEdgeTagColor

protected PdColor m_globalEdgeTagColor

m_globalElementColor

protected PdColor m_globalElementColor

m_globalElementTagColor

protected PdColor m_globalElementTagColor

m_maxNumElements

protected int m_maxNumElements
Number of allocated vertices. Do not modify this value directly but use setNumElements(int). This value is adjusted automatically whenever more memory is needed.
See Also:
setNumElements(int), setMaxNumElements(int)

m_neighbour

protected PiVector[] m_neighbour
Array with neighbours of all elements. For each tetrahedron exists a corresponding neighbour array listing the indices of the neighbouring tetrahedrons at the four faces. See method makeNeighbour() for details on usage.

m_numEdgesPerTetra

protected static final int m_numEdgesPerTetra
Number of edges per tetrahedron.

m_numFacesPerTetra

protected static final int m_numFacesPerTetra
Number of faces per tetrahedron.

m_numTetras

protected int m_numTetras
Number of (used) tetrahedrons.
See Also:
setNumElements(int)

m_numVerticesPerTetra

protected static final int m_numVerticesPerTetra
Constant number of vertices per tetrahedron.
See Also:
PgElementSet.setDimOfElements(int)

m_showBoundary

protected boolean m_showBoundary
Array with boundary polygons. Each polygon may have boundary constraints.

m_showEdges

protected boolean m_showEdges

m_showElementNormals

protected boolean m_showElementNormals

m_showElements

protected boolean m_showElements

m_showTaggedBoundary

protected boolean m_showTaggedBoundary

m_showTaggedEdges

protected boolean m_showTaggedEdges

m_showTaggedElements

protected boolean m_showTaggedElements

m_tetra

protected PiVector[] m_tetra
Array with all tetrahedrons. Each tetrahedron refers to exactly 4 vertices by the indices in array 'm_vertex[]' of the superclass.

m_useGlobalEdgeColor

protected boolean m_useGlobalEdgeColor

m_bShowElementColors

protected boolean m_bShowElementColors
Flag if global color of elements used in display, applied if no individual element coloring available.
Constructor Detail

PgTetraSet

public PgTetraSet()
Default constructor setting the vertex dimension to 3. Just calls PgTetraset(int).

PgTetraSet

public PgTetraSet(int aVertexDim)
Constructor with specified vertex dimension.
Parameters:
aVertexDim - An int with the vertex dimension.
Method Detail

init

public void init()
Description copied from class: PgPointSet
Initialize and reset instance variables after call to super.init().
Overrides:
init in class PgPointSet

paint

public void paint(PvGeometryIf dc)
Description copied from class: PgPointSet
Major rendering method fills an internal container class supplied by the display. See jv.project.PgGeometryIf for detailed information.
Overrides:
paint in class PgPointSet
Following copied from class: jv.geom.PgPointSet
See Also:
PgGeometryIf

update

public boolean update(java.lang.Object event)
Description copied from class: PgPointSet
Update the class whenever a child has changed. Method is usually invoked from the children.
Overrides:
update in class PgPointSet
Following copied from interface: jv.object.PsUpdateIf
Parameters:
event - carries a lot of information
Returns:
true if event has been handled, otherwise false
See Also:
PsObject, PsUpdateIf.getFather(), PsUpdateIf.setParent(PsUpdateIf)

addElement

public int addElement(PiVector anElement)
Add new element to the end of the element list. Method just calls addElement(PiVector, int).
Overrides:
addElement in class PgGeometry
Parameters:
anElement - A PiVector with the element to be added to element list.
Returns:
An intwith index of added element in element list.

addElement

public boolean addElement(PiVector anElement,
                          int anIndex)
Add new element to the end of the element list.
Parameters:
anElement - A PiVector with the element to be added to element list.
anIndex - An int with index of element position.
Returns:
A boolean that is false, if index is out of range.

assureElementColors

public void assureElementColors()
Assures correct length of neighbour array and initializes with -1. Length of array is equal to all lengths of element array. Initialization of neighbour array with -1 marks each edge as boundary edge.

assureNeighbours

public void assureNeighbours()
Assures correct length of neighbour array and initializes with -1. Length of array is equal to all lengths of element array. Initialization of neighbour array with -1 marks each edge as boundary edge.

blend

public boolean blend(double s,
                     PgGeometry ag,
                     double t,
                     PgGeometry bg)
Blend between two elementSets, used in interpolation and computing the associate surfaces this = s*a + t*b.
Overrides:
blend in class PgPointSet
Parameters:
s - A double with the weight of vertices of first elementSet.
t - A double with the weight of vertices of second elementSet.
a - A PgTetraSet with first elementSet.
b - A PgTetraSet with first elementSet.
Returns:
A boolean indicating success (true).

buildQuadr

public void buildQuadr(PdVector[] quadr,
                       int uDiscr,
                       int vDiscr,
                       int wDiscr)
Creates a volume by trilinear interpolation of eight given vertices and given discretization. (For used order of indexing see macrocube.gif). Each micro cube is divided into six tetrahedra in makeQuadrConn(int,int,int).
Parameters:
quadr - a PdVector array with the eight edge points
uDiscr - an int with the number of knots for the first axis
vDiscr - an int with the number of knots for the second axis
wDiscr - an int with the number of knots for the third axis
See Also:
makeQuadrConn(int,int,int)

checkNeighbour

public boolean checkNeighbour()
Check correct neighbour connectivity. For each tetrahedron ensure that
- it does not reference itself.
- it is neighbour of each adjacent tetrahedron.
- it and its neighbour join a face with common vertices.
Returns:
A boolean indicating if neighbour connectivity is correct (true).

checkNeighbour

public boolean checkNeighbour(java.util.Vector neighbours)
Check correct neighbour connectivity. For each tetrahedron ensure that
- it does not reference itself.
- it is neighbour of each adjacent tetrahedron.
- it and its neighbour join a face with common vertices.
Parameters:
neighbours - A Vector with additional neighbours.
Returns:
A boolean indicating if neighbour connectivity is correct (true).

computeBox

public void computeBox(int numULines,
                       int numVLines,
                       int numWLines,
                       double uMin,
                       double vMin,
                       double wMin,
                       double uMax,
                       double vMax,
                       double wMax)
Generates rectangular volume with given min/max values.
Parameters:
numULines - an int with the number of lines on the x-axis
numVLines - an int with the number of lines on the y-axis
numWLines - an int with the number of lines on the z-axis
UMin - a double with the startvalue on the x-axis
VMin - a double with the startvalue on the y-axis
WMin - a double with the startvalue on the z-axis
UMax - a double with the endvalue on the x-axis
VMax - a double with the endvalue on the y-axis
WMax - a double with the endvalue on the z-axis
See Also:
buildQuadr(PdVector[],int,int,int)

copy

public void copy(PgGeometry aGeom)
Description copied from class: PgPointSet
Copy instance variables by duplication, not by copying a reference.
Overrides:
copy in class PgPointSet

getArea

public double getArea()
Compute total area of boundary surface of tetrahedral volume.

getElement

public PiVector getElement(int elemInd)
Description copied from class: PgGeometry
Method does nothing and may be overriden by subclasses.
Overrides:
getElement in class PgGeometry
Following copied from interface: jv.project.PgGeometryIf
Parameters:
anIndex - index of element to be returned
Returns:
reference to element vector with given index

getElementColor

public java.awt.Color getElementColor(int elemInd)

getElementColors

public java.awt.Color[] getElementColors()

getElements

public PiVector[] getElements()

getElementVertices

public PdVector[] getElementVertices(int elemInd)
Get an array with pointers to all vertices of an element. Vertices appear in the array in the same order as in the element.

getElementWithEdge

public int getElementWithEdge(int vertexInd1,
                              int vertexInd2)
Find first element with an edge whose two vertex indices are given. Modified version of PgElementSet#getElementWithEdge since for tetrahedra we need to run through all vertex pairs of an element.

getFaceArray

public java.util.Vector[] getFaceArray()
Gets all faces of the tetrahedron set. For each vertex there is a vector of faces containing all faces emanting from this vertex and the other vertices having only higher indices. That means there are many entries that are null, especially the higher ones.
Returns:
A Vector[] of PgTetraFaces.

getFaceList

public PiVector[] getFaceList()
Gets all faces of the tetrahedron set.
Returns:
A PiVector[] with the faces.

getGlobalElementColor

public void getGlobalElementColor()
Get global element color (used if no local colors are available).

getGlobalEdgeColor

public void getGlobalEdgeColor()
Get global edge color (used if no local colors are available).

getGlobalBndColor

public void getGlobalBndColor()
Get global boundary color (used if no local colors are available).

getMaxNumElements

public int getMaxNumElements()

getNeighbour

public PiVector getNeighbour(int elemInd)

getNeighbours

public PiVector[] getNeighbours()

getNumBoundaryVertices

public int getNumBoundaryVertices()
Count number of boundary vertices assuming vertices have been previously marked.
See Also:
markBoundary()

getNumEdges

public int getNumEdges()
Calculate number of edges. If neighbour information is missing, then each element edge is counted. Algorithm runs once over all elements.
Returns:
number of edges

getNumElements

public int getNumElements()

getOppVertexLocInd

public int getOppVertexLocInd(int elemInd,
                              int locInd)
In the adjacent element find the vertex containing the neighbourhood information for the original element. Return the local index of the vertex in the adjacent element whose neighbour entry references to the original element. Modified to handle elements with more than three edges too. The 'otherVertex' is now defined as the place which stores the neighbourhood information for edge (vInd, wInd) in m_neighbour. If i is the lowest local index of both edge vertices, then (i-1+nov)%nov is the searched position. In case of a triangle, (i-1+nov)%nov == (i+2)%nov, so nothing has changed for triangles.
Parameters:
elemInd - an element index
locInd - local index such that m_neighbour[elemInd].m_data[locInd]==neighElemInd is the adjacent element.
Returns:
local index of the vertex in adjacent triangle containing the neighbourhood information for common edge.
See Also:
getOtherVertexLocInd(int, int, int)

getOtherVertexLocInd

public int getOtherVertexLocInd(int elemInd,
                                int vInd,
                                int wInd)
For a given edge return the local index of the vertex containing the neighbourhood information. For triangles, return the local index of the third vertex in the element[anElem], i.e. the vertex not on the edge (vInd, wInd).
Modified to handle elements with more than three edges too. The 'otherVertex' is now defined as the place which stores the neighbourhood information for edge (vInd, wInd) in m_neighbour. If i is the lowest local index of both edge vertices, then i+elemLen-1 is the searched position. In case of a triangle, i+elemLen-1 == i+2, so nothing is changed for triangles.
Parameters:
vInd, - wInd vertex indices specifying an element edge, not local indices
elemInd - an element index
Returns:
local index of the vertex containing the neighbourhood information for given edge
See Also:
getOppVertexLocInd(int, int)

getSurface

public PgElementSet getSurface()
Gets the surface elements of the tetrahedron set.
Returns:
A PgElementSet with the surface.

getVertexAngle

public double getVertexAngle(int elemInd,
                             int locInd)
Compute length of triangle edge specified by element index and vertex index.
Parameters:
elemInd - index of element
locInd - local index of vertex
Returns:
angle between edges at vertex
See Also:
m_neighbour

getVolume

public double getVolume()
Compute total volume of tetraSet.
Returns:
A double with the volume.

getVolumeOfElement

public double getVolumeOfElement(int elemInd)
Compute volume of single tetrahedron.
Parameters:
elemInd - An int with the tetrahedron index.
Returns:
A double with the volume.

intersectionWithLine

public PvPickEvent intersectionWithLine(PdVector rayBase,
                                        PdVector rayDir)
Description copied from class: PgGeometry
Method used for picking, should be overriden by subclasses.
Overrides:
intersectionWithLine in class PgGeometry

isShowingElementColors

public boolean isShowingElementColors()
Return flag whether global element color is used.

makeNeighbour

public boolean makeNeighbour()
Generates the neighbourhood information for all tetrahedrons including refinement edges and types. For making the neighbourhood information it creates temporarily an array of faces and adjacent tetrahedrons. Then these are scanned through and stored in m_neighbour.

If there is one adjacent tetrahedron to a face this face is marked as boundary (that is no neighbour). If there are two adjacent tetrahedrons they are pointing to each other. If there are more than two adjacent tetrahedrons the first two point to each other while for the other tetrahedrons this face is marked as boundary. Moreover the return value will be false in this case.

Returns:
A boolean indicating if polyhedron is conform (true).
See Also:
assureNeighbours(), #makeRefinementEdges(int), #makeRefinementType(int)

makeQuadrConn

public void makeQuadrConn(int uDiscr,
                          int vDiscr,
                          int wDiscr)
Generates element and neighbourhood information for a quadrilateral volume. Method generates only topological information, no coordinates are required. For information about the generated tetrahedrons see microcube.gif.
Parameters:
uDiscr - An int with number of lines on x-axis.
vDiscr - An int with number of lines on y-axis.
wDiscr - An int with number of lines on z-axis.
See Also:
makeNeighbour()

markBoundary

public void markBoundary()
Tag all boundary vertices as those. Assume a correct neighbour connectivity.

merge

public boolean merge(PgTetraSet geom)
Merge element set with current object and store union of both objects in 'this'. Number of points and elements is the sum of both objects. List of boundary curves is the union of both objects, i.e. both objects are not identified along common boundary curves. This identification can be made by a later call to close().
Parameters:
geom - A PgTetraSet to be merged into 'this'.
Returns:
A boolean that is true if method was successfull.

refineGlobalIntoEight

public void refineGlobalIntoEight()
Refines by dividing each tetrahedron into eight children. A sketch can be found in microtetra.gif. Finally the neighbourhood information is updated.
See Also:
makeNeighbour()

removeElement

public int[] removeElement(int ind)
Remove element with given index, and decrement index of all elements with higher index. Method just marks element with tag PsObject.IS_DELETED and invokes #removeMarkedElements().
Overrides:
removeElement in class PgGeometry
Parameters:
ind - An int with the index of the tetrahedron to remove.
Returns:
Array with indices of new positions of elements

removeMarkedElements

public int[] removeMarkedElements()
Remove all elements which have been marked PsObject.IS_DELETED. E.g. after application of method close() elements are no longer in use since elements are shrunk at zero-length boundary curves. First, the method computes where each element is moved to, then all element data is moved and the references to the element in bnd curves is changed. This routine is O(n).

Method assumes that there exist no references to marked elements. Otherwise application of this method would lead to upredictable results.

Returns:
Array with indices of new positions of elements

removeMarkedVertices

public int[] removeMarkedVertices()
Remove vertices marked with tag PsObject#IS_DELETED from elements. Remove all elements containing a marked vertex, and remove all marked vertices. It is neccessary to keep a valid element set after removal of vertices in the superclass.
Overrides:
removeMarkedVertices in class PgPointSet
Returns:
array with indices of new positions of vertices

removeUnusedVertices

public boolean removeUnusedVertices()
Remove all points not referenced by elements.
Returns:
true if method was successfull.

setElement

public boolean setElement(int elemInd,
                          int[] anIndArray)

setElement

public boolean setElement(int elemInd,
                          PiVector aPoint)
Description copied from class: PgGeometry
Method does nothing and may be overriden by subclasses.
Overrides:
setElement in class PgGeometry
Following copied from interface: jv.project.PgGeometryIf
Parameters:
anIndex - index of element to be changed
aVertex - vector with indices of vertices in global vertex array

setElement

public boolean setElement(int elemInd,
                          int a,
                          int b,
                          int c,
                          int d)

setElementColor

public boolean setElementColor(int elemInd,
                               java.awt.Color aColor)

setElementColors

public void setElementColors(java.awt.Color[] color)

setElements

public void setElements(PiVector[] element)

setElementVertices

public boolean setElementVertices(int elemInd,
                                  PdVector[] aVectorArray)
Parameters:
elemInd - an int
aVectorArray - an array of PdVector with element vertices

setGlobalElementColor

public void setGlobalElementColor(java.awt.Color color)
Set global element color to be used if no local colors are available.

setGlobalEdgeColor

public void setGlobalEdgeColor(java.awt.Color color)
Set global edge color to be used if no local colors are available.

setGlobalBndColor

public void setGlobalBndColor(java.awt.Color color)
Set global boundary color to be used if no local colors are available.

setJvx

public void setJvx(PgJvxSrc src)
Fill this instance with data from a geometry source, for example, previously read from file.
Overrides:
setJvx in class PgPointSet
Parameters:
src - a geometry source used to fill this instance with data.

setMaxNumElements

protected void setMaxNumElements(int aNumTetras)
Sets the maximum number of tetrahedrons.
Parameters:
aNumTetras - An int with the maximum number of tetrahedrons.

setNumElements

public void setNumElements(int aNumTetras)
Sets the number of tetrahedrons.
Parameters:
aNumTetras - An int with the number of tetrahedrons.

setTagElement

public void setTagElement(int anIndex,
                          int aTag)
Set a tag of a tetrahedron. For possible tags see PvGeometryIf.
Overrides:
setTagElement in class PgGeometry
Parameters:
anIndex - An int with the index of the tetrahedron.
aTag - An int with the tag.

showBoundary

public void showBoundary(boolean flag)

showEdges

public void showEdges(boolean flag)

showElementColors

public void showElementColors(boolean flag)
Set flag of using global element color instead of coloring each element individually.

showElementNormals

public void showElementNormals(boolean flag)

showElements

public void showElements(boolean flag)

toString

public java.lang.String toString()
Description copied from class: PgPointSet
Create a multi-line string representation with detailed information about all instance variables.
Overrides:
toString in class PgPointSet

JavaView® v2.00.008

The software JavaView® is copyright protected. All Rights Reserved.