Class PgTetraSet
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PgGeometry
-
- jv.geom.PgPointSet
-
- jv.geom.PgTetraSet
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf
public class PgTetraSet extends PgPointSet
Base class for most geometric volumes of tetrahedra formed by vertices. The class contains an array with tetrahedra. Each tetra is an instance of type PiVector containing indices of the vertices which are stored in the superclassPgPointSet. Additionally, there exist instance variables for tetra normals, tetra colors, tetra texture coordinates, and other tetra properties. Note, that such tetra properties are not stored with each tetra but each property is stored in an additional array of same length as the array of tetras. If a property is not available then the corresponding array isnull.The dimension of all points is determined as argument of the constructor and cannot be changed later. See
PgPointSetfor details about allocation and access.The number of vertices per tetra is the same for all tetras of the tetra set, each tetra has four vertices.
There exist several utility functions to allocate and modify the number of tetras, for example,
allocatessetNumTetras(int num)numtetras. Internally, there exists a cache to reduce the number of actual memory allocations. The size of the cache is managed by protected methods.Whenever the number of tetras is changed, the class automatically adjusts the size of those tetra properties which are currently in use, i.e. whose array is not
null.Applications may modify the entries of a tetra and of tetra properties by direct method calls such as
which sets the tetra with index ind equal to the components of a vector v by copying. Alternatively, if an application modifies a larger number of tetras then the application may prefer to obtain the tetra array from the tetra set and directly modify the arraysetTetra(int, PiVector)
The same choice is available for arrays containing tetra properties. Note, that classes like PgTetraSet, may not reference all vertices, e.g. if the currently active tetras consists of a subset of all vertices. Also note, that the actual size of the tetra array may differ from m_numTetras efficiency reasons. Therefore, do not use tetra.length but use getNumTetras().PiVector [] tetra = tetraSet.getTetras(); for (int i=0; i<tetraSet.getNumTetras(); i++) tetra[i].copy(v);This class contains mainly basic methods for memory allocation and access to instance variables. Geometric methods operating on tetra sets such as computing a specific surface or computing the intersection of two surfaces are available in special workshop classes as extensions outside the base JavaView packages.
A good starting to obtain further insight are methods like
computeBox(if source code access to JavaView is available), or the tutorial applets of JavaView.- See Also:
- Serialized Form
- Author:
- Konrad Polthier
- Version:
- 09.03.15, 5.00 revised (kp) Moved to jv.geom from dev.volume.
18.02.15, 4.10 revised (ur) corrected orientation of FACE_TO_VERTEX.
23.06.07, 4.00 created (kp) Created based on PgElementSet.
02.07.06, 3.50 revised (kp) Edge handling improved, including color and size.
17.01.04, 3.20 revised (kp) Use area-weighted element normals to compute vertex normals.
02.01.04, 3.10 revised (kp) Crease angle added.
09.11.02, 3.00 revised (kp) New method setTetraTexturesFromList(PdVector[]) added.
11.07.02, 2.90 revised (kp) Explicit methods for removal of colors and normals added.
23.12.01, 2.80 revised (ep) Internationalization.
19.09.01, 2.72 revised (ur) Copy method removes those features, that don't exist in the original PgTetraSet.
14.08.01, 2.71 revised (ep) Set vector field names in setJvx.
28.11.00, 2.70 revised (kp) Two new methods setTetra() implemented.
17.10.00, 2.60 revised (ep) Bugfix in methodsetDimOfVectors(int).
21.09.00, 2.55 revised (kp) Methods for global backface element color added.
21.07.00, 2.50 revised (kp) Global properties of normals split into vertex and element part.
02.04.00, 2.00 revised (kp) PdColor replaced with Color in lists.
09.02.00, 1.30 revised (kp) Outline mode added which draws a silhouette of a shape.
01.09.99, 1.11 revised (ur) setSize of elements and neighbours in copy(PgTetraSet) if m_dimOfTetras=-1.
08.07.99, 1.10 revised (kp) BndList array not allocated during init() to avoid loading of class.
20.02.99, 1.02 revised (kp) init() method enabled as reset method.
03.01.99, 1.01 revised (kp) Set of get-methods implemented, texture.
01.09.97, 1.00 created (kp)
-
-
Field Summary
Fields Modifier and Type Field and Description static int[][]FACE_TO_VERTEXChanged to positive oriented triangles (normal pointing outward if tet is positively oriented).static int[][]LOCAL_EDGE_TO_VERTEXLocal indices of the two vertices of all edges of tetrahedra.static int[][]LOCAL_FACE_TO_EDGEFor a given tet, [i] contains edge indices of the edges adjacent to the i-th face.-
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.PgGeometryIf
AMBIENT_H2_HYPERBOLIC, AMBIENT_H3_HYPERBOLIC, AMBIENT_H4_HYPERBOLIC, AMBIENT_PROJECTIONS, AMBIENT_R1_EUCLIDEAN, AMBIENT_R2_EUCLIDEAN, AMBIENT_R3_EUCLIDEAN, AMBIENT_R4_EUCLIDEAN, AMBIENT_R5_EUCLIDEAN, AMBIENT_S1_SPHERE, AMBIENT_S2_SPHERE, AMBIENT_S3_SPHERE, AMBIENT_S4_SPHERE, AMBIENT_SPACES, BLEND_ALPHA, BLEND_MATERIAL, BLEND_REPLACE, FILTER_DIRECT, FILTER_LINEAR, FILTER_QUADRATIC, HAS_METHOD_MENU, INSPECTOR_CONTROL, INSPECTOR_CONTROL_EXT, INSPECTOR_MATERIAL, INSPECTOR_MATERIAL_EXT, INSPECTOR_TEXTURE, INSPECTOR_TEXTURE_EXT, LABEL_BASE, LABEL_CENTER, LABEL_HEAD, LABEL_MIDDLE, LABEL_TAIL, LABEL_TOP, m_numLabelTypes, METHOD_EXT, PERIODIC_BOTH, PERIODIC_HEIGHT, PERIODIC_NONE, PERIODIC_WIDTH, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE, SIDE_BACK, SIDE_BOTH, SIDE_FRONT, SIDE_NONE
-
-
Constructor Summary
Constructors Constructor and Description PgTetraSet()Constructor of a tetrahedral grid for a solid in three-dimensional space.PgTetraSet(int aVertexDim)Constructor of a tetrahedral grid for a solid in a space of given dimension.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description intaddElement(PiVector el)Add a new tetrahedron.intaddTetra(PiVector tetra)Add a new tetrahedron to the end of the tetrahedra list and increment the number of tetrahedra.booleanapplyModelingMatrix()Multiply the modeling matrix to all vertices and vectors.voidassureBoundary(int num)Allocate boundary polygons and register current tetra set.voidassureTetraColors()Assures respectively allocates correct length of tetrahedron color array.voidassureTetraTextures()Assures respectively allocates correct length of tetrahedron texture array.booleanblend(double s, PgGeometry ag, double t, PgGeometry bg)Blend between two tetra sets, used in interpolation and computing the associate surfacesthis = s*ag + t*bg.voidbuildCube(PdVector[] quadr, int uDiscr, int vDiscr, int wDiscr)Creates a volume by trilinear interpolation of eight given vertices and given discretization.booleancheckNeighbour()Check correct neighbour connectivity.booleancheckNeighbour(boolean bMessage)Check correct neighbour connectivity.voidclearTagTetra(int ind, int aTag)Clear a single tag of a tetrahedron.java.lang.Objectclone()Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.voidcomputeBox(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.voidcomputeCone(int numULines, int numVLines, double bottomRadius, double height)Generate cone in z-direction centered at the origin with given bottom radius and height.voidcomputeCylinder(int numULines, int numVLines, double radius, double length)Generate cylinder in z-direction centered at the origin with given radius and length.voidcomputeSphere(int numULines, int numVLines, double radius)Generate sphere with given radius.voidcomputeTorus(int numULines, int numVLines, double radius, double thick)Generate torus in x-y plane with given radius of soal and thickness of tube.voidcopy(PsObject object)Copy instance variables by duplication, not by copying a reference.voidcopyConnectivity(PgTetraSet geom)Copy connectivity of mesh, i.e. tetrahedra and neighbour array.voidcopyTetraSet(PgTetraSet geom)Copy instance variables of this class but not of its superclass.voidflipOrientation()Change orientation of all tetrahedra and invert normal vectors.doublegetArea()Compute total area of boundary surface of tetrahedral volume.PgBndElementSet[]getBoundaries()Get array of boundary surfaces.PdVectorgetCenterOfTetra(int t)Get center point of tetrahedron.intgetDimOfTetras()Get number of vertices per tetrahedron which is constant 4.doublegetEdgeLength(int tetraInd, int locInd1, int locInd2)Compute length of tetrahedron edge specified by tetrahedron index and vertex indices.intgetEdgeVertex0(int tet, int locEdgeInd)Get first vertex of the edge in given tet with given local edge index.intgetEdgeVertex1(int tet, int locEdgeInd)Get first vertex of the edge in given tet with given local edge index.PiVectorgetFace(int t, int i)Get a face triangle of a tetra.int[]getFVector()Compute F-vector which shows the number of points, edges, faces, etc.java.awt.ColorgetGlobalBndColor()Get global boundary color which is used if no local colors are available.java.awt.ColorgetGlobalBndTagColor()Get global color of tagged boundaries.java.awt.ColorgetGlobalEdgeColor()Get global edge color which is used if no local colors are available.doublegetGlobalEdgeSize()Get thickness in pixels of edge when drawn in display.java.awt.ColorgetGlobalTetraColor()Get global tetrahedron color which is used if no local colors are available.java.awt.ColorgetGlobalTetraTagColor()Get global color of tagged tetrahedra.PgJvxSrcgetJvx()Fills a geometry object with data from this instance, for example, to print to file.intgetMaxNumTetras()Get total length of allocated tetrahedron array.PiVectorgetNeighbour(int ind)Get a reference to an individual neighbour vector.intgetNeighbourLocInd(int elemInd, int vInd, int wInd)For a given edge return the local index of the vertex containing the neighbourhood information.PiVector[]getNeighbours()Get neighbour array for read and write access, but do not modify the size of any neighbour vector.intgetNumBoundaries()Return number of (living) boundary polygons.intgetNumBoundaryFaces()Calculate number of boundary Faces of a manifold solid using m_neighbour information.intgetNumBoundaryVertices()Count number of boundary vertices assuming boundary vertices have been previously marked.intgetNumEdges()Calculate number of edges of a 3d triangulation using m_neighbour information.intgetNumFaces()Get number of triangle faces of tetrahedron set.intgetNumTetraIndices()Get total number of vertex entries in all tetrahedra.intgetNumTetras()Get number of tetrahedra in tetrahedron array.intgetNumUnusedVertices()Get the number of unused vertices which are not references by tetrahedra. // * This method is very cheap and should beintgetOppVertexInd(int tetraInd, int locInd)In the adjacent tetrahedron find the vertex containing the neighbourhood information for the original tetrahedron.intgetOppVertexLocInd(int tetraInd, int locInd)In the adjacent tetrahedron find the vertex containing the neighbourhood information for the original tetrahedron.intgetOtherVertexLocInd(int tetraInd, int uInd, int vInd, int wInd)For a given face return the local index of the vertex containing the neighbourhood information.PgElementSetgetSurface(PgElementSet surface)Gets the surface elements of the tetrahedron set.PiVectorgetTetra(int ind)Get a reference to an individual tetrahedron.java.awt.ColorgetTetraColor(int ind)Get a reference to an individual tetrahedron color.java.awt.Color[]getTetraColors()Get tetrahedron color array for read and write access, but do not modify the size of any color vector.PiVector[]getTetras()Get tetrahedron array for read and write access.PdVector[]getTetraTexture(int ind)Get tetrahedron texture array of an individual tetrahedron.PdVector[][]getTetraTextures()Get tetrahedron texture array for read and write access, but do not modify the size of any texture vector.PdVector[]getTetraVertices(int elemInd)Get an array with pointers to all vertices of a tetrahedron.intgetTetraWithEdge(int vertexInd1, int vertexInd2)Find first tetrahedron with an edge whose two vertex indices are given.PdVector[]getVertexTextures()Get array of all texture coordinates both for vertex and tetrahedron based textures.static PiVectorgetVertexValence(PgTetraSet geom)Compute valence of each vertex, that is, the number of incoming edges.doublegetVolume()Compute total volume of the solid.doublegetVolume2()Compute total volume of the solid, using the dimension-independentgetVolumeOfNdTetra(int)method.doublegetVolumeOfNdTetra(int tetraInd)Compute algebraic volume of the cone of a face with the third vertex.doublegetVolumeOfTetra(int tetraInd)Compute algebraic volume of the cone of a face with the third vertex.booleanhasBoundary()Check whether surface has boundary polygons, assume boundary has been calculated.booleanhasTagTetra(int ind, int aTag)Check whether tetrahedron has given tag.booleanhasTetraColors()Check if tetrahedron colors have been allocated.booleanhasTetraTextures()Check if tetrahedron textures have been allocated.voidinit()Initialize and reset instance variables after call to super.init().PvPickEventintersectionWithLine(PdVector rayBaseWorld, PdVector rayDirWorld)Find intersection of tetra set with a given ray.booleanisShowingBoundaries()Determines whether drawing of boundary curves is enabled.booleanisShowingEdgeColorFromTetras()Determines whether local edge color is induced from tetrahedron or vertex colors.booleanisShowingEdgeColorFromVertices()Determines whether smooth edge coloring uses vertex colors at vertices, requires vertex colors.booleanisShowingEdgeColors()Determine whether showing of edge colors is enabled.booleanisShowingEdges()Determines whether drawing of tetrahedron edges is enabled.booleanisShowingSmoothEdgeColors()Determines whether smooth coloring of edges is enabled, currently requires vertex colors.booleanisShowingSmoothLighting()Determines whether smooth lighting is enabled, requires vertex normals.booleanisShowingSmoothTetraColors()Determines whether smooth coloring of tetrahedra is enabled, currently requires vertex colors.booleanisShowingTaggedBoundaries()Determines whether drawing of tagged boundary curves is enabled.booleanisShowingTaggedTetras()Determines whether drawing of tagged tetrahedra is enabled.booleanisShowingTetraColorFromVertices()Determines whether smooth tetrahedron coloring uses vertex colors, requires vertex colors.booleanisShowingTetraColors()Determines whether global tetrahedron color is used.booleanisShowingTetraFromVertexColors()Deprecated.since JavaView 4.60.001, use #isShowingTetraColorFromVertices()booleanisShowingTetraLabels()Determines whether showing of tetrahedron labels is enabled.booleanisShowingTetras()Determines whether drawing of tetrahedra is enabled.booleanisShowingTetraTexture()Determines whether drawing of tetrahedron texture is enabled.voidmakeCubeConn(int uDiscr, int vDiscr, int wDiscr)Generates element and neighbourhood information for a quadrilateral volume.voidmakeCubeTetraTexture(int uDiscr, int vDiscr, int wDiscr)Generate default tetrahedron texture in [0,1]*[0,1]*[0,1] for a cubical volume.PgEdgeStar[]makeEdgeStars()Generate list of edges from element information of a possibly non-manifold surface.booleanmakeNeighbour()Generate neighbourhood information for a given manifold polyhedron.booleanmakeTetraColorsFromXYZ()Create color from the tetrahedron position within its bounding box which is interpreted as RGB cube.booleanmakeTetraColorsFromZ()Create color from the vertical z-height within its bounding box ranging from low blue to high red.booleanmakeTetraColorsFromZHue()Create color from the vertical z-height within its bounding box ranging through hue rainbow.booleanmakeTetraFromVertexColors()Create tetra colors as average of all colors of its vertices.booleanmakeTetraFromVertexTexture()Create tetra textures from vertex textures and remove vertex textures.booleanmakeVertexFromTetraColors()Create vertex colors as average of individual color of all adjacent tetras.voidmarkBoundary()Tag all boundary vertices as those.booleanmerge(PgGeometryIf aGeom)Merge tetra set with current object and store union of both objects in 'this'.voidpaint(PvGeometryIf dc)Major rendering method fills an internal container class supplied by the display.PgGeometryreflect(PdMatrix mat, boolean bOrient, boolean bVector)Generate a cloned geometry and transform vertices by a matrix.voidremoveBoundaries()Remove all boundary surfaces.intremoveDeletedBoundaries()Remove all boundary surfaces which are marked PsObject.IS_DELETED.int[]removeMarkedTetras()Remove all tetrahedra which have been markedPsObject.IS_DELETED.int[]removeMarkedVertices()Remove vertices marked with tag PsObject#IS_DELETED from tetrahedra.int[]removeTetra(int ind)Remove tetrahedron with given index, and decrement index of all tetrahedra with higher index.voidremoveTetraColors()Remove local tetrahedron colors from a geometry and use global tetrahedron color instead.voidremoveTexture()Remove all texture information from surface and switch off showing of texture.booleanremoveUnusedVertices()Remove all points not referenced by tetrahedra.booleanresetBoundaryNormals()Remove boundary vertex normal.voidsetBoundary(PgBndElementSet[] newBnd)Set new boundary polygons by replacing the previous array with the argument array.voidsetDimOfColors(int aSize)Let all colors have same number of componentsaSize!voidsetDimOfVectors(int aSize)Let all vectors have same number of vectorsaSize!voidsetGlobalBndColor(java.awt.Color color)Set global boundary color to be used if no local colors are available.voidsetGlobalBndTagColor(java.awt.Color color)Set global color of tagged boundaries.voidsetGlobalEdgeColor(java.awt.Color color)Set global edge color to be used if no local colors are available.voidsetGlobalEdgeSize(double size)Set thickness in pixels of edge when drawn in display.voidsetGlobalTetraColor(java.awt.Color color)Set global tetrahedron color to be used if no local colors are available.voidsetGlobalTetraTagColor(java.awt.Color color)Set global color of tagged tetrahedra.voidsetJvx(PgJvxSrc src)Fill this instance with data from a geometry source, for example, previously read from file.voidsetMaxNumTetras(int numTetras)Major memory allocation routine, all tetrahedron allocation should be done here.booleansetNeighbour(int ind, PiVector newNeigh)Set neighbour tetrahedra of given tetrahedron.voidsetNeighbours(PiVector[] neighbour)Copy neighbour array to existing array of neighbours.voidsetNumFaces(int numFaces)Major memory allocation routine, all element allocation should be done here.voidsetNumTetras(int numTetras)Allocate given number of tetrahedra, and allocate normals, colors etc.voidsetTagTetra(int ind, int aTag)Set a tag of a tetrahedron.booleansetTetra(int elemInd, int[] anIndArray)Copy new vertex indices to tetrahedron at specified position in the tetrahedron list.voidsetTetra(int elemInd, int a, int b, int c, int d)Copy new vertex indices to tetra at specified position in the tetrahedron list.booleansetTetra(int ind, PiVector newElem)Copy new vertex indices to tetrahedron at specified position in the tetrahedron list.booleansetTetraColor(int ind, java.awt.Color aColor)Copy new color to tetrahedron color at specified position in the color listvoidsetTetraColors(java.awt.Color[] color)Copy tetrahedron colors of list to existing array of tetrahedron colors.voidsetTetras(PiVector[] tetra)Copy the firstgetNumTetras()tetrahedra of source array into an existing tetrahedron array.booleansetTetraTexture(int ind, PdVector[] aTexture)Copy new texture coordinates to tetrahedron texture at specified position in the tetrahedron texture listvoidsetTetraTextures(PdVector[][] texCoords)Use the given textures coordinates as tetra-based texture coordinates.voidsetTetraTexturesFromList(PdVector[] texCoords)Use the given textures coordinates as tetra-based texture coordinates.booleansetTetraVertices(int elemInd, PdVector[] vArray)Copy new tetra vertices at specified position in the vertex array of PgPointSet.voidshowBoundaries(boolean flag)Set flag to enable drawing of boundary surfaces.voidshowEdgeColorFromTetras(boolean flag)Set flag if edge colors are induced from local tetrahedron or vertex colors.voidshowEdgeColorFromVertices(boolean flag)Set flag to enable smooth edge coloring using vertex colors at vertices, requires vertex colors.voidshowEdgeColors(boolean flag)Set flag to enable drawing of individual edge colors.voidshowEdges(boolean flag)Set flag to enable drawing of tetrahedron edges.voidshowSmoothEdgeColors(boolean flag)Set flag to enable smooth coloring of edges, currently requires vertex colors.voidshowSmoothLighting(boolean flag)Set flag to enable smooth lighting, requires vertex normals.voidshowSmoothTetraColors(boolean flag)Set flag to enable smooth coloring of tetrahedra, currently requires vertex colors.voidshowTaggedBoundaries(boolean flag)Set flag to enable drawing of boundary surfaces.voidshowTaggedTetras(boolean flag)Set flag to enable drawing of tagged tetrahedra.voidshowTetraColorFromVertices(boolean flag)Set flag to enable smooth tetrahedron coloring using vertex colors at vertices, requires vertex colors.voidshowTetraColors(boolean flag)Set flag of using global tetrahedron color instead of coloring each tetrahedron individually.voidshowTetraFromVertexColors(boolean flag)Deprecated.since JavaView 4.60.001, use #showingTetraColorFromVertices(boolean)voidshowTetraLabels(boolean flag)Set flag to enable drawing of tetrahedron labels in display.voidshowTetras(boolean flag)Set flag to enable drawing of tetrahedra.voidshowTetraTexture(boolean flag)Set flag to enable drawing of tetrahedron texture.voidshowVertexTexture(boolean flag)Set flag to enable drawing of vertex texture.java.lang.StringtoString()Create a multi-line string representation with detailed information about all instance variables.booleanupdate(java.lang.Object event)Update the class whenever a child has changed.-
Methods inherited from class jv.geom.PgPointSet
addGeometryItem, addVectorField, addVertex, applyAmbientMatrix, assureVertexColors, assureVertexNormals, assureVertexSizes, assureVertexTextures, clearTagVertex, computeDisk, computePlane, computeRotation, computeSnail, copySelect, getAmbientBounds, getBounds, getCenterOfBndBox, getCenterOfGravity, getDimOfColors, getDimOfTextures, getDimOfVectors, getEulerCharacteristic, getGlobalVectorColor, getGlobalVectorLength, getGlobalVectorSize, getGlobalVertexColor, getGlobalVertexNormalColor, getGlobalVertexNormalLength, getGlobalVertexNormalSize, getGlobalVertexSize, getGlobalVertexTagColor, getIndexOfVectorField, getMarkedVertices, getMarkedVertices, getMaxNumVertices, getNumVectorFields, getNumVertices, getSelectedVectorField, getShininess, getSpecularColor, getTexture, getTextureImage, getTextureImageName, getTransparency, getVectorField, getVectorField, getVertex, getVertexColor, getVertexColors, getVertexNormal, getVertexNormals, getVertexSize, getVertexSizes, getVertexTexture, getVertices, hasTagVertex, hasVertex, hasVertex, hasVertexColors, hasVertexNormals, hasVertexSizes, hasVertexTextures, isDefaultLabelEnabled, isEnabledIndexLabels, isShowingIndices, isShowingSingleVectorField, isShowingTaggedVertices, isShowingTransparency, isShowingVectorArrow, isShowingVectorArrows, isShowingVectorColors, isShowingVectorField, isShowingVectorFields, isShowingVertexColors, isShowingVertexLabels, isShowingVertexNormalArrow, isShowingVertexNormals, isShowingVertexOutline, isShowingVertexSizes, isShowingVertexTexture, isShowingVertices, makeColorFromVectorLength, makeQuadrVertexTexture, makeVertexColorsFromNormal, makeVertexColorsFromXYZ, makeVertexColorsFromZ, makeVertexColorsFromZHue, makeVertexNormals, makeVertexTextureFromBndBox, makeVertexTextureFromCylinder, makeVertexTextureFromSphere, makeVertexTextureFromUV, projectFromAmbientSpace, projectToSphere, removeAllVectorFields, removeHiddenVectorFields, removeVectorField, removeVertex, removeVertexColors, removeVertexNormals, removeVertexSizes, scale, scale, selectVectorField, setCenterOfBndBox, setDefaultLabelEnabled, setDimOfTextures, setDimOfVertices, setEnabledIndexLabels, setGlobalVectorColor, setGlobalVectorLength, setGlobalVectorSize, setGlobalVertexColor, setGlobalVertexNormalColor, setGlobalVertexNormalLength, setGlobalVertexNormalSize, setGlobalVertexSize, setGlobalVertexSize, setGlobalVertexTagColor, setMaxNumVertices, setNumVertices, setShininess, setSpecularColor, setState, setTagVertex, setTexture, setTextureImage, setTextureImageName, setTransparency, setVertex, setVertex, setVertex, setVertex, setVertexColor, setVertexColors, setVertexNormal, setVertexNormals, setVertexSize, setVertexSizes, setVertexTexture, setVertexTextures, setVertices, showIndices, showSingleVectorField, showTaggedVertices, showTransparency, showVectorArrow, showVectorArrows, showVectorColors, showVectorField, showVectorFields, showVertexColors, showVertexLabels, showVertexNormalArrow, showVertexNormals, showVertexOutline, showVertexSizes, showVertices, translate
-
Methods inherited from class jv.project.PgGeometry
addDisplay, addPolygon, clearTagElement, clearTagPolygon, convertWorldToModel, fillMethodMenu, fillMethodMenu, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplayList, getDisplays, getElement, getGeometryInfo, getLabelAttribute, getLabelColor, getLabelFont, getLabelSize, getLabelStyle, getMaterialPanel, getModelMatrix, getPolygon, getState, getTitle, getType, getVersion, getVersionType, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagElement, hasTagPolygon, isConfigurable, isEnabledInstanceSharing, isShowingBndBox, isShowingCenter, isShowingName, isShowingTitle, isVisible, removeDisplay, removeElement, removeMethodMenus, removePolygon, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setElement, setEnabledInstanceSharing, setGeometryInfo, setLabelAttribute, setLabelAttribute, setLabelColor, setLabelFont, setLabelSize, setLabelStyle, setModelMatrix, setPolygon, setTagElement, setTagPolygon, setTitle, setType, setVersion, setVersionType, setVisible, showBndBox, showCenter, showName, showTitle
-
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, updatePanels
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jv.project.PgGeometryIf
assureInspector, getInfoPanel, getName, hasTag, setName
-
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent
-
-
-
-
Field Detail
-
LOCAL_EDGE_TO_VERTEX
public static final int[][] LOCAL_EDGE_TO_VERTEX
Local indices of the two vertices of all edges of tetrahedra. This list provides an absolute ordering of all edges of a tetrahedron, for example, the k-th edge (k in {0,...,5}) connects the two verticesm_tetra.m_data[LOCAL_EDGE_TO_VERTEX[k][0]]andm_tetra.m_data[LOCAL_EDGE_TO_VERTEX[k][1]].
-
LOCAL_FACE_TO_EDGE
public static final int[][] LOCAL_FACE_TO_EDGE
For a given tet, [i] contains edge indices of the edges adjacent to the i-th face.- Version:
- 18.02.2015, 1.10 revised (ur) Adapt ordering of changed FACE_TO_VERTEX (see below).
-
FACE_TO_VERTEX
public static final int[][] FACE_TO_VERTEX
Changed to positive oriented triangles (normal pointing outward if tet is positively oriented).- Version:
- 18.02.2015, 1.10 revised (ur).
-
-
Constructor Detail
-
PgTetraSet
public PgTetraSet()
Constructor of a tetrahedral grid for a solid in three-dimensional space.This constructor allows to create a geometry by specifying the class name as string. By default, showing of vertices is enabled.
-
PgTetraSet
public PgTetraSet(int aVertexDim)
Constructor of a tetrahedral grid for a solid in a space of given dimension. This constructor should be preferred by all applications. By default, showing of vertices is disabled.
-
-
Method Detail
-
init
public void init()
Initialize and reset instance variables after call to super.init().- Overrides:
initin classPgPointSet
-
getJvx
public PgJvxSrc getJvx()
Fills a geometry object with data from this instance, for example, to print to file.- Specified by:
getJvxin interfacePgGeometryIf- Overrides:
getJvxin classPgPointSet- Returns:
- src a geometry source to be filled with data from this instance.
-
setJvx
public void setJvx(PgJvxSrc src)
Fill this instance with data from a geometry source, for example, previously read from file.If src geometry has missing neighbour information then method calculates neighbour information using makeNeighbour(), unless PsJavaView.m_bAutoNeighbour==false.
// TODO: Tetra normals??? // Is this just cut-and-paste stuff, or is it really done? If src geometry has missing tetra normals then method calculates tetra normals using makeTetraNormals(), unless PsJavaView.m_bAutoNormals==false.
- Specified by:
setJvxin interfacePgGeometryIf- Overrides:
setJvxin classPgPointSet- Parameters:
src- a geometry source used to fill this instance with data.- Version:
- 07.04.02, 1.20 revised (kp) Adjust range of PuDouble/PuInteger variables.
25.09.00, 1.10 revised (kp) Bug in handling of backface color removed.
-
applyModelingMatrix
public boolean applyModelingMatrix()
Multiply the modeling matrix to all vertices and vectors. The modeling matrix of this geometry is set to the identity matrix.- Overrides:
applyModelingMatrixin classPgPointSet- Returns:
trueif operation was applied successfully.- Since:
- JavaView 2.36
- Version:
- 04.09.02, 1.00 created (kp)
-
clone
public java.lang.Object clone()
Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners. The parent relationship is maintained only within this class but not to external classes. In general, all links of the clone to external objects are set tonull.- Specified by:
clonein interfacePgGeometryIf- Overrides:
clonein classPgPointSet- See Also:
copy(PsObject)- Version:
- 27.07.03, 1.20 revised (kp) Missing assignment of parent to cloned backColor added.
16.09.00, 1.10 revised (kp) Cloning of boundary curves added.
05.07.00, 1.00 created (kp)
-
copy
public void copy(PsObject object)
Copy instance variables by duplication, not by copying a reference.The argument was changed from PgGeometry to PsObject since there were problems in J/Link which preferred to use jv.object.PsObject#copy(PsObject) instead of jv.project.PgGeometry#copy(PsObject).
- Overrides:
copyin classPgPointSet- See Also:
clone()- Version:
- 08.11.02, 1.10 revised (kp) Argument changed to PsObject from PgGeometry.
-
copyTetraSet
public void copyTetraSet(PgTetraSet geom)
Copy instance variables of this class but not of its superclass.
-
copyConnectivity
public void copyConnectivity(PgTetraSet geom)
Copy connectivity of mesh, i.e. tetrahedra and neighbour array.
-
toString
public java.lang.String toString()
Create a multi-line string representation with detailed information about all instance variables.- Specified by:
toStringin interfacePgGeometryIf- Overrides:
toStringin classPgPointSet- Version:
- 11.07.03, 1.10 revised (kp) Print tetra normals.
-
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 classPgPointSet- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)- Version:
- 23.09.99, 1.01 (kp) Missing tag colors added.
-
addTetra
public int addTetra(PiVector tetra)
Add a new tetrahedron to the end of the tetrahedra list and increment the number of tetrahedra. The neighbour array is automatically updated.If tetrahedron normals exist then the normal is calculated for the new tetrahedron too. Note, if vertex normals exist then the normals of the tetrahedron vertices are currently not recalculated (this behavior might change in the future).
If tetrahedron colors exist then the color of the new tetrahedron is the global tetrahedron color. // TODO: New tetrahedron's neighbourhood is not yet computed.
- Parameters:
tetra- tetrahedron to be added to tetrahedra list- Returns:
- int index of new tetrahedron in tetrahedra list
- Version:
- 11.07.03, 2.20 revised (kp) Compute normal of new tetrahedron if normals exist.
17.07.02, 2.10 revised (kp) Increase total size by 20 percent.
26.05.02, 2.00 revised (kp) Create neighbour and color of new tetrahedra.
05.12.00, 1.00 created (kp)
-
getGlobalTetraColor
public java.awt.Color getGlobalTetraColor()
Get global tetrahedron color which is used if no local colors are available.
-
getGlobalTetraTagColor
public java.awt.Color getGlobalTetraTagColor()
Get global color of tagged tetrahedra.
-
setGlobalTetraColor
public void setGlobalTetraColor(java.awt.Color color)
Set global tetrahedron color to be used if no local colors are available.
-
setGlobalTetraTagColor
public void setGlobalTetraTagColor(java.awt.Color color)
Set global color of tagged tetrahedra.
-
getGlobalEdgeColor
public java.awt.Color getGlobalEdgeColor()
Get global edge color which is used if no local colors are available.
-
getGlobalEdgeSize
public double getGlobalEdgeSize()
Get thickness in pixels of edge when drawn in display.
-
setGlobalEdgeColor
public void setGlobalEdgeColor(java.awt.Color color)
Set global edge color to be used if no local colors are available.
-
setGlobalEdgeSize
public void setGlobalEdgeSize(double size)
Set thickness in pixels of edge when drawn in display.
-
getGlobalBndColor
public java.awt.Color getGlobalBndColor()
Get global boundary color which is used if no local colors are available.
-
getGlobalBndTagColor
public java.awt.Color getGlobalBndTagColor()
Get global color of tagged boundaries.
-
setGlobalBndColor
public void setGlobalBndColor(java.awt.Color color)
Set global boundary color to be used if no local colors are available.
-
setGlobalBndTagColor
public void setGlobalBndTagColor(java.awt.Color color)
Set global color of tagged boundaries.
-
getTetras
public PiVector[] getTetras()
Get tetrahedron array for read and write access.Do not modify the size of any tetrahedron vector.
Note, that the actual size of the array may be larger than m_numTetras for efficiency reasons. Therefore, do not use the length of array.
-
getTetraColors
public java.awt.Color[] getTetraColors()
Get tetrahedron color array for read and write access, but do not modify the size of any color vector. Note, that subclasses may not reference all tetrahedron colors. Also note, that the actual size of the color array may be larger than m_numTetras for efficiency reasons. Therefore, do not use length of array.
-
getTetraTexture
public PdVector[] getTetraTexture(int ind)
Get tetrahedron texture array of an individual tetrahedron. Returns null if no tetrahedron texture available, or index out of range.- Since:
- JavaView 2.80.000
- Version:
- 06.06.03, 1.00 created (kp)
-
getTetraTextures
public PdVector[][] getTetraTextures()
Get tetrahedron texture array for read and write access, but do not modify the size of any texture vector. Note, that subclasses may not reference all tetrahedron textures. Also note, that the actual size of the texture array may be larger than m_numTetras for efficiency reasons. Therefore, do not use length of array. Each tetrahedron has associated an array of 2-dimensional vectors with normalized texture coordinates.
-
getVertexTextures
public PdVector[] getVertexTextures()
Get array of all texture coordinates both for vertex and tetrahedron based textures. This method overwrites PgPointSet#getVertexTextures if texture is tetrahedron based.- Overrides:
getVertexTexturesin classPgPointSet- Returns:
- plain array of texture coordinates
-
getNeighbours
public PiVector[] getNeighbours()
Get neighbour array for read and write access, but do not modify the size of any neighbour vector. Also note, that the actual size of the array may be larger than m_numTetras for efficiency reasons. Therefore, do not use length of array.
-
getNumBoundaries
public int getNumBoundaries()
Return number of (living) boundary polygons. This number may be different from number of boundary components and number of boundary edges.- Returns:
- number of boundary segments used
- See Also:
getBoundaries()- Author:
- Konrad Polthier
- Version:
- 23.04.05, 2.00 revised (kp) Count boundaries only which are not deleted.
16.09.98, 1.00 created (kp)
-
hasBoundary
public boolean hasBoundary()
Check whether surface has boundary polygons, assume boundary has been calculated. TODO: Check for boundary even if boundary polygons have not been calculated yet.- Version:
- 23.04.05, 2.00 revised (kp) No longer count boundaries which are marked deleted.
-
getBoundaries
public PgBndElementSet[] getBoundaries()
Get array of boundary surfaces. If there does not exist a boundary then method returns array of zero length.- Returns:
- a possibly empty array of boundary polygons. Array is never null.
- Version:
- 23.04.05, 2.00 revised (kp) No longer return boundaries which are marked deleted.
-
removeBoundaries
public void removeBoundaries()
Remove all boundary surfaces.- Version:
- 11.12.04, 1.10 revised (kp) Explicitly remove link to this tetraSet before nulling bnd.
16.09.00, 1.00 created (kp)
-
removeDeletedBoundaries
public int removeDeletedBoundaries()
Remove all boundary surfaces which are marked PsObject.IS_DELETED.- Returns:
- number of deleted boundaries.
- Version:
- 23.04.05, 1.00 created (kp)
-
setBoundary
public void setBoundary(PgBndElementSet[] newBnd)
Set new boundary polygons by replacing the previous array with the argument array.- Parameters:
newBnd- array with new boundary polygons of tetra set.- Version:
- 16.09.00, 1.10 revised (kp) Use num of bnd polygons instead of bnd components.
-
assureBoundary
public void assureBoundary(int num)
Allocate boundary polygons and register current tetra set. If new number of polygons is smaller than old number then try to reuse old polygons.
-
isShowingEdges
public boolean isShowingEdges()
Determines whether drawing of tetrahedron edges is enabled.
-
showEdges
public void showEdges(boolean flag)
Set flag to enable drawing of tetrahedron edges.
-
isShowingEdgeColors
public boolean isShowingEdgeColors()
Determine whether showing of edge colors is enabled.
-
showEdgeColors
public void showEdgeColors(boolean flag)
Set flag to enable drawing of individual edge colors.
-
isShowingEdgeColorFromTetras
public boolean isShowingEdgeColorFromTetras()
Determines whether local edge color is induced from tetrahedron or vertex colors.
-
showEdgeColorFromTetras
public void showEdgeColorFromTetras(boolean flag)
Set flag if edge colors are induced from local tetrahedron or vertex colors.
-
isShowingSmoothEdgeColors
public boolean isShowingSmoothEdgeColors()
Determines whether smooth coloring of edges is enabled, currently requires vertex colors.
-
showSmoothEdgeColors
public void showSmoothEdgeColors(boolean flag)
Set flag to enable smooth coloring of edges, currently requires vertex colors.
-
isShowingEdgeColorFromVertices
public boolean isShowingEdgeColorFromVertices()
Determines whether smooth edge coloring uses vertex colors at vertices, requires vertex colors.
-
showEdgeColorFromVertices
public void showEdgeColorFromVertices(boolean flag)
Set flag to enable smooth edge coloring using vertex colors at vertices, requires vertex colors.
-
isShowingTetraLabels
public boolean isShowingTetraLabels()
Determines whether showing of tetrahedron labels is enabled.
-
isShowingTetras
public boolean isShowingTetras()
Determines whether drawing of tetrahedra is enabled.
-
isShowingTaggedTetras
public boolean isShowingTaggedTetras()
Determines whether drawing of tagged tetrahedra is enabled.
-
isShowingTetraTexture
public boolean isShowingTetraTexture()
Determines whether drawing of tetrahedron texture is enabled.
-
isShowingBoundaries
public boolean isShowingBoundaries()
Determines whether drawing of boundary curves is enabled.
-
isShowingTaggedBoundaries
public boolean isShowingTaggedBoundaries()
Determines whether drawing of tagged boundary curves is enabled.
-
isShowingTetraColors
public boolean isShowingTetraColors()
Determines whether global tetrahedron color is used.
-
isShowingSmoothLighting
public boolean isShowingSmoothLighting()
Determines whether smooth lighting is enabled, requires vertex normals.
-
showSmoothLighting
public void showSmoothLighting(boolean flag)
Set flag to enable smooth lighting, requires vertex normals.
-
isShowingSmoothTetraColors
public boolean isShowingSmoothTetraColors()
Determines whether smooth coloring of tetrahedra is enabled, currently requires vertex colors.
-
showSmoothTetraColors
public void showSmoothTetraColors(boolean flag)
Set flag to enable smooth coloring of tetrahedra, currently requires vertex colors.
-
isShowingTetraColorFromVertices
public boolean isShowingTetraColorFromVertices()
Determines whether smooth tetrahedron coloring uses vertex colors, requires vertex colors.
-
showTetraColorFromVertices
public void showTetraColorFromVertices(boolean flag)
Set flag to enable smooth tetrahedron coloring using vertex colors at vertices, requires vertex colors.
-
isShowingTetraFromVertexColors
public boolean isShowingTetraFromVertexColors()
Deprecated. since JavaView 4.60.001, use #isShowingTetraColorFromVertices()Determines whether smooth element coloring uses vertex colors, requires vertex colors.
-
showTetraFromVertexColors
public void showTetraFromVertexColors(boolean flag)
Deprecated. since JavaView 4.60.001, use #showingTetraColorFromVertices(boolean)Set flag to enable smooth element coloring using vertex colors at vertices, requires vertex colors.
-
showTetraLabels
public void showTetraLabels(boolean flag)
Set flag to enable drawing of tetrahedron labels in display.
-
showTetras
public void showTetras(boolean flag)
Set flag to enable drawing of tetrahedra.
-
showTaggedTetras
public void showTaggedTetras(boolean flag)
Set flag to enable drawing of tagged tetrahedra.
-
showTetraTexture
public void showTetraTexture(boolean flag)
Set flag to enable drawing of tetrahedron texture.
-
showVertexTexture
public void showVertexTexture(boolean flag)
Set flag to enable drawing of vertex texture. This method disables tetra texture whenever vertex texture is enabled, and vice versa.- Overrides:
showVertexTexturein classPgPointSet
-
showBoundaries
public void showBoundaries(boolean flag)
Set flag to enable drawing of boundary surfaces.
-
showTaggedBoundaries
public void showTaggedBoundaries(boolean flag)
Set flag to enable drawing of boundary surfaces.
-
showTetraColors
public void showTetraColors(boolean flag)
Set flag of using global tetrahedron color instead of coloring each tetrahedron individually.
-
getNumFaces
public int getNumFaces()
Get number of triangle faces of tetrahedron set. TODO: currently always recomputes number of faces.
-
setNumFaces
public void setNumFaces(int numFaces)
Major memory allocation routine, all element allocation should be done here. Element and neighbour array are adjusted to new size. All element property arrays, such as element normals, are adjusted if they where allocated before. All element allocation is done in this method. Method should not be called directly unless a specific allocation is required. Usually, a user would specify the number of elements via setNumElements().- Version:
- 14.03.06, 2.00 revised (kp) Method made public to allow better control of allocations.
14.03.03, 1.50 revised (kp) Increase number of vectors of vector field is available.
19.12.00, 1.25 revised (kp) Reset neighbour array if number of elements is decreased.
16.07.00, 1.20 revised (kp) Assure length of element textures if allocated.
11.07.00, 1.10 revised (kp) Assure neighbours if dimOfElements==-1.
-
getMaxNumTetras
public int getMaxNumTetras()
Get total length of allocated tetrahedron array. Usually, only a subset is filled with data. Method is for internal use, see getNumTetras() for daily work.
-
setMaxNumTetras
public void setMaxNumTetras(int numTetras)
Major memory allocation routine, all tetrahedron allocation should be done here. Tetrahedron and neighbour array are adjusted to new size. All tetrahedron property arrays, such as tetrahedron normals, are adjusted if they where allocated before. All tetrahedron allocation is done in this method. Method should not be called directly unless a specific allocation is required. Usually, a user would specify the number of tetrahedra via setNumTetras().- Version:
- 14.03.06, 2.00 revised (kp) Method made public to allow better control of allocations.
14.03.03, 1.50 revised (kp) Increase number of vectors of vector field is available.
19.12.00, 1.25 revised (kp) Reset neighbour array if number of tetrahedra is decreased.
16.07.00, 1.20 revised (kp) Assure length of tetrahedron textures if allocated.
11.07.00, 1.10 revised (kp) Assure neighbours if dimOfTetras==-1.
-
getNumTetras
public int getNumTetras()
Get number of tetrahedra in tetrahedron array. Note, that the actual size of the tetrahedron array may be larger for efficiency reasons. Therefore, do not use m_tetra.length.
-
getNumTetraIndices
public int getNumTetraIndices()
Get total number of vertex entries in all tetrahedra. If instance variable m_dimOfTetras is unequal to -1 then total number is equal to m_numTetras*m_dimOfTetras.- Returns:
- int total number of all vertex indices of all tetrahedra
-
setNumTetras
public void setNumTetras(int numTetras)
Allocate given number of tetrahedra, and allocate normals, colors etc. if they already exist. Internally, there may exist more tetrahedra than requested serving as buffer and to reduce allocation times.Note, the neighbour array might be initialized to -1 when its size changes.
- Version:
- 18.04.10, 2.90 revised (kp) Invocation of setMaxNumTetras and check for instanceSharing adjusted to PgElementSet#setNumElements.
11.12.04, 2.80 revised (kp) No longer update dimOfTetras of numTetras is reduced.
05.08.04, 2.70 revised (kp) No action if same number is requested.
24.07.03, 2.60 revised (kp) Cache of maxNumTetras reduced if numTetras too small.
28.06.03, 2.50 revised (kp) Update dimOfTetras when numTetras is reduced.
25.03.03, 2.10 revised (kp) Update vector fields too.
-
getDimOfTetras
public int getDimOfTetras()
Get number of vertices per tetrahedron which is constant 4.
-
setDimOfColors
public void setDimOfColors(int aSize)
Let all colors have same number of componentsaSize!=0.- Overrides:
setDimOfColorsin classPgPointSet- Parameters:
aSize- Number of components of each color vector.
-
setDimOfVectors
public void setDimOfVectors(int aSize)
Let all vectors have same number of vectorsaSize!=0. It is more efficient to call method beforesetNumVertices().- Overrides:
setDimOfVectorsin classPgPointSet- Parameters:
aSize- Number of coordinates of each tetrahedron.- See Also:
PgPointSet.setDimOfVectors(int)- Version:
- 17.10.00, 2.00 revised (ep) Corrected bounds of loop for tetrahedron normals.
-
hasTetraColors
public boolean hasTetraColors()
Check if tetrahedron colors have been allocated.- See Also:
assureTetraColors()
-
hasTetraTextures
public boolean hasTetraTextures()
Check if tetrahedron textures have been allocated.- See Also:
assureTetraTextures()
-
assureTetraColors
public void assureTetraColors()
Assures respectively allocates correct length of tetrahedron color array. Length of array is equal to length of tetrahedron array.
-
assureTetraTextures
public void assureTetraTextures()
Assures respectively allocates correct length of tetrahedron texture array. Length of array is equal to length of tetrahedron array. Dimension of normal vectors is equal togetDimOfTextures().- Version:
- 24.06.05, 1.10 revised (kp) No longer remove vertex textures.
-
paint
public void paint(PvGeometryIf dc)
Major rendering method fills an internal container class supplied by the display. Seejv.project.PgGeometryIffor detailed information.- Specified by:
paintin interfacePgGeometryIf- Overrides:
paintin classPgPointSet- See Also:
PgGeometryIf
-
makeCubeTetraTexture
public void makeCubeTetraTexture(int uDiscr, int vDiscr, int wDiscr)Generate default tetrahedron texture in [0,1]*[0,1]*[0,1] for a cubical volume.- Parameters:
uDiscr- Number of lines inudirection.vDiscr- Number of lines invdirection.wDiscr- Number of lines inwdirection.- Author:
- Konrad Polthier
- Version:
- 23.06.07, 1.00 created (kp)
-
makeCubeConn
public void makeCubeConn(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 tetrahedra see // TODO: Change the image??? // Numbering is slightly changed. microcube.gif.- Parameters:
uDiscr- Anintwith number of lines on x-axis.vDiscr- Anintwith number of lines on y-axis.wDiscr- Anintwith number of lines on z-axis.- See Also:
makeNeighbour()- Version:
- 23.06.07, 1.00 created (kp)
-
flipOrientation
public void flipOrientation()
Change orientation of all tetrahedra and invert normal vectors.- Overrides:
flipOrientationin classPgPointSet- See Also:
PgPointSet.flipOrientation()- Author:
- Konrad Polthier
- Version:
- 15.06.06, 1.20 revised (kp) Direct replacement rules which avoid internal array allocations,
missing inversion of tetra textures added.
30.01.99, 1.05 revised (kp) Neighbour corrected.
04.10.98, 1.02 revised (kp) Invert normals too.
21.12.97, 1.01 revised (kp) Use invert().
21.10.97, 1.00 created (kp)
-
getVertexValence
public static PiVector getVertexValence(PgTetraSet geom)
Compute valence of each vertex, that is, the number of incoming edges. This method requires correct neighbour information.- Returns:
- vector with the valence of each vertex, its length equals the number of vertices.
-
buildCube
public void buildCube(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 makeCubeConn(int,int,int).- Parameters:
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 axis- See Also:
makeCubeConn(int,int,int)
-
getNumUnusedVertices
public int getNumUnusedVertices()
Get the number of unused vertices which are not references by tetrahedra. // * This method is very cheap and should be- Returns:
- number of unused vertices
- Author:
- Konrad Polthier
- Version:
- 26.12.01, 1.00 revised (kp)
26.12.01, 1.00 created (kp)
-
removeUnusedVertices
public boolean removeUnusedVertices()
Remove all points not referenced by tetrahedra. First, the method computes where each point is moved to, then all point data is moved and the vertex indices are changed. This routine is O(n).- Returns:
trueif method was successfull- Author:
- Konrad Polthier
- Version:
- 26.12.01, 1.50 revised (kp) Early quit if there are no unused vertices.
17.12.00, 1.30 revised (ep) Handle vector fields.
12.02.00, 1.20 revised (kp) Additional check whether bnd refers to valid vertices.
17.10.99, 1.10 revised (kp) Rename from previous name compress(). Texture added.
00.00.98, 1.00 created (kp)
-
removeMarkedVertices
public int[] removeMarkedVertices()
Remove vertices marked with tag PsObject#IS_DELETED from tetrahedra. Remove all tetras containing a marked vertex, and remove all marked vertices. It is necessary to keep a valid tetra set after removal of vertices in the superclass.- Overrides:
removeMarkedVerticesin classPgPointSet- Returns:
- array with indices of new positions of all previously existing vertices
- Version:
- 22.04.02, 1.50 revised (kp) Update list of boundary vertices. 15.06.00, 1.00 created (kp)
-
removeTetra
public int[] removeTetra(int ind)
Remove tetrahedron with given index, and decrement index of all tetrahedra with higher index. Method just marks tetrahedron with tagPsObject.IS_DELETEDand invokesremoveMarkedTetras().- Parameters:
ind- index of tetrahedron which is to be deleted- Returns:
- Array with indices of new positions of all previously existing tetrahedra
- Author:
- Konrad Polthier
- Version:
- 20.07.00, 1.10 revised (kp) Return value changed to index array from boolean.
14.07.00, 1.00 created (kp)
-
removeMarkedTetras
public int[] removeMarkedTetras()
Remove all tetrahedra which have been markedPsObject.IS_DELETED. First, the method computes where each tetrahedron is moved to, then all tetrahedron data is moved and the references to the tetra in bnd curves is changed. This routine is O(n).Method assumes that there exist no references to marked tetrahedra. Otherwise application of this method would lead to unpredictable results.
- Returns:
- Array with indices of new positions of all previously existing tetrahedra
- Author:
- Konrad Polthier
- Version:
- 17.12.00, 1.20 revised (ep) Handle vector fields.
20.07.00, 1.10 revised (kp) Return value changed to index array from boolean.
13.01.00, 1.01 revised (kp) Slight bug found by (ur) removed.
17.10.99, 1.00 created (kp)
-
merge
public boolean merge(PgGeometryIf aGeom)
Merge tetra set with current object and store union of both objects in 'this'. Number of points and tetrahedra 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.The merged geometry will local colors allocated and assigned if
1. both the global color of both geometries are different, or 2. either geometry has local colors.If local colors are allocated but one of the geometries does not have local colors then its local colors are be assumed to be its global color. The merged geometry will show globalVertexColors if1. the global color of both geometries is the same, and 2. both geometries are showing the global color.In all other cases the merged geometry will show local colors. The global color of the merged geometry is never changed.- Specified by:
mergein interfacePgGeometryIf- Overrides:
mergein classPgPointSet- Parameters:
aGeom- tetraSet to be merged into 'this'- Returns:
trueif method was successfull- Author:
- Konrad Polthier
- Version:
- 08.07.06, 2.50 revised (kp) Handling of edges implemented.
12.09.02, 2.20 revised (kp) Merging of colors revised.
01.10.01, 2.11 revised (ur) Set individual tetra colors to global color in a geometry, if only the other geometry has tetra colors.
22.07.00, 2.10 revised (kp) Argument changed to class PgGeometryIf.
15.06.00, 2.00 revised (kp) Argument changed to class PgGeometry.
01.06.99, 1.01 revised (kp) Added missing assureTetraNormals(), -Colors().
10.12.97, 1.00 created (kp)
-
getTetraWithEdge
public int getTetraWithEdge(int vertexInd1, int vertexInd2)Find first tetrahedron 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 a tetrahedron.
-
clearTagTetra
public void clearTagTetra(int ind, int aTag)Clear a single tag of a tetrahedron. For possible tags seePvGeometryIf.
-
hasTagTetra
public boolean hasTagTetra(int ind, int aTag)Check whether tetrahedron has given tag. For possible tags seePvGeometryIf.
-
setTagTetra
public void setTagTetra(int ind, int aTag)Set a tag of a tetrahedron. For possible tags seePvGeometryIf.
-
getTetraVertices
public PdVector[] getTetraVertices(int elemInd)
Get an array with pointers to all vertices of a tetrahedron. Vertices appear in the array in the same order as in the tetrahedron.- Author:
- Konrad Polthier
- Version:
- 08.06.99, 1.01 revised (kp) Cousin method removed allowing to pass vector array as argument.
12.12.97, 1.00 created (kp)
-
getTetra
public PiVector getTetra(int ind)
Get a reference to an individual tetrahedron.- Parameters:
ind- index of tetra
-
getNeighbour
public PiVector getNeighbour(int ind)
Get a reference to an individual neighbour vector.- Parameters:
ind- index of tetra
-
getTetraColor
public java.awt.Color getTetraColor(int ind)
Get a reference to an individual tetrahedron color.- Parameters:
ind- index of tetra
-
setTetraVertices
public boolean setTetraVertices(int elemInd, PdVector[] vArray)Copy new tetra vertices at specified position in the vertex array of PgPointSet. Destination tetra including data array must already exists.- Parameters:
elemInd- index of tetravArray- array with new coordinates of tetra vertices- Returns:
- boolean false, if index out of range, or argument missing
- Version:
- 12.12.97, 1.00 created (kp)
-
setTetra
public void setTetra(int elemInd, int a, int b, int c, int d)Copy new vertex indices to tetra at specified position in the tetrahedron list. Number of tetras is increased if required. Dimension of tetrahedra is adjusted if necessary.- Parameters:
elemInd- index of tetraa- new vertex index of tetrab- new vertex index of tetrac- new vertex index of tetrad- new vertex index of tetra- Version:
- 28.11.00, 1.00 created (kp)
-
setTetra
public boolean setTetra(int elemInd, int[] anIndArray)Copy new vertex indices to tetrahedron at specified position in the tetrahedron list. Number of tetrahedra is increased if required.- Parameters:
elemInd- index of tetrahedronanIndArray- array with new vertex indices of tetrahedron- Returns:
- boolean false, if tetra and array have different length
-
setTetra
public boolean setTetra(int ind, PiVector newElem)Copy new vertex indices to tetrahedron at specified position in the tetrahedron list. Number of tetrahedra is increased if required.- Parameters:
ind- index of tetranewElem- vector with new indices of tetra- Returns:
- boolean false, if tetra and array have different
-
setNeighbour
public boolean setNeighbour(int ind, PiVector newNeigh)Set neighbour tetrahedra of given tetrahedron. Index must be a valid tetrahedron index, and length of neighbour entries must be equal to size of specified tetrahedron.Usually, an applications calls makeNeighbour() instead of calling this low level method. This method is provided for efficiency.
- Parameters:
ind- index of tetranewNeigh- vector with indices of neighbour tetras- Returns:
- boolean false, if tetra and array have different
- Since:
- JavaView 3.24.001
- Version:
- 16.05.04, 1.00 created (kp)
-
setTetraColor
public boolean setTetraColor(int ind, java.awt.Color aColor)Copy new color to tetrahedron color at specified position in the color list- Parameters:
ind- index of tetrahedronaColor- color to be copied to color list- Returns:
- boolean false, if index out of range, or argument missing
- Version:
- 24.02.01, 1.10 revised (kp) Invoke assureTetra...() only if destination array too small.
-
setTetraTexture
public boolean setTetraTexture(int ind, PdVector[] aTexture)Copy new texture coordinates to tetrahedron texture at specified position in the tetrahedron texture list- Parameters:
ind- index of tetrahedronaTexture- array with texture coordinates to be copied- Returns:
- boolean false, if index out of range, or argument missing
- Version:
- 24.02.01, 1.10 revised (kp) Invoke assureTetra...() only if destination array too small.
-
setTetras
public void setTetras(PiVector[] tetra)
Copy the firstgetNumTetras()tetrahedra of source array into an existing tetrahedron array. If source array is too small then abort operation. Assure size of neighbour array, but recomputation of neighbour information must be invoked explicitly usingmakeNeighbour().Appearance of tetras with 2 or less vertices should be avoid. They lead to a setting of m_dimOfTetras=2.
- Parameters:
tetra- array of tetrahedron vectors to be copied- Version:
- 09.11.02, 2.00 revised (kp) Full revision handling tetras with 2 or less vertices.
24.02.01, 1.10 revised (kp) Call assureNeighbours() only if new value of m_dimOfTetras==1.
-
removeTetraColors
public void removeTetraColors()
Remove local tetrahedron colors from a geometry and use global tetrahedron color instead.Showing of tetra colors must be switched off explicitly using
showTetraColors(boolean).
-
setTetraColors
public void setTetraColors(java.awt.Color[] color)
Copy tetrahedron colors of list to existing array of tetrahedron colors. Length of argument list must be equal or larger than getNumTetras().Showing of tetra colors must be switched on in order to be visible.
- Parameters:
color- array with new tetra colors
-
setTetraTextures
public void setTetraTextures(PdVector[][] texCoords)
Use the given textures coordinates as tetra-based texture coordinates. Length of argument list must be equal or larger than getNumTetras(). All tetra textures are copied. The dimension of all argument textures must be equal togetDimOfTextures()of the geometry.Showing of textures must be switched on in order to be visible.
- Parameters:
texCoords- array with new tetra textures- See Also:
setTetraTexturesFromList(PdVector [])
-
setTetraTexturesFromList
public void setTetraTexturesFromList(PdVector[] texCoords)
Use the given textures coordinates as tetra-based texture coordinates. Length of argument list must be equal or larger thangetNumTetraIndices(). All textures coordinates are copied. The dimension of all argument texture vectors must be equal to getDimOfTextures() of the geometry.In contrast to the method
setTetraTextures(PdVector [][])the texture coordinates of the double vector are simply linearized, that means, if the first tetra has n-vertices, then the first n-textures coordinates are used as texture coordinates of this tetra.Showing of textures must be switched on in order to be visible.
- Parameters:
texCoords- array with new tetra textures- Since:
- JavaView 2.45
- See Also:
setTetraTextures(PdVector [][])- Version:
- 09.11.02, 1.00 created (kp)
-
removeTexture
public void removeTexture()
Remove all texture information from surface and switch off showing of texture. Removes texture image and texture coordinates from tetrahedra and vertices both.- Overrides:
removeTexturein classPgPointSet- Version:
- 25.01.02, 1.00 created (kp)
-
setNeighbours
public void setNeighbours(PiVector[] neighbour)
Copy neighbour array to existing array of neighbours. Length of argument list must be equal or larger than getNumTetras(). All neighbour information is copied.- Parameters:
neighbour- array with neighbour information- See Also:
makeNeighbour()
-
getNeighbourLocInd
public int getNeighbourLocInd(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 tetra[anElem], i.e. the vertex not on the edge (vInd, wInd).Modified to handle tetras with more than three edges too. The 'neighbour vertex' 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- index of first vertex of an tetra edge, not local indiceswInd- index of second vertex of an tetra edge, not local indiceselemInd- an tetra index- Returns:
- local index of the vertex containing the neighbourhood information for given edge
- See Also:
getOppVertexLocInd(int, int)- Author:
- Konrad Polthier
- Version:
- 03.09.99, 2.00 revised (kp) Renamed from getOtherVertexLocInd().
11.04.99, 1.50 revised (kp) otherVertex redefined to allow general polygons, nothing changed in case of triangles. See documentation above.
12.12.97, 1.00 created (kp)
-
getOppVertexInd
public int getOppVertexInd(int tetraInd, int locInd)In the adjacent tetrahedron find the vertex containing the neighbourhood information for the original tetrahedron. Return the index of the vertex in the adjacent tetrahedron whose neighbour entry references to the original tetrahedron.- Parameters:
tetraInd- a tetrahedron indexlocInd- local index such thatm_neighbour[elemInd].m_data[locInd]==neighElemIndis the adjacent tetra.- Returns:
- index of the vertex in adjacent tetrahedron containing the neighbourhood information for common face, or -1.
- See Also:
getOppVertexLocInd(int, int)- Author:
- Konrad Polthier
- Version:
- 01.10.00, 1.10 revised (kp) Check if tetrahedron edge is boundary.
14.01.00, 1.00 created (kp)
-
getOppVertexLocInd
public int getOppVertexLocInd(int tetraInd, int locInd)In the adjacent tetrahedron find the vertex containing the neighbourhood information for the original tetrahedron. Return the local index of the vertex in the adjacent tetrahedron whose neighbour entry references to the original tetrahedron. The 'otherVertex' is now defined as the place which stores the neighbourhood information for edge (vInd, wInd) in m_neighbour.Returns -2 in case of bug in neighbourhood. Use makeNeighbour() to create a new neighbourhood.
- Parameters:
tetraInd- a tetrahedron indexlocInd- local index such thatm_neighbour[elemInd].m_data[locInd]==neighElemIndis the adjacent tetra.- Returns:
- local index of the vertex in adjacent tetrahedron containing the neighbourhood information for common face.
- See Also:
getNeighbourLocInd(int, int, int)- Author:
- Konrad Polthier
- Version:
- 22.06.07, 1.00 created (kp)
-
getOtherVertexLocInd
public int getOtherVertexLocInd(int tetraInd, int uInd, int vInd, int wInd)For a given face return the local index of the vertex containing the neighbourhood information.- Parameters:
uInd- vertex index specifies a face, not local indicesvInd- vertex index specifies a face, not local indiceswInd- vertex index specifies a face, not local indicestetraInd- a tetrahedron index- Returns:
- local index of the vertex containing the neighbourhood information for given face
- See Also:
getOppVertexLocInd(int, int)- Version:
- 22.06.07, 1.00 created (kp)
-
getVolumeOfTetra
public double getVolumeOfTetra(int tetraInd)
Compute algebraic volume of the cone of a face with the third vertex.- Author:
- Konrad Polthier
- Version:
- 04.09.02, 1.10 revised (kp) Sign of volume added.
12.12.97, 1.00 created (kp) - Fixme:
- (poe) This only works for tets in R3 due to use of cross product.
-
getVolumeOfNdTetra
public double getVolumeOfNdTetra(int tetraInd)
Compute algebraic volume of the cone of a face with the third vertex. In contrast togetVolumeOfTetra(int)this method is dimension-independent and works for tetrahedra in Rn for arbitraryn>=3. The volume is computed as1/6*gwhere g is the Gram determinant of three edges spanning the tetrahedron.- Parameters:
tetraInd- A valid index for a tetrahedron in this mesh.- Returns:
- The volume of the given tetrahedron.
- Author:
- Konstantin Poelke
- Version:
- 18.09.14, 1.00 created (poe)
- ToDo:
- (poe) Method needs proper testing. Performance could be improved in several ways, e.g. by using a left/rightMult member method of PdMatrix that works for non-square n*m-matrices, as long as column/row sizes match.
-
getVolume2
public double getVolume2()
Compute total volume of the solid, using the dimension-independentgetVolumeOfNdTetra(int)method.- Returns:
- Total volume of the solid.
- Author:
- Konstantin Poelke
- Version:
- 18.09.14, 1.00 created (poe)
- ToDo:
- (poe) This method should eventually replace
getVolume().
-
getVolume
public double getVolume()
Compute total volume of the solid.- Author:
- Konrad Polthier
- Version:
- 12.12.97, 1.00 revised (kp)
12.12.97, 1.00 created (kp)
-
getArea
public double getArea()
Compute total area of boundary surface of tetrahedral volume.
-
getEdgeLength
public double getEdgeLength(int tetraInd, int locInd1, int locInd2)Compute length of tetrahedron edge specified by tetrahedron index and vertex indices.- Parameters:
tetraInd- index of tetrahedronlocInd1- local index of first vertexlocInd2- local index of second vertex- Returns:
- length of edge
- Author:
- Konrad Polthier
- Version:
- 12.12.97, 1.00 created (kp)
-
computeCone
public void computeCone(int numULines, int numVLines, double bottomRadius, double height)Generate cone in z-direction centered at the origin with given bottom radius and height. Sample method to have simple geometry available for test purposes.- Overrides:
computeConein classPgPointSet- Parameters:
numULines- discretization in angular directionnumVLines- discretization in z-axis directionbottomRadius- radius of bottom disk of coneheight- height of cone from bottom disk to tip- Version:
- 29.12.03, 1.00 created (kp)
- ToDo:
- Missing makeConeConn(numULines, numVLines)
-
computeCylinder
public void computeCylinder(int numULines, int numVLines, double radius, double length)Generate cylinder in z-direction centered at the origin with given radius and length. Sample method to have simple geometry available for test purposes.- Overrides:
computeCylinderin classPgPointSet- Parameters:
numULines- discretization in angular directionnumVLines- discretization in z-axis directionradius- radius of cylinderlength- height of cylinder- ToDo:
- Missing makeCylinderConn(numULines, numVLines)
-
computeSphere
public void computeSphere(int numULines, int numVLines, double radius)Generate sphere with given radius. Sample method to have simple geometry available for test purposes.- Overrides:
computeSpherein classPgPointSet- Parameters:
numULines- discretization in angular directionnumVLines- discretization in meridian directionradius- radius of sphere- ToDo:
- Missing makeSphereConn(numULines, numVLines)
-
computeTorus
public void computeTorus(int numULines, int numVLines, double radius, double thick)Generate torus in x-y plane with given radius of soal and thickness of tube. Sample method to have simple geometry available for test purposes.- Overrides:
computeTorusin classPgPointSet- Parameters:
numULines- discretization in angular directionnumVLines- discretization in meridian directionradius- radius of soalthick- radius of torus tube- ToDo:
- Missing makeTorusConn(numULines, numVLines)
-
getNumBoundaryFaces
public int getNumBoundaryFaces()
Calculate number of boundary Faces of a manifold solid using m_neighbour information. This number may be different from number of boundary components and number of boundary segments.If solid is non-manifold and neighbour information is not correct then this method may determine a wrong number of boundary faces.
- Returns:
- number of boundary faces
- See Also:
getNumBoundaries()- Author:
- Konrad Polthier
- Version:
- 23.06.07, 1.00 created (kp)
-
getNumEdges
public int getNumEdges()
Calculate number of edges of a 3d triangulation using m_neighbour information.If neighbour information is missing, then each tetra edge is counted. Algorithm runs once over all tetras and counts an edge if the index of the adjacent tetra is smaller than the index of the current tetra.
If surface is non-manifold and neighbour information is not correct then this method may determine a wrong number of edges.
- Returns:
- number of edges, inner edges counted once
- See Also:
getNumBoundaryFaces()- Author:
- Konrad Polthier
- Version:
- 23.06.07, 1.00 created (kp)
-
getNumBoundaryVertices
public int getNumBoundaryVertices()
Count number of boundary vertices assuming boundary vertices have been previously marked.- See Also:
markBoundary()- Author:
- Konrad Polthier
- Version:
- 21.05.99, 1.00 revised (kp)
21.05.99, 1.00 created (kp)
-
blend
public boolean blend(double s, PgGeometry ag, double t, PgGeometry bg)Blend between two tetra sets, used in interpolation and computing the associate surfacesthis = s*ag + t*bg.- Specified by:
blendin interfacePgGeometryIf- Overrides:
blendin classPgPointSet- Parameters:
s- weight of vertices of first geometryag- first geometry used for blendingt- weight of vertices of second geometrybg- second geometry used for blending- Returns:
- true on success
- Author:
- Konrad Polthier
- Version:
- 08.07.06, 2.50 revised (kp) Handling of edges implemented.
10.03.02, 2.10 revised (kp) Interpolation of vector fields implemented.
10.11.01, 2.00 revised (kp) Interpolation of material properties enabled.
30.12.97, 1.00 created (kp)
-
checkNeighbour
public boolean checkNeighbour(boolean bMessage)
Check correct neighbour connectivity. For each tetrahedron ensure that - length of each neighbour array has same size as tetrahedron array - it does not reference itself - it is neighbour of each adjacent tetrahedron - it and its neighbour share a face with common vertices.- Parameters:
bMessage- Flag to send a message to the console.- Returns:
- true if neighbour connectivity is correct
- Author:
- Konrad Polthier
- Version:
- 28.01.02, 1.10 revised (ur) Flag added to avoid the Message to console.
31.01.00, 1.01 revised (kp) Allow reference of adjacent tetrahedra even if differently oriented.
31.10.98, 1.00 created (kp)
-
intersectionWithLine
public PvPickEvent intersectionWithLine(PdVector rayBaseWorld, PdVector rayDirWorld)
Find intersection of tetra set with a given ray. Method is used for interactive picking. Base and direction of ray must be given in 3D world coordinates.- Specified by:
intersectionWithLinein interfacePgGeometryIf- Overrides:
intersectionWithLinein classPgPointSet- Parameters:
rayBaseWorld- 3D base point of ray eventually hitting the surface.rayDirWorld- 3D direction vector of ray eventually hitting the surface.- Returns:
- full information about hit tetrahedron, barycentric coordinates etc.
- Author:
- Konrad Polthier
- Version:
- 04.09.06, 2.31 revised (kp) Bary now contains tetra index.
01.04.06, 2.30 revised (kp) Conversion of world to model coordinate move to this method from PvDisplay.
15.02.05, 2.20 revised (kp) Use horizontal distance, diameter constraint removed.
25.03.01, 2.10 revised (kp) Use point on geometry as vertex, use rayBase as viewBase.
04.03.01, 2.00 revised (kp) Rewritten intersectionWithLine() to handle vertices in dim 2 and 3.
02.12.00, 1.10 revised (kp) Use minDist as distance, use rayBase as vertex.
04.10.99, 1.00 created (kp)
-
makeTetraColorsFromXYZ
public boolean makeTetraColorsFromXYZ()
Create color from the tetrahedron position within its bounding box which is interpreted as RGB cube. If dimension of vertices is smaller than three then only the first vertex components are used in the color computation.- Author:
- Konrad Polthier
- Version:
- 27.09.01, 1.10 revised (kp) Correct if vertex dimension larger than three.
22.08.00, 1.00 created (kp)
-
makeTetraColorsFromZ
public boolean makeTetraColorsFromZ()
Create color from the vertical z-height within its bounding box ranging from low blue to high red. If dimension of vertices is smaller than three then the highest vertex component are used instead of the z-component in the color computation.- Author:
- Konrad Polthier
- Version:
- 16.04.05, 1.20 revised (kp) Both colors flipped to better sync with Maple.
27.09.01, 1.10 revised (kp) Correct if vertex dimension larger than three.
22.08.00, 1.00 created (kp)
-
makeTetraColorsFromZHue
public boolean makeTetraColorsFromZHue()
Create color from the vertical z-height within its bounding box ranging through hue rainbow. If dimension of vertices is smaller than three then the highest vertex component are used instead of the z-component in the color computation.- Author:
- Konrad Polthier
- Version:
- 17.04.05, 1.20 revised (kp) Expand color spectrum to [magenta,red] from [blue,red].
27.09.01, 1.10 revised (kp) Correct if vertex dimension larger than three.
22.08.00, 1.00 created (kp)
-
makeTetraFromVertexColors
public boolean makeTetraFromVertexColors()
Create tetra colors as average of all colors of its vertices. Vertex colors must be available.- Author:
- Konrad Polthier
- Version:
- 18.03.01, 1.00 created (kp)
-
makeVertexFromTetraColors
public boolean makeVertexFromTetraColors()
Create vertex colors as average of individual color of all adjacent tetras. Local tetra colors must be available.- Author:
- Konrad Polthier
- Version:
- 18.03.01, 1.00 created (kp)
-
makeTetraFromVertexTexture
public boolean makeTetraFromVertexTexture()
Create tetra textures from vertex textures and remove vertex textures. Vertex textures must be available.- Author:
- Ulrich Reitebuch
- Version:
- 23.04.05, 1.10 revised (kp) Remove vertex textures after conversion.
04.12.01, 1.00 created (ur)
-
reflect
public PgGeometry reflect(PdMatrix mat, boolean bOrient, boolean bVector)
Generate a cloned geometry and transform vertices by a matrix. For example, this method is called to calculate mirror images of a geometry. Orientation of geometry affects surface vectors.- Specified by:
reflectin interfacePgGeometryIf- Overrides:
reflectin classPgPointSet- Parameters:
mat- 3*3 or 4*4 transformation matrixbOrient- flag whether to keep the orientation of the geometrybVector- flag whether to keep the orientation of vectors- Returns:
- new reflected copy of the geometry
- Author:
- Konrad Polthier
- Version:
- 20.03.01, 1.20 revised (kp) Neighbour array of reflected geometry corrected.
12.12.00, 1.10 revised (kp) Additional argument added for orientation of vectors.
16.11.00, 1.00 created (kp)
-
resetBoundaryNormals
public boolean resetBoundaryNormals()
Remove boundary vertex normal. Often boundary vertex normals can not be determined correctly. This method allows to reset these normal to zero. The boundary is determined from the neighbour information.- Returns:
- false if vertex normals are missing
- Author:
- Konrad Polthier
- Version:
- 29.05.01, 1.00 revised (kp)
29.05.01, 1.00 created (kp)
-
getFVector
public int[] getFVector()
Compute F-vector which shows the number of points, edges, faces, etc.Note, the number of vertices may include some vertices which are not referenced by tetras. The number of unused vertices must be subtracted from the number of vertices found in the F-vector when computing the Euler characteristic.
- Overrides:
getFVectorin classPgPointSet- Version:
- 20.12.01, 1.10 revised (kp) Renamed to getFVector() from getEulerNumbers().
04.11.01, 1.00 created (kp)
-
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
booleanindicating 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-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 start value on the x-axisvMin- a double with the start value on the y-axiswMin- a double with the start value on the z-axisuMax- a double with the end value on the x-axisvMax- a double with the end value on the y-axiswMax- a double with the end value on the z-axis- See Also:
buildCube(PdVector[],int,int,int)
-
getSurface
public PgElementSet getSurface(PgElementSet surface)
Gets the surface elements of the tetrahedron set.- Returns:
- A
PgElementSetwith the surface.
-
makeEdgeStars
public PgEdgeStar[] makeEdgeStars()
Generate list of edges from element information of a possibly non-manifold surface. Method does not use neighbour information but computes the edge list solely based on information of the m_tetra array.The routine computes an array of edges temporarily in a single pass through all elements. Additionally, it stores the (1, 2, ..) elements sharing an edge.
During edge collection, each edge is stored in the array edgesAtVertex at an index equal to the lowest of its two vertex indices. After the collection, each entry of edgesAtVertex is a vector containing those edges emanating from this vertex to vertices with higher vertex index. The entry at index i in edgesAtVertex is an array which contains all edges emanating from vertex with index i to vertices with higher index.
This algorithm requires the array edgesAtVertex to have size equal to largest vertex index referenced from an element, but has a linear runtime when finding entries with identical edges. When collection is finished, usually some array entries will be
null. The return parameter is an array of edges constructed from edgesAtVertex.If element set is non-manifold then the number of edges returned by this method may differ from the number which getNumEdgeStars() returns and getNumEdges() since the later relies on a correct neighbour information which is not used here.
- Returns:
- array with all edge, size equals number of edges.
- Author:
- Konrad Polthier
- Version:
- 02.07.06, 3.00 revised (kp) Renamed to makeEdgeStars() from getEdgeList().
17.09.00, 2.10 revised (kp) Bug removed in vertex counting, one vertex was missing.
23.06.00, 2.00 revised (kp) List of edges changed from vector to array.
22.08.99, 1.10 revised (kp) Method now also works if vertices haven't been created yet.
10.04.99, 1.00 created (kp) Code taken from method makeNeighbour().
-
makeNeighbour
public boolean makeNeighbour()
Generate neighbourhood information for a given manifold polyhedron. The routine computes an array of faces temporarily in a single pass through all elements, and uses this information to fill out the neighbour instance variable. The diagram
details this.- Returns:
- boolean false, if polyhedron is not a manifold, i.e. an face is shared by more than two elements.
- Author:
- Konrad Polthier
- Version:
- 21.12.00, 2.70 revised (kp) Edges with more than two elements all become boundary faces.
10.04.99, 2.60 revised (kp) Edge construction moved into separate method.
31.10.98, 2.50 revised (kp) Opposite vertex local index change from k+2 to k-1, no difference for triangulations
16.09.98, 2.00 revised (kp) Optimized, O(n*n) replaced with O(n) algorithm
23.11.97, 1.00 created (kp)
-
markBoundary
public void markBoundary()
Tag all boundary vertices as those. Assume a correct neighbour connectivity.
-
getEdgeVertex0
public int getEdgeVertex0(int tet, int locEdgeInd)Get first vertex of the edge in given tet with given local edge index.- Version:
- 19.04.10, 1.00 created (mn)
-
getEdgeVertex1
public int getEdgeVertex1(int tet, int locEdgeInd)Get first vertex of the edge in given tet with given local edge index.- Version:
- 19.04.10, 1.00 created (mn)
-
getFace
public PiVector getFace(int t, int i)
Get a face triangle of a tetra.- Parameters:
t- Index of tetrahedron.i- Local neighbour index of face in tetrahedron.- Returns:
- Vector of size 3 containing the (oriented) vertex indices of the face.
- Author:
- Matthias Nieser
- Version:
- 09.03.15, 1.50 revised (ur) Use global variable to assure correct orientation of face.
20.05.10, 1.00 created (mn)
-
addElement
public int addElement(PiVector el)
Add a new tetrahedron.- Specified by:
addElementin interfacePgGeometryIf- Overrides:
addElementin classPgGeometry- Parameters:
el- vector with indices of vertices in global vertex array
-
getCenterOfTetra
public PdVector getCenterOfTetra(int t)
Get center point of tetrahedron.
-
-
"