public class PgPolygon extends PgPointSet
PgPointSet
as consecutive points of a polygon. Therefore, this
class mainly consists of polygon properties, for example, polygon color,
additional to the geometric information contained in its superclass.
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.
A good starting point to obtain further insight are methods like computeEight(int)
(if source code access to JavaView is available), or the tutorial applets of JavaView.
PgPointSet
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
BINORMAL |
static int |
CURVATURE_NORMAL |
static int |
NORMAL |
static int |
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 |
---|
PgPolygon()
Constructor of a polygon in three-dimensional space.
|
PgPolygon(int aVertexDim)
Constructor of a polygon set in a space of given dimension.
|
Modifier and Type | Method and Description |
---|---|
void |
assureEdgeColors()
Assures respectively allocates correct length of edge color array.
|
void |
assureEdgeNormals()
Assures respectively allocates correct length of edge normal array.
|
void |
assureEdgeSizes()
Assures respectively allocates correct length of edge size vector.
|
boolean |
blend(double s,
PgGeometry ag,
double t,
PgGeometry bg)
Blend between two polygons using
this = s*ag + t*bg . |
boolean |
checkTriangleCut(int vertexInd,
PdVector normal)
Given a simple closed, nearly planar polygon, then the function
tests whether three successive points of the polygon form
a triangle which can be cut off the polygon, i.e. the
triangle does not contain any other vertex of the polygon.
|
java.lang.Object |
clone()
Duplicate geometry by recursively cloning all instance variables
except inspector panels and lists of registered listeners.
|
void |
computeCircle(int numPoints,
double radius)
Compute circle centered at origin in xy-plane with given radius including vertex normals.
|
void |
computeEight(int numPoints)
Compute figure eight in xy-plane with given radius including vertex normals.
|
void |
copy(PsObject object)
Copy instance variables by duplication, not by copying a reference.
|
void |
flipOrientation()
Change orientation of the polygon by inverting the order of vertices
of the pointSet, i.e. the end point becomes the first point.
|
java.awt.Color[] |
getEdgeColors()
Get color array for read and write access, but do not modify the size of any color vector.
|
PdVector[] |
getEdgeNormals()
Get vertex normal array for read and write access, but do not modify the size of any normal vector.
|
PiVector[] |
getEdges()
Get the array of vertex indices which define the polygon for readonly purpose.
|
PdVector |
getEdgeSizes()
Get edge sizes for read and write access, but do not modify the length of the vector.
|
int[] |
getFVector()
Compute F-vector that is the number of points, edges, faces, etc.
|
java.awt.Color |
getGlobalEdgeColor()
Get global edge color which is used if no local colors are available.
|
java.awt.Color |
getGlobalEdgeNormalColor()
Get global element color which is used if no local colors are available.
|
double |
getGlobalEdgeNormalLength()
Get length factor of normal vectors when drawn in display.
|
double |
getGlobalEdgeNormalSize()
Get thickness in pixels of normals when drawn in display.
|
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 |
getGlobalPolygonColor()
Deprecated.
use getGlobalEdgeColor()
|
double |
getGlobalPolygonSize()
Deprecated.
use getGlobalEdgeSize()
|
java.awt.Color |
getGlobalPolygonTagColor()
Deprecated.
use getGlobalEdgeTagColor()
|
PgJvxSrc |
getJvx()
Fills a geometry object with data from this instance, for example, to print to file.
|
double |
getLength()
Compute geometric length of polygon as the sum of all edge lengths.
|
double |
getLengthOfEdge(int edgeInd)
Compute length of given edge of polygon.
|
int |
getNumEdges()
Get number of edges of polygon.
|
boolean |
hasEdgeColors()
Check if edge colors have been allocated.
|
boolean |
hasEdgeNormals()
Check if edge normals have been allocated.
|
void |
init()
Initialize and reset instance variables after call to super.init().
|
PvPickEvent |
intersectionWithLine(PdVector rayBaseWorld,
PdVector rayDirWorld)
Find intersection of polygon with a given ray.
|
boolean |
isClosed()
Check whether polygon is closed, i.e.if endpoints are connected by additional edge.
|
boolean |
isShowingEdgeColorFromVertices()
Determines whether smooth edge coloring uses vertex colors at vertices, requires vertex colors.
|
boolean |
isShowingEdgeColors()
Determine whether drawing of edge colors is enabled.
|
boolean |
isShowingEdgeFromVertexColors()
Deprecated.
since JavaView 3.96.031, use #isShowingEdgeColorFromVertices()
|
boolean |
isShowingEdgeLabels()
Determine whether showing of edge labels is enabled.
|
boolean |
isShowingEdgeNormalArrow()
Determine whether drawing of arrow at edge normals is enabled.
|
boolean |
isShowingEdgeNormals()
Determine whether drawing of edge normals is enabled.
|
boolean |
isShowingEdges()
Determine whether drawing of edges of polygon is enabled.
|
boolean |
isShowingEdgeSizes()
Determine whether drawing of edge sizes is enabled.
|
boolean |
isShowingPolygonColors()
Deprecated.
use isShowingEdgeColors()
|
boolean |
isShowingPolygonEndArrow()
Determine whether drawing of arrow at last point of polygon is enabled.
|
boolean |
isShowingPolygonStartArrow()
Determine whether drawing of arrow at first point of polygon is enabled.
|
boolean |
isShowingSmoothEdgeColors()
Determines whether smooth coloring of edges is enabled, currently requires vertex colors.
|
boolean |
isShowingSmoothLighting()
Determines whether smooth lighting is enabled, requires vertex normals.
|
void |
makeBiNormals()
Compute binormals at vertices which are orthogonal to both adjacent edges.
|
void |
makeCurvatureNormals()
Compute normals at vertices as edge bisectors with length equal to (Pi-vertexAngle).
|
boolean |
makeEdgeColorsFromLength()
Create edge color from the polygon length ranging through hue rainbow.
|
boolean |
makeEdgeColorsFromXYZ()
Create color from the edge position within its bounding box
which is interpreted as RGB cube.
|
boolean |
makeEdgeColorsFromZ()
Create color from the vertical z-height within its bounding box
ranging from low blue to high red.
|
boolean |
makeEdgeColorsFromZHue()
Create color from the vertical z-height within its bounding box
ranging through hue rainbow.
|
boolean |
makeEdgeFromVertexColors()
Create edge colors as average of the color of its two vertices.
|
void |
makeNormals()
Deprecated.
since JavaView 3.50.002, use makeVertexNormals().
|
void |
makeNormals(int type,
double length)
Compute normals at vertices which lie in the span of the adjacent edges.
|
void |
makeOffsetNormals()
Compute normals at vertices as edge bisectors whose tip lies on an offset==1 curve.
|
boolean |
makeVertexColorsFromLength()
Create vertex color from the polygon length ranging through hue rainbow.
|
boolean |
makeVertexFromEdgeColors()
Create vertex colors as average of color of all adjacent edges.
|
boolean |
makeVertexNormals()
Compute normals at vertices as edge bisectors with unit length.
|
boolean |
merge(PgGeometryIf aGeom)
Merge polygon 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.
|
void |
removeEdgeColors()
Remove individual edge colors from a polygon and use the global
polygon color instead.
|
void |
removeEdgeNormals()
Remove local edge normals from a geometry.
|
void |
removeEdgeSizes()
Remove edge sizes from a geometry.
|
int[] |
removeMarkedVertices()
Remove vertices marked with tag PsObject#IS_DELETED from polygons.
|
void |
setClosed(boolean flag)
Set flag that polygon is closed.
|
void |
setDimOfVertices(int dim)
Set dimension of vertices.
|
boolean |
setEdgeColor(int ind,
java.awt.Color aColor)
Copy new color to edge color at specified position in the color list
|
void |
setEdgeColors(java.awt.Color[] color)
Assign edge colors of list to existing array of edge colors.
|
boolean |
setEdgeNormal(int ind,
PdVector aNormal)
Copy new normal to edge normal at specified position in the normal list
|
void |
setEdgeNormals(PdVector[] normal)
Copy edge normals of list to existing array of edge normals.
|
void |
setEdgeSizes(PdVector size)
Copy edge sizes of list to existing array of edge sizes.
|
void |
setGlobalEdgeColor(java.awt.Color color)
Set global edge color to be used if no local colors are available.
|
void |
setGlobalEdgeNormalColor(java.awt.Color color)
Set global normal color to be used if no local colors are available.
|
void |
setGlobalEdgeNormalLength(double length)
Get length factor of normal vectors when drawn in display.
|
void |
setGlobalEdgeNormalSize(double size)
Get thickness in pixels of normals when drawn in display.
|
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 |
setGlobalPolygonColor(java.awt.Color color)
Deprecated.
use setGlobalEdgeColor()
|
void |
setGlobalPolygonSize(double size)
Deprecated.
use setGlobalEdgeSize()
|
void |
setGlobalPolygonTagColor(java.awt.Color color)
Deprecated.
use setGlobalEdgeTagColor()
|
void |
setJvx(PgJvxSrc src)
Fill this instance with data from a geometry source, for example, previously read from file.
|
void |
setNumVertices(int numVertices)
Adjust the number of vertices of the polygon.
|
void |
showEdgeColorFromVertices(boolean flag)
Set flag to enable smooth edge coloring using vertex colors at vertices, requires vertex colors.
|
void |
showEdgeColors(boolean flag)
Set flag to enable drawing of edge colors.
|
void |
showEdgeFromVertexColors(boolean flag)
Deprecated.
since JavaView 3.96.031, use #showEdgeColorFromVertices(boolean)
|
void |
showEdgeLabels(boolean flag)
Set flag to enable drawing of edge labels in display.
|
void |
showEdgeNormalArrow(boolean flag)
Set flag to enable drawing of arrow at edge normals.
|
void |
showEdgeNormals(boolean flag)
Set flag to enable drawing of edge normals.
|
void |
showEdges(boolean flag)
Set flag to enable drawing of edges of polygon.
|
void |
showEdgeSizes(boolean flag)
Set flag to enable drawing of edge sizes.
|
void |
showPolygonColors(boolean flag)
Deprecated.
use showEdgeColors(boolean)
|
void |
showPolygonEndArrow(boolean flag)
Set flag to enable drawing of arrow at last point of polygons.
|
void |
showPolygonStartArrow(boolean flag)
Set flag to enable drawing of arrow at first point of polygons.
|
void |
showSmoothEdgeColors(boolean flag)
Set flag to enable smooth coloring of edges, currently requires vertex colors.
|
void |
showSmoothLighting(boolean flag)
Set flag to enable smooth lighting, requires vertex normals.
|
java.lang.String |
toString()
Create a multi-line string representation
with detailed information about all instance variables.
|
PiVector[] |
triangulate()
Given a simple closed, nearly planar polygon, then the method
triangulates the patch by successively removing the vertex
with the smallest interior angle.
|
boolean |
update(java.lang.Object event)
Update the class whenever a child has changed.
|
void |
useGlobalPolygonColor(boolean flag)
Deprecated.
use showEdgeColors(boolean)
|
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, setMaxNumVertices, 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 final int NORMAL
public static final int BINORMAL
public static final int OFFSET_NORMAL
public static final int CURVATURE_NORMAL
public PgPolygon()
public PgPolygon(int aVertexDim)
public void init()
init
in class PgPointSet
public PgJvxSrc getJvx()
getJvx
in interface PgGeometryIf
getJvx
in class PgPointSet
public void setJvx(PgJvxSrc src)
setJvx
in interface PgGeometryIf
setJvx
in class PgPointSet
src
- a geometry source used to fill this instance with data.public java.lang.Object clone()
null
.clone
in interface PgGeometryIf
clone
in class PgPointSet
copy(PsObject)
public void copy(PsObject object)
The argument was changed from PgGeometry to PsObject since there were problems in J/Link which preferred to use jv.object.PsObject#copy(PsObject) instead of jv.project.PgGeometry#copy(PsObject).
copy
in class PgPointSet
clone()
public java.lang.String toString()
toString
in interface PgGeometryIf
toString
in class PgPointSet
public void setDimOfVertices(int dim)
setDimOfVertices
in class PgPointSet
public void setNumVertices(int numVertices)
Internally the number of edges are updated.
setNumVertices
in class PgPointSet
public int getNumEdges()
setNumVertices(int)
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 getGlobalPolygonColor()
public java.awt.Color getGlobalPolygonTagColor()
public double getGlobalPolygonSize()
public void setGlobalPolygonColor(java.awt.Color color)
public void setGlobalPolygonTagColor(java.awt.Color color)
public void setGlobalPolygonSize(double size)
public java.awt.Color getGlobalEdgeNormalColor()
public double getGlobalEdgeNormalLength()
public double getGlobalEdgeNormalSize()
public void setGlobalEdgeNormalColor(java.awt.Color color)
public void setGlobalEdgeNormalLength(double length)
public void setGlobalEdgeNormalSize(double size)
public void showPolygonColors(boolean flag)
public void useGlobalPolygonColor(boolean flag)
public boolean isShowingEdgeLabels()
public boolean isShowingEdges()
public boolean isShowingEdgeNormals()
public boolean isShowingEdgeNormalArrow()
public boolean isShowingEdgeColors()
public boolean isShowingEdgeSizes()
public boolean isShowingPolygonStartArrow()
public boolean isShowingPolygonEndArrow()
public boolean isShowingPolygonColors()
public void showEdgeLabels(boolean flag)
public void showEdges(boolean flag)
public void showEdgeNormals(boolean flag)
public void showEdgeNormalArrow(boolean flag)
public void showEdgeColors(boolean flag)
public void showEdgeSizes(boolean flag)
public void showPolygonStartArrow(boolean flag)
public void showPolygonEndArrow(boolean flag)
public java.awt.Color[] getEdgeColors()
public boolean hasEdgeColors()
assureEdgeColors()
public boolean hasEdgeNormals()
assureEdgeNormals()
public void removeEdgeColors()
Showing of edge colors must be switched off explicitly using
showEdgeColors(boolean)
.
public void setEdgeColors(java.awt.Color[] color)
color
- array with new edge colorspublic boolean setEdgeColor(int ind, java.awt.Color aColor)
ind
- index of edgeaColor
- color to be copied to color listpublic void assureEdgeColors()
public PdVector[] getEdgeNormals()
public void removeEdgeNormals()
Showing of edge normals must be switched off explicitly using
showEdgeColors(boolean)
.
public void setEdgeNormals(PdVector[] normal)
normal
- array with new edge normalspublic boolean setEdgeNormal(int ind, PdVector aNormal)
ind
- index of edgeaNormal
- normal to be copied to normal listpublic void assureEdgeNormals()
public PdVector getEdgeSizes()
public void removeEdgeSizes()
Showing of edge sizes must be switched off explicitly using
showEdgeSizes(boolean)
.
public void setEdgeSizes(PdVector size)
Showing of edge sizes must be switched on in order to be visible.
size
- array with new edge size for all polygonspublic void assureEdgeSizes()
public PiVector[] getEdges()
public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in class PgPointSet
event
- carries a lot of informationPsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public void paint(PvGeometryIf dc)
jv.project.PgGeometryIf
for detailed information.paint
in interface PgGeometryIf
paint
in class PgPointSet
PgGeometryIf
public double getLengthOfEdge(int edgeInd)
public double getLength()
isClosed()
public boolean isClosed()
setClosed(boolean)
public void setClosed(boolean flag)
flag
- true
closes polygonsisClosed()
public void computeEight(int numPoints)
numPoints
- Discretization of polygonpublic void computeCircle(int numPoints, double radius)
numPoints
- Discretization of polygonradius
- Radius of circlepublic int[] removeMarkedVertices()
removeMarkedVertices
in class PgPointSet
PgPointSet.removeMarkedVertices()
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 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 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 PgPointSet
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 PgPointSet
s
- weight of vertices of first geometryag
- first geometry used for blendingt
- weight of vertices of second geometrybg
- second geometry used for blendingpublic boolean makeVertexNormals()
This method correctly handles polygons with sequences of parallel edges and multiple vertices.
makeVertexNormals
in class PgPointSet
public void makeNormals()
public void makeBiNormals()
This method correctly handles polygons with sequences of parallel edges and multiple vertices.
public void makeOffsetNormals()
This method correctly handles polygons with sequences of parallel edges and multiple vertices.
public void makeCurvatureNormals()
This method correctly handles polygons with sequences of parallel edges and multiple vertices.
public void makeNormals(int type, double length)
This method correctly handles polygons with sequences of parallel edges and multiple vertices.
public boolean checkTriangleCut(int vertexInd, PdVector normal)
Remark: this condition is only valid of the projection of the polygon onto a plane orthogonal to the normal of the polygon is a simple closed curve with no self-intersections.
Fuer den Test wird abgefragt, ob die uebrigen Eckpunkte des Polygons im Innern des vom Dreieck p1,p2,p3 und der Normalen orient gebildeten Prismas liegt. Wenn alle Punkte ausserhalb liegen, so verlaeuft Linie im Innern d. Polygons.
vertexInd
- index of middle vertex which might be cut offnormal
- normal of polygon, used as orientation, i.e. polygon runs counter-clockwise around normalpublic PiVector[] triangulate()
ToDo: But until now it cannot handle situations where an edge introduced by removing a vertex may intersect the polygon somewhere else. To solve this problem the above method checkTriangleCut must be employed.
public PvPickEvent intersectionWithLine(PdVector rayBaseWorld, PdVector rayDirWorld)
intersectionWithLine
in interface PgGeometryIf
intersectionWithLine
in class PgPointSet
rayBaseWorld
- 3D base point of ray eventually hitting the surface.rayDirWorld
- 3D direction vector of ray eventually hitting the surface.public int[] getFVector()
getFVector
in class PgPointSet
public void flipOrientation()
flipOrientation
in class PgPointSet
public boolean makeEdgeColorsFromXYZ()
public boolean makeEdgeColorsFromZ()
public boolean makeEdgeColorsFromZHue()
public boolean isShowingSmoothLighting()
public void showSmoothLighting(boolean flag)
public boolean isShowingSmoothEdgeColors()
public void showSmoothEdgeColors(boolean flag)
public boolean isShowingEdgeColorFromVertices()
public void showEdgeColorFromVertices(boolean flag)
public boolean isShowingEdgeFromVertexColors()
public void showEdgeFromVertexColors(boolean flag)
public boolean makeEdgeFromVertexColors()
public boolean makeVertexFromEdgeColors()
public boolean makeEdgeColorsFromLength()
public boolean makeVertexColorsFromLength()
"