JavaView® v2.12

jv.project
Class PgGeometry

java.lang.Object
  |
  +--jv.object.PsObject
        |
        +--jv.project.PgGeometry
All Implemented Interfaces:
java.lang.Cloneable, PgGeometryIf, PsUpdateIf, java.io.Serializable
Direct Known Subclasses:
PgAxes, PgJvxSrc, PgParmSurface, PgPointSet, PgSurfacePair, PgVectorField, PgWeierstrassDescr, PsKeyframe

public class PgGeometry
extends PsObject
implements PgGeometryIf, java.lang.Cloneable

Abstract class for all geometry classes in JavaView, and implementation of PgGeometryIf. Users may derive their own geometry classes either from this class resp. its subclasses, or by writing a class implementing the interface PgGeometryIf. Either of the two options is required to view the geometry in a JavaView display.

Version:
15.09.01, 3.30 revised (ur) Modification of method fillMethodMenu for Reorganisation of Method Menus.
29.04.01, 3.20 revised (kp) Modeling matrix of ambient space added.
22.06.00, 3.10 revised (kp) Variable m_dimOfSimplex added.
02.04.00, 3.00 revised (kp) PdColor replaced with Color in lists.
30.09.99, 2.60 created (kp) Methods to print indices in display added.
19.08.99, 2.50 revised (kp) Most code from update() moved to PsObject, display in Hashtable.
14.11.98, 2.00 revised (kp) Clean up and documenting.
00.00.97, 1.00 created (kp)
Author:
Konrad Polthier
See Also:
PgGeometryIf, PvDisplayIf, 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
PgGeometry()
          Constructor.
PgGeometry(int aDim)
          Constructor with dimension of geometric points, must be constant for all points.
 
Method Summary
 boolean addDisplay(PvDisplayIf display)
          Register a new display.
 int addElement(PiVector anElement)
          Method does nothing and may be overriden by subclasses.
 int addPolygon(PiVector aPolygon)
          Method does nothing and may be overriden by subclasses.
 int addVertex(PdVector aVertex)
          Method does nothing and may be overriden by subclasses.
 boolean blend(double s, PgGeometry a, double t, PgGeometry b)
          Blend between two geometries, used in interpolation and computing the associate surfaces this = s*a + t*b.
 void clearTagElement(int index, int aTag)
          Method does nothing and may be overriden by subclasses.
 void clearTagPolygon(int index, int aTag)
          Method does nothing and may be overriden by subclasses.
 void clearTagVertex(int index, int aTag)
          Method does nothing and may be overriden by subclasses.
 java.lang.Object clone()
          Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.
 void copy(PgGeometry geom)
          Copy argument object into this object by recursively copying all instance variables.
 java.awt.Menu fillMethodMenu(java.awt.Menu aMenu)
          Fill menu with items to invoke advanced methods of this geometry.
 PdVector[] getAmbientBounds()
          Compute bounding box of this geometry from the set of all vertices, or return null if no vertices.
 PdMatrix getAmbientInvMatrix()
          Get a reference of the inverse ambient 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.
 PsAuthorInfo getAuthorInfo()
          Get author information.
 PsAuthorInfo getAuthors()
          Deprecated. used getAuthorInfo()
 PdVector[] getBounds()
          Compute bounding box of the vertices which are transformed with ambient and model matrix.
 PdVector getCenter()
          Get center of geometry which local transformation use as origin.
