jvx.geom
Class PgPolygonSetOnElementSet
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PgGeometry
-
- jv.geom.PgPointSet
-
- jv.geom.PgPolygonSet
-
- jvx.geom.PgPolygonSetOnElementSet
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf
public class PgPolygonSetOnElementSet extends PgPolygonSet
Basic class for collections of lines and polygons. It is similar to PgPolygonSet except that the vertices are stored with their barycentric coordinates on a given element set.- See Also:
- Serialized Form
- Author:
- Matthias Nieser
- Version:
- 04.09.2006, 1.00 created (mn)
-
-
Field Summary
-
Fields inherited from class jv.geom.PgPolygonSet
BINORMAL, CURVATURE_NORMAL, NORMAL, OFFSET_NORMAL
-
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 PgPolygonSetOnElementSet(PgElementSet geom)Constructor of a polygon set in three-dimensional space.PgPolygonSetOnElementSet(PgElementSet geom, int aVertexDim)Deprecated.JavaView 3.97.040, since dimension of vertices must be equal to geometry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intaddPolygonBary(PgPolygonOnElementSet poly)Add a polygon to the polygon set.booleanblend(double s, PgGeometry ag, double t, PgGeometry bg)Blend between two polygon sets usingthis = s*ag + t*bg.java.lang.Objectclone()Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.voidcomputeVertices()Compute all geometric vertex positions on the base surface from barycentric coordinates.voidcopy(PsObject object)Copy instance variables by duplication, not by copying a reference.PgElementSetgetGeometry()Get the underlying geometry.PdBary[]getVertexBary()Get array of barycentric positions for read and write access, but do not modify the size of any vector.PdBarygetVertexBary(int vertInd)Get barycentric coordinates of the vertex at given index.intgetVertexElemInd(int vertInd)Get element index of the vertex at given index.voidinit()Initialize and reset instance variables after call to super.init().booleanmerge(PgGeometryIf aGeom)Merge polygon set with current object and store union of both objects in 'this'.booleanremoveUnusedVertices()Remove all points not referenced by polygons.voidsetGeometry(PgElementSet geom)Assign a new underlying simplicial surface.voidsetMaxNumVertices(int numVertices)Allocate given number of vertices, and allocate normals, colors etc.voidsetVertexBary(int vertInd, int elemInd, PdBary bary)Set barycentric coordinate and element index of vertex at given index, and also update the position of the corresponding vertex.voidsetVertexBary(int vertInd, PdBary bary)Set barycentric coordinate and element index of vertex at given index, and also update the position of the corresponding vertex.-
Methods inherited from class jv.geom.PgPolygonSet
addPolygon, applyModelingMatrix, assureDimOfPolygons, assurePolygonColors, assurePolygonNormals, assurePolygonSizes, clearTagPolygon, convert, copyPolygonSet, flipOrientation, getDimOfPolygons, getFVector, getGlobalPolygonColor, getGlobalPolygonNormalColor, getGlobalPolygonNormalLength, getGlobalPolygonNormalSize, getGlobalPolygonSize, getGlobalPolygonTagColor, getJvx, getLength, getLengthOfPolygon, getMaxDimOfPolygons, getMaxNumPolygons, getNumEdges, getNumPolygons, getPolygon, getPolygonAsPgPolygon, getPolygonColor, getPolygonColors, getPolygonNormal, getPolygonNormals, getPolygons, getPolygonSize, getPolygonSizes, getPolygonVertices, getPolygonWithVertex, getVertexAngle, hasPolygonColors, hasPolygonNormals, hasPolygonSizes, hasTagPolygon, intersectionWithLine, isClosed, isShowingEdgeColorFromVertices, isShowingEdgeFromVertexColors, isShowingEdgeLabels, isShowingPolygonColors, isShowingPolygonEndArrow, isShowingPolygonLabels, isShowingPolygonNormalArrow, isShowingPolygonNormals, isShowingPolygons, isShowingPolygonSizes, isShowingPolygonStartArrow, isShowingSmoothEdgeColors, isShowingSmoothLighting, isShowingTaggedPolygons, makeBiNormals, makeCurvatureNormals, makeNormals, makeNormals, makeOffsetNormals, makePolygonColorsFromLength, makePolygonColorsFromXYZ, makePolygonColorsFromZ, makePolygonColorsFromZHue, makePolygonFromVertexColors, makeVertexColorsFromLength, makeVertexFromPolygonColors, makeVertexNormals, paint, removeMarkedPolygons, removeMarkedVertices, removePolygon, removePolygonColors, removePolygonNormals, removePolygonSizes, setClosed, setDimOfColors, setDimOfPolygons, setDimOfVectors, setDimOfVertices, setGlobalPolygonColor, setGlobalPolygonNormalColor, setGlobalPolygonNormalLength, setGlobalPolygonNormalSize, setGlobalPolygonSize, setGlobalPolygonTagColor, setJvx, setMaxNumPolygons, setNumPolygons, setPolygon, setPolygon, setPolygonColor, setPolygonColors, setPolygonNormal, setPolygonNormals, setPolygons, setPolygonSize, setPolygonSizes, setPolygonVertices, setSizeOfPolygon, setTagPolygon, showEdgeColorFromVertices, showEdgeFromVertexColors, showEdgeLabels, showPolygonColors, showPolygonEndArrow, showPolygonLabels, showPolygonNormalArrow, showPolygonNormals, showPolygons, showPolygonSizes, showPolygonStartArrow, showSmoothEdgeColors, showSmoothLighting, showTaggedPolygons, toString, triangulate, update, useGlobalPolygonColor
-
Methods inherited from class jv.geom.PgPointSet
addGeometryItem, addVectorField, addVertex, applyAmbientMatrix, assureVertexColors, assureVertexNormals, assureVertexSizes, assureVertexTextures, clearTagVertex, computeCone, computeCylinder, computeDisk, computePlane, computeRotation, computeSnail, computeSphere, computeTorus, 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, getVertexTextures, 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, makeVertexTextureFromBndBox, makeVertexTextureFromCylinder, makeVertexTextureFromSphere, makeVertexTextureFromUV, projectFromAmbientSpace, projectToSphere, reflect, removeAllVectorFields, removeHiddenVectorFields, removeTexture, removeVectorField, removeVertex, removeVertexColors, removeVertexNormals, removeVertexSizes, scale, scale, selectVectorField, setCenterOfBndBox, setDefaultLabelEnabled, setDimOfTextures, setEnabledIndexLabels, setGlobalVectorColor, setGlobalVectorLength, setGlobalVectorSize, setGlobalVertexColor, setGlobalVertexNormalColor, setGlobalVertexNormalLength, setGlobalVertexNormalSize, setGlobalVertexSize, setGlobalVertexSize, setGlobalVertexTagColor, 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, showVertexTexture, showVertices, translate
-
Methods inherited from class jv.project.PgGeometry
addDisplay, addElement, clearTagElement, 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, getState, getTitle, getType, getVersion, getVersionType, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagElement, isConfigurable, isEnabledInstanceSharing, isShowingBndBox, isShowingCenter, isShowingName, isShowingTitle, isVisible, removeDisplay, removeElement, removeMethodMenus, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setElement, setEnabledInstanceSharing, setGeometryInfo, setLabelAttribute, setLabelAttribute, setLabelColor, setLabelFont, setLabelSize, setLabelStyle, setModelMatrix, setTagElement, 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
-
-
-
-
Constructor Detail
-
PgPolygonSetOnElementSet
public PgPolygonSetOnElementSet(PgElementSet geom)
Constructor of a polygon set in three-dimensional space.
-
PgPolygonSetOnElementSet
public PgPolygonSetOnElementSet(PgElementSet geom, int aVertexDim)
Deprecated. JavaView 3.97.040, since dimension of vertices must be equal to geometry.Constructor of a polygon set in a space of given dimension.
-
-
Method Detail
-
init
public void init()
Initialize and reset instance variables after call to super.init().- Overrides:
initin classPgPolygonSet
-
getGeometry
public PgElementSet getGeometry()
Get the underlying geometry.
-
setGeometry
public void setGeometry(PgElementSet geom)
Assign a new underlying simplicial surface. Method returns with warning if surface is not a triangulation.- Version:
- 04.08.06, 2.00 created (mn) From jv.geom.PgPolygonSet.
22.10.05, 1.10 revised (kp) Return with warning if geometry is not triangulated.
-
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 tonullexcept to the base geometry whose reference is kept.- Specified by:
clonein interfacePgGeometryIf- Overrides:
clonein classPgPolygonSet- See Also:
copy(PsObject)- Version:
- 04.08.06, 1.00 created (mn)
-
copy
public void copy(PsObject object)
Copy instance variables by duplication, not by copying a reference. Reference to base geometry is not changed.- Overrides:
copyin classPgPolygonSet- See Also:
clone()- Version:
- 04.08.06, 1.00 created (mn)
-
merge
public boolean merge(PgGeometryIf aGeom)
Merge polygon set with current object and store union of both objects in 'this'. Number of points and polygons is the sum of both objects.The merged geometry will local colors allocated and assignd 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 classPgPolygonSet- Parameters:
aGeom- Polygon set to be merged into 'this'- Returns:
trueif method was successfull- Version:
- 09.12.06, 2.00 revised (kp) Allocation of superclass respected. 04.08.06, 1.00 created (mn) From jv.geom.PgPolygonSet.
-
blend
public boolean blend(double s, PgGeometry ag, double t, PgGeometry bg)Blend between two polygon sets usingthis = s*ag + t*bg.- Specified by:
blendin interfacePgGeometryIf- Overrides:
blendin classPgPolygonSet- 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
- Version:
- 09.12.06, 2.00 revised (kp) Superclass respected. 04.08.06, 1.00 created (mn) From jv.geom.PgPolygonSet.
-
setMaxNumVertices
public void setMaxNumVertices(int numVertices)
Allocate given number of vertices, and allocate normals, colors etc. if they already exist. All vertex 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 vertices via setNumVertices().- Overrides:
setMaxNumVerticesin classPgPointSet- Version:
- 04.08.06, 1.00 created (mn)
-
getVertexBary
public PdBary[] getVertexBary()
Get array of barycentric positions for read and write access, but do not modify the size of any vector.Note, that the actual size of the vertex array may differ from getNumVertices() for efficiency reasons. Therefore, do not use bary.length but use getNumVertices().
Note, the array is void as soon as the number of vertices changes. After issuing setNumVertices(int) then call this method again.
- Version:
- 04.08.06, 1.00 created (mn) Copied from PgPointSetOnElementSet.
-
getVertexBary
public PdBary getVertexBary(int vertInd)
Get barycentric coordinates of the vertex at given index.- Parameters:
vertInd- Index of vertex.- Returns:
- Barycentric coordinates of vertex.
- See Also:
getVertexElemInd(int)- Version:
- 04.08.06, 1.00 created (mn) Copied from PgPointSetOnElementSet.
-
getVertexElemInd
public int getVertexElemInd(int vertInd)
Get element index of the vertex at given index.- Parameters:
vertInd- index of vertex- Returns:
- element index of given vertex
- See Also:
getVertexBary(int)- Version:
- 04.08.06, 1.00 created (mn) Copied from PgPointSetOnElementSet.
-
setVertexBary
public void setVertexBary(int vertInd, int elemInd, PdBary bary)Set barycentric coordinate and element index of vertex at given index, and also update the position of the corresponding vertex. Barycentric coordinate is copied into anotherPdBaryinstance.- Parameters:
vertInd- Vertex index in vertex array.elemInd- Global element index where the vertex shall lie on.bary- Barycentric coordinates of vertex within the given element.- Version:
- 04.08.06, 3.00 created (mn) Copied from PgPointSetOnElementSet.
21.08.06, 2.10 revised (kp) Improved checks for consistency of indices.
-
setVertexBary
public void setVertexBary(int vertInd, PdBary bary)Set barycentric coordinate and element index of vertex at given index, and also update the position of the corresponding vertex. Element index is contained in parameter bary.- Parameters:
vertInd- Vertex index in vertex array.bary- Barycentric coordinates of vertex within the given element.- Version:
- 04.08.06, 3.00 created (mn) Copied from PgPointSetOnElementSet.
21.08.06, 2.10 revised (kp) Update position of vertex too.
-
computeVertices
public void computeVertices()
Compute all geometric vertex positions on the base surface from barycentric coordinates.- Version:
- 04.08.06, 2.00 created (mn) Copied from PgPointSetOnElementSet. 16.04.06, 1.00 created (kp)
-
addPolygonBary
public int addPolygonBary(PgPolygonOnElementSet poly)
Add a polygon to the polygon set. Its vertices will be appended to the vertex list.- Returns:
- Index of the appended polygon.
- Author:
- Matthias Nieser
- Version:
- 05.08.06, 1.00 created (mn)
-
removeUnusedVertices
public boolean removeUnusedVertices()
Remove all points not referenced by polygons. 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).- Overrides:
removeUnusedVerticesin classPgPolygonSet- Returns:
trueif method was successful- Author:
- Konrad Polthier
- Version:
- 31.10.13, 1.20 revised (ur) Copied from super class and completed.
19.01.05, 1.10 revised (kp) Remove affected vectors from vectorFields.
23.09.99, 1.00 created (kp)
-
-
"