jvx.geom
Class PgPolygonOnElementSet
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PgGeometry
-
- jv.geom.PgPointSet
-
- jv.geom.PgPolygon
-
- jvx.geom.PgPolygonOnElementSet
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf
public class PgPolygonOnElementSet extends PgPolygon
A polygon on a triangulated element set whose vertices are given by barycentric coordinates. Every point of aPolygonOnElementSetis given by the element index of the element the point lies on, and the barycentric coordinates with respect to this triangle. The base geometry must be a triangulated element set.- See Also:
PgPolygon,PgElementSet,PgPointSetOnElementSet, Serialized Form- Author:
- Eike Preuss, Konrad Polthier
- Version:
- 15.04.06, 2.50 revised (kp) Major revision including new methods clone and copy, m_bary renamed to m_vertexBary.
07.03.06, 2.20 revised (kp) Merged with (ah) version.
01.03.06, 2.13 revised (ah) Added sizeIncrement.
01.03.06, 2.12 revised (ah) Added methods for swapping.
01.03.06, 2.11 revised (ah) Added more efficienteval(PdVector [], PiVector, double).
01.03.06, 2.10 revised (ah) Removed PiVector m_index.
22.10.05, 2.00 revised (kp) Major revision including change of superclass to PgPolygon.
20.03.03, 1.70 revised (ep) New methodcopyIntrinsicData.
11.07.01, 1.60 revised (ep) Computational optimizations in exp(...).
10.05.01, 1.50 revised (ep) Corrected numerical error in methodexp(...).
28.09.00, 1.40 revised (ep) Changed handling of null-parameter in constructor.
28.08.00, 1.31 revised (ep) Added setAccuracy(double) and corresponding variable m_eps. 28.08.00, 1.30 revised (ep) Changed method exp(...) to match that.
28.08.00, 1.20 revised (ep) Added getGeometry().
21.11.99, 1.01 revised (ep) Static methods moved to class PwBary.
30.06.99, 1.00 created (ep)
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleBARYEPSDefault accuracy used at checks for zero in barycentric coordinates (used e.g. in exp(...)).doublem_epsThis accuracy is actually used for zero-checks in barycentric coordinates (used e.g. in exp(...)).-
Fields inherited from class jv.geom.PgPolygon
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 PgPolygonOnElementSet(int dim)Constructs a new polygon on an element set triangulation.PgPolygonOnElementSet(PgElementSet geom)Constructs a new polygon on an element set triangulation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voidaddPolygon(PgPolygonOnElementSet poly)Deprecated.since JavaView 3.95.004, use merge(PgGeometryIf).booleanblend(double s, PgGeometry ag, double t, PgGeometry bg)Blend between two polygons usingthis = s*ag + t*bg.java.lang.Objectclone()Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.voidcomputeNormalCurvature()Compute the normal curvature of a surface mesh along a curve on the mesh.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.voidcopyIntrinsicData(PgPolygonOnElementSet source)deprecated since JavaView 3.96.006, use copy() instead.inteval(PdVector[] bary, PiVector outelem, double stepSize)Evaluates the polygon in steps of given size.doubleeval(PdVector bary1, PdVector bary2, PdVector bary3, PiVector outelem, double step)Evaluates the polygon in given steps and returns the calculated points in order.PdBaryDirexp(int iniElem, PdBary iniBary, PdBaryDir iniDir, double length)Deprecated.Use jvx.numeric.PnStraightestGeodesic .PdBaryDirexp(int iniElem, PdBary iniBary, PdBaryDir iniDir, double length, PgPolygon outpoly)Deprecated.Use jvx.numeric.PnStraightestGeodesic .voidflipOrientation()Change orientation of the polygon by inverting the order of the vertices, i.e. the end point becomes the first point.PdBary[]getBary()Deprecated.since JavaView 3.96.006, use getVertexBary() instead.PdBarygetBary(int vertInd)Deprecated.since JavaView 3.96.006, use getVertexBary(int) instead.PiVectorgetElemInd()Deprecated.since JavaView 3.96.006, use getVertexElemInd(int) instead.intgetElemInd(int vertInd)Deprecated.since JavaView 3.96.006, use getVertexElemInd(int) instead.PgElementSetgetGeometry()Get the underlying geometry.static PgVectorFieldgetNormalCurvature(PgPolygonOnElementSet polygon, PdMatrix[] shapeOperator, PgVectorField normCurvature)Compute the normal curvature of a surface mesh along a curve on the mesh.PgPolygongetPolygon()Returns a polygon in world coordinates.booleangetPolygon(PgPolygon out)Returns a polygon in world coordinates.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.PiVectorgetVertexElemInd()Get element indices of all vertices.intgetVertexElemInd(int vertInd)Get element index of the vertex at given index.voidinit()Initialize and reset instance variables after call to super.init().voidmakeNormalsFromSurfaceNormals()Create a (vertex-based) normal field along the curve from the (vertex-based) normal field of the surface.static voidmakeNormalsFromSurfaceNormals(PgPolygonOnElementSet polygon)Create a (vertex-based) normal field along the curve from the (vertex-based) normal field of the surface.booleanmerge(PgGeometryIf aGeom)Merge polygon with current object and store union of both objects in 'this'.static PdBaryDir[]projectCurveOntoElementSet(PgElementSet geom, PgPolygon curve, PdBary start, PgPolygonOnElementSet outCurve)Project a polygon onto the surface.static PdBaryDir[]projectCurveOntoElementSet(PgElementSet geom, PgPolygon curve, PgPolygonOnElementSet outCurve)Project a polygon onto the surface.int[]removeMarkedVertices()Remove vertices marked with tag PsObject#IS_DELETED from polygons.voidsetAccuracy(double newacc)Sets the accuracy that is used at checks for zero in barycentric coordinates.voidsetBary(int vertInd, int elemInd, PdBary bary)Deprecated.since JavaView 3.96.006, use setVertexBary(int, int, PdBary) instead.voidsetGeometry(PgElementSet geom)Assign a new underlying simplicial surface.voidsetMaxNumVertices(int numVertices)Allocate given number of vertices, and allocate normals, colors etc.voidsetVertex(int vertInd, int elemInd, PdBary bary)Deprecated.since JavaView 3.96.006, use setVertexBary(int, int, PdBary) instead.voidsetVertex(int vertInd, PdBary bary)Deprecated.since JavaView 3.96.006, use setVertexBary(int, int, PdBary) instead.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.voidswap(int i, int j)Swap vertices pos and otherPos.PdBaryswap(PgPolygonOnElementSet other, int pos, int otherPos, int num)Swaps a specified number of vertices in this polygon, beginning at the specified position, with vertices of the specified polygon.java.lang.StringtoString()A long long descriptionvoidupdateVertices()Updates the Euclidean coordinates of the vertices from their barycentric coordinates.-
Methods inherited from class jv.geom.PgPolygon
assureEdgeColors, assureEdgeNormals, assureEdgeSizes, checkTriangleCut, computeCircle, computeEight, getEdgeColors, getEdgeNormals, getEdges, getEdgeSizes, getFVector, getGlobalEdgeColor, getGlobalEdgeNormalColor, getGlobalEdgeNormalLength, getGlobalEdgeNormalSize, getGlobalEdgeSize, getGlobalEdgeTagColor, getGlobalPolygonColor, getGlobalPolygonSize, getGlobalPolygonTagColor, getJvx, getLength, getLengthOfEdge, getNumEdges, hasEdgeColors, hasEdgeNormals, intersectionWithLine, isClosed, isShowingEdgeColorFromVertices, isShowingEdgeColors, isShowingEdgeFromVertexColors, isShowingEdgeLabels, isShowingEdgeNormalArrow, isShowingEdgeNormals, isShowingEdges, isShowingEdgeSizes, isShowingPolygonColors, isShowingPolygonEndArrow, isShowingPolygonStartArrow, isShowingSmoothEdgeColors, isShowingSmoothLighting, makeBiNormals, makeCurvatureNormals, makeEdgeColorsFromLength, makeEdgeColorsFromXYZ, makeEdgeColorsFromZ, makeEdgeColorsFromZHue, makeEdgeFromVertexColors, makeNormals, makeNormals, makeOffsetNormals, makeVertexColorsFromLength, makeVertexFromEdgeColors, makeVertexNormals, paint, removeEdgeColors, removeEdgeNormals, removeEdgeSizes, setClosed, setDimOfVertices, setEdgeColor, setEdgeColors, setEdgeNormal, setEdgeNormals, setEdgeSizes, setGlobalEdgeColor, setGlobalEdgeNormalColor, setGlobalEdgeNormalLength, setGlobalEdgeNormalSize, setGlobalEdgeSize, setGlobalEdgeTagColor, setGlobalPolygonColor, setGlobalPolygonSize, setGlobalPolygonTagColor, setJvx, setNumVertices, showEdgeColorFromVertices, showEdgeColors, showEdgeFromVertexColors, showEdgeLabels, showEdgeNormalArrow, showEdgeNormals, showEdges, showEdgeSizes, showPolygonColors, showPolygonEndArrow, showPolygonStartArrow, showSmoothEdgeColors, showSmoothLighting, triangulate, update, useGlobalPolygonColor
-
Methods inherited from class jv.geom.PgPointSet
addGeometryItem, addVectorField, addVertex, applyAmbientMatrix, applyModelingMatrix, 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, setDimOfColors, setDimOfTextures, setDimOfVectors, setEnabledIndexLabels, setGlobalVectorColor, setGlobalVectorLength, setGlobalVectorSize, setGlobalVertexColor, setGlobalVertexNormalColor, setGlobalVertexNormalLength, setGlobalVertexNormalSize, setGlobalVertexSize, setGlobalVertexSize, setGlobalVertexTagColor, 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, 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
-
BARYEPS
public static double BARYEPS
Default accuracy used at checks for zero in barycentric coordinates (used e.g. in exp(...)).
-
m_eps
public double m_eps
This accuracy is actually used for zero-checks in barycentric coordinates (used e.g. in exp(...)).
-
-
Constructor Detail
-
PgPolygonOnElementSet
public PgPolygonOnElementSet(PgElementSet geom)
Constructs a new polygon on an element set triangulation.- Parameters:
geom- Underlying element set, must be a triangulation.
-
PgPolygonOnElementSet
public PgPolygonOnElementSet(int dim)
Constructs a new polygon on an element set triangulation.- Parameters:
dim- Dimension of ambient space.
-
-
Method Detail
-
init
public void init()
Initialize and reset instance variables after call to super.init().
-
toString
public java.lang.String toString()
A long long description- Specified by:
toStringin interfacePgGeometryIf- Overrides:
toStringin classPgPolygon
-
getGeometry
public PgElementSet getGeometry()
Get the underlying geometry.- Returns:
- Reference to underlying triangulation.
-
setGeometry
public void setGeometry(PgElementSet geom)
Assign a new underlying simplicial surface. Method returns with warning if surface is not a triangulation.- Parameters:
geom- New underlying triangulation.- Version:
- 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 classPgPolygon- See Also:
copy(PsObject)- Version:
- 16.04.06, 1.00 created (kp)
-
copy
public void copy(PsObject object)
Copy instance variables by duplication, not by copying a reference. Reference to base geometry is not changed.
-
copyIntrinsicData
public void copyIntrinsicData(PgPolygonOnElementSet source)
deprecated since JavaView 3.96.006, use copy() instead.
-
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:
- 14.03.06, 3.00 revised (kp) Method made public to allow better control of allocations.
-
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.
-
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)
-
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)
-
getVertexElemInd
public PiVector getVertexElemInd()
Get element indices of all vertices.- Returns:
- a new PiVector of the global element indices.
-
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:
- 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:
- 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:
- 16.04.06, 1.00 created (kp)
-
eval
public double eval(PdVector bary1, PdVector bary2, PdVector bary3, PiVector outelem, double step)
Evaluates the polygon in given steps and returns the calculated points in order. For two consecutive points of the polygon, one of the following conditions must hold:- both are on the same element, or - one of them is on an edge or vertex of a neighbor of the other point's element, or - both are on an edge or vertex of elements that have at least one common neighbor.
- Parameters:
bary1- output: contains the first barycentric coordinate of all evaluated pointsbary2- output: contains the second barycentric coordinate of all evaluated pointsbary3- output: contains the third barycentric coordinate of all evaluated pointsoutelem- output: element indices of all evaluated pointsstep- stepsize in world metrics- Returns:
- distance of last step (that is less than
step)
-
eval
public int eval(PdVector[] bary, PiVector outelem, double stepSize)
Evaluates the polygon in steps of given size. For two consecutive points of the polygon, one of the following conditions must hold: - both are on the same element, or - the second point is on an edge or vertex of a neighbor of the first point's element.- Parameters:
bary- output: bary[0], [1], [2] contain the first, second and third barycentric coordinates, respectively, of the evaluated points.outelem- output: corresponding element indicesstepSize- in world metrics- Returns:
- number of evaluated points
- Version:
- 12.09.07, 1.10 created (kp) Bug removed were element index was not copied.
01.03.06, 1.02 created (ah) More cleanup, adapted toPnStraightestGeodesic.exp.
01.03.06, 1.01 created (ah) Removed unnecessary allocations.
01.03.06, 1.00 created (ah) From eval(PdVector, PdVector, PdVector, PiVector, double)
-
getPolygon
public PgPolygon getPolygon()
Returns a polygon in world coordinates.- Returns:
- polygon representation of this curve on success, otherwise null.
-
getPolygon
public boolean getPolygon(PgPolygon out)
Returns a polygon in world coordinates.- Parameters:
out- Polygon representation of this curve- Returns:
trueon success
-
swap
public PdBary swap(PgPolygonOnElementSet other, int pos, int otherPos, int num)
Swaps a specified number of vertices in this polygon, beginning at the specified position, with vertices of the specified polygon. If necessary, the number of vertices of the polygons is increased.- Parameters:
other- other polygonpos- starting position in this PgPolygonOnElementSetotherPos- starting position in the other PgPolygonOnElementSetnum- number of vertices to swap- Returns:
- last swapped vertex of this polygon
-
swap
public void swap(int i, int j)Swap vertices pos and otherPos.
-
merge
public boolean merge(PgGeometryIf aGeom)
Merge polygon with current object and store union of both objects in 'this'. Number of points and polygons is the sum of both objects unless last vertex of this polygon is PuMath.EPS close to first vertex of argument polygon, which would be identified.Polygon will not be closed, even if it was closed before.
The merged geometry will have 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 classPgPolygon- Parameters:
aGeom- Polygon set to be merged into 'this'- Returns:
trueif method was successfull- Author:
- Konrad Polthier
- Version:
- 22.10.05, 1.00 created (kp)
-
blend
public boolean blend(double s, PgGeometry ag, double t, PgGeometry bg)Blend between two polygons usingthis = s*ag + t*bg.- Specified by:
blendin interfacePgGeometryIf- Overrides:
blendin classPgPolygon- 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) From jv.geom.PgPolygonSet.
-
setAccuracy
public void setAccuracy(double newacc)
Sets the accuracy that is used at checks for zero in barycentric coordinates. (E.g. in exponential map computation. Setting this to a high value produces a straight geodesic that behaves more often as if it crosses a vertex.) Default is defined in static field BARYEPS.
-
flipOrientation
public void flipOrientation()
Change orientation of the polygon by inverting the order of the vertices, i.e. the end point becomes the first point.- Overrides:
flipOrientationin classPgPolygon- Author:
- Klaus Hildebrandt
- Version:
- 22.10.05, 1.10 revised (kp) Calling super.flipOrientation().
11.02.05, 1.00 created (kh)
-
projectCurveOntoElementSet
public static PdBaryDir[] projectCurveOntoElementSet(PgElementSet geom, PgPolygon curve, PdBary start, PgPolygonOnElementSet outCurve)
Project a polygon onto the surface. All vertices of the projected polygon lie on edges of geom. Except if the polygon is not closed, then the first and last vertex lie in the inner of an element.- Parameters:
geom- Geometry.curve- Polygon in R^3.start- Barycentric coordinates as start position for the first vertex. This avoids a linear run over all elements of the geometry.outCurve- Will be filled with projected polygon. May be null.- Returns:
- The edges of the output polygon on the elements of geom in barycentric coordinates. Null, if the projection fails.
- Author:
- Matthias Nieser
- Version:
- 14.08.2006, 1.00 created (mn)
-
projectCurveOntoElementSet
public static PdBaryDir[] projectCurveOntoElementSet(PgElementSet geom, PgPolygon curve, PgPolygonOnElementSet outCurve)
Project a polygon onto the surface. All vertices of the projected polygon lie on edges of geom. Except if the polygon is not closed, then the first and last vertex lie in the inner of an element.- Parameters:
geom- Geometry.curve- Polygon in R^3.outCurve- Will be filled with projected polygon. May be null.- Returns:
- The edges of the output polygon on the elements of geom in barycentric coordinates. Null, if the projection fails.
- Author:
- Matthias Nieser
- Version:
- 14.08.2006, 1.00 created (mn)
-
exp
public PdBaryDir exp(int iniElem, PdBary iniBary, PdBaryDir iniDir, double length)
Deprecated. Use jvx.numeric.PnStraightestGeodesic .Makes discrete exponential map, i.e. the straightest geodesic from given initial values.
-
exp
public PdBaryDir exp(int iniElem, PdBary iniBary, PdBaryDir iniDir, double length, PgPolygon outpoly)
Deprecated. Use jvx.numeric.PnStraightestGeodesic .Makes discrete exponential map, i.e. the straightest geodesic from given initial values.- Parameters:
iniElem- index of starting point's elementiniBary- barycentric coordinates of the initial pointiniDir- initial direction in barycentric notationlength- Euclidean length of the geodesic is length*norm(iniDir)outpoly- if outpoly is notnullthe method puts the whole geodesic here- Returns:
nullat an error; else the last barycentric direction that was used
-
getBary
public PdBary[] getBary()
Deprecated. since JavaView 3.96.006, use getVertexBary() instead.
-
getBary
public PdBary getBary(int vertInd)
Deprecated. since JavaView 3.96.006, use getVertexBary(int) instead.
-
getElemInd
public int getElemInd(int vertInd)
Deprecated. since JavaView 3.96.006, use getVertexElemInd(int) instead.
-
getElemInd
public PiVector getElemInd()
Deprecated. since JavaView 3.96.006, use getVertexElemInd(int) instead.
-
addPolygon
public void addPolygon(PgPolygonOnElementSet poly)
Deprecated. since JavaView 3.95.004, use merge(PgGeometryIf).
-
setBary
public void setBary(int vertInd, int elemInd, PdBary bary)Deprecated. since JavaView 3.96.006, use setVertexBary(int, int, PdBary) instead.
-
setVertex
public void setVertex(int vertInd, int elemInd, PdBary bary)Deprecated. since JavaView 3.96.006, use setVertexBary(int, int, PdBary) instead.
-
setVertex
public void setVertex(int vertInd, PdBary bary)Deprecated. since JavaView 3.96.006, use setVertexBary(int, int, PdBary) instead.
-
updateVertices
public void updateVertices()
Updates the Euclidean coordinates of the vertices from their barycentric coordinates.- Version:
- 15.02.07, 1.00 created (mn)
-
removeMarkedVertices
public int[] removeMarkedVertices()
Remove vertices marked with tag PsObject#IS_DELETED from polygons. It is neccessary to keep a valid polygon set after removal of vertices in the superclass.- Overrides:
removeMarkedVerticesin classPgPolygon- Returns:
- array with indices of new positions of vertices
- See Also:
PgPointSet.removeMarkedVertices()- Version:
- 8.5.07, 1.00 created (mn)
-
computeNormalCurvature
public void computeNormalCurvature()
Compute the normal curvature of a surface mesh along a curve on the mesh. The result is stored in a scalar field that is added to the geometry.- Version:
- 02.12.07, 1.00 created (kh)
-
getNormalCurvature
public static PgVectorField getNormalCurvature(PgPolygonOnElementSet polygon, PdMatrix[] shapeOperator, PgVectorField normCurvature)
Compute the normal curvature of a surface mesh along a curve on the mesh. If the argument normCurvature is null, a new scalar field is created.- Parameters:
polygon- curve on the surface meshshapeOperator- shape operator at each vertex of the surface meshnormCurvature- the computed curvature is stored in this scalar field on the curve- Returns:
- PgVectorfield the given scalar field normCurvature is return
- Version:
- 02.12.07, 1.00 created (kh)
-
makeNormalsFromSurfaceNormals
public void makeNormalsFromSurfaceNormals()
Create a (vertex-based) normal field along the curve from the (vertex-based) normal field of the surface.
-
makeNormalsFromSurfaceNormals
public static void makeNormalsFromSurfaceNormals(PgPolygonOnElementSet polygon)
Create a (vertex-based) normal field along the curve from the (vertex-based) normal field of the surface.- Parameters:
polygon- polygon on which the normal field is created
-
-
"