JavaView® v2.12

jv.geom
Class PgBndPolygon

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.project.PgGeometry
              |
              +--jv.geom.PgPointSet
                    |
                    +--jv.geom.PgPolygon
                          |
                          +--jv.geom.PgBndPolygon
All Implemented Interfaces:
java.lang.Cloneable, PgGeometryIf, PsUpdateIf, java.io.Serializable

public class PgBndPolygon
extends PgPolygon

Boundary polygon of PgElementSets with reference to boundary vertices and elements. Polygon may have boundary constraints for variational problems. Call: bndsh (n, bnd) bndinv (from, to, nedges, a, b) invert() bndcp (from, to, nedges, a, b) bndcpy (from, to, nedges, a, b) bndcmp (a, b, eps) bndtst (a, eps) bnd_id (a, b, i) bnd_shrink (a) bnd_dist (a, b, dist, orient) bnd_cmp_paste (a, b, maxDist) bnd_cmp_logic (a, b, eps) bnd_paste (a, b, type) g_bnd_curve_invert (a)

Version:
25.05.00, 1.30 revised (ur) Method getNumElements(): return value changed from m_elementInd.getSize() to getNumVertices()-1.
03.09.98, 1.20 revised (kp) Non-conforming element set allowed, new instance variable m_neighbourLocInd added.
02.09.98, 1.10 revised (kp) Vertices are no longer shared with element set.
00.00.98, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
PgPointSet, Serialized Form

Fields inherited from class jv.geom.PgPolygon
BINORMAL, CURVATURE_NORMAL, NORMAL, 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
 
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, 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, METHOD_EXT, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE
 
Constructor Summary
PgBndPolygon(int aVertexDim)
           
 
Method Summary
 boolean assignVertices()
          Update the vertices of the polygon.
 boolean blend(double s, PgBndPolygon a, double t, PgBndPolygon b)
          Name: public boolean blend(double s, PgBndPolygon a, double t, PgBndPolygon b) Description: Blend between two PgBndPolygons, used in interpolation and computing the associate surfaces this = s*a + t*b Arguments: double s, t weights of vertices of each PgBndPolygon PgBndPolygon a, b two PgBndPolygons used for blending Author: Konrad Polthier History: created: 31.12.97 (kp) revised:
 int bnd_cmp_logic(PgBndPolygon b, double maxDist)
          Parameters: PgBndPolygon a, pointer on structure of bnd_curve PgBndPolygon b, pointer on structure of bnd_curve Returnvalue: int 0: boundaries are not equal 1: bnd's are equal with m_vertexInd.m_data[0] = b.m_vertexInd.m_data[0] -1: bnd's are invers equal with m_vertexInd.m_data[0] = b.m_vertexInd.m_data[nop-1] Description: compare boundaries of one triang2d structure, they may have different number of vertices.
 double bnd_dist(PgBndPolygon b)
          Parameters: PgBndPolygon a, pointer to structure of bnd_curve PgBndPolygon b, pointer to structure of bnd_curve return: double dist distance of two boundaries int *orient 1: bnd's have same direction, i.e. a.m_vertexInd.m_data[i] = b.m_vertexInd.m_data[i] -1:bnd's have different directions, i.e. a.m_vertexInd.m_data[i] = b.m_vertexInd.m_data[nop-1-i] Returnvalue: 0 failure, orient and dist will not be defined on return; 1 success; Description: compare boundaries of one triang2d structure and return their distance, i.e. the maximal value of the minimal distance of boundary points
 boolean bnd_id(PgBndPolygon b, int orient)
          Parameters: PgBndPolygon a, pointer to structure of type bnd_curve PgBndPolygon b, pointer to structure of type bnd_curve int orient, orientation marker orient >=0 : bnd's are equal orient < 0 : bnd's are invers equal Returnvalue: --- Description: identify boundaries History: created: 29.12.97 Konrad Polthier
 boolean bnd_paste(PgBndPolygon b, int type)
          Parameters: PgBndPolygon a, pointer on structure of bnd_curve PgBndPolygon b, pointer on structure of bnd_curve Returnvalue: int 0: paste didn't work 1: paste succeeded Description: paste two bnd's of a triang2d structure paste b at the end of a
 boolean bnd_shrink()
          Identify a boundary curve to a single point.
 int bndcmp(PgBndPolygon b, double maxDist)
          Parameters: PgBndPolygon a, pointer on structure of bnd_curve PgBndPolygon b, pointer on structure of bnd_curve Returnvalue: int 0: boundaries are not equal 1: bnd's are equal: a.m_vertexInd.m_data[i] = b.m_vertexInd.m_data[i] -1: bnd's are invers equal: a.m_vertexInd.m_data[i] = b.m_vertexInd.m_data[nop-1-i] Description: compare boundaries of one triang2d structure
