|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.project.PgGeometry
|
+--jv.geom.PgPointSet
|
+--jv.geom.PgTetraSet
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.
| 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.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 |
| 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.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 |
protected static final int m_dimOfElements
protected java.awt.Color[] m_elementColor
null.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
setNumElements(int),
setMaxNumElements(int)protected PiVector[] m_neighbour
protected static final int m_numEdgesPerTetra
protected static final int m_numFacesPerTetra
protected int m_numTetras
setNumElements(int)protected static final int m_numVerticesPerTetra
PgElementSet.setDimOfElements(int)protected boolean m_showBoundary
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
protected boolean m_useGlobalEdgeColor
protected boolean m_bShowElementColors
| Constructor Detail |
public PgTetraSet()
public PgTetraSet(int aVertexDim)
aVertexDim - An int with the vertex dimension.| Method Detail |
public void init()
PgPointSetinit in class PgPointSetpublic void paint(PvGeometryIf dc)
PgPointSetjv.project.PgGeometryIf for detailed information.paint in class PgPointSetjv.geom.PgPointSetPgGeometryIfpublic boolean update(java.lang.Object event)
PgPointSetupdate in class PgPointSetjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)public int addElement(PiVector anElement)
addElement in class PgGeometryanElement - A PiVector with the element to be
added to element list.intwith index of added element in element list.
public boolean addElement(PiVector anElement,
int anIndex)
anElement - A PiVector with the element to be
added to element list.anIndex - An int with index of element position.boolean that is false, if index is out of range.public void assureElementColors()
-1 marks each edge as
boundary edge.public void assureNeighbours()
-1 marks each edge as
boundary edge.
public boolean blend(double s,
PgGeometry ag,
double t,
PgGeometry bg)
this = s*a + t*b.blend in class PgPointSets - 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.boolean indicating success (true).
public void buildQuadr(PdVector[] quadr,
int uDiscr,
int vDiscr,
int wDiscr)
quadr - a PdVector array with the eight edge pointsuDiscr - an int with the number of knots for the first axisvDiscr - an int with the number of knots for the second axiswDiscr - an int with the number of knots for the third axismakeQuadrConn(int,int,int)public boolean checkNeighbour()
boolean indicating if neighbour connectivity is
correct (true).public boolean checkNeighbour(java.util.Vector neighbours)
neighbours - A Vector with additional neighbours.boolean indicating if neighbour connectivity is
correct (true).
public void computeBox(int numULines,
int numVLines,
int numWLines,
double uMin,
double vMin,
double wMin,
double uMax,
double vMax,
double wMax)
numULines - an int with the number of lines on the x-axisnumVLines - an int with the number of lines on the y-axisnumWLines - an int with the number of lines on the z-axisUMin - a double with the startvalue on the x-axisVMin - a double with the startvalue on the y-axisWMin - a double with the startvalue on the z-axisUMax - a double with the endvalue on the x-axisVMax - a double with the endvalue on the y-axisWMax - a double with the endvalue on the z-axisbuildQuadr(PdVector[],int,int,int)public void copy(PgGeometry aGeom)
PgPointSetcopy in class PgPointSetpublic double getArea()
public PiVector getElement(int elemInd)
PgGeometrygetElement in class PgGeometryjv.project.PgGeometryIfanIndex - index of element to be returnedpublic java.awt.Color getElementColor(int elemInd)
public java.awt.Color[] getElementColors()
public PiVector[] getElements()
public PdVector[] getElementVertices(int elemInd)
public int getElementWithEdge(int vertexInd1,
int vertexInd2)
public java.util.Vector[] getFaceArray()
Vector[] of PgTetraFaces.public PiVector[] getFaceList()
PiVector[] with the faces.public void getGlobalElementColor()
public void getGlobalEdgeColor()
public void getGlobalBndColor()
public int getMaxNumElements()
public PiVector getNeighbour(int elemInd)
public PiVector[] getNeighbours()
public int getNumBoundaryVertices()
markBoundary()public int getNumEdges()
public int getNumElements()
public int getOppVertexLocInd(int elemInd,
int locInd)
(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.elemInd - an element indexlocInd - local index such that m_neighbour[elemInd].m_data[locInd]==neighElemInd is the adjacent element.getOtherVertexLocInd(int, int, int)
public int getOtherVertexLocInd(int elemInd,
int vInd,
int wInd)
vInd, - wInd vertex indices specifying an element edge, not local indiceselemInd - an element indexgetOppVertexLocInd(int, int)public PgElementSet getSurface()
PgElementSet with the surface.
public double getVertexAngle(int elemInd,
int locInd)
elemInd - index of elementlocInd - local index of vertexm_neighbourpublic double getVolume()
double with the volume.public double getVolumeOfElement(int elemInd)
elemInd - An int with the tetrahedron index.double with the volume.
public PvPickEvent intersectionWithLine(PdVector rayBase,
PdVector rayDir)
PgGeometryintersectionWithLine in class PgGeometrypublic boolean isShowingElementColors()
public boolean makeNeighbour()
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.
boolean indicating if polyhedron is conform
(true).assureNeighbours(),
#makeRefinementEdges(int),
#makeRefinementType(int)
public void makeQuadrConn(int uDiscr,
int vDiscr,
int wDiscr)
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.makeNeighbour()public void markBoundary()
public boolean merge(PgTetraSet geom)
geom - A PgTetraSet to be merged into 'this'.boolean that is true if method was successfull.public void refineGlobalIntoEight()
makeNeighbour()public int[] removeElement(int ind)
PsObject.IS_DELETED and invokes
#removeMarkedElements().removeElement in class PgGeometryind - An int with the index of the tetrahedron to remove.public int[] removeMarkedElements()
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.
public int[] removeMarkedVertices()
removeMarkedVertices in class PgPointSetpublic boolean removeUnusedVertices()
true if method was successfull.
public boolean setElement(int elemInd,
int[] anIndArray)
public boolean setElement(int elemInd,
PiVector aPoint)
PgGeometrysetElement in class PgGeometryjv.project.PgGeometryIfanIndex - index of element to be changedaVertex - vector with indices of vertices in global vertex array
public boolean setElement(int elemInd,
int a,
int b,
int c,
int d)
public boolean setElementColor(int elemInd,
java.awt.Color aColor)
public void setElementColors(java.awt.Color[] color)
public void setElements(PiVector[] element)
public boolean setElementVertices(int elemInd,
PdVector[] aVectorArray)
elemInd - an intaVectorArray - an array of PdVector with element verticespublic void setGlobalElementColor(java.awt.Color color)
public void setGlobalEdgeColor(java.awt.Color color)
public void setGlobalBndColor(java.awt.Color color)
public void setJvx(PgJvxSrc src)
setJvx in class PgPointSetsrc - a geometry source used to fill this instance with
data.protected void setMaxNumElements(int aNumTetras)
aNumTetras - An int with the maximum number of
tetrahedrons.public void setNumElements(int aNumTetras)
aNumTetras - An int with the number of
tetrahedrons.
public void setTagElement(int anIndex,
int aTag)
PvGeometryIf.setTagElement in class PgGeometryanIndex - An int with the index of the tetrahedron.aTag - An int with the tag.public void showBoundary(boolean flag)
public void showEdges(boolean flag)
public void showElementColors(boolean flag)
public void showElementNormals(boolean flag)
public void showElements(boolean flag)
public java.lang.String toString()
PgPointSettoString in class PgPointSet
|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||