JavaView® v2.12

jv.project
Class PgJvxSrc

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.project.PgGeometry
              |
              +--jv.project.PgJvxSrc
All Implemented Interfaces:
java.lang.Cloneable, PgGeometryIf, PsUpdateIf, java.io.Serializable
Direct Known Subclasses:
PgRuler, PvGrid

public class PgJvxSrc
extends PgGeometry

Container of very diverse geometry data of points, curves, surfaces, and volumes. This class allows temporary storage and exchange of data. For example, this class is filled by loaders and later assigned to specialized geometry classes for further processing.

Note, this class is not intended to perform geometric operations or even to modify data once it is allocated or assigned. For such operations use more specialized classes as e.g. PgPointSet, PgPolygonSet, or PgElementSet.

Version:
19.05.01, 2.30 revised (kp) Vector field handling slightly revised.
12.12.00, 2.20 revised (kp) Descriptions moved from PgJvxSrc to PgGeometry.
12.12.00, 2.10 revised (kp) Secondary classification instance variable change to array of strings from pure string.
26.09.00, 2.00 revised (kp) All integer flags replaced with booleans to conform with PgGeometry.
21.09.00, 1.25 revised (kp) Methods for global backface element color added.
07.07.00, 1.20 revised (kp) More missing methods of PgGeometryIf implemented.
20.04.00, 1.10 revised (kp) Author member variable added.
08.04.00, 1.00 created (kp) Extracted from jv.project.PgGeometry
Author:
Konrad Polthier
See Also:
Serialized Form

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
PgJvxSrc()
          Constructs a geometry container whose vertex dimension is initialized to 3.
 