static void bndcp(int from, int to, int nedges, PgBndPolygon a, PgBndPolygon b)
          Parameters: int from, vertexno of beginning of source bnd_curve int to, vertexno of beginning of destination bnd_curve int nedges, number of edges to copy PgBndPolygon a, pointer on structure of source bnd_curve PgBndPolygon b, pointer on structure of destination bnd_curve Returnvalue: --- Description: copy part of bnd_curve number of edges = number of vertices - 1
static void bndcpy(int from, int to, int nedges, PgBndPolygon a, PgBndPolygon b)
          Parameters: int from, vertexno of beginning of source bnd_curve int to, vertexno of beginning of destination bnd_curve int nedges, number of edges to copy PgBndPolygon a, pointer on structure of source bnd_curve PgBndPolygon b, pointer on structure of destination bnd_curve Returnvalue: --- Description: copy part of bnd_curve number of edges = number of vertices
static boolean bndinv(int from, int to, int nedges, PgBndPolygon a, PgBndPolygon b)
          Parameters: int from, vertexno of beginning of source bnd_curve int to, vertexno of end of destination bnd_curve int nedges, number of edges to copy PgBndPolygon a, pointer on structure of source bnd_curve PgBndPolygon b, pointer on structure of destination bnd_curve Description: copy part of bnd_curve in reverse order
 boolean bndsh(int n)
          Parameters: int n, length of shift PgBndPolygon bnd, pointer on structure of bnd_curve Returnvalue: --- Description: shifts vertices and neighbours from beginning to end of bnd_curve
 int bndtst(double maxDist)
          Parameters: double maxDist tolerance to first bnd vertex Returnvalue: int 0: some bnd_curve points are equal 1: all bnd_curve points are equal -1: all bnd_curve points are different Description: tests whether bnd_curve is a single point
 java.lang.Object clone()
          Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.
 boolean constrain()
          Project boundary vertices of element set onto curves determined by boundary constraints.
 void copy(PgGeometry aGeom)
          Copies data from given boundary curve.
 PgBndConstraint getBndConstraint()
           
 PiVector getElementInd()
           
 PgElementSet getElementSet()
           
 PiVector getNeighbourLocInd()
           
 int getNumElements()
           
 PiVector getVertexInd()
           
 void init()
          Initialize and reset instance variables after call to super.init().
 boolean invert()
          Returnvalue: --- Description: invert bnd_curve to reverse order
 boolean isConforming()
          Return true if boundary belongs to conforming element set and boundary has been updated.
 void makeConforming()
          Modify vertex indices of a boundary after elementSet has been made conforming again.
 boolean makeElementInd()
          After the vertexInd have been assign, this method fills the elementInd vector by asking the triangulation for edges.
 void makeNonConforming()
          Modify vertex indices of a boundary after elementSet has been made non-conforming.
 boolean merge(PgBndPolygon b)
          Merge boundary polygon with current object into 'this' and identify last vertex of 'this' with first vertex of argument curve.
 void paint(PvGeometryIf dc)
          Major rendering method fills an internal container class supplied by the display.
 void setBndConstraint(PgBndConstraint bndConstraint)
           
 void setElementSet(PgElementSet aTriang)
           
 java.lang.String toString()
          Create a multi-line string representation with detailed information about all instance variables.
 
Methods inherited from class jv.geom.PgPolygon
blend, checkTriangleCut, computeCircle, computeEight, getGlobalPolygonColor, getGlobalPolygonSize, getGlobalPolygonTagColor, getJvx, getLength, getPolygon, intersectionWithLine, isClosed, isShowingEdgeColors, isShowingEdgeLabels, isShowingEdgeNormals, isShowingEdges, isShowingPolygonColors, isShowingPolygonEndArrow, isShowingPolygonStartArrow, makeBiNormals, makeCurvatureNormals, makeNormals, makeNormals, makeOffsetNormals, setClosed, setGlobalPolygonColor, setGlobalPolygonSize, setGlobalPolygonTagColor, setJvx, showEdgeColors, showEdgeLabels, showEdgeNormals, showEdges, showPolygonColors, showPolygonEndArrow, showPolygonStartArrow, triangulate, update, useGlobalPolygonColor, useGlobalPolygonSize
 