static PdVector getCenterOfElement(PdVector center, PdVector[] vertex, int[] vertInd)
          Compute the bary center of a geometry element like face or polygon edge.
 PsPanel getControlPanel()
          Deprecated. use assurePanel(String, String)
 double getDiameter()
          Get diameter of object which is the diagonal in the bounding box.
 int getDimOfSimplex()
          Get dimension of simplicial complex, i.e. maximal dimension of occurring simplices.
 int getDimOfVertices()
          Retrieve dimension of vertices, which must be the same for all vertices.
 java.util.Enumeration getDisplays()
          Get all registered displays as enumeration.
 PiVector getElement(int anIndex)
          Method does nothing and may be overriden by subclasses.
 PsGeometryInfo getGeometryInfo()
          Get geometry information.
 PgJvxSrc getJvx()
          Fills a geometry object with data from this instance, for example, to print to file.
 PiVector getLabelAttribute(int type)
          Get offset vector in pixel coordinates of label w.r.t. base point.
 PsPanel getMaterialPanel()
          Deprecated. use assurePanel(String, String)
 PdMatrix getModelMatrix()
          Get a copy of the model matrix of geometry.
 PiVector getPolygon(int anIndex)
          Method does nothing and may be overriden by subclasses.
 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.
 java.lang.String getTitle()
           
 java.lang.String getVersion()
           
 java.lang.String getVersionType()
           
 PdVector getVertex(int anIndex)
          Method does nothing and may be overriden by subclasses.
 boolean hasAmbientMatrix()
          Check for ambient model matrix of geometry.
 boolean hasDisplay(PvDisplayIf display)
          Check for a registered display.
 boolean hasModelMatrix()
          Check for model matrix of geometry.
 boolean hasTagElement(int index, int aTag)
          Method does nothing and may be overriden by subclasses.
 boolean hasTagPolygon(int index, int aTag)
          Method does nothing and may be overriden by subclasses.
 boolean hasTagVertex(int index, int aTag)
          Method does nothing and may be overriden by subclasses.
 void init()
          Initializes and resets geometry.
 PvPickEvent intersectionWithLine(PdVector base, PdVector dir)
          Method used for picking, should be overriden by subclasses.
 boolean isConfigurable(int panel)
          Determine whether class has a configuration panel of a given type.
 boolean isShowingBndBox()
          Set flag to enable drawing of bounding box.
 boolean isShowingCenter()
          Set flag to enable drawing of center of geometry.
 boolean isShowingTitle()
          Check whether showing of title of geometry is switched on.
 boolean isVisible()
          Check the visibility flag of the geometry.
 boolean merge(PgGeometryIf geom)
          Add another of same 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)
          Method does nothing and may be overriden by subclasses.
 int[] removePolygon(int anIndex)
          Method does nothing and may be overriden by subclasses.
 int[] removeVertex(int anIndex)
          Method does nothing and may be overriden by subclasses.
 void setAmbientMatrix(PdMatrix ambientMat, PdMatrix ambientInvMat)
          Set ambient model matrix of geometry to copy of argument matrix.
 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.
 void setAuthorInfo(PsAuthorInfo authorInfo)
          Set author information.
 void setAuthors(PsAuthorInfo author)
          Deprecated. used setAuthorInfo(PsAuthorInfo)
 void setCenter(PdVector aCenter)
          Set center of geometry which local transformation use as origin.
 void setDimOfSimplex(int dim)
          Set dimension of simplicial complex, i.e. maximal dimension of occurring simplices.
 boolean setElement(int anIndex, PiVector aElement)
          Method does nothing and may be overriden by subclasses.
 void setGeometryInfo(PsGeometryInfo geometryInfo)
          Set geometry information.
 void setJvx(PgJvxSrc src)
          Fill this instance with data from a geometry source, for example, previously read from file.
 boolean setLabelAttribute(int type, int xOffset, int yOffset, int horAdjust, int verAdjust, int font)
          Set offset vector in pixel coordinates of label w.r.t. base point.
 boolean setLabelAttribute(int type, PiVector labelAtt)
          Set attributes of labels of given type.
 void setModelMatrix(PdMatrix modelMat)
          Set model matrix of geometry to copy of argument matrix.
 boolean setPolygon(int anIndex, PiVector aPolygon)
          Method does nothing and may be overriden by subclasses.
 void setState(int aKey, boolean aState)
          Set drawing flags of this geometry from within the display.
 void setTagElement(int index, int aTag)
          Method does nothing and may be overriden by subclasses.
 void setTagPolygon(int index, int aTag)
          Method does nothing and may be overriden by subclasses.
 void setTagVertex(int index, int aTag)
          Method does nothing and may be overriden by subclasses.
 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.
 void setTitle(java.lang.String title)
           
 void setVersion(java.lang.String version)
           
 void setVersionType(java.lang.String versionType)
           
 boolean setVertex(int anIndex, PdVector aVertex)
          Method does nothing and may be overriden by subclasses.
 void setVisible(boolean flag)
          Set the visibility flag of the geometry.
 void showBndBox(boolean flag)
          Set flag to enable drawing of bounding box.
 void showCenter(boolean flag)
          Set flag to enable drawing of center of geometry.
 void showTitle(boolean flag)
          Enable and disable showing of title of geometry in display.
 java.lang.String toString()
          Create a multi-line string representation with detailed information about all instance variables.
 boolean update(java.lang.Object event)
          Update method of geometry updates registered panels, update listeners, and invokes a repaint in the registered displays.
 
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