Method Summary
 int addEdge(PiVector anEdge)
          Add new edge to the end of the edge list.
 int addElement(PiVector anElement)
          Add element to the element list and increase number of elements.
 int addPolygon(PiVector anPolygon)
          Add new polygon to the end of the polygon list.
 int addVertex(PdVector aVertex)
          Add new vertex to the end of the vertex list Method just calls setVertex(numVertices, PdVector).
 void assureEdgeColors()
          Assures respectively allocates correct length of edge color array.
 void assureElementBackColors()
          Assures respectively allocates correct length of element back face color array.
 void assureElementColors()
          Assures respectively allocates correct length of element color array.
 void assureElementNormals()
          Assures respectively allocates correct length of element normal array.
 void assureElementTextures()
          Assures respectively allocates correct length of element texture array.
 void assureNeighbours()
          Assures correct length of neighbour array and, if any length changes, initializes with -1.
 void assurePolygonColors()
          Assures respectively allocates correct length of polygon color array.
 void assurePolygonNormals()
          Assures respectively allocates correct length of polygon normal array.
 void assureVectorColors(int ind)
          Assures respectively allocates correct length of element color array.
 void assureVertexColors()
          Assures respectively allocates correct length of vertex color array.
 void assureVertexNormals()
          Assures respectively allocates correct length of vertex normal array.
 void assureVertexTextures()
          Assures respectively allocates correct length of vertex texture array.
 void clearTagVertex(int anIndex, int aTag)
          Clear a single tag of a vertex.
 java.lang.Object clone()
          Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.
 void copy(PgJvxSrc src)
           
 PdVector[] getAmbientBounds()
          Compute bounding box of this geometry from the set of all vertices, or return null if no vertices.
 PdVector[] getBounds()
          Compute bounding box of the vertices which are transformed with ambient and model matrix.
 int getDimOfVectors(int ind)
          Get uniform number of components of each vector in a vector field.
 PiVector getEdge(int anIndex)
          Get a reference to index vector of edge with given index.
 java.awt.Color[] getEdgeColors()
          Get color array for read and write access.
 PiVector[] getEdges()
          Get edge array for read and write access, but do not modify the size of any edge.
 PiVector getElement(int anIndex)
          Get a reference to an individual element.
 java.awt.Color[] getElementBackColors()
          Get backside element color array for read and write access.
 java.awt.Color[] getElementColors()
          Get element color array for read and write access.
 PdVector[] getElementNormals()
          Get element normal array for read and write access, but do not modify the size of any normal vector.
 PiVector[] getElements()
          Get element array for read and write access, but do not modify the size of any element.
 PdVector[][] getElementTextures()
          Get element texture array for read and write access, but do not modify the size of any texture vector.
 java.awt.Color getGlobalBndColor()
          Get global boundary color which is used if no local colors are available.
 double getGlobalBndSize()
          Get thickness in pixels of boundary when drawn in display.
 java.awt.Color getGlobalBndTagColor()
          Get global color of tagged boundaries.
 java.awt.Color getGlobalEdgeColor()
          Get global edge color which is used if no local colors are available.
 double getGlobalEdgeSize()
          Get global radius in pixels of circle to visualize vertices in display.
 java.awt.Color getGlobalEdgeTagColor()
          Get global color of tagged vertices.
 java.awt.Color getGlobalElementBackColor()
          Get global color of backface of elements.
 java.awt.Color getGlobalElementColor()
          Get global element color which is used if no local colors are available.
 java.awt.Color getGlobalElementNormalColor()
          Get global element normal color which is used if no local colors are available.
 double getGlobalElementNormalLength()
          Get length factor of normal vectors when drawn in display.
 double getGlobalElementNormalSize()
          Get thickness in pixels of normals when drawn in display.
 java.awt.Color getGlobalElementTagColor()
          Get global color of tagged elements.
 java.awt.Color getGlobalPolygonColor()
          Get global polygon color which is used if no local colors are available.
 java.awt.Color getGlobalPolygonNormalColor()
          Get global polygon normal color which is used if no local colors are available.
 double getGlobalPolygonNormalLength()
          Get length factor of normal vectors when drawn in display.
 double getGlobalPolygonNormalSize()
          Get thickness in pixels of normals when drawn in display.
 double getGlobalPolygonSize()
          Get global radius in pixels of circle to visualize vertices in display.
 java.awt.Color getGlobalPolygonTagColor()
          Get global color of tagged vertices.
 java.awt.Color getGlobalVectorColor(int ind)
          Get global color of vector field which is used if no local colors are available.
 double getGlobalVectorLength(int ind)
          Get length factor of vectors of vector field when drawn in display.
 double getGlobalVectorSize(int ind)
          Get thickness in pixels of vectors of vector field when drawn in display.
 java.awt.Color getGlobalVertexColor()
          Get global vertex color which is used if no local colors are available.
 java.awt.Color getGlobalVertexNormalColor()
          Get global vertex normal color which is used if no local colors are available.
 double getGlobalVertexNormalLength()
          Get length factor of vertex normal vectors when drawn in display.
 double getGlobalVertexNormalSize()
          Get thickness in pixels of vertex normals when drawn in display.
 double getGlobalVertexSize()
          Get global radius in pixels of circle to visualize vertices in display.
 java.awt.Color getGlobalVertexTagColor()
          Get global color of tagged vertices.
 PgJvxSrc getJvx()
          Fills a geometry object with data from this instance, for example, to print to file.
 PiVector[] getNeighbours()
          Get neighbourhood information.
 int getNumEdges()
          Get number of allocated and used edges.
 int getNumElements()
          Get number of allocated and used elements.
 int getNumPolygons()
          Get number of allocated and used polygons.
 int getNumVectorFields()
          Get number of allocated and used vector fields.
 int getNumVectors(int ind)
          Get number of vectors in vector field with given index.
 int getNumVertices()
          Get number of vertices in vertex array.
 PiVector getPolygon(int anIndex)
          Get a reference to index vector of polygon with given index.
 java.awt.Color[] getPolygonColors()
          Get color array for read and write access.
 PdVector[] getPolygonNormals()
          Get vertex normal array for read and write access, but do not modify the size of any normal vector.
 PiVector[] getPolygons()
          Get polygon array for read and write access, but do not modify the size of any polygon.
 java.awt.Image getTextureImage()
          Get image of texture.
 java.lang.String getTextureImageName()
          Get name of texture image, a URL or full path name.
 int getType()
          Get type of geometry, for example PvGeometryIf#GEOM_POINT_SET and PvGeometryIf#GEOM_ELEMENT_SET.
 java.awt.Color[] getVectorFieldColors(int ind)
          Get color array of a vector field for read and write access.
 java.lang.String getVectorFieldName(int ind)
          Get name of vector field.
 PdVector[] getVectors(int ind)
          Get array of a vectors of a field for read and write access.
 PdVector getVertex(int anIndex)
          Get a reference to an individual vertex.
 java.awt.Color[] getVertexColors()
          Get vertex color array for read and write access.
 java.lang.String[][] getVertexFunctions()
           
 PdVector[] getVertexNormals()
          Get vertex normal array for read and write access, but do not modify the size of any normal vector.
 PdVector[] getVertexTextures()
          Get vertex texture array for read and write access, but do not modify the size of any texture vector.
 PdVector[] getVertices()
          Get vertex array for read and write access, but do not modify the size of any vertex.
 boolean hasTagVertex(int anIndex, int aTag)
          Check whether vertex has given tag.
 void init()
          Initializes and resets geometry.
 boolean isDefaultLabelEnabled()
          Determine whether drawing of default labels, i.e. item indices, is enabled.
 boolean isShowingBackface()
          Determine flag to enable drawing of backfacing elements whose normal points away from camera.
 boolean isShowingBoundaries()
          Determines whether drawing of boundary curves is enabled.
 boolean isShowingEdgeColors()
          Determines whether drawing of edge colors is enabled.
 boolean isShowingEdgeLabels()
          Determine whether showing of edge labels is enabled.
 boolean isShowingEdges()
          Determines whether drawing of element edges is enabled.
 boolean isShowingElementBackColor()
          Determines whether drawing of global backface element color is enabled.
 boolean isShowingElementBackColors()
          Determines whether drawing of individual backface element colors is enabled.
 boolean isShowingElementColors()
          Determines whether drawing of individual element colors is enabled.
 boolean isShowingElementLabels()
          Determine whether showing of element labels is enabled.
 boolean isShowingElementNormalArrow()
          Determines whether drawing of arrow of element normals is enabled.
 boolean isShowingElementNormals()
          Determines whether drawing of element normals is enabled.
 boolean isShowingElements()
          Determines whether drawing of elements is enabled.
 boolean isShowingElementTexture()
          Determines whether drawing of element texture is enabled.
 boolean isShowingIndices()
          Check whether showing of indices is switched on.
 boolean isShowingOutline()
          Determines whether drawing of outline element edges is enabled.
 boolean isShowingPolygonColors()
          Determines whether drawing of polygon colors is enabled.
 boolean isShowingPolygonEndArrow()
          Determine whether drawing of arrow at last point of polygon is enabled.
 boolean isShowingPolygonLabels()
          Determine whether showing of polygon labels is enabled.
 boolean isShowingPolygonNormalArrow()
          Determines whether drawing of arrow of polygon normals is enabled.
 boolean isShowingPolygonNormals()
          Determines whether drawing of polygon normals is enabled.
 boolean isShowingPolygons()
          Determines whether drawing of polygons is enabled.
 boolean isShowingPolygonStartArrow()
          Determine whether drawing of arrow at first point of polygon is enabled.
 boolean isShowingVectorArrows(int ind)
          Get flag if tip of vectors is shown as arrow.
 boolean isShowingVectorColors(int ind)
          Get flag to enable drawing of individual vertex colors of a vector field.
 boolean isShowingVectorField(int ind)
          Get flag to enable drawing of vectors of a vector field.
 boolean isShowingVertexColors()
          Determines whether drawing of vertex colors is enabled.
 boolean isShowingVertexLabels()
          Determine whether showing of vertex labels is enabled.
 boolean isShowingVertexNormalArrow()
          Determines whether drawing of arrow of vertex normals is enabled.
 boolean isShowingVertexNormals()
          Determines whether drawing of vertex normals is enabled.
 boolean isShowingVertexTexture()
          Determines whether drawing of vertex texture is enabled.
 boolean isShowingVertices()
          Determines whether drawing of vertices is enabled.
 boolean isVectorElementBased(int ind)
          Get flag whether vector field is element based or vertex based.
 boolean makeElementColorsFromXYZ()
          Create color from the element position within its bounding box which is interpreted as RGB cube.
 boolean makeElementNormals()
          Compute element normals from edge crossproducts.
 void makeQuadrConn(int uDiscr, int vDiscr, boolean uClosed, boolean vClosed)
          Generate element and neighbourhood information for a quadrilateral surface.
 void paint(PvGeometryIf dc)
          Major rendering method fills an internal container class supplied by the display.
 PgGeometry reflect(PdMatrix mat, boolean bOrient, boolean bVector)
          Generate a cloned geometry and transform vertices by a matrix.
 void setDefaultLabelEnabled(boolean flag)
          Determine whether drawing of default labels, i.e. item indices, is enabled.
 void setDimOfElements(int aSize)
          Let all elements have same number of vertices aSize<>0, or individual aSize=-1.
 void setDimOfPolygons(int aSize)
          Let all polygons have same number of vertices aSize<>0, or individual aSize=-1.
 void setDimOfVertices(int dim)
          Assign dimension of vertices.
 boolean setEdge(int anIndex, PiVector aEdge)
          Set index vector of edge with given index.
 void setEdgeColors(java.awt.Color[] color)
          Copy edge colors of list to existing array of edge colors.
 void setEdges(PiVector[] edge)
          Copy the first m_numEdges of given array into edge array.
 boolean setElement(int anIndex, PiVector newElem)
          Assign element data to an existing element.
 void setElementBackColors(java.awt.Color[] color)
          Copy backface element colors of list to existing array of element colors.
 void setElementBased(int ind, boolean flag)
          Deprecated. use setVectorElementBased(int, boolean) instead.
 void setElementColors(java.awt.Color[] color)
          Copy element colors of list to existing array of element colors.
 void setElementNormals(PdVector[] normal)
          Copy element normals of list to existing array of element normals.
 void setElements(PiVector[] element)
          Copy the first m_numElements of given array into element array.
 void setElementTextures(PdVector[][] texCoords)
          Copy element textures of list to existing array of element textures.
 void setGlobalBndColor(java.awt.Color color)
          Set global boundary color to be used if no local colors are available.
 void setGlobalBndSize(double size)
          Set thickness in pixels of boundary when drawn in display.
 void setGlobalBndTagColor(java.awt.Color color)
          Set global color of tagged boundaries.
 void setGlobalEdgeColor(java.awt.Color color)
          Set global edge color to be used if no local colors are available.
 void setGlobalEdgeSize(double size)
          Set global radius in pixels of circle to visualize vertices in display.
 void setGlobalEdgeTagColor(java.awt.Color color)
          Set global color of tagged vertices.
 void setGlobalElementBackColor(java.awt.Color color)
          Set global color of backface of elements.
 void setGlobalElementColor(java.awt.Color color)
          Set global vertex color to be used if no local colors are available.
 void setGlobalElementNormalColor(java.awt.Color color)
          Set global element normal color to be used if no local colors are available.
 void setGlobalElementNormalLength(double length)
          Get length factor of normal vectors when drawn in display.
 void setGlobalElementNormalSize(double size)
          Get thickness in pixels of normals when drawn in display.
 void setGlobalElementTagColor(java.awt.Color color)
          Set global color of tagged elements.
 void setGlobalPolygonColor(java.awt.Color color)
          Set global polygon color to be used if no local colors are available.
 void setGlobalPolygonNormalColor(java.awt.Color color)
          Set global polygon normal color to be used if no local colors are available.
 void setGlobalPolygonNormalLength(double length)
          Get length factor of normal vectors when drawn in display.
 void setGlobalPolygonNormalSize(double size)
          Get thickness in pixels of normals when drawn in display.
 void setGlobalPolygonSize(double size)
          Set global radius in pixels of circle to visualize vertices in display.
 void setGlobalPolygonTagColor(java.awt.Color color)
          Set global color of tagged vertices.
 boolean setGlobalVectorColor(int ind, java.awt.Color color)
          Set global color of vector field to be used if no local colors are available.
 boolean setGlobalVectorLength(int ind, double length)
          Set length factor of vectors of vector field when drawn in display.
 boolean setGlobalVectorSize(int ind, double size)
          Set thickness in pixels of vectors of vector field when drawn in display.
 void setGlobalVertexColor(java.awt.Color color)
          Set global vertex color to be used if no local colors are available.
 void setGlobalVertexNormalColor(java.awt.Color color)
          Set global vertex normal color to be used if no local colors are available.
 void setGlobalVertexNormalLength(double length)
          Get length factor of vertex normal vectors when drawn in display.
 void setGlobalVertexNormalSize(double size)
          Get thickness in pixels of vertex normals when drawn in display.
 void setGlobalVertexSize(double size)
          Set global radius in pixels of circle to visualize vertices in display.
 void setGlobalVertexTagColor(java.awt.Color color)
          Set global color of tagged vertices.
 void setJvx(PgJvxSrc src)
          Fill this instance with data from a geometry source, for example, previously read from file.
 void setNeighbours(PiVector[] neighbour)
          Copy neighbour array to existing array of neighbours.
 void setNumEdges(int aNumEdges, int dimOfEdges)
          Allocate given number of edges, and allocate normals, colors etc. if they already exist.
 void setNumElements(int numElements)
          Allocate given number of elements, and allocate neighbours, normals, colors etc. if they already exist.
 void setNumPolygons(int numPolygons)
          Allocate given number of polygons, and allocate normals, colors etc. if they already exist.
 void setNumVectorFields(int num)
          Set number of allocated and used vector fields.
 void setNumVectors(int ind, int num, int dimOfVectors)
          Set number of vectors of a vector field with given index.
 void setNumVertices(int numVertices)
          Allocate given number of vertices, and allocate normals, colors etc. if they already exist.
 boolean setPolygon(int anIndex, PiVector aPolygon)
          Set index vector of polygon with given index.
 void setPolygonColors(java.awt.Color[] color)
          Copy polygon colors of list to existing array of polygon colors.
 void setPolygonNormals(PdVector[] normal)
          Copy polygon normals of list to existing array of polygon normals.
 void setPolygons(PiVector[] polygon)
          Copy the first m_numPolygons of given array into polygon array.
 void setState(int aKey, boolean aState)
          Set drawing flags of this geometry from within the display.
 void setTagVertex(int anIndex, int aTag)
          Set a tag of a vertex.
 void setTextureImage(java.awt.Image image)
          Set image of texture.
 void setTextureImageName(java.lang.String image)
          Set file name of texture image as relative path or protocoll.
 void setType(int type)
          Set type of geometry, for example PvGeometryIf#GEOM_POINT_SET and PvGeometryIf#GEOM_ELEMENT_SET.
 void setVectorColors(int ind, java.awt.Color[] list)
          Copy vector colors of list to existing array of vector colors.
 void setVectorElementBased(int ind, boolean flag)
          Set flag whether vector field is element based or vertex based.
 void setVectorFieldName(int ind, java.lang.String name)
          Set name of vector field.
 void setVectors(int ind, PdVector[] list)
          Copy all vectors of vector list to existing array of vectors.
 boolean setVertex(int anIndex, PdVector aVertex)
          Copy new vertex to vertex at specified position in the vertex list
 void setVertexColors(java.awt.Color[] aVertexColorList)
          Copy vertex colors of list to existing array of vertex colors.
 void setVertexFunctions(java.lang.String[][] vertex)
          Copy all vertices of vertex list to existing array of vertices.
 void setVertexNormals(PdVector[] aVertexNormalList)
          Copy vertex normals of list to existing array of vertex normals.
 void setVertexTextures(PdVector[] aVertexTextureList)
          Copy vertex textures of list to existing array of vertex textures.
 void setVertices(PdVector[] vertex)
          Copy all vertices of vertex list to existing array of vertices.
 void showBackface(boolean flag)
          Set flag to enable drawing of backfacing elements whose normal points away from camera.
 void showBoundaries(boolean flag)
          Set flag to enable drawing of boundary curves.
 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 showEdges(boolean flag)
          Set flag to enable drawing of element edges.
 void showElementBackColor(boolean flag)
          Set flag to enable drawing of backface element colors.
 void showElementBackColors(boolean flag)
          Set flag to enable drawing of individual backface element colors.
 void showElementColors(boolean flag)
          Set flag to enable drawing of individual element colors.
 void showElementLabels(boolean flag)
          Set flag to enable drawing of element labels in display.
 void showElementNormalArrow(boolean flag)
          Set flag to enable drawing of arrow of element normal.
 void showElementNormals(boolean flag)
          Set flag to enable drawing of element normals.
 void showElements(boolean flag)
          Set flag to enable drawing of elements.
 void showElementTexture(boolean flag)
          Set flag to enable drawing of vertex texture.
 void showIndices(boolean flag)
          Set flag to drawing of indices in display.
 void showOutline(boolean flag)
          Set flag to enable drawing of outline element edges.
 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 showPolygonLabels(boolean flag)
          Set flag to enable drawing of polygon labels in display.
 void showPolygonNormalArrow(boolean flag)
          Set flag to enable drawing of arrow of polygon normal.
 void showPolygonNormals(boolean flag)
          Set flag to enable drawing of polygon normals.
 void showPolygons(boolean flag)
          Set flag to enable drawing of polygons.
 void showPolygonStartArrow(boolean flag)
          Set flag to enable drawing of arrow at first point of polygons.
 void showVectorArrows(int ind, boolean flag)
          Set flag if tip of vectors is shown as arrow.
 void showVectorColors(int ind, boolean flag)
          Set flag to enable drawing of individual vertex colors of a vector field.
 void showVectorField(int ind, boolean flag)
          Set flag to enable drawing of vectors of a vector field.
 void showVertexColors(boolean flag)
          Set flag to enable drawing of vertex colors.
 void showVertexLabels(boolean flag)
          Set flag to enable drawing of vertex labels in display.
 void showVertexNormalArrow(boolean flag)
          Set flag to enable drawing of arrow of vertex normal.
 void showVertexNormals(boolean flag)
          Set flag to enable drawing of vertex normals.
 void showVertexTexture(boolean flag)
          Set flag to enable drawing of element texture.
 void showVertices(boolean flag)
          Set flag to enable drawing of vertices.
 
