public class PgPolygonOnElementSet extends PgPolygon
PolygonOnElementSet
is 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.PgPolygon
,
PgElementSet
,
PgPointSetOnElementSet
,
Serialized FormModifier and Type | Field and Description |
---|---|
static double |
BARYEPS
Default accuracy used at checks for zero in barycentric coordinates (used e.g. in exp(...)).
|
double |
m_eps
This accuracy is actually used for zero-checks in barycentric coordinates (used e.g. in exp(...)).
|
BINORMAL, CURVATURE_NORMAL, NORMAL, OFFSET_NORMAL
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
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 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.
|
Modifier and Type | Method and Description |
---|---|
void |
addPolygon(PgPolygonOnElementSet poly)
Deprecated.
since JavaView 3.95.004, use merge(PgGeometryIf).
|
boolean |
blend(double s,
PgGeometry ag,
double t,
PgGeometry bg)
Blend between two polygons using
this = s*ag + t*bg . |
java.lang.Object |
clone()
Duplicate geometry by recursively cloning all instance variables
except inspector panels and lists of registered listeners.
|
void |
computeNormalCurvature()
Compute the normal curvature of a surface mesh along a curve on the mesh.
|
void |
computeVertices()
Compute all geometric vertex positions on the base surface from barycentric coordinates.
|
void |
copy(PsObject object)
Copy instance variables by duplication, not by copying a reference.
|
void |
copyIntrinsicData(PgPolygonOnElementSet source)
deprecated since JavaView 3.96.006, use copy() instead.
|
int |
eval(PdVector[] bary,
PiVector outelem,
double stepSize)
Evaluates the polygon in steps of given size.
|
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.
|
PdBaryDir |
exp(int iniElem,
PdBary iniBary,
PdBaryDir iniDir,
double length)
Deprecated.
Use jvx.numeric.PnStraightestGeodesic .
|
PdBaryDir |
exp(int iniElem,
PdBary iniBary,
PdBaryDir iniDir,
double length,
PgPolygon outpoly)
Deprecated.
Use jvx.numeric.PnStraightestGeodesic .
|
void |
flipOrientation()
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.
|
PdBary |
getBary(int vertInd)
Deprecated.
since JavaView 3.96.006, use getVertexBary(int) instead.
|
PiVector |
getElemInd()
Deprecated.
since JavaView 3.96.006, use getVertexElemInd(int) instead.
|
int |
getElemInd(int vertInd)
Deprecated.
since JavaView 3.96.006, use getVertexElemInd(int) instead.
|
PgElementSet |
getGeometry()
Get the underlying geometry.
|
static PgVectorField |
getNormalCurvature(PgPolygonOnElementSet polygon,
PdMatrix[] shapeOperator,
PgVectorField normCurvature)
Compute the normal curvature of a surface mesh along a curve on the mesh.
|
PgPolygon |
getPolygon()
Returns a polygon in world coordinates.
|
boolean |
getPolygon(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.
|
PdBary |
getVertexBary(int vertInd)
Get barycentric coordinates of the vertex at given index.
|
PiVector |
getVertexElemInd()
Get element indices of all vertices.
|
int |
getVertexElemInd(int vertInd)
Get element index of the vertex at given index.
|
void |
init()
Initialize and reset instance variables after call to super.init().
|
void |
makeNormalsFromSurfaceNormals()
Create a (vertex-based) normal field along the curve from
the (vertex-based) normal field of the surface.
|
static void |
makeNormalsFromSurfaceNormals(PgPolygonOnElementSet polygon)
Create a (vertex-based) normal field along the curve from
the (vertex-based) normal field of the surface.
|
boolean |
merge(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.
|
void |
setAccuracy(double newacc)
Sets the accuracy that is used at checks for zero in barycentric coordinates.
|
void |
setBary(int vertInd,
int elemInd,
PdBary bary)
Deprecated.
since JavaView 3.96.006, use setVertexBary(int, int, PdBary) instead.
|
void |
setGeometry(PgElementSet geom)
Assign a new underlying simplicial surface.
|
void |
setMaxNumVertices(int numVertices)
Allocate given number of vertices, and allocate normals, colors etc.
|
void |
setVertex(int vertInd,
int elemInd,
PdBary bary)
Deprecated.
since JavaView 3.96.006, use setVertexBary(int, int, PdBary) instead.
|
void |
setVertex(int vertInd,
PdBary bary)
Deprecated.
since JavaView 3.96.006, use setVertexBary(int, int, PdBary) instead.
|
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.
|
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.
|
void |
swap(int i,
int j)
Swap vertices pos and otherPos.
|
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.
|
java.lang.String |
toString()
A long long description
|
void |
updateVertices()
Updates the Euclidean coordinates of the vertices from their barycentric coordinates.
|
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
addGeometryItem, addVectorField, addVertex, applyAmbientMatrix, applyModelingMatrix, assureVertexColors, assureVertexNormals, assureVertexSizes, assureVertexTextures, clearTagVertex, computeCone, computeCylinder, computeDisk, computePlane, computeRotation, computeSnail, computeSphere, computeTorus, getAmbientBounds, getBounds, getCenterOfBndBox, getCenterOfGravity, getDimOfColors, getDimOfTextures, getDimOfVectors, getEulerCharacteristic, getGlobalVectorColor, getGlobalVectorLength, getGlobalVectorSize, getGlobalVertexColor, getGlobalVertexNormalColor, getGlobalVertexNormalLength, getGlobalVertexNormalSize, getGlobalVertexSize, getGlobalVertexTagColor, getIndexOfVectorField, 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, 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
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
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
assureInspector, getInfoPanel, getName, hasTag, setName
getFather, setParent
public static double BARYEPS
public double m_eps
public PgPolygonOnElementSet(PgElementSet geom)
geom
- Underlying element set, must be a triangulation.public PgPolygonOnElementSet(int dim)
dim
- Dimension of ambient space.public void init()
public java.lang.String toString()
toString
in interface PgGeometryIf
toString
in class PgPolygon
public PgElementSet getGeometry()
public void setGeometry(PgElementSet geom)
geom
- New underlying triangulation.public java.lang.Object clone()
null
except to the base geometry whose reference is kept.clone
in interface PgGeometryIf
clone
in class PgPolygon
copy(PsObject)
public void copy(PsObject object)
public void copyIntrinsicData(PgPolygonOnElementSet source)
public void setMaxNumVertices(int numVertices)
setMaxNumVertices
in class PgPointSet
public PdBary[] getVertexBary()
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.
public PdBary getVertexBary(int vertInd)
vertInd
- Index of vertex.getVertexElemInd(int)
public int getVertexElemInd(int vertInd)
vertInd
- index of vertexgetVertexBary(int)
public PiVector getVertexElemInd()
public void setVertexBary(int vertInd, int elemInd, PdBary bary)
PdBary
instance.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.public void setVertexBary(int vertInd, PdBary bary)
vertInd
- Vertex index in vertex array.bary
- Barycentric coordinates of vertex within the given element.public void computeVertices()
public double eval(PdVector bary1, PdVector bary2, PdVector bary3, PiVector outelem, double step)
- 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.
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 metricsstep
)public int eval(PdVector[] bary, PiVector outelem, double stepSize)
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 metricspublic PgPolygon getPolygon()
public boolean getPolygon(PgPolygon out)
out
- Polygon representation of this curvetrue
on successpublic PdBary swap(PgPolygonOnElementSet other, int pos, int otherPos, int num)
other
- other polygonpos
- starting position in this PgPolygonOnElementSetotherPos
- starting position in the other PgPolygonOnElementSetnum
- number of vertices to swappublic void swap(int i, int j)
public boolean merge(PgGeometryIf aGeom)
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 if
1. 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.
merge
in interface PgGeometryIf
merge
in class PgPolygon
aGeom
- Polygon set to be merged into 'this'true
if method was successfullpublic boolean blend(double s, PgGeometry ag, double t, PgGeometry bg)
this = s*ag + t*bg
.blend
in interface PgGeometryIf
blend
in class PgPolygon
s
- weight of vertices of first geometryag
- first geometry used for blendingt
- weight of vertices of second geometrybg
- second geometry used for blendingpublic void setAccuracy(double newacc)
public void flipOrientation()
flipOrientation
in class PgPolygon
public static PdBaryDir[] projectCurveOntoElementSet(PgElementSet geom, PgPolygon curve, PdBary start, PgPolygonOnElementSet outCurve)
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.public static PdBaryDir[] projectCurveOntoElementSet(PgElementSet geom, PgPolygon curve, PgPolygonOnElementSet outCurve)
geom
- Geometry.curve
- Polygon in R^3.outCurve
- Will be filled with projected polygon. May be null.public PdBaryDir exp(int iniElem, PdBary iniBary, PdBaryDir iniDir, double length)
public PdBaryDir exp(int iniElem, PdBary iniBary, PdBaryDir iniDir, double length, PgPolygon outpoly)
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 not null
the method puts the whole geodesic herenull
at an error; else the last barycentric direction that was usedpublic PdBary[] getBary()
public PdBary getBary(int vertInd)
public int getElemInd(int vertInd)
public PiVector getElemInd()
public void addPolygon(PgPolygonOnElementSet poly)
public void setBary(int vertInd, int elemInd, PdBary bary)
public void setVertex(int vertInd, int elemInd, PdBary bary)
public void setVertex(int vertInd, PdBary bary)
public void updateVertices()
public int[] removeMarkedVertices()
removeMarkedVertices
in class PgPolygon
PgPointSet.removeMarkedVertices()
public void computeNormalCurvature()
public static PgVectorField getNormalCurvature(PgPolygonOnElementSet polygon, PdMatrix[] shapeOperator, PgVectorField normCurvature)
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 curvepublic void makeNormalsFromSurfaceNormals()
public static void makeNormalsFromSurfaceNormals(PgPolygonOnElementSet polygon)
polygon
- polygon on which the normal field is created"