PgGeometry

public PgGeometry()
Constructor.

PgGeometry

public PgGeometry(int aDim)
Constructor with dimension of geometric points, must be constant for all points. The initial value of the dimension is a required argument of the constructor.
Parameters:
aDim - dimension of geometric points
See Also:
getDimOfVertices()
Method Detail

init

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

getAuthorInfo

public PsAuthorInfo getAuthorInfo()
Get author information.

setAuthorInfo

public void setAuthorInfo(PsAuthorInfo authorInfo)
Set author information.

getAuthors

public PsAuthorInfo getAuthors()
Deprecated. used getAuthorInfo()

Get author information.

setAuthors

public void setAuthors(PsAuthorInfo author)
Deprecated. used setAuthorInfo(PsAuthorInfo)

Set author information.

getGeometryInfo

public PsGeometryInfo getGeometryInfo()
Get geometry information.

setGeometryInfo

public void setGeometryInfo(PsGeometryInfo geometryInfo)
Set geometry information.

getVersion

public java.lang.String getVersion()

getVersionType

public java.lang.String getVersionType()

getTitle

public java.lang.String getTitle()

setVersion

public void setVersion(java.lang.String version)

setVersionType

public void setVersionType(java.lang.String versionType)

setTitle

public void setTitle(java.lang.String title)

getDiameter

public double getDiameter()
Get diameter of object which is the diagonal in the bounding box.

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.

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.
Returns:
two vectors which are the extremal corners of the bounding cube
See Also:
getBounds()

getCenter

public PdVector getCenter()
Get center of geometry which local transformation use as origin. If the center has not been set then the origin of the world is returned, which is usually (0,0,0).
Returns:
a vector which is the local origin of the geometry

setCenter

public void setCenter(PdVector aCenter)
Set center of geometry which local transformation use as origin. This method sets an instance variable and does not modify vertices.
Parameters:
a - vector which becomes the local origin of the geometry

isConfigurable

public boolean isConfigurable(int panel)
Determine whether class has a configuration panel of a given type. Default status is that class has no configuration panel. Possible choices of argument are HAS_INSPECTOR_PANEL or HAS_MATERIAL_PANEL or HAS_TEXTURE_PANEL or HAS_CONFIG_PANEL or
Specified by:
isConfigurable in interface PgGeometryIf
Parameters:
panel - Identifier of panel

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. Usually, this variable must be set in the constructor of a class.
Specified by:
getDimOfSimplex in interface PgGeometryIf
Since:
JavaView 1.95
See Also:
#setDimOfSimplex()

setDimOfSimplex

public void setDimOfSimplex(int dim)
Set 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. Usually, this variable must be set in the constructor of a class.
Since:
JavaView 1.95
See Also:
#setDimOfSimplex()

getJvx

public PgJvxSrc getJvx()
Fills a geometry object with data from this instance, for example, to print to file.
Specified by:
getJvx in interface PgGeometryIf
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.
Specified by:
setJvx in interface PgGeometryIf
Parameters:
src - a geometry source used to fill this instance with data.

toString

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

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.

Display list is not cloned but set to null. Method menu is not cloned.

Specified by:
clone in interface PgGeometryIf
Overrides:
clone in class PsObject
See Also:
copy(PgGeometry)

copy

public void copy(PgGeometry geom)
Copy argument object into this object by recursively copying all instance variables. Does not copy dimension of vertices, author info, geometry info, and visibility attributes.

update

public boolean update(java.lang.Object event)
Update method of geometry updates registered panels, update listeners, and invokes a repaint in the registered displays. Usage:
1. event == this : geometry has changed, all panels will be updated.
2. event == null : geometry has changed, no need to update a panel.
3. event == a panel : geometry has changed, all panels except 'panel' will be updated.
3. event == else : unhandled event, error.
Panels are not updated if they have not been created yet, or if they are not visible.

Any update is forwarded to the parent of the geometry with the geometry as event.

Any update is forwarded to each registered display with the geometry as event which leads to a repaint of the display.
Specified by:
update in interface PsUpdateIf
Overrides:
update in class PsObject
Following copied from interface: jv.object.PsUpdateIf
Parameters:
event - carries a lot of information
Returns:
true if event has been handled, otherwise false
See Also:
PsObject, PsUpdateIf.getFather(), PsUpdateIf.setParent(PsUpdateIf)

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.
Specified by:
paint in interface PgGeometryIf
See Also:
PgGeometryIf

getDimOfVertices