Methods inherited from class jv.project.PgGeometry
addDisplay, blend, clearTagElement, clearTagPolygon, copy, fillMethodMenu, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplays, getGeometryInfo, getLabelAttribute, getMaterialPanel, getModelMatrix, getTitle, getVersion, getVersionType, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagElement, hasTagPolygon, intersectionWithLine, isConfigurable, isShowingBndBox, isShowingCenter, isShowingTitle, isVisible, merge, removeDisplay, removeElement, removePolygon, removeVertex, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setGeometryInfo, setLabelAttribute, setLabelAttribute, setModelMatrix, setTagElement, setTagPolygon, setTitle, setVersion, setVersionType, setVisible, showBndBox, showCenter, showTitle, toString, update
 
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

PgJvxSrc

public PgJvxSrc()
Constructs a geometry container whose vertex dimension is initialized to 3. You are advised to call this method rather than PgJvxSrc(int) to avoid problems with the init() method. This constructor explicitly calls the init() method. These problems are due to JAX.
See Also:
#PgJvxSrc(int)
Method Detail

init

public void init()
Initializes and resets geometry.
Overrides:
init in class PgGeometry

setDimOfVertices

public void setDimOfVertices(int dim)
Assign dimension of vertices.

getBounds

public PdVector[] getBounds()
Compute bounding box of the vertices which are transformed with ambient and model matrix.

