|
JavaView® v2.12 | ||||||||
| 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.PgElementSet
Base class for most geometric surfaces with polygonal faces formed by vertices.
The class contains an array with faces, i.e. elements, and each element may have different
number of vertices. Each element is an instance of type PiVector containing indices of the
vertices which are stored in the superclass PgPointSet. Additionally,
there exist instance variables for element normals, element colors, element texture
coordinates, and other element properties. Note, that such element properties are not stored
with each element but each property is stored in an additional array of same length
as the array of elements. If a property is not available then the corresponding array
is null.
The dimension of all points is determined as argument of the constructor and cannot
be changed later. See PgPointSet for details about allocation and access.
The number of vertices per element may be the same for all elements of the element set,
and assigned using the method setDimOfElements(int).
Or, the size of elements may differ in which case getDimOfElements()==-1,
which is the default case. The advantage of the first case is, that the class is able
to do more memory allocations automatically.
There exist several utility functions to allocate and modify the number of elements, for example,
setNumElements(int num)
allocates num elements. 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 elements is changed, the class automatically adjusts the size
of those element properties which are currently in use, i.e. whose array is not null.
Applications may modify the entries of an element and of element properties by direct method calls such as
setElement(int, PiVector)
which sets the element with index ind equal to the components of a vector v by copying.
Alternatively, if an application modifies a larger number of elements then the application
may prefer to obtain the element array from the element set and directly modify the array
PiVector [] element = elementSet.getElements();
for (int i=0; i<elementSet.getNumElements(); i++)
element[i].copy(v);
The same choice is available for arrays containing element properties.
Note, that classes like PgElementSet, may not reference all vertices, e.g.
if the currently active elements consists of a subset of all vertices.
Also note, that the actual size of the element array may differ from m_numElements
efficiency reasons. Therefore, do not use element.length but use getNumElements().
This class contains mainly basic methods for memory allocation and access to instance variables. Geometric methods operating on element 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 computeTorus
(if source code access to JavaView is available), or the tutorial applets of JavaView.
setDimOfVectors(int).| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS |
| Constructor Summary | |
PgElementSet()
Constructor of a polyhedral surface in three-dimensional space. |
|
PgElementSet(int aVertexDim)
Constructor of a polyhedral surface in a space of given dimension. |
|
| Method Summary | |
int |
addEdge(PiVector anEdge)
Add new edge to the end of the edge list. |
int |
addElement(PiVector anElement)
Add new element to the end of the element list. |
boolean |
addElement(PiVector anElement,
int anIndex)
Add a new element at the specified position in the element list. |
void |
assureBoundary(int num)
Allocate boundary polygons and register current element set. |
boolean |
assureDimOfElements()
Assure correctness of value m_dimOfElements specifying the number of vertices per Element. |
void |
assureEdgeColors()
Assures respectively allocates correct length of edge color array. |
void |
assureElementBackColors()
Assures respectively allocates correct length of element color array. |
void |
assureElementColors()
Assures respectively allocates correct length of element color array. |
void |
assureElementNormals()
Assures respectively allocates correct length of element normal array. |
void |
assureElementTextures()
Assures respectively allocates correct length of element texture array. |
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 |
buildPolygon(PdVector[] polygon,
int discr)
Generate the vertices for a macro polygon where all edges are subdivided into 'discr' points. |
void |
buildPolygonFromCurve(PgPolygon[] curve)
Generate the vertices for a macro polygon given by a set of polygons, all with same discretization. |
void |
buildQuadr(PdVector[] quadr,
int uDiscr,
int vDiscr)
Create a rectangular elements by bilinear interpolation of four given vertices and discretization. |
void |
buildQuadrFromCurve(PgPolygon[] curve,
PgBndConstraint[] bndConstr)
Generate the vertices for a macro quadrilateral given by four polygons with pairwise same discretization. curve[0] and curve[2] respectively curve[1] and curve[3] must have same discretization. |
void |
buildTriangle(PdVector[] triangle,
int discr)
Generate the vertices for a macro triangle where all edges are subdivided into 'discr' points. |
void |
buildTriangleFromCurve(PgPolygon[] curve,
PgBndConstraint[] bndConstr)
Generate the vertices for a macro triangle given by three polygons with same discretization. |
boolean |
checkNeighbour()
Check correct neighbour connectivity. |
void |
clearTagElement(int anIndex,
int aTag)
Clear a single tag of a element. |
java.lang.Object |
clone()
Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners. |
boolean |
close()
Identify and remove all interior boundaries of a geometry, and compress vertex array. |
void |
computeCylinder(int numULines,
int numVLines,
double radius,
double length)
Generate cylinder in z-direction with given radius and length. |
void |
computeDisk(int numULines,
int numVLines,
double radius)
Generate disk in xy-plane with given radius. |
void |
computePlane(int numULines,
int numVLines,
double uMin,
double vMin,
double uMax,
double vMax)
Generate rectangle in z=0 plane with given min/max values. |
void |
computeRotation(PgPolygon meridian,
int numULines)
Generate rotational symmetric surface from given meridian around x-axis. |
void |
computeSnail(int numULines,
int numVLines,
double numWindings)
Generate a winding snail. |
void |
computeSphere(int numULines,
int numVLines,
double radius)
Generate sphere with given radius. |
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. |
void |
copy(PgGeometry geom)
Copy instance variables by duplication, not by copying a reference. |
void |
copyConnectivity(PgElementSet geom)
Copy connectivity of mesh, i.e. element and neighbour array. |
void |
copyElementSet(PgElementSet geom)
Copy instance variables of this class but not of its superclass. |
void |
fixBoundaries()
Constrain all boundary vertices not to move during variations. |
void |
flipEdges()
Flip edge of pairs of adjacent triangles if sum of opposite angles is larger than sum of spatial angles at common edge. |
void |
flipOrientation()
Change orientation of all elements and invert normal vectors. |
double |
getArea()
Compute total area of polyhedral surface. |
double |
getAreaOfElement(int elemInd)
Compute area of polyhedral element with given index. |
PgBndPolygon[] |
getBoundaries()
Get array of boundary polygons, some of which may be marked inactive. |
int |
getDimOfElements()
Retrieve number of vertices per element, if it is the same for all elements, otherwise return -1. |
PiVector |
getEdge(int anIndex)
Get a reference to index vector of edge with given index. |
PgElementEdge |
getEdge(int vInd1,
int vInd2)
Create an edge structure with information about edge and adjacent elements. |
java.awt.Color[] |
getEdgeColors()
Get color array for read and write access. |
double |
getEdgeLength(int anElem,
int locInd)
Compute length of triangle edge specified by element index and vertex index. |
PgElementEdge[] |
getEdgeList()
Generate list of edges from element information. |
PiVector[] |
getEdges()
Get edge array for read and write access, but do not modify the size of any edge. |
PiVector |
getElement(int anIndex)
Get a reference to an individual element. |
java.awt.Color |
getElementBackColor(int anIndex)
Get a reference to an individual backside element color. |
java.awt.Color[] |
getElementBackColors()
Get backside element color array for read and write access, but do not modify the size of any color vector. |
java.awt.Color |
getElementColor(int anIndex)
Get a reference to an individual element color. |
java.awt.Color[] |
getElementColors()
Get element color array for read and write access, but do not modify the size of any color vector. |
PdVector |
getElementNormal(int anIndex)
Get a reference to an individual element normal. |
PdVector[] |
getElementNormals()
Get element normal array for read and write access, but do not modify the size of any normal vector. |
PiVector[] |
getElements()
Get element array for read and write access. |
PdVector[][] |
getElementTextures()
Get element texture array for read and write access, but do not modify the size of any texture vector. |
PdVector[] |
getElementVertices(int elemInd)
Get an array with pointers to all vertices of an element. |
int |
getElementWithVertex(int vertexInd)
Find first element referencing a given vertex. |
java.awt.Color |
getGlobalBndColor()
Get global boundary color which is used if no local colors are available. |
double |
getGlobalBndSize()
Get thickness in pixels of boundary when drawn in display. |
java.awt.Color |
getGlobalBndTagColor()
Get global color of tagged boundaries. |
java.awt.Color |
getGlobalEdgeColor()
Get global edge color which is used if no local colors are available. |
double |
getGlobalEdgeSize()
Get thickness in pixels of edge when drawn in display. |
java.awt.Color |
getGlobalEdgeTagColor()
Get global color of tagged edges. |
java.awt.Color |
getGlobalElementBackColor()
Get global color of backface of elements. |
java.awt.Color |
getGlobalElementColor()
Get global element color which is used if no local colors are available. |
java.awt.Color |
getGlobalElementNormalColor()
Get global element normal color which is used if no local colors are available. |
double |
getGlobalElementNormalLength()
Get length factor of element normal vectors when drawn in display. |
double |
getGlobalElementNormalSize()
Get thickness in pixels of element normals when drawn in display. |
java.awt.Color |
getGlobalElementTagColor()
Get global color of tagged elements. |
PgJvxSrc |
getJvx()
Fills a geometry object with data from this instance, for example, to print to file. |
PdMatrix |
getL2Matrix(PdMatrix mat)
Compute L2 matrix S such that L2-norm(u)^2 = u*S*u. |
double |
getL2Norm()
Compute L2 norm of identity map of element set. |
int |
getMaxNumElements()
Get total length of allocated element array. |
PiVector |
getNeighbour(int anIndex)
Get a reference to an individual neighbour vector. |
int |
getNeighbourLocInd(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. |
int |
getNumBoundaries()
Return number of boundary polygons, i.e. length of array m_bndList. |
int |
getNumBoundaryComponents()
Compute number of boundary components of a trianglation. |
int |
getNumBoundaryEdges()
Calculate number of boundary edges. |
int |
getNumBoundaryVertices()
Count number of boundary vertices assuming boundary vertices have been previously marked. |
int |
getNumEdges()
Calculate number of edges. |
int |
getNumElementIndices()
Get total number of vertex entries in all elements. |
int |
getNumElements()
Get number of elements in element array. |
int |
getOppVertexInd(int elemInd,
int locInd)
In the adjacent element find the vertex containing the neighbourhood information for the original element. |
int |
getOppVertexLocInd(int elemInd,
int locInd)
In the adjacent element find the vertex containing the neighbourhood information for the original element. |
PiVector[] |
getSavedElements()
Only used when working with non-conforming triangulations. |
int |
getSavedNumVertices()
Only used when working with non-conforming triangulations. |
double |
getVertexAngle(int elemInd,
int locInd)
Compute length of triangle edge specified by element index and vertex index. |
PdVector[] |
getVertexTextures()
Get array of all texture coordinates both for vertex and element based textures. |
double |
getVolume()
Compute total volume of polyhedral surface. |
double |
getVolumeOfElement(int elemInd)
Compute volume of the cone of a polyhedral element with the origin. |
boolean |
hasBoundary()
Check whether surface has boundary polygons, assume boundary has been calculated. |
boolean |
hasEdgeColors()
Check if edge colors have been allocated and size corresponds to number of edges. |
boolean |
hasEdges()
Check if edge array has been allocated, size is not checked. |
boolean |
hasElementBackColors()
Check if element back colors have been allocated. |
boolean |
hasElementColors()
Check if element colors have been allocated. |
boolean |
hasElementNormals()
Check if element normals have been allocated. |
boolean |
hasElementTextures()
Check if element textures have been allocated. |
boolean |
hasTagElement(int anIndex,
int aTag)
Check whether element has given tag. |
void |
init()
Initialize and reset instance variables after call to super.init(). |
PvPickEvent |
intersectionWithLine(PdVector rayBase,
PdVector rayDir)
Find intersection of element set with a given ray. |
boolean |
isConforming()
Return true if elementSet is conforming, else false. |
boolean |
isShowingBackface()
Determines whether drawing of backfacing elements whose normal points away from camera is enabled. |
boolean |
isShowingBoundaries()
Determines whether drawing of boundary curves is enabled. |
boolean |
isShowingEdgeColors()
Determines whether global edge color is used. |
boolean |
isShowingEdgeLabels()
Determines whether showing of edge labels is enabled. |
boolean |
isShowingEdges()
Determines whether drawing of element edges is enabled. |
boolean |
isShowingElementBackColor()
Determines whether global element backface color is used. |
boolean |
isShowingElementBackColors()
Determines whether drawing of individual backface element colors is enabled. |
boolean |
isShowingElementColors()
Determines whether global element color is used. |
boolean |
isShowingElementLabels()
Determines whether showing of element labels is enabled. |
boolean |
isShowingElementNormalArrow()
Determines whether drawing of arrow of element normals is enabled. |
boolean |
isShowingElementNormals()
Determines whether drawing of element normals is enabled. |
boolean |
isShowingElements()
Determines whether drawing of elements is enabled. |
boolean |
isShowingElementTextures()
Determines whether drawing of element texture is enabled. |
boolean |
isShowingOutline()
Determines whether drawing of outline element edges is enabled. |
boolean |
isShowingTaggedBoundaries()
Determines whether drawing of tagged boundary curves is enabled. |
boolean |
isShowingTaggedEdges()
Determines whether drawing of tagged element edges is enabled. |
boolean |
isShowingTaggedElements()
Determines whether drawing of tagged elements is enabled. |
void |
makeAlternatingQuadrConn(int uDiscr,
int vDiscr,
boolean alternateUDir)
Make quadrilateral connectivity with quadrilaterals being alternately triangulated. |
void |
makeCylinderConn(int uDiscr,
int vDiscr)
Generate element and neighbourhood information for a cylindrical surface. |
boolean |
makeElementColorsFromXYZ()
Create color from the element position within its bounding box which is interpreted as RGB cube. |
boolean |
makeElementColorsFromZ()
Create color from the vertical z-height within its bounding box ranging from red to blue. |
boolean |
makeElementColorsFromZHue()
Create color from the vertical z-height within its bounding box ranging through hue rainbow. |
boolean |
makeElementFromVertexColors()
Create element colors as average of all colors of its vertices. |
boolean |
makeElementNormals()
Compute element normals from edge crossproducts. |
boolean |
makeNeighbour()
Generate neighbourhood information for a given manifold polyhedron. |
void |
makePatchConn(int discr)
Generate the connectivity for a macro polygon where all edges are subdivided into 'discr' points. |
void |
makeQuadrBnd(int uDiscr,
int vDiscr)
Generate boundary information for a quadrilateral surface. |
void |
makeQuadrConn(int uDiscr,
int vDiscr)
Generate element and neighbourhood information for a quadrilateral surface. |
void |
makeQuadrElementTexture(int uDiscr,
int vDiscr)
Generate default element texture in [0,1]*[0,1] for a quadrilateral surface. |
void |
makeQuadrVertexTexture(int uDiscr,
int vDiscr)
Generate default vertex texture in [0,1]*[0,1] for a quadrilateral surface. |
void |
makeTriangleBnd(int discr)
Generate the boundary of a macro triangle where all edges are subdivided into 'discr' points. |
void |
makeTriangleConn(int discr)
Generate the connectivity for a macro triangle where all edges are subdivided into 'discr' points. |
boolean |
makeVertexFromElementColors()
Create element colors as average of all colors of its vertices. |
boolean |
makeVertexNormals()
Compute vertex normals by adding all adjacent corner element normals, and final normalization. |
void |
markBoundary()
Tag all boundary vertices as those. |
boolean |
merge(PgGeometryIf aGeom)
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. |
java.lang.String |
printEdgeList()
Generate list of edges from element information. |
boolean |
refineGlobalIntoFour()
|
PgGeometry |
reflect(PdMatrix mat,
boolean bOrient,
boolean bVector)
Generate a cloned geometry and transform vertices by a matrix. |
void |
removeBoundaries()
Remove all boundary curves. |
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 |
resetBoundaryNormals()
Remove boundary vertex normal. |
void |
setBoundary(PgBndPolygon[] newBnd)
Set new boundary polygons by replacing the previous array with the argument array. |
void |
setConforming(boolean flag)
Set conformality state of geometry and boundary curves, and do not modify connectivity. |
void |
setDimOfColors(int aSize)
Let all colors have same number of components aSize<>0. |
void |
setDimOfElements(int aSize)
Let all elements have same number of vertices aSize<>0,
or individual aSize=-1.
|
void |
setDimOfVectors(int aSize)
Let all vectors have same number of vectors aSize<>0.
|
boolean |
setEdge(int anIndex,
PiVector aEdge)
Set index vector of edge with given index. |
void |
setEdgeColors(java.awt.Color[] color)
Copy edge colors of list to existing array of edge colors. |
void |
setEdges(PiVector[] edge)
Copy the first m_numEdges of given array into edge array. |
boolean |
setElement(int elemInd,
int[] anIndArray)
Copy new vertex indices to element at specified position in the element list. |
void |
setElement(int elemInd,
int a,
int b,
int c)
Copy new vertex indices to element at specified position in the element list. |
void |
setElement(int elemInd,
int a,
int b,
int c,
int d)
Copy new vertex indices to element at specified position in the element list. |
boolean |
setElement(int anIndex,
PiVector newElem)
Copy new vertex indices to element at specified position in the element list. |
boolean |
setElementBackColor(int anIndex,
java.awt.Color aColor)
Copy new color to element color at specified position in the color list |
void |
setElementBackColors(java.awt.Color[] color)
Copy backface element colors of list to existing array of element colors. |
boolean |
setElementColor(int anIndex,
java.awt.Color aColor)
Copy new color to element color at specified position in the color list |
void |
setElementColors(java.awt.Color[] color)
Copy element colors of list to existing array of element colors. |
boolean |
setElementNormal(int anIndex,
PdVector aNormal)
Copy new normal to element normal at specified position in the normal list |
void |
setElementNormals(PdVector[] normal)
Copy element normals of list to existing array of element normals. |
void |
setElements(PiVector[] element)
Copy the first getNumElements() elements of source array into
an existing element array.
|
boolean |
setElementTexture(int anIndex,
PdVector[] aTexture)
Copy new texture coordinates to element texture at specified position in the element texture list |
void |
setElementTextures(PdVector[][] texCoords)
Copy element textures of list to existing array of element textures. |
boolean |
setElementVertices(int elemInd,
PdVector[] vArray)
Copy new element vertices at specified position in the vertex array of PgPointSet. |
void |
setGlobalBndColor(java.awt.Color color)
Set global boundary color to be used if no local colors are available. |
void |
setGlobalBndSize(double size)
Set thickness in pixels of boundary when drawn in display. |
void |
setGlobalBndTagColor(java.awt.Color color)
Set global color of tagged boundaries. |
void |
setGlobalEdgeColor(java.awt.Color color)
Set global edge color to be used if no local colors are available. |
void |
setGlobalEdgeSize(double size)
Set thickness in pixels of edge when drawn in display. |
void |
setGlobalEdgeTagColor(java.awt.Color color)
Set global color of tagged edges. |
void |
setGlobalElementBackColor(java.awt.Color color)
Set global color of backface of elements. |
void |
setGlobalElementColor(java.awt.Color color)
Set global element color to be used if no local colors are available. |
void |
setGlobalElementNormalColor(java.awt.Color color)
Set global element normal color to be used if no local colors are available. |
void |
setGlobalElementNormalLength(double length)
Get length factor of element normal vectors when drawn in display. |
void |
setGlobalElementNormalSize(double size)
Get thickness in pixels of element normals when drawn in display. |
void |
setGlobalElementTagColor(java.awt.Color color)
Set global color of tagged elements. |
void |
setJvx(PgJvxSrc src)
Fill this instance with data from a geometry source, for example, previously read from file. |
void |
setNeighbours(PiVector[] neighbour)
Copy neighbour array to existing array of neighbours. |
void |
setNumEdges(int aNumEdges,
int dimOfEdges)
Allocate given number of edges, and allocate normals, colors etc. if they already exist. |
void |
setNumElements(int aNumElements)
Allocate given number of elements, and allocate normals, colors etc. if they already exist. |
void |
setSavedElements(PiVector[] element)
Only used when working with non-conforming triangulations. |
void |
setSavedNumVertices(int num)
Only used when working with non-conforming triangulations. |
void |
setTagElement(int anIndex,
int aTag)
Set a tag of a element. |
void |
setVertexTextures(PdVector[] aVertexTextureList)
Copy vertex textures of list to existing array of vertex textures. |
void |
showBackface(boolean flag)
Set flag to enable drawing of backfacing elements whose normal points away from camera. |
void |
showBoundaries(boolean flag)
Set flag to enable drawing of boundary curves. |
void |
showEdgeColors(boolean flag)
Set flag of using global edge color instead of coloring each edge individually. |
void |
showEdgeLabels(boolean flag)
Set flag to enable drawing of edge labels in display. |
void |
showEdges(boolean flag)
Set flag to enable drawing of element edges. |
void |
showElementBackColor(boolean flag)
Set flag to enable drawing of backface color of elements. |
void |
showElementBackColors(boolean flag)
Set flag to enable drawing of individual backface element colors. |
void |
showElementColors(boolean flag)
Set flag of using global element color instead of coloring each element individually. |
void |
showElementLabels(boolean flag)
Set flag to enable drawing of element labels in display. |
void |
showElementNormalArrow(boolean flag)
Set flag to enable drawing of arrow of element normal. |
void |
showElementNormals(boolean flag)
Set flag to enable drawing of element normals. |
void |
showElements(boolean flag)
Set flag to enable drawing of elements. |
void |
showElementTexture(boolean flag)
Set flag to enable drawing of element texture. |
void |
showOutline(boolean flag)
Set flag to enable drawing of outline element edges. |
void |
showTaggedBoundaries(boolean flag)
Set flag to enable drawing of boundary curves. |
void |
showTaggedEdges(boolean flag)
Set flag to enable drawing of element edges. |
void |
showTaggedElements(boolean flag)
Set flag to enable drawing of tagged elements. |
java.lang.String |
toString()
Create a multi-line string representation with detailed information about all instance variables. |
static boolean |
triangulate(PgElementSet geom)
Triangulate the given element set in place. |
boolean |
update(java.lang.Object event)
Update the class whenever a child has changed. |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, assureInspector, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.project.PgGeometryIf |
assureInspector, getInfoPanel, getName, setName |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, setParent |
| Constructor Detail |
public PgElementSet()
public PgElementSet(int aVertexDim)
| Method Detail |
public void init()
init in class PgPointSetpublic PgJvxSrc getJvx()
getJvx in class PgPointSetpublic void setJvx(PgJvxSrc src)
setJvx in class PgPointSetsrc - a geometry source used to fill this instance with data.public java.lang.Object clone()
null.
Tags of this object are not copied but maybe copied of subclasses.clone in class PgPointSet#copy(PgElementSet)public void copy(PgGeometry geom)
copy in class PgPointSetpublic void copyElementSet(PgElementSet geom)
public void copyConnectivity(PgElementSet geom)
public java.lang.String toString()
toString in class PgPointSetpublic boolean update(java.lang.Object event)
update in class PgPointSetjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)public int addElement(PiVector anElement)
addElement(PiVector, int).
After adding an element or a set of elements, the neighbour relation is out of date
and must be updated by calling makeNeighbour().addElement in class PgGeometryPiVector - element to be added to element list
public boolean addElement(PiVector anElement,
int anIndex)
Length of element must be at least three, and all entries of the index vector must be different.
When the first element is added to an element set then the internal variable m_dimOfElements is set to the length of the first element. The variable dimOfElements is adjusted if it is different from size of the argument element.
PiVector - element to be added to element listint - index of element positionpublic java.awt.Color getGlobalElementColor()
public java.awt.Color getGlobalElementBackColor()
public java.awt.Color getGlobalElementTagColor()
public void setGlobalElementColor(java.awt.Color color)
public void setGlobalElementBackColor(java.awt.Color color)
public void setGlobalElementTagColor(java.awt.Color color)
public java.awt.Color getGlobalElementNormalColor()
public double getGlobalElementNormalLength()
public double getGlobalElementNormalSize()
public void setGlobalElementNormalColor(java.awt.Color color)
public void setGlobalElementNormalLength(double length)
public void setGlobalElementNormalSize(double size)
public java.awt.Color getGlobalEdgeColor()
public java.awt.Color getGlobalEdgeTagColor()
public double getGlobalEdgeSize()
public void setGlobalEdgeColor(java.awt.Color color)
public void setGlobalEdgeTagColor(java.awt.Color color)
public void setGlobalEdgeSize(double size)
public java.awt.Color getGlobalBndColor()
public java.awt.Color getGlobalBndTagColor()
public double getGlobalBndSize()
public void setGlobalBndColor(java.awt.Color color)
public void setGlobalBndTagColor(java.awt.Color color)
public void setGlobalBndSize(double size)
public PiVector[] getEdges()
public java.awt.Color[] getEdgeColors()
public void setNumEdges(int aNumEdges,
int dimOfEdges)
public void assureEdgeColors()
public void setEdges(PiVector[] edge)
#setNumEdges(int, int) before to
allocate argument array. If argment array too small do nothing.edge - array of edge vectors to be copiedpublic void setEdgeColors(java.awt.Color[] color)
color - array with new edge colorspublic boolean hasEdges()
#assureEdgespublic boolean hasEdgeColors()
assureElementColors()public int addEdge(PiVector anEdge)
setEdge(PiVector, numEdges).PiVector - edge to be added to edge listpublic PiVector getEdge(int anIndex)
public boolean setEdge(int anIndex,
PiVector aEdge)
anIndex - index of edgeaEdge - array with indices of new edgepublic PiVector[] getElements()
getDimOfElements()!=-1.
Also note, that the actual size of the array may be larger than m_numElements for
efficiency reasons. Therefore, do not use length of array.public java.awt.Color[] getElementColors()
public java.awt.Color[] getElementBackColors()
public PdVector[] getElementNormals()
public PdVector[][] getElementTextures()
public PdVector[] getVertexTextures()
getVertexTextures in class PgPointSetpublic void setVertexTextures(PdVector[] aVertexTextureList)
setVertexTextures in class PgPointSetaVertexTextureList - array with new vertex texturespublic PiVector[] getNeighbours()
public boolean hasBoundary()
public PgBndPolygon[] getBoundaries()
public void removeBoundaries()
public void setBoundary(PgBndPolygon[] newBnd)
newBnd - array with new boundary polygons of element set.public void assureBoundary(int num)
public boolean isShowingEdgeLabels()
public boolean isShowingElementLabels()
public boolean isShowingElements()
public boolean isShowingTaggedElements()
public boolean isShowingBackface()
public boolean isShowingElementNormals()
public boolean isShowingElementNormalArrow()
public boolean isShowingElementTextures()
public boolean isShowingOutline()
public boolean isShowingEdges()
public boolean isShowingTaggedEdges()
public boolean isShowingBoundaries()
public boolean isShowingTaggedBoundaries()
public boolean isShowingElementColors()
public boolean isShowingElementBackColors()
public boolean isShowingEdgeColors()
public boolean isShowingElementBackColor()
public void showEdgeLabels(boolean flag)
public void showElementLabels(boolean flag)
public void showElements(boolean flag)
public void showTaggedElements(boolean flag)
public void showElementBackColor(boolean flag)
public void showElementBackColors(boolean flag)
public void showBackface(boolean flag)
public void showElementNormals(boolean flag)
public void showElementNormalArrow(boolean flag)
public void showElementTexture(boolean flag)
public void showOutline(boolean flag)
public void showEdges(boolean flag)
public void showTaggedEdges(boolean flag)
public void showBoundaries(boolean flag)
public void showTaggedBoundaries(boolean flag)
public void showElementColors(boolean flag)
public void showEdgeColors(boolean flag)
public int getMaxNumElements()
public int getNumElements()
public int getNumElementIndices()
public void setNumElements(int aNumElements)
Note, the neighbour array might be initialized to -1 when its size changes.
public int getDimOfElements()
setDimOfElements(int)public void setDimOfElements(int aSize)
aSize<>0,
or individual aSize=-1.
It is more efficient to call method before setNumElements().
Argument must be -1 or >=3. Other values lead to a warning message.
Note, if aSize!=-1 then this method initializes the neighbour array of all elements to -1.
aSize - Number of vertices for all elements.setNumElements(int)public void setDimOfColors(int aSize)
aSize<>0.setDimOfColors in class PgPointSetaSize - Number of components of each color vector.public void setDimOfVectors(int aSize)
aSize<>0.
It is more efficient to call method before setNumVertices().setDimOfVectors in class PgPointSetaSize - Number of coordinates of each element.PgPointSet.setDimOfVectors(int)public boolean assureDimOfElements()
setDimOfElements(int) is called
to set the correct value.
Note: this check does not include the size of elements with index in {m_numElements, m_maxNumElements-1}.setDimOfElements(int)public boolean hasElementColors()
assureElementColors()public boolean hasElementBackColors()
assureElementBackColors()public boolean hasElementNormals()
assureElementNormals()public boolean hasElementTextures()
assureElementTextures()public void assureElementColors()
public void assureElementBackColors()
public void assureElementNormals()
public void assureElementTextures()
getDimOfTextures().
Texture values are lost if maximal number of elements changes.public void paint(PvGeometryIf dc)
jv.project.PgGeometryIf for detailed information.paint in class PgPointSetPgGeometryIf
public void makeQuadrVertexTexture(int uDiscr,
int vDiscr)
uDiscr, - vDiscr Number of lines in u and v direction.
public void makeQuadrElementTexture(int uDiscr,
int vDiscr)
uDiscr, - vDiscr Number of lines in u and v direction.
public void makeQuadrConn(int uDiscr,
int vDiscr)
uDiscr, - vDiscr Number of lines in u and v direction.makeCylinderConn(int, int)
public void makeAlternatingQuadrConn(int uDiscr,
int vDiscr,
boolean alternateUDir)
uDiscr, - vDiscr Number of lines in u and v direction.makeCylinderConn(int, int)
public void makeCylinderConn(int uDiscr,
int vDiscr)
uDiscr, - vDiscr Number of lines in u and v direction.makeQuadrConn(int, int)
public void makeQuadrBnd(int uDiscr,
int vDiscr)
uDiscr, - vDiscr Number of lines in u and v direction.makeQuadrConn(int, int),
getBoundaries()public void makeTriangleConn(int discr)
discr - number of points on each edgemakeTriangleBnd(int)public void makeTriangleBnd(int discr)
discr - number of points on each edgemakeTriangleConn(int)public void makePatchConn(int discr)
discr - number of points on each edgemakeQuadrConn(int, int)public void flipOrientation()
flipOrientation in class PgPointSetPgPointSet.flipOrientation()public void flipEdges()
public PgElementEdge[] getEdgeList()
The method allows an edge to be shared by more than two elements, i.e. non-manifold
polyhedrons. Method consists of code from previous version of
makeNeighbour(), which now calls getEdgeList(). Therefore, the
method does not use any neighbour information.
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 a java.util.Vector which contains all edges emanting from vertex with index i to vertices with higher index.
This algorithm requires the array edgesAtVertex to have size equal to m_numVertices but allows linear runtime when finding entries with identical edges. When collection is finsihed, usually some array entries will null. The return parameter is an array of edges constructed from edgesAtVertex.
Note, think about using getEdge to obtain just a few edges.
getNumEdges(),
#getEdge()public java.lang.String printEdgeList()
public boolean makeNeighbour()
details this.
Since version 2.60 the construction of the edge list is outsourced in
getEdgeList().
Edges belonging to more than two elements become a boundary edge in each element.
public boolean makeElementNormals()
Method works for convex elements only.
makeVertexNormals()public boolean makeVertexNormals()
makeVertexNormals in class PgPointSetmakeElementNormals()
public void buildQuadr(PdVector[] quadr,
int uDiscr,
int vDiscr)
shows
how the macro vertices of the rectangle must be ordered, and shows the micro boxes.quadr - array with four vertices of macro patchuDiscr - number of vertices along u-directionvDiscr - number of vertices along v-directionmakeQuadrConn(int, int)
public void buildTriangle(PdVector[] triangle,
int discr)
triangle - array with three vertices of macro patchdiscr - number of points on each edgemakeTriangleBnd(int)
public void buildPolygon(PdVector[] polygon,
int discr)
triangle - array with three vertices of macro patchdiscr - number of points on each edgemakeTriangleBnd(int)
public void buildTriangleFromCurve(PgPolygon[] curve,
PgBndConstraint[] bndConstr)
curve - array with three polygons with same number of verticesbndConstr - boundary constraints assigned to boundary polygonsmakeTriangleConn(int)
public void buildQuadrFromCurve(PgPolygon[] curve,
PgBndConstraint[] bndConstr)
curve - array with four polygons with pairwise same number of verticesbndConstr - boundary constraints assigned to boundary polygonsmakeTriangleConn(int)public void buildPolygonFromCurve(PgPolygon[] curve)
curve - array with polygons with same number of verticesmakeTriangleConn(int)public boolean close()
true if successfulremoveUnusedVertices()public boolean removeUnusedVertices()
close() vertices are
no longer in used since elements are identified long interior boundary curves.
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).
The implementation is based on GRAPE method "sort-points-send" of Bernd Oberknapp.true if method was successfullpublic int[] removeMarkedVertices()
removeMarkedVertices in class PgPointSetpublic int[] removeElement(int ind)
PsObject.IS_DELETED
and invokes #removeMarkedElements().removeElement in class PgGeometrypublic 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 boolean merge(PgGeometryIf aGeom)
close().merge in class PgPointSetaGeom - elementSet to be merged into 'this'true if method was successfullclose()public boolean refineGlobalIntoFour()
public int getElementWithVertex(int vertexInd)
public PgElementEdge getEdge(int vInd1,
int vInd2)
Note, method runs through all elements to find an edge.
So, do not use this method in inner loops but create an edge array instead
using getEdgeList().
vInd1, - vInd2 Indices of edge vertices in global vertex array of elementSet.getEdgeList()
public void clearTagElement(int anIndex,
int aTag)
PvGeometryIf.clearTagElement in class PgGeometry
public boolean hasTagElement(int anIndex,
int aTag)
PvGeometryIf.hasTagElement in class PgGeometry
public void setTagElement(int anIndex,
int aTag)
PvGeometryIf.setTagElement in class PgGeometrypublic PdVector[] getElementVertices(int elemInd)
public PiVector getElement(int anIndex)
getElement in class PgGeometryanIndex - index of elementpublic PiVector getNeighbour(int anIndex)
anIndex - index of elementpublic java.awt.Color getElementColor(int anIndex)
anIndex - index of elementpublic java.awt.Color getElementBackColor(int anIndex)
anIndex - index of elementpublic PdVector getElementNormal(int anIndex)
anIndex - index of element
public boolean setElementVertices(int elemInd,
PdVector[] vArray)
elemInd - index of elementvArray - array with new coordinates of element vertices
public void setElement(int elemInd,
int a,
int b,
int c)
elemInd - index of elementa,b,c - new vertex indices of element
public void setElement(int elemInd,
int a,
int b,
int c,
int d)
elemInd - index of elementa,b,c,d - new vertex indices of element
public boolean setElement(int elemInd,
int[] anIndArray)
anIndex - index of elementanIndArray - array with new vertex indices of element
public boolean setElement(int anIndex,
PiVector newElem)
setElement in class PgGeometryanIndex - index of elementnewElem - vector with new indices of element
public boolean setElementColor(int anIndex,
java.awt.Color aColor)
anIndex - index of elementaColor - color to be copied to color list
public boolean setElementBackColor(int anIndex,
java.awt.Color aColor)
anIndex - index of elementaColor - color to be copied to color list
public boolean setElementNormal(int anIndex,
PdVector aNormal)
anIndex - index of elementaNormal - normal to be copied to normal list
public boolean setElementTexture(int anIndex,
PdVector[] aTexture)
anIndex - index of elementaTexture - array with texture coordinates to be copiedpublic void setElements(PiVector[] element)
getNumElements() elements of source array into
an existing element array.
If source array is too small then abort operation.
Assure size of neighbour array, but recomputation of neighbour information must be
invoked explicitly using makeNeighbour().element - array of element vectors to be copiedpublic void setElementColors(java.awt.Color[] color)
color - array with new element colorspublic void setElementBackColors(java.awt.Color[] color)
color - array with new element colorspublic void setElementNormals(PdVector[] normal)
normal - array with new element normalspublic void setElementTextures(PdVector[][] texCoords)
getDimOfTextures() of the geometry.texCoords - array with new element texturespublic void setNeighbours(PiVector[] neighbour)
neighbour - array with neighbour informationmakeNeighbour()
public int getNeighbourLocInd(int elemInd,
int vInd,
int wInd)
vInd, - wInd vertex indices specifying an element edge, not local indiceselemInd - an element indexgetOppVertexLocInd(int, int)
public int getOppVertexInd(int elemInd,
int locInd)
elemInd - an element indexlocInd - local index such that m_neighbour[elemInd].m_data[locInd]==neighElemInd is the adjacent element.getOppVertexLocInd(int, int)
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.getNeighbourLocInd(int, int, int)public double getAreaOfElement(int elemInd)
public double getArea()
public double getVolumeOfElement(int elemInd)
public double getVolume()
public double getL2Norm()
public PdMatrix getL2Matrix(PdMatrix mat)
public double getEdgeLength(int anElem,
int locInd)
elemInd - index of elementlocInd - local index of vertex whose neighbour refers to this edge
public double getVertexAngle(int elemInd,
int locInd)
elemInd - index of elementlocInd - local index of vertex
public void computeRotation(PgPolygon meridian,
int numULines)
close() to remove interior boundaries.
Compute vertex normals.computeRotation in class PgPointSetnumULines - discretization in angular direction
public void computeCylinder(int numULines,
int numVLines,
double radius,
double length)
close() to remove interior boundaries.
Compute vertex normals.
Sample method to have simple geometry available for test purposes.computeCylinder in class PgPointSetnumULines - discretization in angular directionnumVLines - discretization in z-axis directionradius - radius of cylinderlength - height of cylinder
public void computeDisk(int numULines,
int numVLines,
double radius)
close() to remove interior boundaries.
Compute vertex normals.
Sample method to have simple geometry available for test purposes.computeDisk in class PgPointSetnumULines - discretization in radial directionnumVLines - discretization in angular directionradius - radius of disk
public void computePlane(int numULines,
int numVLines,
double uMin,
double vMin,
double uMax,
double vMax)
close() to remove interior boundaries.
Compute vertex normals.
Sample method to have simple geometry available for test purposes.computePlane in class PgPointSetnumULines - discretization in x directionnumVLines - discretization in y directionuMin, - vMin, uMax, vMax size of rectangle
public void computeSphere(int numULines,
int numVLines,
double radius)
close() to remove interior boundaries.
Compute vertex normals.
Sample method to have simple geometry available for test purposes.computeSphere in class PgPointSetnumULines - discretization in angular directionnumVLines - discretization in meridian directionradius - radius of sphere
public void computeTorus(int numULines,
int numVLines,
double radius,
double thick)
close() to remove interior boundaries.
Compute vertex normals.
Sample method to have simple geometry available for test purposes.computeTorus in class PgPointSetnumULines - discretization in angular directionnumVLines - discretization in meridian directionradius - radius of soalthick - radius of torus tube
public void computeSnail(int numULines,
int numVLines,
double numWindings)
computeSnail in class PgPointSetnumULines - discretization in angular directionnumVLines - discretization in meridian directionnumWindings - number of half-turns of snail housepublic int getNumBoundaries()
getNumBoundaryComponents(),
getNumBoundaryEdges()public int getNumBoundaryComponents()
getNumBoundaries(),
getNumBoundaryEdges()public int getNumBoundaryEdges()
getNumBoundaryComponents(),
getNumBoundaries()public int getNumEdges()
getEdgeList()public void fixBoundaries()
public void markBoundary()
public int getNumBoundaryVertices()
markBoundary()
public boolean blend(double s,
PgGeometry ag,
double t,
PgGeometry bg)
this = s*a + t*b.blend in class PgPointSetdouble - s, t weights of vertices of each elementSetPgElementSet - a, b two elementSets used for blendingpublic boolean isConforming()
true if elementSet is conforming, else false.public void setConforming(boolean flag)
public static boolean triangulate(PgElementSet geom)
PgUtil.triangulate.geom - Surface with polygonal faces. Modified after this calling method.PgUtil.triangulate(jv.vecmath.PdVector[])public boolean checkNeighbour()
public PvPickEvent intersectionWithLine(PdVector rayBase,
PdVector rayDir)
intersectionWithLine in class PgPointSetrayBase - base point of ray eventually hitting the surfacerayDir - direction point of ray eventually hitting the surfacepublic int getSavedNumVertices()
public void setSavedNumVertices(int num)
public PiVector[] getSavedElements()
public void setSavedElements(PiVector[] element)
public boolean makeElementColorsFromXYZ()
public boolean makeElementColorsFromZ()
public boolean makeElementColorsFromZHue()
public boolean makeElementFromVertexColors()
public boolean makeVertexFromElementColors()
public PgGeometry reflect(PdMatrix mat,
boolean bOrient,
boolean bVector)
reflect in class PgPointSetmat - 3*3 or 4*4 transformation matrixbOrient - flag whether to keep the orientation of the geometrybVector - flag whether to keep the orientation of vectorspublic boolean resetBoundaryNormals()
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||