public int getDimOfVertices()
Retrieve dimension of vertices, which must be the same for all vertices. An initial value of the dimension is a required argument of the constructor. The dimension of vertices is read-only.
Specified by:
getDimOfVertices in interface PgGeometryIf
See Also:
PgGeometry(int)

getAmbientSpace

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

setAmbientSpace

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

getAmbientProjection

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

setAmbientProjection

public void setAmbientProjection(int mode)
Set projection mode of ambient space used in model transformations.
Specified by:
setAmbientProjection in interface PgGeometryIf
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.

This method catches unhandled keys of subclasses. Subclasses should overwrite this method and call super for unhandled keys.

Specified by:
setState in interface PgGeometryIf
Parameters:
aKey - flag to be set, choose among PvGeometryIf.SHOW_...
aState - enable or disable state

getModelMatrix

public PdMatrix getModelMatrix()
Get a copy of the model matrix of geometry.
Specified by:
getModelMatrix in interface PgGeometryIf

hasModelMatrix

public boolean hasModelMatrix()
Check for model matrix of geometry.
Specified by:
hasModelMatrix in interface PgGeometryIf

setModelMatrix

public void setModelMatrix(PdMatrix modelMat)
Set model matrix of geometry to copy of argument matrix. If argument is null then model matrix is removed.
Specified by:
setModelMatrix in interface PgGeometryIf

getAmbientMatrix

public PdMatrix getAmbientMatrix()
Get a reference of the ambient model matrix of geometry.
Specified by:
getAmbientMatrix in interface PgGeometryIf

getAmbientInvMatrix

public PdMatrix getAmbientInvMatrix()
Get a reference of the inverse ambient model matrix of geometry.
Specified by:
getAmbientInvMatrix in interface PgGeometryIf

hasAmbientMatrix

public boolean hasAmbientMatrix()
Check for ambient model matrix of geometry.
Specified by:
hasAmbientMatrix in interface PgGeometryIf

setAmbientMatrix

public void setAmbientMatrix(PdMatrix ambientMat,
                             PdMatrix ambientInvMat)
Set ambient model matrix of geometry to copy of argument matrix. If argument is null then ambient model matrix is removed.
Specified by:
setAmbientMatrix in interface PgGeometryIf

isVisible

public boolean isVisible()
Check the visibility flag of the geometry. A geometry may be hidden to be invisible in all displays by setting the visibility flag.
Specified by:
isVisible in interface PgGeometryIf
See Also:
setVisible(boolean)

setVisible

public void setVisible(boolean flag)
Set the visibility flag of the geometry. A geometry may be hidden to be invisible in all displays by setting the visibility flag. This does not remove the geometries from the displays but just deactivates their drawing.
Specified by:
setVisible in interface PgGeometryIf
See Also:
isVisible()

isShowingTitle

public boolean isShowingTitle()
Check whether showing of title of geometry is switched on. On default, showing of title is disabled.

showTitle

public void showTitle(boolean flag)
Enable and disable showing of title of geometry in display. On default, showing of title is disabled.

isShowingBndBox

public boolean isShowingBndBox()
Set flag to enable drawing of bounding box.

showBndBox

public void showBndBox(boolean flag)
Set flag to enable drawing of bounding box.

isShowingCenter

public boolean isShowingCenter()
Set flag to enable drawing of center of geometry.

showCenter

public void showCenter(boolean flag)
Set flag to enable drawing of center of geometry.

getLabelAttribute

public PiVector getLabelAttribute(int type)
Get offset vector in pixel coordinates of label w.r.t. base point. First two components are pixel coordinates. Third component is in [1..3] and indices whether head, center or tail is located at base+offset. Fourth component indicates font. Note, (0,0) is in the upper left corner of the screen. For possible type see PvGeometryIf#GEOM_ITEM_POINT and other items.
Parameters:
type - type of label, vertex, polygon, element or title labels.
Returns:
vector with three components, x, y, and position on string.

setLabelAttribute

public boolean setLabelAttribute(int type,
                                 int xOffset,
                                 int yOffset,
                                 int horAdjust,
                                 int verAdjust,
                                 int font)
Set offset vector in pixel coordinates of label w.r.t. base point. The base point of vertices is the vertex, the base point of elements and edges and polygon edges is the barycenter, i.e. midpoint.

First two components of attr are pixel coordinates determining the offset with respect to the base point. For example, an offset pair (1,-2) locates label center 1 to the right and 2 pixels up of the base point (since the upper left corner of the display is (0,0) in screen coordinates).