The two returned bounding box vectors are 3-dimensional. If dimension of vertices is less than 3 then remaining components are zeroed.

Note, transformation not supported yet.

Overrides:
getBounds in class PgGeometry
Returns:
two 3d vectors which are the extremal corners of the bounding cube
See Also:
getAmbientBounds()

getAmbientBounds

public PdVector[] getAmbientBounds()
Compute bounding box of this geometry from the set of all vertices, or return null if no vertices. Method returns two vectors whose size is equal to the dimenstion of this geometry. The two bounding vectors are first, the minimal corner, and second, the maximal corner of the bounding m_dim-cube. Both vectors uniquely determine the bounding box. Note, the bounding box does not include transformations from the ambient or model matrix.
Overrides:
getAmbientBounds in class PgGeometry
Returns:
two vectors which are the extremal corners of the bounding cube
See Also:
getBounds()

setState

public void setState(int aKey,
                     boolean aState)
Set drawing flags of this geometry from within the display. Currently, this method is not intended for public use.
Overrides:
setState in class PgGeometry
Parameters:
aKey - flag to be set, choose among PvGeometryIf.SHOW_...
aState - enable or disable state

getJvx

public PgJvxSrc getJvx()
Fills a geometry object with data from this instance, for example, to print to file.
Overrides:
getJvx in class PgGeometry
Returns:
this instance.

setJvx

public void setJvx(PgJvxSrc src)
Fill this instance with data from a geometry source, for example, previously read from file.
Overrides:
setJvx in class PgGeometry
Parameters:
src - a geometry source used to fill this instance with data.

copy

public void copy(PgJvxSrc src)

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.
Overrides:
clone in class PgGeometry
See Also:
copy(PgJvxSrc)

paint

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

getType

public int getType()
Get type of geometry, for example PvGeometryIf#GEOM_POINT_SET and PvGeometryIf#GEOM_ELEMENT_SET.

setType

public void setType(int type)
Set type of geometry, for example PvGeometryIf#GEOM_POINT_SET and PvGeometryIf#GEOM_ELEMENT_SET. Change display of vertices to default setting depending on geometry type.

getNumVertices

public int getNumVertices()
Get number of vertices in vertex array.

getVertices

public PdVector[] getVertices()
Get vertex array for read and write access, but do not modify the size of any vertex.

getVertexColors

public java.awt.Color[] getVertexColors()
Get vertex color array for read and write access.

getVertexNormals

public PdVector[] getVertexNormals()
Get vertex normal array for read and write access, but do not modify the size of any normal vector.

getVertexTextures

public PdVector[] getVertexTextures()
Get vertex texture array for read and write access, but do not modify the size of any texture vector.

getNumPolygons

public int getNumPolygons()
Get number of allocated and used polygons.

getPolygons

public PiVector[] getPolygons()
Get polygon array for read and write access, but do not modify the size of any polygon.

getPolygonColors

public java.awt.Color[] getPolygonColors()
Get color array for read and write access.

getPolygonNormals

public PdVector[] getPolygonNormals()
Get vertex normal array for read and write access, but do not modify the size of any normal vector.

getNumEdges

public int getNumEdges()
Get number of allocated and used edges.

getEdges

public PiVector[] getEdges()
Get edge array for read and write access, but do not modify the size of any edge.

getEdgeColors

public java.awt.Color[] getEdgeColors()
Get color array for read and write access.

getNumElements

public int getNumElements()
Get number of allocated and used elements.

getElements

public PiVector[] getElements()
Get element array for read and write access, but do not modify the size of any element.

getElementColors

public java.awt.Color[] getElementColors()
Get element color array for read and write access.

getElementBackColors

public java.awt.Color[] getElementBackColors()
Get backside element color array for read and write access.

getElementNormals

public PdVector[] getElementNormals()
Get element normal array for read and write access, but do not modify the size of any normal vector.

getElementTextures

public PdVector[][] getElementTextures()
Get element texture array for read and write access, but do not modify the size of any texture vector.

getNeighbours

public PiVector[] getNeighbours()
Get neighbourhood information.

clearTagVertex

public void clearTagVertex(int anIndex,
                           int aTag)
Clear a single tag of a vertex. For possible tags see PvGeometryIf.
Overrides:
clearTagVertex in class PgGeometry

hasTagVertex

public boolean hasTagVertex(int anIndex,
                            int aTag)
Check whether vertex has given tag. For possible tags see PvGeometryIf.
Overrides:
hasTagVertex in class PgGeometry

setTagVertex

public void setTagVertex(int anIndex,
                         int aTag)
Set a tag of a vertex. For possible tags see PvGeometryIf.
Overrides:
setTagVertex in class PgGeometry

addVertex

public int addVertex(PdVector aVertex)
Add new vertex to the end of the vertex list Method just calls setVertex(numVertices, PdVector).
Overrides:
addVertex in class PgGeometry
Parameters:
PdVector - vertex to be added to vertex list
Returns:
int index of added vertex in vertex list

getVertex

public PdVector getVertex(int anIndex)
Get a reference to an individual vertex.
Overrides:
getVertex in class PgGeometry
Parameters:
anIndex - index of vertex

setVertex

public boolean setVertex(int anIndex,
                         PdVector aVertex)
Copy new vertex to vertex at specified position in the vertex list
Overrides:
setVertex in class PgGeometry
Parameters:
int - index of vertex position
PdVector - vertex to be copied to vertex list
Returns:
boolean false, if index out of range, or argument missing

setNumVertices

public void setNumVertices(int numVertices)
Allocate given number of vertices, and allocate normals, colors etc. if they already exist. The user should change the number of vertices only via this method.
Parameters:
dim - uniform dimension of points, i.e. number of coordinates per point

assureVertexColors

public void assureVertexColors()
Assures respectively allocates correct length of vertex color array. Length of array is equal to length of vertex array.

assureVertexNormals

public void assureVertexNormals()
Assures respectively allocates correct length of vertex normal array. Length of array is equal to length of vertex array. Dimension of normal vectors is equal to dimension of vertices.

