JavaView® v2.12

jv.project
Interface PgGeometryIf

All Superinterfaces:
java.lang.Cloneable, PsUpdateIf
All Known Implementing Classes:
PgGeometry

public interface PgGeometryIf
extends PsUpdateIf, java.lang.Cloneable

This interface must be implemented by all geometries to allow registration and rendering in a display of JavaView. Displays call the method paint(PvGeometryIf) of a registered geometry where the geometry should pass its data to the display. paint() is the most important method of this interface.

An implementation of the interface must assure that whenever a geometry has changed such that an update of the display is required, the update method of the display is called with the geometry as argument.

         disp.update(geom)
 
Then display automatically calls the method geom.paint(PvGeometryIf) to request data from geometry. Each display in JavaView implements the interface PvDisplayIf to be able to handle geometries implementing the interface PgGeometryIf.

The interface PgGeometryIf is implemented by PgGeometry. By subclassing from PgGeometry the user only needs to override a few methods.

The class_name for info/control/material panel and methodMenu must follow special rules namely:

         "name of main class"+"_CP"
         "name of main class"+"_IP"
         "name of main class"+"_MP"
         "name of main class"+"_Menu"
 

Version:
03.06.01, 3.30 revised (kp) Texture added.
06.05.01, 3.20 revised (kp) Hyperbolic and spherical ambient spaces added.
16.11.00, 3.10 revised (kp) New method to reflect geometries.
08.10.00, 3.01 revised (kp) PROJ_STEREO renamed to PROJ_STEREOGRAPHIC.
02.04.00, 3.00 revised (kp) PdColor replaced with Color in lists.
05.03.00, 2.10 created (kp) Methods showIndices() and isShowingIndices() moved to PgPointSet.
04.03.00, 2.00 created (kp) Interface split into this and PgGeometrySrcIf.
29.12.99, 1.30 created (kp) Ambient spaces and their projections added.
21.12.99, 1.20 created (kp) Model matrix handling added.
30.09.99, 1.10 created (kp) Methods to print indices in display added.
09.02.98, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
PgGeometry, PgGeometrySrcIf, PvDisplayIf, PvDisplay, PvDisplayIf

Field Summary
static int AMBIENT_H2_HYPERBOLIC
          Ambient space is hyperbolic 2d space in R3_L, used in model transformations.
static int AMBIENT_H3_HYPERBOLIC
          Ambient space is hyperbolic 3d space in R3_L, used in model transformations.
static int AMBIENT_H4_HYPERBOLIC
          Ambient space is hyperbolic 4d space in R5_L, used in model transformations.
static java.lang.String[][] AMBIENT_PROJECTIONS
          List of names of projection methods from ambient spaces.
static int AMBIENT_R1_EUCLIDEAN
          Ambient space is 1d-euclidean, used in model transformations.
static int AMBIENT_R2_EUCLIDEAN
          Ambient space is 2d-euclidean, used in model transformations.
static int AMBIENT_R3_EUCLIDEAN
          Ambient space is 3d-euclidean, used in model transformations.
static int AMBIENT_R4_EUCLIDEAN
          Ambient space is 4d-euclidean, used in model transformations.
static int AMBIENT_R5_EUCLIDEAN
          Ambient space is 5d-euclidean, used in model transformations.
static int AMBIENT_S1_SPHERE
          Ambient space is unit circle in 2d-euclidean, used in model transformations.
static int AMBIENT_S2_SPHERE
          Ambient space is unit sphere in R3, used in model transformations.
static int AMBIENT_S3_SPHERE
          Ambient space is unit sphere in R4, used in model transformations.
static int AMBIENT_S4_SPHERE
          Ambient space is unit sphere in R5, used in model transformations.
static java.lang.String[][] AMBIENT_SPACES
          List of names of possible ambient spaces of geometries.
static java.lang.String INSPECTOR_CONTROL
          Name of default control panel under which panel is registered in panel list.
static java.lang.String INSPECTOR_CONTROL_EXT
          File name suffix of control panel class to name of base class.
static java.lang.String INSPECTOR_MATERIAL
          Name of default material panel under which panel is registered in panel list.
static java.lang.String INSPECTOR_MATERIAL_EXT
          File name suffix of material panel class to name of base class.
static java.lang.String INSPECTOR_TEXTURE
          Name of default texture panel under which panel is registered in panel list.
static java.lang.String INSPECTOR_TEXTURE_EXT
          File name suffix of texture panel class to name of base class.