Methods inherited from class jv.geom.PgPointSet
addVectorField, addVertex, assureVertexColors, assureVertexNormals, assureVertexTextures, blend, clearTagVertex, computeCylinder, computeDisk, computePlane, computeRotation, computeSnail, computeSphere, computeTorus, flipOrientation, getAmbientBounds, getBounds, getCenterOfBndBox, getCenterOfGravity, getDimOfColors, getDimOfTextures, getDimOfVectors, getGlobalVectorColor, getGlobalVectorLength, getGlobalVectorSize, getGlobalVertexColor, getGlobalVertexNormalColor, getGlobalVertexNormalLength, getGlobalVertexNormalSize, getGlobalVertexSize, getGlobalVertexTagColor, getIndexOfVectorField, getMaxNumVertices, getNumVectorFields, getNumVertices, getTexture, getTextureImage, getTextureImageName, getVectorField, getVectorField, getVertex, getVertexColor, getVertexColors, getVertexNormal, getVertexNormals, getVertexTextures, getVertices, hasTagVertex, hasVertex, hasVertex, hasVertexColors, hasVertexNormals, hasVertexTextures, isDefaultLabelEnabled, isShowingIndices, isShowingTaggedVertices, isShowingVectorArrow, isShowingVectorArrows, isShowingVectorColors, isShowingVectorField, isShowingVertexColors, isShowingVertexLabels, isShowingVertexNormalArrow, isShowingVertexNormals, isShowingVertexTexture, isShowingVertices, makeColorFromVectorLength, makeVertexColorsFromXYZ, makeVertexColorsFromZ, makeVertexColorsFromZHue, makeVertexNormals, makeVertexTextureFromBndBox, makeVertexTextureFromCylinder, makeVertexTextureFromSphere, merge, projectToSphere, reflect, removeAllVectorFields, removeMarkedVertices, removeVectorField, removeVertex, scale, scale, setCenterOfBndBox, setDefaultLabelEnabled, setDimOfColors, setDimOfTextures, setDimOfVectors, setGlobalVectorColor, setGlobalVectorLength, setGlobalVectorSize, setGlobalVertexColor, setGlobalVertexNormalColor, setGlobalVertexNormalLength, setGlobalVertexNormalSize, setGlobalVertexSize, setGlobalVertexTagColor, setNumVertices, setState, setTagVertex, setTexture, setTextureImage, setTextureImageName, setTransparency, setVertex, setVertex, setVertex, setVertex, setVertexColor, setVertexColors, setVertexNormal, setVertexNormals, setVertexTextures, setVertices, showIndices, showTaggedVertices, showVectorArrow, showVectorArrows, showVectorColors, showVectorField, showVectorFields, showVertexColors, showVertexLabels, showVertexNormalArrow, showVertexNormals, showVertexTexture, showVertices, translate
 
Methods inherited from class jv.project.PgGeometry
addDisplay, addElement, addPolygon, clearTagElement, clearTagPolygon, fillMethodMenu, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplays, getElement, getGeometryInfo, getLabelAttribute, getMaterialPanel, getModelMatrix, getPolygon, getTitle, getVersion, getVersionType, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagElement, hasTagPolygon, isConfigurable, isShowingBndBox, isShowingCenter, isShowingTitle, isVisible, removeDisplay, removeElement, removePolygon, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setElement, setGeometryInfo, setLabelAttribute, setLabelAttribute, setModelMatrix, setPolygon, setTagElement, setTagPolygon, setTitle, setVersion, setVersionType, setVisible, showBndBox, showCenter, showTitle
 
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
 

Constructor Detail

PgBndPolygon

public PgBndPolygon(int aVertexDim)
Method Detail

init

public void init()
Description copied from class: PgPolygon
Initialize and reset instance variables after call to super.init().
Overrides:
init in class PgPolygon

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 to null. Tags of this object are not copied but maybe copied of subclasses.

Link to associated element set is set to null.