assureVertexTextures

public void assureVertexTextures()
Assures respectively allocates correct length of vertex texture array. Length of array is equal to length of vertex array. Dimension of texture coordinates is equal to getDimOfTextures().

getDimOfVectors

public int getDimOfVectors(int ind)
Get uniform number of components of each vector in a vector field.

getNumVectors

public int getNumVectors(int ind)
Get number of vectors in vector field with given index.

setNumVectors

public void setNumVectors(int ind,
                          int num,
                          int dimOfVectors)
Set number of vectors of a vector field with given index.
Parameters:
ind - index of vector field
num - number of vectors in that vector field
dimOfVectors - dim of vectors in that vector field

getNumVectorFields

public int getNumVectorFields()
Get number of allocated and used vector fields.

setNumVectorFields

public void setNumVectorFields(int num)
Set number of allocated and used vector fields.
Parameters:
num - number of vector fields

getVectors

public PdVector[] getVectors(int ind)
Get array of a vectors of a field for read and write access.

setVectors

public void setVectors(int ind,
                       PdVector[] list)
Copy all vectors of vector list to existing array of vectors. Length of argument vector list must be equal or larger than getNumVectors(). All vectors are copied. The dimension of all argument vectors must be equal to getDimOfVectors(ind) of the vector field.
Parameters:
ind - index of vector field
list - array with new vectors

getVectorFieldName

public java.lang.String getVectorFieldName(int ind)
Get name of vector field.

setVectorFieldName

public void setVectorFieldName(int ind,
                               java.lang.String name)
Set name of vector field.

isShowingVectorArrows

public boolean isShowingVectorArrows(int ind)
Get flag if tip of vectors is shown as arrow.

showVectorArrows

public void showVectorArrows(int ind,
                             boolean flag)
Set flag if tip of vectors is shown as arrow.

isVectorElementBased

public boolean isVectorElementBased(int ind)
Get flag whether vector field is element based or vertex based.

setVectorElementBased

public void setVectorElementBased(int ind,
                                  boolean flag)
Set flag whether vector field is element based or vertex based.
Parameters:
ind - index of vector field.
flag - true if element based vf, false if vertex based vf.

setElementBased

public void setElementBased(int ind,
                            boolean flag)
Deprecated. use setVectorElementBased(int, boolean) instead.


isShowingVectorField

public boolean isShowingVectorField(int ind)
Get flag to enable drawing of vectors of a vector field.

showVectorField

public void showVectorField(int ind,
                            boolean flag)
Set flag to enable drawing of vectors of a vector field.

isShowingVectorColors

public boolean isShowingVectorColors(int ind)
Get flag to enable drawing of individual vertex colors of a vector field.

showVectorColors

public void showVectorColors(int ind,
                             boolean flag)
Set flag to enable drawing of individual vertex colors of a vector field.

getGlobalVectorColor

public java.awt.Color getGlobalVectorColor(int ind)
Get global color of vector field which is used if no local colors are available.

setGlobalVectorColor

public boolean setGlobalVectorColor(int ind,
                                    java.awt.Color color)
Set global color of vector field to be used if no local colors are available.

getGlobalVectorLength

public double getGlobalVectorLength(int ind)
Get length factor of vectors of vector field when drawn in display.

setGlobalVectorLength

public boolean setGlobalVectorLength(int ind,
                                     double length)
Set length factor of vectors of vector field when drawn in display.

getGlobalVectorSize

public double getGlobalVectorSize(int ind)
Get thickness in pixels of vectors of vector field when drawn in display.

setGlobalVectorSize

public boolean setGlobalVectorSize(int ind,
                                   double size)
Set thickness in pixels of vectors of vector field when drawn in display.

assureVectorColors

public void assureVectorColors(int ind)
Assures respectively allocates correct length of element color array. Length of array is equal to length of element array.

getVectorFieldColors

public java.awt.Color[] getVectorFieldColors(int ind)
Get color array of a vector field for read and write access.

setVectorColors

public void setVectorColors(int ind,
                            java.awt.Color[] list)
Copy vector colors of list to existing array of vector colors. Length of argument list must be equal or larger than getNumVectors(int).
Parameters:
ind - index of vector field
list - array with new vector colors

setDimOfPolygons

public void setDimOfPolygons(int aSize)
Let all polygons have same number of vertices aSize<>0, or individual aSize=-1. It is more efficient to call method before setNumPolygons().
Parameters:
aSize - Number of vertices for all polygons.
See Also:
PgPolygonSet#setNumPolygons(int)

setNumPolygons

public void setNumPolygons(int numPolygons)
Allocate given number of polygons, and allocate normals, colors etc. if they already exist. The user should change the number of polygons only via this method. If dimension of polygons is '-1' then only the polygon array is allocated and not the individual polygons.

assurePolygonColors

public void assurePolygonColors()
Assures respectively allocates correct length of polygon color array. Length of array is equal to length of polygon array.

assurePolygonNormals

public void assurePolygonNormals()
Assures respectively allocates correct length of polygon normal array. Length of array is equal to length of polygon array. Dimension of normal vectors is equal to dimension of vertices.

setNumEdges

public void setNumEdges(int aNumEdges,
                        int dimOfEdges)
Allocate given number of edges, and allocate normals, colors etc. if they already exist. The user should change the number of edges only via this method. If dimension of edges is '-1' then only the edge array is allocated and not the individual edges.

assureEdgeColors

public void assureEdgeColors()
Assures respectively allocates correct length of edge color array. Length of array is equal to length of edge array.

setDimOfElements

public void setDimOfElements(int aSize)
Let all elements have same number of vertices aSize<>0, or individual aSize=-1. It is more efficient to call method before setNumElements().

Argument must be -1 or >=3. Other values lead to a warning message.

Parameters:
aSize - Number of vertices for all elements.
See Also:
setNumElements(int)

setNumElements

public void setNumElements(int numElements)
Allocate given number of elements, and allocate neighbours, normals, colors etc. if they already exist. The user should change the number of elements only via this method. If dimension of elements is '-1' then only the element array is allocated and not the individual elements.

assureNeighbours

public void assureNeighbours()
Assures correct length of neighbour array and, if any length changes, initializes with -1. Length of array is equal to all lengths of element array. Variable m_dimOfElements is used to determine length of neighbour array for each element if m_dimOfElement!=-1. Initialization of neighbour array with -1 marks each edge as boundary edge.

If neighbour array or any individual vector changes length, then neighbour is set to -1.


assureElementColors

public void assureElementColors()
Assures respectively allocates correct length of element color array. Length of array is equal to length of element array.

assureElementBackColors

public void assureElementBackColors()
Assures respectively allocates correct length of element back face color array. Length of array is equal to length of element array.

assureElementNormals

public void assureElementNormals()
Assures respectively allocates correct length of element normal array. Length of array is equal to length of element array. Dimension of normal vectors is equal to dimension of vertices.

assureElementTextures

public void assureElementTextures()
Assures respectively allocates correct length of element texture array. Length of array is equal to length of element array. Dimension of normal vectors is equal to getDimOfTextures(). Texture values are lost if number of elements changes.

getGlobalVertexColor

public java.awt.Color getGlobalVertexColor()
Get global vertex color which is used if no local colors are available.

getGlobalVertexTagColor

public java.awt.Color getGlobalVertexTagColor()
Get global color of tagged vertices.

getGlobalVertexSize

public double getGlobalVertexSize()
Get global radius in pixels of circle to visualize vertices in display.