static int LABEL_BASE
           
static int LABEL_CENTER
           
static int LABEL_HEAD
           
static int LABEL_MIDDLE
           
static int LABEL_TAIL
           
static int LABEL_TOP
           
static java.lang.String METHOD_EXT
          File name suffix of menu class to name of base class.
static int PROJ_KLEIN_BALL
          Projection into Klein's hyperbolic sphere, used in model transformations.
static int PROJ_PARALLEL
          Parallel projection, used in model transformations.
static int PROJ_POINCARE_BALL
          Conformal projection into Poincare's sphere, used in model transformations.
static int PROJ_STEREOGRAPHIC
          Stereographic projection, used in model transformations.
static int PROJ_UPPER_HALFSPACE
          Conformal projection into Poincare's hyperbolic upper half space model, used in model transformations.
 
Method Summary
 boolean addDisplay(PvDisplayIf display)
          Register a new display to render the geometry.
 int addElement(PiVector aElement)
          Add a vector to a geometry, probably at the end of its element array.
 int addPolygon(PiVector aPolygon)
          Add a polygon to a geometry, probably at the end of its polygon array.
 int addVertex(PdVector aVertex)
          Add a vector to a geometry, probably at the end of its vertex array.
 PsPanel assureInspector(java.lang.String type, java.lang.String ext)
          Get a certain panel - if it does not exist then try to allocate it.
 boolean blend(double s, PgGeometry a, double t, PgGeometry b)
          Interpolate between two geometries, for example, in a smooth animation.
 void clearTagElement(int index, int aTag)
          Clear a single tag of an element.
 void clearTagPolygon(int index, int aTag)
          Clear a single tag of a polygon.
 void clearTagVertex(int index, 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.
 java.awt.Menu fillMethodMenu(java.awt.Menu aMenu)
          Fill menu with items to invoke advanced methods of this geometry.
 PdMatrix getAmbientInvMatrix()
          Get a reference of the ambient inverse model matrix of geometry.
 PdMatrix getAmbientMatrix()
          Get a reference of the ambient model matrix of geometry.
 int getAmbientProjection()
          Get projection mode of ambient space used in model transformations.
 int getAmbientSpace()
          Get ambient space used in model transformations.
 PsPanel getControlPanel()
          Deprecated. use assureInspector(String, String)
 int getDimOfSimplex()
          Get dimension of simplicial complex, i.e. maximal dimension of occurring simplices.
 int getDimOfVertices()
          Get dimension of points used in geometry, i.e. the number coordinates per point.
 java.util.Enumeration getDisplays()
          Get all registered displays as Enumeration.
 PiVector getElement(int anIndex)
          Return reference to element with given index.
 PsPanel getInfoPanel()
          Get info panel - if it does not exist try to allocate it.
 PgJvxSrc getJvx()
          Fills a geometry object with data from this instance, for example, to print to file.
 PsPanel getMaterialPanel()
          Deprecated. use assureInspector(String, String)
 PdMatrix getModelMatrix()
          Get model matrix of geometry.
 java.lang.String getName()
          Name of geometry, should be unique inside JavaView.
 PiVector getPolygon(int anIndex)
          Return reference to polygon with given index.
 java.awt.Image getTextureImage()
          Get image of texture.
 java.lang.String getTextureImageName()
          Get name of texture image, a full URL or a relative file name.
 PdVector getVertex(int anIndex)
          Return reference to vertex with given index anIndex.
 boolean hasAmbientMatrix()
          Check for ambient model matrix of geometry.
 boolean hasDisplay(PvDisplayIf display)
          Check for a registered display by name.
 boolean hasModelMatrix()
          Check for model matrix of geometry.
 boolean hasTagElement(int index, int aTag)
          Check whether element has given tag.
 boolean hasTagPolygon(int index, int aTag)
          Check whether polygon has given tag.
 boolean hasTagVertex(int index, int aTag)
          Check whether vertex has given tag.
 PvPickEvent intersectionWithLine(PdVector base, PdVector dir)
          Find intersection with ray.
 boolean isConfigurable(int panel)
          Check whether class has a configuration panel to configure it.
 boolean isVisible()
          Check flag whether geometry is selected to be hidden or not in display.
 boolean merge(PgGeometryIf geom)
          Add another geometry of same type to this geometry.
 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.
 boolean removeDisplay(PvDisplayIf display)
          Remove a registered display from list of registered displays.
 int[] removeElement(int anIndex)
          Remove an element with given index.
 int[] removePolygon(int anIndex)
          Remove polygon with given index.
 int[] removeVertex(int anIndex)
          Remove vertex with given index.
 void setAmbientMatrix(PdMatrix ambientMat, PdMatrix ambientInvMat)
          Set ambient model matrix of geometry and its inverse.
 void setAmbientProjection(int mode)
          Set projection mode of ambient space used in model transformations.
 void setAmbientSpace(int mode)
          Set ambient space used in model transformations.
 boolean setElement(int anIndex, PiVector aElement)
          Allow setting the vertex indices of a single element.
 void setJvx(PgJvxSrc src)
          Fill this instance with data from a geometry source, for example, previously read from file.
 void setModelMatrix(PdMatrix modelMat)
          Set model matrix of geometry.
 void setName(java.lang.String name)
          Set name of geometry, should be unique inside JavaView.
 boolean setPolygon(int anIndex, PiVector aPolygon)
          Allow setting the vertex indices of a single polygon.
 void setState(int aKey, boolean aState)
          Set drawing flags of this geometry from within the display.
 void setTagElement(int index, int aTag)
          Set a tag of an element.
 void setTagPolygon(int index, int aTag)
          Set a tag of a polygon.
 void setTagVertex(int index, int aTag)
          Set a tag of a vertex.
 void setTextureImage(java.awt.Image img)
          Set texture image for vertex and element textures.
 void setTextureImageName(java.lang.String name)
          Set name of texture image, a URL or a relative file name.
 boolean setVertex(int anIndex, PdVector aVertex)
          Allow setting the coordinates of a single vertex.
 void setVisible(boolean flag)
          Set geometry to be hidden or visible in display.
 java.lang.String toString()
          Get a detailed string representation of object, usually rather long.
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent, update
 

Field Detail

INSPECTOR_CONTROL_EXT

public static final java.lang.String INSPECTOR_CONTROL_EXT
File name suffix of control panel class to name of base class.

INSPECTOR_MATERIAL_EXT

public static final java.lang.String INSPECTOR_MATERIAL_EXT
File name suffix of material panel class to name of base class.

INSPECTOR_TEXTURE_EXT

public static final java.lang.String INSPECTOR_TEXTURE_EXT
File name suffix of texture panel class to name of base class.

METHOD_EXT

public static final java.lang.String METHOD_EXT
File name suffix of menu class to name of base class.

INSPECTOR_CONTROL

public static final java.lang.String INSPECTOR_CONTROL
Name of default control panel under which panel is registered in panel list.

INSPECTOR_MATERIAL

public static final java.lang.String INSPECTOR_MATERIAL
Name of default material panel under which panel is registered in panel list.

INSPECTOR_TEXTURE

public static final java.lang.String INSPECTOR_TEXTURE
Name of default texture panel under which panel is registered in panel list.

LABEL_TOP

public static final int LABEL_TOP

LABEL_MIDDLE

public static final int LABEL_MIDDLE

LABEL_BASE

public static final int LABEL_BASE

LABEL_HEAD

public static final int LABEL_HEAD

LABEL_CENTER

public static final int LABEL_CENTER

LABEL_TAIL

public static final int LABEL_TAIL

AMBIENT_R1_EUCLIDEAN

public static final int AMBIENT_R1_EUCLIDEAN
Ambient space is 1d-euclidean, used in model transformations.

AMBIENT_R2_EUCLIDEAN

public static final int AMBIENT_R2_EUCLIDEAN
Ambient space is 2d-euclidean, used in model transformations.

AMBIENT_S1_SPHERE

public static final int AMBIENT_S1_SPHERE
Ambient space is unit circle in 2d-euclidean, used in model transformations.

AMBIENT_R3_EUCLIDEAN

public static final int AMBIENT_R3_EUCLIDEAN
Ambient space is 3d-euclidean, used in model transformations.

AMBIENT_S2_SPHERE

public static final int AMBIENT_S2_SPHERE
Ambient space is unit sphere in R3, used in model transformations.

AMBIENT_H2_HYPERBOLIC

public static final int AMBIENT_H2_HYPERBOLIC
Ambient space is hyperbolic 2d space in R3_L, used in model transformations.

AMBIENT_R4_EUCLIDEAN

public static final int AMBIENT_R4_EUCLIDEAN
Ambient space is 4d-euclidean, used in model transformations.

AMBIENT_S3_SPHERE

public static final int AMBIENT_S3_SPHERE
Ambient space is unit sphere in R4, used in model transformations.

AMBIENT_H3_HYPERBOLIC

public static final int AMBIENT_H3_HYPERBOLIC
Ambient space is hyperbolic 3d space in R3_L, used in model transformations.

AMBIENT_R5_EUCLIDEAN

public static final int AMBIENT_R5_EUCLIDEAN
Ambient space is 5d-euclidean, used in model transformations.

AMBIENT_S4_SPHERE

public static final int AMBIENT_S4_SPHERE
Ambient space is unit sphere in R5, used in model transformations.

AMBIENT_H4_HYPERBOLIC

public static final int AMBIENT_H4_HYPERBOLIC
Ambient space is hyperbolic 4d space in R5_L, used in model transformations.

PROJ_PARALLEL

public static final int PROJ_PARALLEL
Parallel projection, used in model transformations.

PROJ_STEREOGRAPHIC

public static final int PROJ_STEREOGRAPHIC
Stereographic projection, used in model transformations.

PROJ_POINCARE_BALL

public static final int PROJ_POINCARE_BALL
Conformal projection into Poincare's sphere, used in model transformations.

PROJ_KLEIN_BALL

public static final int PROJ_KLEIN_BALL
Projection into Klein's hyperbolic sphere, used in model transformations.

PROJ_UPPER_HALFSPACE

public static final int PROJ_UPPER_HALFSPACE
Conformal projection into Poincare's hyperbolic upper half space model, used in model transformations.

AMBIENT_SPACES

public static final java.lang.String[][] AMBIENT_SPACES
List of names of possible ambient spaces of geometries.

AMBIENT_PROJECTIONS

public static final java.lang.String[][] AMBIENT_PROJECTIONS
List of names of projection methods from ambient spaces. Each array contains the projection methods of a corresponding ambient space.
See Also:
AMBIENT_SPACES
Method Detail

getAmbientSpace

public int getAmbientSpace()
Get ambient space used in model transformations.
Returns:
One of the values PgGeometryIf#AMBIENT_...

setAmbientSpace

public void setAmbientSpace(int mode)
Set ambient space used in model transformations.
Parameters:
mode - One of the values PgGeometryIf#AMBIENT_...

getAmbientProjection

public int getAmbientProjection()
Get projection mode of ambient space used in model transformations.
Returns:
One of the values PgGeometryIf#PROJ_...

setAmbientProjection

public void setAmbientProjection(int mode)
Set projection mode of ambient space used in model transformations.
Parameters:
mode - One of the values PgGeometryIf#PROJ_...

setState

public void setState(int aKey,
                     boolean aState)
Set drawing flags of this geometry from within the display. Method used be overwritten by subclasses to catch specific states. Currently, this method is not intended for public use.

Subclasses should overwrite this method and call super for unhandled keys.

Parameters:
aKey - flag to be set, choose among PvGeometryIf.SHOW_...
aState - enable or disable state

paint

public void paint(PvGeometryIf dc)
Major rendering method fills an internal container class supplied by the display. Method is invoked by displays in which this instance is registered. Whenever the display receives an update event of this geometry instance, then the display calls the paint method. Therefore, it is essential to follow the following strategy to ensure update of the display container whenever the geometry has changed:
		PgGeometryIf geom;       // An arbitrary geometry class
		disp.addGeometry(geom);  // Register geometry in a JavaView display
		geom.computeSomething(); // Compute or modify geometry, e.g. surface coordinates etc.
		disp.update(geom);       // After changing geometry invoke update of display.
	
The call disp.update(geom) invokes the method geom.paint(dc) to fill the container instance dc which is then rendered inside the display.

Use methods supplied in jv.project.PvGeometryIf to fill a container class. All data is duplicated allowing rendering and interaction while the geometry data in the current class may already be modified, e.g. by numerical processes.

Note: Whenever a geometry is registered in a project jv.project.PjProject then the project automatically registers the geometry in associated displays, and it is sufficient to send an update message to the project with the geometry as argument.

Note: Display properties such as auto-rotation, camera choices etc. are made by calling methods of a display directly, see jv.project.PvDisplayIf.


fillMethodMenu

public java.awt.Menu fillMethodMenu(java.awt.Menu aMenu)
Fill menu with items to invoke advanced methods of this geometry.

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.

getJvx

public PgJvxSrc getJvx()
Fills a geometry object with data from this instance, for example, to print to file.
Returns:
src a geometry source filled with data from this instance.

setJvx

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

getInfoPanel

public PsPanel getInfoPanel()
Get info panel - if it does not exist try to allocate it. Standard panel for inspecting standard internal data such as vertex arrays etc. of geometry.

getMaterialPanel

public PsPanel getMaterialPanel()
Deprecated. use assureInspector(String, String)

Get material panel - if it does not exist try to allocate it. Standard panel for inspecting material properties of geometry.

assureInspector

public PsPanel assureInspector(java.lang.String type,
                               java.lang.String ext)
Get a certain panel - if it does not exist then try to allocate it. This method is a shortcut to avoid checking, creating, and adding the panel to the inspector list.
Parameters:
type - type of panel, e.g. PsObject.INSPECTOR_INFO
ext - file name extension, e.g. PsObject.INSPECTOR_INFO_EXT

getControlPanel

public PsPanel getControlPanel()
Deprecated. use assureInspector(String, String)

Get control panel - if it does not exist try to allocate it. Standard panel for inspecting functional data of a geometry, usually used by subclasses of geometry classes which have additional functionality.

isConfigurable

public boolean isConfigurable(int panel)
Check whether class has a configuration panel to configure it.

getName

public java.lang.String getName()
Name of geometry, should be unique inside JavaView.
Specified by:
getName in interface PsUpdateIf

setName

public void setName(java.lang.String name)
Set name of geometry, should be unique inside JavaView.

toString

public java.lang.String toString()
Get a detailed string representation of object, usually rather long.
Overrides:
toString in class java.lang.Object

intersectionWithLine

public PvPickEvent intersectionWithLine(PdVector base,
                                        PdVector dir)
Find intersection with ray. Used to locate picking hits on the surface or polygon.

blend

public boolean blend(double s,
                     PgGeometry a,
                     double t,
                     PgGeometry b)
Interpolate between two geometries, for example, in a smooth animation. This geometry is a linear blend of the two source geometries: this = s*a + t*b.
Parameters:
s, - t weights of vertices of each elementSet
a, - b two source geometries used for blending
Returns:
true on success

merge

public boolean merge(PgGeometryIf geom)
Add another geometry of same type to this geometry. If types of geometries are different then nothing is done.
Parameters:
geom - geometry added to current geometry
Returns:
true on success

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.
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

addDisplay

public boolean addDisplay(PvDisplayIf display)
Register a new display to render the geometry. Method is called from display to register itself and query when geometry is added to a display. Method is implemented by PgGeometry and need not be overwritten.

getDisplays

public java.util.Enumeration getDisplays()
Get all registered displays as Enumeration. Method is implemented by PgGeometry and need not be overwritten.

hasDisplay

public boolean hasDisplay(PvDisplayIf display)
Check for a registered display by name. Method is implemented by PgGeometry and need not be overwritten.

removeDisplay

public boolean removeDisplay(PvDisplayIf display)
Remove a registered display from list of registered displays. Method is implemented by PgGeometry and need not be overwritten.

isVisible

public boolean isVisible()
Check flag whether geometry is selected to be hidden or not in display.

setVisible

public void setVisible(boolean flag)
Set geometry to be hidden or visible in display.

getModelMatrix

public PdMatrix getModelMatrix()
Get model matrix of geometry.

hasModelMatrix

public boolean hasModelMatrix()
Check for model matrix of geometry.

setModelMatrix

public void setModelMatrix(PdMatrix modelMat)
Set model matrix of geometry. If argument is null then model matrix is removed.

getAmbientMatrix

public PdMatrix getAmbientMatrix()
Get a reference of the ambient model matrix of geometry.

getAmbientInvMatrix

public PdMatrix getAmbientInvMatrix()
Get a reference of the ambient inverse model matrix of geometry.

hasAmbientMatrix

public boolean hasAmbientMatrix()
Check for ambient model matrix of geometry.

setAmbientMatrix

public void setAmbientMatrix(PdMatrix ambientMat,
                             PdMatrix ambientInvMat)
Set ambient model matrix of geometry and its inverse. If argument is null then ambient model matrix is removed.

getDimOfVertices

public int getDimOfVertices()
Get dimension of points used in geometry, i.e. the number coordinates per point. Dimension must be equal for all vertices of a class, ad must be specified as argument of the constructor.

getDimOfSimplex

public int getDimOfSimplex()
Get dimension of simplicial complex, i.e. maximal dimension of occurring simplices. For example, polygonal curves have simplex dimension 1, triangulated surfaces 2, and volumes have 3.
Since:
JavaView 1.95

addVertex

public int addVertex(PdVector aVertex)
Add a vector to a geometry, probably at the end of its vertex array. The implementation of the method must copy the supplied vector. Method is called, for example, when picking new vertices in the display. Avoid using this method, but if, then call update() in its implementation.
Parameters:
aVertex - vector with new vertex coordinates

getVertex

public PdVector getVertex(int anIndex)
Return reference to vertex with given index anIndex.
Parameters:
anIndex - index of vertex to be returned
Returns:
reference to vertex vector with given index

removeVertex

public int[] removeVertex(int anIndex)
Remove vertex with given index.
Parameters:
anIndex - index of vertex to be removed
Returns:
array with indices of new positions of vertices

setVertex

public boolean setVertex(int anIndex,
                         PdVector aVertex)
Allow setting the coordinates of a single vertex. The implementation of setVertex must copy the supplied vector. Method is called, for example, when dragging a picked vertex in the viewer.
Parameters:
anIndex - index of vertex to be changed
aVertex - vector with new vertex coordinates

addPolygon

public int addPolygon(PiVector aPolygon)
Add a polygon to a geometry, probably at the end of its polygon array. The implementation of the method must copy the supplied vector. Avoid using this method, but if, then call update() in its implementation.
Parameters:
aPolygon - vector with indices of vertices in global vertex array

getPolygon

public PiVector getPolygon(int anIndex)
Return reference to polygon with given index.
Parameters:
anIndex - index of polygon to be returned
Returns:
reference to polygon vector with given index

removePolygon

public int[] removePolygon(int anIndex)
Remove polygon with given index.
Parameters:
anIndex - index of polygon to be removed
Returns:
array with indices of new positions of polygons

setPolygon

public boolean setPolygon(int anIndex,
                          PiVector aPolygon)
Allow setting the vertex indices of a single polygon. The implementation must copy the supplied vector.
Parameters:
anIndex - index of polygon to be changed
aPolygon - vector with indices of vertices in global vertex array

addElement

public int addElement(PiVector aElement)
Add a vector to a geometry, probably at the end of its element array. The implementation of the method must copy the supplied vector. Avoid using this method, but if, then call update() in its implementation.
Parameters:
aPolygon - vector with indices of vertices in global vertex array

getElement

public PiVector getElement(int anIndex)
Return reference to element with given index.
Parameters:
anIndex - index of element to be returned
Returns:
reference to element vector with given index

removeElement

public int[] removeElement(int anIndex)
Remove an element with given index.
Parameters:
anIndex - index of element to be removed
Returns:
array with indices of new positions of elements

setElement

public boolean setElement(int anIndex,
                          PiVector aElement)
Allow setting the vertex indices of a single element. The implementation must copy the supplied vector.
Parameters:
anIndex - index of element to be changed
aVertex - vector with indices of vertices in global vertex array

clearTagVertex

public void clearTagVertex(int index,
                           int aTag)
Clear a single tag of a vertex. For possible tags see PsObject.

hasTagVertex

public boolean hasTagVertex(int index,
                            int aTag)
Check whether vertex has given tag. For possible tags see PsObject.

setTagVertex

public void setTagVertex(int index,
                         int aTag)
Set a tag of a vertex. For possible tags see PsObject.

clearTagPolygon

public void clearTagPolygon(int index,
                            int aTag)
Clear a single tag of a polygon. For possible tags see PsObject.

hasTagPolygon

public boolean hasTagPolygon(int index,
                             int aTag)
Check whether polygon has given tag. For possible tags see PsObject.

setTagPolygon

public void setTagPolygon(int index,
                          int aTag)
Set a tag of a polygon. For possible tags see PsObject.

clearTagElement

public void clearTagElement(int index,
                            int aTag)
Clear a single tag of an element. For possible tags see PsObject.

hasTagElement

public boolean hasTagElement(int index,
                             int aTag)
Check whether element has given tag. For possible tags see PsObject.

setTagElement

public void setTagElement(int index,
                          int aTag)
Set a tag of an element. For possible tags see PsObject.

getTextureImageName

public java.lang.String getTextureImageName()
Get name of texture image, a full URL or a relative file name.

setTextureImageName

public void setTextureImageName(java.lang.String name)
Set name of texture image, a URL or a relative file name.

getTextureImage

public java.awt.Image getTextureImage()
Get image of texture.

setTextureImage

public void setTextureImage(java.awt.Image img)
Set texture image for vertex and element textures.

JavaView® v2.12

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