Overrides:
clone in class PgPolygon
See Also:
copy(PgGeometry)

copy

public void copy(PgGeometry aGeom)
Copies data from given boundary curve. Note: Reference to parent element set is not copied.
Overrides:
copy in class PgPolygon

toString

public java.lang.String toString()
Create a multi-line string representation with detailed information about all instance variables.
Overrides:
toString in class PgPolygon

getNumElements

public int getNumElements()

getElementSet

public PgElementSet getElementSet()

getVertexInd

public PiVector getVertexInd()

getElementInd

public PiVector getElementInd()

getNeighbourLocInd

public PiVector getNeighbourLocInd()

getBndConstraint

public PgBndConstraint getBndConstraint()

setBndConstraint

public void setBndConstraint(PgBndConstraint bndConstraint)

setElementSet

public void setElementSet(PgElementSet aTriang)

paint

public void paint(PvGeometryIf dc)
Description copied from class: PgPolygon
Major rendering method fills an internal container class supplied by the display. See jv.project.PgGeometryIf for detailed information.
Overrides:
paint in class PgPolygon
Following copied from class: jv.geom.PgPolygon
See Also:
PgGeometryIf

isConforming

public boolean isConforming()
Return true if boundary belongs to conforming element set and boundary has been updated.

makeNonConforming

public void makeNonConforming()
Modify vertex indices of a boundary after elementSet has been made non-conforming. Method assumes that boundary has been setup for a conforming element set before, and, additionally, that the element set is already non-conforming. Number of boundary vertices is reduced by one.
Returns:
true on success
See Also:
jv.geom.PnConjugate#makeConforming(jv.geom.PgElementSet), jv.geom.PnConjugate#makeNonConforming(jv.geom.PgElementSet)

makeConforming

public void makeConforming()
Modify vertex indices of a boundary after elementSet has been made conforming again. Method assumes that boundary has been setup for a non-conforming element set before, and, additionally, that the element set is already conforming again. Number of boundary vertices is incremented by one.
Returns:
true on success
See Also:
jv.geom.PnConjugate#makeConforming(jv.geom.PgElementSet), jv.geom.PnConjugate#makeNonConforming(jv.geom.PgElementSet)

assignVertices

public boolean assignVertices()
Update the vertices of the polygon. It should be called when vertices of the elementSet have changed. Method assumes that boundary has been setup for an element set before.

makeElementInd

public boolean makeElementInd()
After the vertexInd have been assign, this method fills the elementInd vector by asking the triangulation for edges. Additionally, the vertices are assigned. Method does not work for non-conforming element sets.
Returns:
false if missing element set or edge not found, else true.

bndsh

public boolean bndsh(int n)
Parameters: int n, length of shift PgBndPolygon bnd, pointer on structure of bnd_curve Returnvalue: --- Description: shifts vertices and neighbours from beginning to end of bnd_curve

bndinv

public static boolean bndinv(int from,
                             int to,
                             int nedges,
                             PgBndPolygon a,
                             PgBndPolygon b)
Parameters: int from, vertexno of beginning of source bnd_curve int to, vertexno of end of destination bnd_curve int nedges, number of edges to copy PgBndPolygon a, pointer on structure of source bnd_curve PgBndPolygon b, pointer on structure of destination bnd_curve Description: copy part of bnd_curve in reverse order

invert

public boolean invert()
Returnvalue: --- Description: invert bnd_curve to reverse order

bndcp

public static void bndcp(int from,
                         int to,
                         int nedges,
                         PgBndPolygon a,
                         PgBndPolygon b)
Parameters: int from, vertexno of beginning of source bnd_curve int to, vertexno of beginning of destination bnd_curve int nedges, number of edges to copy PgBndPolygon a, pointer on structure of source bnd_curve PgBndPolygon b, pointer on structure of destination bnd_curve Returnvalue: --- Description: copy part of bnd_curve number of edges = number of vertices - 1

bndcpy

public static void bndcpy(int from,
                          int to,
                          int nedges,
                          PgBndPolygon a,
                          PgBndPolygon b)
Parameters: int from, vertexno of beginning of source bnd_curve int to, vertexno of beginning of destination bnd_curve int nedges, number of edges to copy PgBndPolygon a, pointer on structure of source bnd_curve PgBndPolygon b, pointer on structure of destination bnd_curve Returnvalue: --- Description: copy part of bnd_curve number of edges = number of vertices