getGlobalVertexNormalColor

public java.awt.Color getGlobalVertexNormalColor()
Get global vertex normal color which is used if no local colors are available.

getGlobalVertexNormalLength

public double getGlobalVertexNormalLength()
Get length factor of vertex normal vectors when drawn in display.

getGlobalVertexNormalSize

public double getGlobalVertexNormalSize()
Get thickness in pixels of vertex normals when drawn in display.

setGlobalVertexColor

public void setGlobalVertexColor(java.awt.Color color)
Set global vertex color to be used if no local colors are available.

setGlobalVertexTagColor

public void setGlobalVertexTagColor(java.awt.Color color)
Set global color of tagged vertices.

setGlobalVertexSize

public void setGlobalVertexSize(double size)
Set global radius in pixels of circle to visualize vertices in display.

setGlobalVertexNormalColor

public void setGlobalVertexNormalColor(java.awt.Color color)
Set global vertex normal color to be used if no local colors are available.

setGlobalVertexNormalLength

public void setGlobalVertexNormalLength(double length)
Get length factor of vertex normal vectors when drawn in display.

setGlobalVertexNormalSize

public void setGlobalVertexNormalSize(double size)
Get thickness in pixels of vertex normals when drawn in display.

getGlobalPolygonColor

public java.awt.Color getGlobalPolygonColor()
Get global polygon color which is used if no local colors are available.

getGlobalPolygonTagColor

public java.awt.Color getGlobalPolygonTagColor()
Get global color of tagged vertices.

getGlobalPolygonSize

public double getGlobalPolygonSize()
Get global radius in pixels of circle to visualize vertices in display.

getGlobalPolygonNormalColor

public java.awt.Color getGlobalPolygonNormalColor()
Get global polygon normal color which is used if no local colors are available.

getGlobalPolygonNormalLength

public double getGlobalPolygonNormalLength()
Get length factor of normal vectors when drawn in display.

getGlobalPolygonNormalSize

public double getGlobalPolygonNormalSize()
Get thickness in pixels of normals when drawn in display.

setGlobalPolygonColor

public void setGlobalPolygonColor(java.awt.Color color)
Set global polygon color to be used if no local colors are available.

setGlobalPolygonTagColor

public void setGlobalPolygonTagColor(java.awt.Color color)
Set global color of tagged vertices.

setGlobalPolygonSize

public void setGlobalPolygonSize(double size)
Set global radius in pixels of circle to visualize vertices in display.

setGlobalPolygonNormalColor

public void setGlobalPolygonNormalColor(java.awt.Color color)
Set global polygon normal color to be used if no local colors are available.

setGlobalPolygonNormalLength

public void setGlobalPolygonNormalLength(double length)
Get length factor of normal vectors when drawn in display.

setGlobalPolygonNormalSize

public void setGlobalPolygonNormalSize(double size)
Get thickness in pixels of normals when drawn in display.

getGlobalEdgeColor

public java.awt.Color getGlobalEdgeColor()
Get global edge color which is used if no local colors are available.

getGlobalEdgeTagColor

public java.awt.Color getGlobalEdgeTagColor()
Get global color of tagged vertices.

getGlobalEdgeSize

public double getGlobalEdgeSize()
Get global radius in pixels of circle to visualize vertices in display.

setGlobalEdgeColor

public void setGlobalEdgeColor(java.awt.Color color)
Set global edge color to be used if no local colors are available.

setGlobalEdgeTagColor

public void setGlobalEdgeTagColor(java.awt.Color color)
Set global color of tagged vertices.

setGlobalEdgeSize

public void setGlobalEdgeSize(double size)
Set global radius in pixels of circle to visualize vertices in display.

getGlobalElementColor

public java.awt.Color getGlobalElementColor()
Get global element color which is used if no local colors are available.

getGlobalElementBackColor

public java.awt.Color getGlobalElementBackColor()
Get global color of backface of elements.

getGlobalElementTagColor

public java.awt.Color getGlobalElementTagColor()
Get global color of tagged elements.

getGlobalElementNormalColor

public java.awt.Color getGlobalElementNormalColor()
Get global element normal color which is used if no local colors are available.

getGlobalElementNormalLength

public double getGlobalElementNormalLength()
Get length factor of normal vectors when drawn in display.

getGlobalElementNormalSize

public double getGlobalElementNormalSize()
Get thickness in pixels of normals when drawn in display.

setGlobalElementColor

public void setGlobalElementColor(java.awt.Color color)
Set global vertex color to be used if no local colors are available.

setGlobalElementBackColor

public void setGlobalElementBackColor(java.awt.Color color)
Set global color of backface of elements.

setGlobalElementTagColor

public void setGlobalElementTagColor(java.awt.Color color)
Set global color of tagged elements.

setGlobalElementNormalColor

public void setGlobalElementNormalColor(java.awt.Color color)
Set global element normal color to be used if no local colors are available.

setGlobalElementNormalLength

public void setGlobalElementNormalLength(double length)
Get length factor of normal vectors when drawn in display.

setGlobalElementNormalSize

public void setGlobalElementNormalSize(double size)
Get thickness in pixels of normals when drawn in display.

getGlobalBndColor

public java.awt.Color getGlobalBndColor()
Get global boundary color which is used if no local colors are available.

getGlobalBndTagColor

public java.awt.Color getGlobalBndTagColor()
Get global color of tagged boundaries.

getGlobalBndSize

public double getGlobalBndSize()
Get thickness in pixels of boundary when drawn in display.

setGlobalBndColor

public void setGlobalBndColor(java.awt.Color color)
Set global boundary color to be used if no local colors are available.

setGlobalBndTagColor

public void setGlobalBndTagColor(java.awt.Color color)
Set global color of tagged boundaries.

setGlobalBndSize

public void setGlobalBndSize(double size)
Set thickness in pixels of boundary when drawn in display.

setVertices

public void setVertices(PdVector[] vertex)
Copy all vertices of vertex list to existing array of vertices. Length of argument vertex list must be equal or larger than getNumVertices(). All vertices are copied. The dimension of all argument vertices must be equal to getDimOfVertices() of the geometry.
Parameters:
vertex - array with new vertices

getVertexFunctions

public java.lang.String[][] getVertexFunctions()

setVertexFunctions

public void setVertexFunctions(java.lang.String[][] vertex)
Copy all vertices of vertex list to existing array of vertices. Length of argument vertex list must be equal or larger than getNumVertices(). All vertices are copied. The dimension of all argument vertices must be equal to getDimOfVertices() of the geometry.
Parameters:
vertex - array with new vertices

setVertexColors

public void setVertexColors(java.awt.Color[] aVertexColorList)
Copy vertex colors of list to existing array of vertex colors. Length of argument list must be equal or larger than getNumVertices(). All vertex colors are copied. The dimension of all argument colors must be equal to getDimOfColors() of the geometry.
Parameters:
aVertexColorList - array with new vertex colors

setVertexNormals

public void setVertexNormals(PdVector[] aVertexNormalList)
Copy vertex normals of list to existing array of vertex normals. Length of argument list must be equal or larger than getNumVertices(). All vertex normals are copied. The dimension of all argument normals must be equal to getDimOfVectors() of the geometry.
Parameters:
aVertexNormalList - array with new vertex normals

setVertexTextures

public void setVertexTextures(PdVector[] aVertexTextureList)
Copy vertex textures of list to existing array of vertex textures. Length of argument list must be equal or larger than getNumVertices(). All vertex textures are copied. The dimension of all argument textures must be equal to getDimOfTextures() of the geometry.
Parameters:
aVertexTextureList - array with new vertex textures