Third component of attr is PgGeometryIf.LABEL_HEAD or PgGeometryIf.LABEL_CENTER or PgGeometryIf.LABEL_TAIL and indicates whether head, tail, or center of label is located at base+offset.

Fourth component of attr is PgGeometryIf.LABEL_TOP or PgGeometryIf.LABEL_MIDDLE or PgGeometryIf.LABEL_BASE and indicates whether top, middle, or base of label is located at base+offset. Not implemented yet.

Fifth component of attr indicates font. For possible fonts see PsConfig.

Note, it is currently not possible to set the label attribute, say, of a single vertex unless you have a geometry with just one vertex.

There exist one vector for each of the basic primitive types GEOM_ITEM_POINT, GEOM_ITEM_EDGE,GEOM_ITEM_POLYGON,GEOM_ITEM_ELEMENT,GEOM_ITEM_TETRA, and GEOM_ITEM_TITLE. For possible type see PvGeometryIf#GEOM_ITEM_POINT and other items.

Parameters:
type - Type of group of geometry items to set attributes
attr - Attribute vector with four components
Returns:
false if type is unknown.

setLabelAttribute

public boolean setLabelAttribute(int type,
                                 PiVector labelAtt)
Set attributes of labels of given type. Methods just calls setLabelAttribute() with integer arguments. Length of vector must be equal to (or larger than) 5.

getMaterialPanel

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

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

Method is a shortcut to avoid checking, creating, and adding the panel to the inspector list.

Specified by:
getMaterialPanel in interface PgGeometryIf

getControlPanel

public PsPanel getControlPanel()
Deprecated. use assurePanel(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.

Method is a shortcut to avoid checking, creating, and adding the panel to the inspector list.

Specified by:
getControlPanel in interface PgGeometryIf

fillMethodMenu

public java.awt.Menu fillMethodMenu(java.awt.Menu aMenu)
Fill menu with items to invoke advanced methods of this geometry.
Specified by:
fillMethodMenu in interface PgGeometryIf

addDisplay

public boolean addDisplay(PvDisplayIf display)
Register a new display. Display will be informed by update() whenever geometry changes require a repaint of the display. For example, method is called from PvDisplay when registering the geometry in the display.
Specified by:
addDisplay in interface PgGeometryIf
Returns:
false if instance already registered.
See Also:
getDisplays()

getDisplays

public java.util.Enumeration getDisplays()
Get all registered displays as enumeration.
Specified by:
getDisplays in interface PgGeometryIf
Returns:
Enumeration of registered displays, null if no displays found.
See Also:
addDisplay(PvDisplayIf)

hasDisplay

public boolean hasDisplay(PvDisplayIf display)
Check for a registered display.
Specified by:
hasDisplay in interface PgGeometryIf
Returns:
true if registered display found.
See Also:
addDisplay(PvDisplayIf), getDisplays()

removeDisplay

public boolean removeDisplay(PvDisplayIf display)
Remove a registered display from list of registered displays. For example, method is called from PvDisplay when removing the geometry from the display.
Specified by:
removeDisplay in interface PgGeometryIf
Parameters:
Display -  
Returns:
false if display does not exists.
See Also:
addDisplay(PvDisplayIf)

addVertex

public int addVertex(PdVector aVertex)
Method does nothing and may be overriden by subclasses.
Specified by:
addVertex in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
Parameters:
aVertex - vector with new vertex coordinates

getVertex

public PdVector getVertex(int anIndex)
Method does nothing and may be overriden by subclasses.
Specified by:
getVertex in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
Parameters:
anIndex - index of vertex to be returned
Returns:
reference to vertex vector with given index

removeVertex

public int[] removeVertex(int anIndex)
Method does nothing and may be overriden by subclasses.
Specified by:
removeVertex in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
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)
Method does nothing and may be overriden by subclasses.
Specified by:
setVertex in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
Parameters:
anIndex - index of vertex to be changed
aVertex - vector with new vertex coordinates

addPolygon

public int addPolygon(PiVector aPolygon)
Method does nothing and may be overriden by subclasses.
Specified by:
addPolygon in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
Parameters:
aPolygon - vector with indices of vertices in global vertex array

getPolygon

public PiVector getPolygon(int anIndex)
Method does nothing and may be overriden by subclasses.
Specified by:
getPolygon in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
Parameters:
anIndex - index of polygon to be returned
Returns:
reference to polygon vector with given index