bndcmp

public int bndcmp(PgBndPolygon b,
                  double maxDist)
Parameters: PgBndPolygon a, pointer on structure of bnd_curve PgBndPolygon b, pointer on structure of bnd_curve Returnvalue: int 0: boundaries are not equal 1: bnd's are equal: a.m_vertexInd.m_data[i] = b.m_vertexInd.m_data[i] -1: bnd's are invers equal: a.m_vertexInd.m_data[i] = b.m_vertexInd.m_data[nop-1-i] Description: compare boundaries of one triang2d structure

bndtst

public int bndtst(double maxDist)
Parameters: double maxDist tolerance to first bnd vertex Returnvalue: int 0: some bnd_curve points are equal 1: all bnd_curve points are equal -1: all bnd_curve points are different Description: tests whether bnd_curve is a single point

bnd_shrink

public boolean bnd_shrink()
Identify a boundary curve to a single point. Method assumes that all referenced vertices are geometrically identically and replaces all vertex references with a reference to the first vertex in the boundary curve. Remaining vertices are marked PsObject#IS_DELETED. Boundary curve itself is marked deleted too. The boundary edges are removed from adjacent elements respectively elements with three edges are removed.

bnd_id

public boolean bnd_id(PgBndPolygon b,
                      int orient)
Parameters: PgBndPolygon a, pointer to structure of type bnd_curve PgBndPolygon b, pointer to structure of type bnd_curve int orient, orientation marker orient >=0 : bnd's are equal orient < 0 : bnd's are invers equal Returnvalue: --- Description: identify boundaries History: created: 29.12.97 Konrad Polthier

bnd_dist

public double bnd_dist(PgBndPolygon b)
Parameters: PgBndPolygon a, pointer to structure of bnd_curve PgBndPolygon b, pointer to structure of bnd_curve return: double dist distance of two boundaries int *orient 1: bnd's have same direction, i.e. a.m_vertexInd.m_data[i] = b.m_vertexInd.m_data[i] -1:bnd's have different directions, i.e. a.m_vertexInd.m_data[i] = b.m_vertexInd.m_data[nop-1-i] Returnvalue: 0 failure, orient and dist will not be defined on return; 1 success; Description: compare boundaries of one triang2d structure and return their distance, i.e. the maximal value of the minimal distance of boundary points

bnd_paste

public boolean bnd_paste(PgBndPolygon b,
                         int type)
Parameters: PgBndPolygon a, pointer on structure of bnd_curve PgBndPolygon b, pointer on structure of bnd_curve Returnvalue: int 0: paste didn't work 1: paste succeeded Description: paste two bnd's of a triang2d structure paste b at the end of a

bnd_cmp_logic

public int bnd_cmp_logic(PgBndPolygon b,
                         double maxDist)
Parameters: PgBndPolygon a, pointer on structure of bnd_curve PgBndPolygon b, pointer on structure of bnd_curve Returnvalue: int 0: boundaries are not equal 1: bnd's are equal with m_vertexInd.m_data[0] = b.m_vertexInd.m_data[0] -1: bnd's are invers equal with m_vertexInd.m_data[0] = b.m_vertexInd.m_data[nop-1] Description: compare boundaries of one triang2d structure, they may have different number of vertices.

merge

public boolean merge(PgBndPolygon b)
Merge boundary polygon with current object into 'this' and identify last vertex of 'this' with first vertex of argument curve.
Parameters:
b - PgBndPolygon to be merged into 'this'
Returns:
true if merge was successfull

blend

public boolean blend(double s,
                     PgBndPolygon a,
                     double t,
                     PgBndPolygon b)
Name: public boolean blend(double s, PgBndPolygon a, double t, PgBndPolygon b) Description: Blend between two PgBndPolygons, used in interpolation and computing the associate surfaces this = s*a + t*b Arguments: double s, t weights of vertices of each PgBndPolygon PgBndPolygon a, b two PgBndPolygons used for blending Author: Konrad Polthier History: created: 31.12.97 (kp) revised:

constrain

public boolean constrain()
Project boundary vertices of element set onto curves determined by boundary constraints. Then update vertices of boundary polygon too.

JavaView® v2.12

The software JavaView® is copyright protected. All Rights Reserved.