getTextureImageName

public java.lang.String getTextureImageName()
Get name of texture image, a URL or full path name.
Overrides:
getTextureImageName in class PgGeometry

setTextureImageName

public void setTextureImageName(java.lang.String image)
Set file name of texture image as relative path or protocoll.
Overrides:
setTextureImageName in class PgGeometry

getTextureImage

public java.awt.Image getTextureImage()
Get image of texture.
Overrides:
getTextureImage in class PgGeometry

setTextureImage

public void setTextureImage(java.awt.Image image)
Set image of texture.
Overrides:
setTextureImage in class PgGeometry

setPolygons

public void setPolygons(PiVector[] polygon)
Copy the first m_numPolygons of given array into polygon array. Must call #setNumPolygons(int) before to allocate argument array. If argment array too small do nothing.
Parameters:
polygon - array of polygon vectors to be copied

setPolygonColors

public void setPolygonColors(java.awt.Color[] color)
Copy polygon colors of list to existing array of polygon colors. Length of argument list must be equal or larger than getNumPolygons().
Parameters:
color - array with new polygon colors

setPolygonNormals

public void setPolygonNormals(PdVector[] normal)
Copy polygon normals of list to existing array of polygon normals. Length of argument list must be equal or larger than getNumPolygons(). All polygon normals are copied. The dimension of all argument normals must be equal to getDimOfVectors() of the geometry.
Parameters:
normal - array with new polygon normals

addPolygon

public int addPolygon(PiVector anPolygon)
Add new polygon to the end of the polygon list. Method just calls setPolygon(PiVector, numPolygons).
Overrides:
addPolygon in class PgGeometry
Parameters:
PiVector - polygon to be added to polygon list
Returns:
int index of added polygon in polygon list

getPolygon

public PiVector getPolygon(int anIndex)
Get a reference to index vector of polygon with given index.
Overrides:
getPolygon in class PgGeometry
Following copied from interface: jv.project.PgGeometryIf
Parameters:
anIndex - index of polygon to be returned
Returns:
reference to polygon vector with given index

setPolygon

public boolean setPolygon(int anIndex,
                          PiVector aPolygon)
Set index vector of polygon with given index. Copy new polygon to polygon at specified position in the polygon list. Number of polygons is increased if required.
Overrides:
setPolygon in class PgGeometry
Parameters:
anIndex - index of polygon
aPolygon - array with indices of new polygon
Returns:
boolean false, if index out of range, or argument missing

setEdges

public void setEdges(PiVector[] edge)
Copy the first m_numEdges of given array into edge array. Must call #setNumEdges(int, int) before to allocate argument array. If argment array too small do nothing.
Parameters:
edge - array of edge vectors to be copied

setEdgeColors

public void setEdgeColors(java.awt.Color[] color)
Copy edge colors of list to existing array of edge colors. Length of argument list must be equal or larger than getNumEdges().
Parameters:
color - array with new edge colors

addEdge

public int addEdge(PiVector anEdge)
Add new edge to the end of the edge list. Method just calls setEdge(PiVector, numEdges).
Parameters:
PiVector - edge to be added to edge list
Returns:
int index of added edge in edge list

getEdge

public PiVector getEdge(int anIndex)
Get a reference to index vector of edge with given index.

setEdge

public boolean setEdge(int anIndex,
                       PiVector aEdge)
Set index vector of edge with given index. Copy new edge to edge at specified position in the edge list. Number of edges is increased if required.
Parameters:
anIndex - index of edge
aEdge - array with indices of new edge
Returns:
boolean false, if index out of range, or argument missing

setElements

public void setElements(PiVector[] element)
Copy the first m_numElements of given array into element array. Must call #setNumElements(int) before to allocate argument array. If argment array too small do nothing. If dimension of an element exceeds maxDimOfElements then its length is truncated to this value.
Parameters:
element - array of element vectors to be copied

setElementColors

public void setElementColors(java.awt.Color[] color)
Copy element colors of list to existing array of element colors. Length of argument list must be equal or larger than getNumElements().
Parameters:
color - array with new element colors

setElementBackColors

public void setElementBackColors(java.awt.Color[] color)
Copy backface element colors of list to existing array of element colors. Length of argument list must be equal or larger than getNumElements().
Parameters:
color - array with new element colors

setElementNormals

public void setElementNormals(PdVector[] normal)
Copy element normals of list to existing array of element normals. Length of argument list must be equal or larger than getNumElements(). All element normals are copied. The dimension of all argument normals must be equal to getDimOfVectors() of the geometry.
Parameters:
normal - array with new element normals

setElementTextures

public void setElementTextures(PdVector[][] texCoords)
Copy element textures of list to existing array of element textures. Length of argument list must be equal or larger than getNumElements(). All element textures are copied. The dimension of all argument textures must be equal to getDimOfTextures() of the geometry.
Parameters:
texCoords - array with new element textures

setNeighbours

public void setNeighbours(PiVector[] neighbour)
Copy neighbour array to existing array of neighbours. Length of argument list must be equal or larger than getNumElements(). All neighbour information is copied.
Parameters:
neighbour - array with neighbour information

addElement

public int addElement(PiVector anElement)
Add element to the element list and increase number of elements. Method increases the number of elements and calls setElement(int, PiVector). If dimension of element exceeds maxDimOfElements then length of element is truncated to this value.
Overrides:
addElement in class PgGeometry
Parameters:
PiVector - element to be added to element list
Returns:
int index of added element in element list

getElement

public PiVector getElement(int anIndex)
Get a reference to an individual element.
Overrides:
getElement in class PgGeometry
Parameters:
anIndex - index of element

setElement

public boolean setElement(int anIndex,
                          PiVector newElem)
Assign element data to an existing element. Copy new vertex indices to element at specified position in the element list. If dimension of element exceeds maxDimOfElements then length of element is truncated to this value.
Overrides:
setElement in class PgGeometry
Parameters:
anIndex - index of element
newElem - vector with new indices of element
Returns:
boolean false, if element and array have different

isDefaultLabelEnabled

public boolean isDefaultLabelEnabled()
Determine whether drawing of default labels, i.e. item indices, is enabled. Usually, the default label is the index of an item in an array. For example, the index of a vertex in the vertex array of a point set. On default, usage of default labels is enabled.
See Also:
isShowingIndices()

isShowingIndices

public boolean isShowingIndices()
Check whether showing of indices is switched on. If no label is specified for an item the a default label is drawing.
See Also:
isDefaultLabelEnabled(), #setDefaultLabelEnabled(int)

isShowingVertexLabels

public boolean isShowingVertexLabels()
Determine whether showing of vertex labels is enabled.

isShowingPolygonLabels

public boolean isShowingPolygonLabels()
Determine whether showing of polygon labels is enabled.

isShowingEdgeLabels

public boolean isShowingEdgeLabels()
Determine whether showing of edge labels is enabled.

isShowingElementLabels

public boolean isShowingElementLabels()
Determine whether showing of element labels is enabled.

isShowingVertices

public boolean isShowingVertices()
Determines whether drawing of vertices is enabled.

isShowingVertexNormals

public boolean isShowingVertexNormals()
Determines whether drawing of vertex normals is enabled.

isShowingVertexNormalArrow

public boolean isShowingVertexNormalArrow()
Determines whether drawing of arrow of vertex normals is enabled.

isShowingVertexColors