removePolygon

public int[] removePolygon(int anIndex)
Method does nothing and may be overriden by subclasses.
Specified by:
removePolygon in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
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)
Method does nothing and may be overriden by subclasses.
Specified by:
setPolygon in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
Parameters:
anIndex - index of polygon to be changed
aPolygon - vector with indices of vertices in global vertex array

addElement

public int addElement(PiVector anElement)
Method does nothing and may be overriden by subclasses.
Specified by:
addElement in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
Parameters:
aPolygon - vector with indices of vertices in global vertex array

getElement

public PiVector getElement(int anIndex)
Method does nothing and may be overriden by subclasses.
Specified by:
getElement in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
Parameters:
anIndex - index of element to be returned
Returns:
reference to element vector with given index

removeElement

public int[] removeElement(int anIndex)
Method does nothing and may be overriden by subclasses.
Specified by:
removeElement in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
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)
Method does nothing and may be overriden by subclasses.
Specified by:
setElement in interface PgGeometryIf
Following copied from interface: jv.project.PgGeometryIf
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)
Method does nothing and may be overriden by subclasses.
Specified by:
clearTagVertex in interface PgGeometryIf

hasTagVertex

public boolean hasTagVertex(int index,
                            int aTag)
Method does nothing and may be overriden by subclasses.
Specified by:
hasTagVertex in interface PgGeometryIf

setTagVertex

public void setTagVertex(int index,
                         int aTag)
Method does nothing and may be overriden by subclasses.
Specified by:
setTagVertex in interface PgGeometryIf

clearTagPolygon

public void clearTagPolygon(int index,
                            int aTag)
Method does nothing and may be overriden by subclasses.
Specified by:
clearTagPolygon in interface PgGeometryIf

hasTagPolygon

public boolean hasTagPolygon(int index,
                             int aTag)
Method does nothing and may be overriden by subclasses.
Specified by:
hasTagPolygon in interface PgGeometryIf

setTagPolygon

public void setTagPolygon(int index,
                          int aTag)
Method does nothing and may be overriden by subclasses.
Specified by:
setTagPolygon in interface PgGeometryIf

clearTagElement

public void clearTagElement(int index,
                            int aTag)
Method does nothing and may be overriden by subclasses.
Specified by:
clearTagElement in interface PgGeometryIf

hasTagElement

public boolean hasTagElement(int index,
                             int aTag)
Method does nothing and may be overriden by subclasses.
Specified by:
hasTagElement in interface PgGeometryIf

setTagElement

public void setTagElement(int index,
                          int aTag)
Method does nothing and may be overriden by subclasses.
Specified by:
setTagElement in interface PgGeometryIf

intersectionWithLine

public PvPickEvent intersectionWithLine(PdVector base,
                                        PdVector dir)
Method used for picking, should be overriden by subclasses.
Specified by:
intersectionWithLine in interface PgGeometryIf

blend

public boolean blend(double s,
                     PgGeometry a,
                     double t,
                     PgGeometry b)
Blend between two geometries, used in interpolation and computing the associate surfaces this = s*a + t*b.
Specified by:
blend in interface PgGeometryIf
Parameters:
double - s, t weights of vertices of each elementSet
PgGeometry - a, b two geometries used for blending
Returns:
true on success

merge

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

getCenterOfElement

public static PdVector getCenterOfElement(PdVector center,
                                          PdVector[] vertex,
                                          int[] vertInd)
Compute the bary center of a geometry element like face or polygon edge.
Parameters:
center - existing vector of dimension m_dim which will be filled and returned
vertex - vertex array to which the index vector refers
vertInd - index vector with indices in the vertex array
Returns:
Argument center is filled with the position of the bayr center

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.
Specified by:
reflect in interface PgGeometryIf
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

getTextureImageName

public java.lang.String getTextureImageName()
Get name of texture image, a full URL or a relative file name.
Specified by:
getTextureImageName in interface PgGeometryIf

setTextureImageName

public void setTextureImageName(java.lang.String name)
Set name of texture image, a URL or a relative file name.
Specified by:
setTextureImageName in interface PgGeometryIf

getTextureImage

public java.awt.Image getTextureImage()
Get image of texture.
Specified by:
getTextureImage in interface PgGeometryIf

setTextureImage

public void setTextureImage(java.awt.Image img)
Set texture image for vertex and element textures.
Specified by:
setTextureImage in interface PgGeometryIf

JavaView® v2.12

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