|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.project.PgGeometry
|
+--jv.geom.PgPointSet
|
+--jv.geom.PgPolygon
Base class for polygons given as consequtive list of polygon vertices.
The class interprets the vertices in the vertex array of its superclass
PgPointSet as consequtive 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 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 Form| Field Summary | |
int |
BINORMAL
|
int |
CURVATURE_NORMAL
|
int |
NORMAL
|
int |
OFFSET_NORMAL
|
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS |
| Constructor Summary | |
PgPolygon()
Constructor of a polygon in three-dimensional space. |
|
PgPolygon(int aVertexDim)
Constructor of a polygon set in a space of given dimension. |
|
| Method Summary | |
boolean |
blend(double s,
PgPolygon a,
double t,
PgPolygon b)
Blend between two Polygons using this = s*a + t*b |
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(PgGeometry aGeom)
Copy instance variables by duplication, not by copying a reference. |
java.awt.Color |
getGlobalPolygonColor()
Get global polygon color which is used if no local colors are available. |
double |
getGlobalPolygonSize()
Get thickness in pixels of polygon when drawn in display. |
java.awt.Color |
getGlobalPolygonTagColor()
Get global color of tagged polygons. |
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. |
PiVector |
getPolygon()
Get indices of polygon as index vector. |
void |
init()
Initialize and reset instance variables after call to super.init(). |
PvPickEvent |
intersectionWithLine(PdVector rayBase,
PdVector rayDir)
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 |
isShowingEdgeColors()
Determine whether drawing of edge colorsis enabled. |
boolean |
isShowingEdgeLabels()
Determine whether showing of edge labels is enabled. |
boolean |
isShowingEdgeNormals()
Determine whether drawing of edge normalsis enabled. |
boolean |
isShowingEdges()
Determine whether drawing of edges of polygonis enabled. |
boolean |
isShowingPolygonColors()
Set flag to enable drawing of polygon colors. |
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. |
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). |
void |
makeNormals()
Compute normals at vertices as edge bisectors with unit length. |
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. |
void |
paint(PvGeometryIf dc)
Major rendering method fills an internal container class supplied by the display. |
void |
setClosed(boolean flag)
Set flag that polygon is closed. |
void |
setGlobalPolygonColor(java.awt.Color color)
Set global polygon color to be used if no local colors are available. |
void |
setGlobalPolygonSize(double size)
Set thickness in pixels of polygon when drawn in display. |
void |
setGlobalPolygonTagColor(java.awt.Color color)
Set global color of tagged polygons. |
void |
setJvx(PgJvxSrc src)
Fill this instance with data from a geometry source, for example, previously read from file. |
void |
showEdgeColors(boolean flag)
Set flag to enable drawing of edge colors. |
void |
showEdgeLabels(boolean flag)
Set flag to enable drawing of edge labels in display. |
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 |
showPolygonColors(boolean flag)
Set flag to enable drawing of polygon colors. |
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. |
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 showPolygonColors(boolean) |
void |
useGlobalPolygonSize(boolean flag)
Use global polygon size instead of sizing each edge individually. |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, updatePanels |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.project.PgGeometryIf |
assureInspector, getInfoPanel, getName, setName |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, setParent |
| Field Detail |
public int NORMAL
public int BINORMAL
public int OFFSET_NORMAL
public int CURVATURE_NORMAL
| Constructor Detail |
public PgPolygon()
public PgPolygon(int aVertexDim)
| Method Detail |
public void init()
init in class PgPointSetpublic PgJvxSrc getJvx()
getJvx in class PgPointSetpublic void setJvx(PgJvxSrc src)
setJvx in class PgPointSetsrc - a geometry source used to fill this instance with data.public java.lang.Object clone()
null.
Tags of this object are not copied but maybe copied of subclasses.clone in class PgPointSet#copy(PgPolygon)public void copy(PgGeometry aGeom)
copy in class PgPointSetpublic java.lang.String toString()
toString in class PgPointSetpublic 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 void showPolygonColors(boolean flag)
public void useGlobalPolygonColor(boolean flag)
public void useGlobalPolygonSize(boolean flag)
public boolean isShowingEdgeLabels()
public boolean isShowingEdges()
public boolean isShowingEdgeNormals()
public boolean isShowingEdgeColors()
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 showEdgeColors(boolean flag)
public void showPolygonStartArrow(boolean flag)
public void showPolygonEndArrow(boolean flag)
public boolean update(java.lang.Object event)
update in class PgPointSetjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)public void paint(PvGeometryIf dc)
jv.project.PgGeometryIf for detailed information.paint in class PgPointSetPgGeometryIfpublic PiVector getPolygon()
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 polygon
public void computeCircle(int numPoints,
double radius)
numPoints - Discretization of polygonradius - Radius of circle
public boolean blend(double s,
PgPolygon a,
double t,
PgPolygon b)
this = s*a + t*bs, - t weights of vertices of each Polygona, - b two Polygons used for blendingpublic void makeNormals()
This method correctly handles polygons with sequences of parallel edges and multiple vertices.
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 rayBase,
PdVector rayDir)
intersectionWithLine in class PgPointSetrayBase - base point of ray eventually hitting the polygon setrayDir - direction point of ray eventually hitting the polygon set
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||