public boolean isShowingVertexColors()
Determines whether drawing of vertex colors is enabled.

isShowingOutline

public boolean isShowingOutline()
Determines whether drawing of outline element edges is enabled.

setDefaultLabelEnabled

public void setDefaultLabelEnabled(boolean flag)
Determine whether drawing of default labels, i.e. item indices, is enabled. Usually, the default label is the index of an item in an array. For example, the index of a vertex in the vertex array of a point set. On default, usage of of default labels is enabled.
See Also:
#showIndices(int)

showIndices

public void showIndices(boolean flag)
Set flag to drawing of indices in display. If no label is specified for an item the a default label is drawing. Usually, the default label is the index of an item in an array. For example, the index of a vertex in the vertex array of a point set. On default, showing of labels is disabled.
See Also:
isDefaultLabelEnabled(), setDefaultLabelEnabled(boolean)

showVertexLabels

public void showVertexLabels(boolean flag)
Set flag to enable drawing of vertex labels in display.

showPolygonLabels

public void showPolygonLabels(boolean flag)
Set flag to enable drawing of polygon labels in display.

showEdgeLabels

public void showEdgeLabels(boolean flag)
Set flag to enable drawing of edge labels in display.

showElementLabels

public void showElementLabels(boolean flag)
Set flag to enable drawing of element labels in display.

showVertices

public void showVertices(boolean flag)
Set flag to enable drawing of vertices.

showVertexNormals

public void showVertexNormals(boolean flag)
Set flag to enable drawing of vertex normals.

showVertexNormalArrow

public void showVertexNormalArrow(boolean flag)
Set flag to enable drawing of arrow of vertex normal.

showVertexColors

public void showVertexColors(boolean flag)
Set flag to enable drawing of vertex colors.

showOutline

public void showOutline(boolean flag)
Set flag to enable drawing of outline element edges.

isShowingPolygons

public boolean isShowingPolygons()
Determines whether drawing of polygons is enabled.

isShowingPolygonNormals

public boolean isShowingPolygonNormals()
Determines whether drawing of polygon normals is enabled.

isShowingPolygonNormalArrow

public boolean isShowingPolygonNormalArrow()
Determines whether drawing of arrow of polygon normals is enabled.

isShowingPolygonColors

public boolean isShowingPolygonColors()
Determines whether drawing of polygon colors is enabled.

isShowingPolygonStartArrow

public boolean isShowingPolygonStartArrow()
Determine whether drawing of arrow at first point of polygon is enabled.

isShowingPolygonEndArrow

public boolean isShowingPolygonEndArrow()
Determine whether drawing of arrow at last point of polygon is enabled.

showPolygons

public void showPolygons(boolean flag)
Set flag to enable drawing of polygons.

showPolygonNormals

public void showPolygonNormals(boolean flag)
Set flag to enable drawing of polygon normals.

showPolygonNormalArrow

public void showPolygonNormalArrow(boolean flag)
Set flag to enable drawing of arrow of polygon normal.

showPolygonColors

public void showPolygonColors(boolean flag)
Set flag to enable drawing of polygon colors.

showPolygonStartArrow

public void showPolygonStartArrow(boolean flag)
Set flag to enable drawing of arrow at first point of polygons.

showPolygonEndArrow

public void showPolygonEndArrow(boolean flag)
Set flag to enable drawing of arrow at last point of polygons.

isShowingEdges

public boolean isShowingEdges()
Determines whether drawing of element edges is enabled.

isShowingEdgeColors

public boolean isShowingEdgeColors()
Determines whether drawing of edge colors is enabled.

showEdges

public void showEdges(boolean flag)
Set flag to enable drawing of element edges.

showEdgeColors

public void showEdgeColors(boolean flag)
Set flag to enable drawing of edge colors.

isShowingElements

public boolean isShowingElements()
Determines whether drawing of elements is enabled.

isShowingBackface

public boolean isShowingBackface()
Determine flag to enable drawing of backfacing elements whose normal points away from camera.

isShowingElementNormals

public boolean isShowingElementNormals()
Determines whether drawing of element normals is enabled.

isShowingElementNormalArrow

public boolean isShowingElementNormalArrow()
Determines whether drawing of arrow of element normals is enabled.

isShowingElementColors

public boolean isShowingElementColors()
Determines whether drawing of individual element colors is enabled.

isShowingElementBackColor

public boolean isShowingElementBackColor()
Determines whether drawing of global backface element color is enabled.

isShowingElementBackColors

public boolean isShowingElementBackColors()
Determines whether drawing of individual backface element colors is enabled.

isShowingBoundaries

public boolean isShowingBoundaries()
Determines whether drawing of boundary curves is enabled.

isShowingVertexTexture

public boolean isShowingVertexTexture()
Determines whether drawing of vertex texture is enabled.

isShowingElementTexture

public boolean isShowingElementTexture()
Determines whether drawing of element texture is enabled.

showElements

public void showElements(boolean flag)
Set flag to enable drawing of elements.

showBackface

public void showBackface(boolean flag)
Set flag to enable drawing of backfacing elements whose normal points away from camera. If element set has no element normals then method creates element normals.

showElementNormals

public void showElementNormals(boolean flag)
Set flag to enable drawing of element normals.

showElementNormalArrow

public void showElementNormalArrow(boolean flag)
Set flag to enable drawing of arrow of element normal.

showElementColors

public void showElementColors(boolean flag)
Set flag to enable drawing of individual element colors.

showElementBackColor

public void showElementBackColor(boolean flag)
Set flag to enable drawing of backface element colors.

showElementBackColors

public void showElementBackColors(boolean flag)
Set flag to enable drawing of individual backface element colors.

showBoundaries

public void showBoundaries(boolean flag)
Set flag to enable drawing of boundary curves.

showVertexTexture

public void showVertexTexture(boolean flag)
Set flag to enable drawing of element texture.

showElementTexture

public void showElementTexture(boolean flag)
Set flag to enable drawing of vertex texture.

makeQuadrConn

public void makeQuadrConn(int uDiscr,
                          int vDiscr,
                          boolean uClosed,
                          boolean vClosed)
Generate element and neighbourhood information for a quadrilateral surface. Method generates only topological information, no coordinates are required.
Parameters:
uDiscr, - vDiscr Number of lines in u and v direction.
See Also:
PgElementSet#makeCylinderConn(int, int)

makeElementNormals

public boolean makeElementNormals()
Compute element normals from edge crossproducts. For each element, a normal is computed at each of its vertices as the crossproduct of the adjacent edges. These vertex normals are then added, and the normalized sum used as element normal. This strategy reduces the effect of non-planar elements.

Method exists in this class to allow enabling of backface culling even if no element normals have been previously supplied by user.


makeElementColorsFromXYZ

public boolean makeElementColorsFromXYZ()
Create color from the element position within its bounding box which is interpreted as RGB cube. If dimension of vertices is smaller than three then only the first vertex components are used in the color computation.

reflect

public PgGeometry reflect(PdMatrix mat,
                          boolean bOrient,
                          boolean bVector)
Generate a cloned geometry and transform vertices by a matrix. For example, this method is called to calculate mirror images of a geometry. Orientation of geometry affects surface vectors.
Overrides:
reflect in class PgGeometry
Parameters:
mat - 3*3 or 4*4 transformation matrix
bOrient - flag whether to keep the orientation of the geometry
bVector - flag whether to keep the orientation of vectors
Returns:
new reflected copy of the geometry

JavaView® v2.12

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