public abstract class PgGeometry extends PsObject implements PgGeometryIf
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.PgGeometryIf
,
PvDisplayIf
,
Serialized FormHAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
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, BLEND_ALPHA, BLEND_MATERIAL, BLEND_REPLACE, FILTER_DIRECT, FILTER_LINEAR, FILTER_QUADRATIC, HAS_METHOD_MENU, 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, m_numLabelTypes, METHOD_EXT, PERIODIC_BOTH, PERIODIC_HEIGHT, PERIODIC_NONE, PERIODIC_WIDTH, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE, SIDE_BACK, SIDE_BOTH, SIDE_FRONT, SIDE_NONE
Constructor and Description |
---|
PgGeometry()
Constructor.
|
PgGeometry(int aDim)
Constructor with dimension of geometric points, must be constant for all points.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addDisplay(PvDisplayIf display)
Register a new display.
|
int |
addElement(PiVector anElement)
Method does nothing and may be overridden by subclasses.
|
int |
addPolygon(PiVector aPolygon)
Method does nothing and may be overridden by subclasses.
|
int |
addVertex(PdVector aVertex)
Method does nothing and may be overridden by subclasses.
|
boolean |
applyAmbientMatrix()
Multiply the ambient matrix to all geometry items.
|
boolean |
applyModelingMatrix()
Multiply the modeling matrix to all geometry items.
|
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 overridden by subclasses.
|
void |
clearTagPolygon(int index,
int aTag)
Method does nothing and may be overridden by subclasses.
|
void |
clearTagVertex(int index,
int aTag)
Method does nothing and may be overridden by subclasses.
|
java.lang.Object |
clone()
Duplicate geometry by recursively cloning all instance variables
except inspector panels and lists of registered listeners.
|
static void |
convertWorldToModel(PgGeometryIf geom,
PdVector baseWorld,
PdVector dirWorld,
PdVector baseModel,
PdVector dirModel)
Convert 3D world coordinates into 3D model coordinates of current geometry
by multiplication of world coordinates with the inverse model matrix.
|
void |
copy(PsObject object)
Copy argument object into this object by recursively copying all
instance variables.
|
java.awt.Menu |
fillMethodMenu(java.awt.Menu menu)
Deprecated.
use fillMethodMenu(Menu, PvViewerIf)
|
java.awt.Menu |
fillMethodMenu(java.awt.Menu menu,
PvViewerIf viewer)
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 a reference to this 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 transformations use as origin.
|
static PdVector |
getCenterOfElement(PdVector center,
PdVector[] vertex,
int[] vertInd)
Compute the barycenter of a geometry element like face or polygon edge.
|
PsPanel |
getControlPanel()
Get control panel - if it does not exist try to allocate it.
|
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.Vector |
getDisplayList()
Get all registered displays as vector.
|
java.util.Enumeration |
getDisplays()
Get all registered displays as enumeration.
|
PiVector |
getElement(int anIndex)
Method does nothing and may be overridden 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.
|
java.awt.Color |
getLabelColor(int type)
Get color of specified label type.
|
java.lang.String |
getLabelFont(int type)
Get font name of specified label type.
|
double |
getLabelSize(int type)
Get font size of specified label type.
|
int |
getLabelStyle(int type)
Get font style of specified label type.
|
PsPanel |
getMaterialPanel()
Get material panel - if it does not exist try to allocate it.
|
PdMatrix |
getModelMatrix()
Get a copy of the model matrix of geometry.
|
PiVector |
getPolygon(int anIndex)
Method does nothing and may be overridden by subclasses.
|
boolean |
getState(int aKey)
Get a drawing flag of this geometry.
|
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()
Get the title of a geometry which may be the same for several geometries
of a scene indicating a grouping or other purposes.
|
int |
getType()
Get type of geometry, for example
PvGeometryIf#GEOM_POINT_SET
and PvGeometryIf#GEOM_ELEMENT_SET . |
java.lang.String |
getVersion() |
java.lang.String |
getVersionType() |
PdVector |
getVertex(int anIndex)
Method does nothing and may be overridden by subclasses.
|
boolean |
hasAmbientMatrix()
Check for ambient model matrix of geometry.
|
boolean |
hasDisplay(PvDisplayIf display)
Check if a given display is registered in this geometry.
|
boolean |
hasModelMatrix()
Check if geometry has a model matrix.
|
boolean |
hasTagElement(int index,
int aTag)
Method does nothing and may be overridden by subclasses.
|
boolean |
hasTagPolygon(int index,
int aTag)
Method does nothing and may be overridden by subclasses.
|
boolean |
hasTagVertex(int index,
int aTag)
Method does nothing and may be overridden by subclasses.
|
void |
init()
Initializes and resets geometry.
|
PvPickEvent |
intersectionWithLine(PdVector base,
PdVector dir)
Method used for picking, should be overridden by subclasses.
|
boolean |
isConfigurable(int panel)
Determine whether class has a configuration panel of a given type.
|
boolean |
isEnabledInstanceSharing()
Determines if sharing of vertices and other instances with a base
geometry is enabled when this instance is filled in PgGeomtry#getJvx().
|
boolean |
isShowingBndBox()
Get flag if drawing of bounding box is enabled.
|
boolean |
isShowingCenter()
Get flag if drawing of center of geometry is enabled.
|
boolean |
isShowingName()
Check whether showing of name of geometry is switched on.
|
boolean |
isShowingTitle()
Check whether showing of title of geometry is switched on.
|
boolean |
isVisible()
Check the visibility flag of the geometry.
|
boolean |
merge(PgGeometryIf geomIf)
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.
|
boolean |
projectFromAmbientSpace()
Apply projection matrix and perform projection determined by projection flag
of the surface in a Euclidean model R3, R2, or R1 with parallel projection.
|
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 overridden by subclasses.
|
void |
removeMethodMenus()
Remove all menus with items to invoke advanced methods of this geometry.
|
int[] |
removePolygon(int anIndex)
Method does nothing and may be overridden by subclasses.
|
int[] |
removeVertex(int anIndex)
Method does nothing and may be overridden 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 by copying or cloning the argument author info.
|
void |
setAuthors(PsAuthorInfo author)
Deprecated.
used setAuthorInfo(PsAuthorInfo)
|
void |
setCenter(PdVector center)
Set center of geometry which local transformations use as origin.
|
void |
setDimOfSimplex(int dim)
Set dimension of simplicial complex, i.e. maximal dimension of occurring simplices.
|
void |
setDimOfVertices(int dim)
Set dimension of vertices.
|
boolean |
setElement(int anIndex,
PiVector aElement)
Method does nothing and may be overridden by subclasses.
|
void |
setEnabledInstanceSharing(boolean flag)
Determines if sharing of vertices and other instances with a base
geometry is enabled when this instance is filled in PgGeomtry#getJvx().
|
void |
setGeometryInfo(PsGeometryInfo geometryInfo)
Set geometry information by copying or cloning the argument geometry info.
|
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 |
setLabelColor(int type,
java.awt.Color color)
Set color of specified label type.
|
void |
setLabelFont(int type,
java.lang.String font)
Set font name of specified label type.
|
void |
setLabelSize(int type,
double size)
Set font size of specified label type.
|
void |
setLabelStyle(int type,
int style)
Set font style of specified label 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 overridden by subclasses.
|
void |
setState(int aKey,
boolean aState)
Set a drawing flag of this geometry.
|
void |
setTagElement(int index,
int aTag)
Method does nothing and may be overridden by subclasses.
|
void |
setTagPolygon(int index,
int aTag)
Method does nothing and may be overridden by subclasses.
|
void |
setTagVertex(int index,
int aTag)
Method does nothing and may be overridden 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)
Set the title of a geometry which may be the same for several geometries
of a scene indicating a grouping or other purposes.
|
void |
setType(int type)
Set type of geometry, for example
PvGeometryIf#GEOM_POINT_SET
and PvGeometryIf#GEOM_ELEMENT_SET . |
void |
setVersion(java.lang.String version) |
void |
setVersionType(java.lang.String versionType) |
boolean |
setVertex(int anIndex,
PdVector aVertex)
Method does nothing and may be overridden 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 |
showName(boolean flag)
Enable and disable showing of name of geometry in display.
|
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.
|
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, updatePanels
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
assureInspector, getInfoPanel, getName, hasTag, setName
getFather, setParent
public PgGeometry()
public PgGeometry(int aDim)
aDim
- dimension of geometric pointsgetDimOfVertices()
public boolean isEnabledInstanceSharing()
public void setEnabledInstanceSharing(boolean flag)
If sharing is enabled then base geometry and this container physically share memory of many instance arrays such as vertex, normal, face etc arrays. Sharing should be carefully enabled and special care must be taken.
public PsAuthorInfo getAuthorInfo()
getAuthorInfo
in interface PgGeometryIf
public void setAuthorInfo(PsAuthorInfo authorInfo)
setAuthorInfo
in interface PgGeometryIf
public PsAuthorInfo getAuthors()
public void setAuthors(PsAuthorInfo author)
public PsGeometryInfo getGeometryInfo()
getGeometryInfo
in interface PgGeometryIf
public void setGeometryInfo(PsGeometryInfo geometryInfo)
setGeometryInfo
in interface PgGeometryIf
public int getType()
PvGeometryIf#GEOM_POINT_SET
and PvGeometryIf#GEOM_ELEMENT_SET
.getType
in interface PgGeometryIf
public void setType(int type)
PvGeometryIf#GEOM_POINT_SET
and PvGeometryIf#GEOM_ELEMENT_SET
.
Change display of vertices to default setting depending on geometry type.public java.lang.String getVersion()
public void setVersion(java.lang.String version)
public java.lang.String getVersionType()
public void setVersionType(java.lang.String versionType)
public java.lang.String getTitle()
getTitle
in interface PgGeometryIf
PsObject.setName(String)
,
showTitle(boolean)
,
setTitle(String)
public void setTitle(java.lang.String title)
setTitle
in interface PgGeometryIf
PsObject.setName(String)
,
showTitle(boolean)
,
getTitle()
public double getDiameter()
public PdVector[] getBounds()
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.
getAmbientBounds()
public PdVector[] getAmbientBounds()
Subclasses may return null if no geometric size information available, for example, no vertices allocated yet.
Note, the bounding box does not include transformations from the ambient or model matrix.
getBounds()
public PdVector getCenter()
public void setCenter(PdVector center)
center
- vector which becomes the local origin of the geometrypublic boolean isConfigurable(int panel)
HAS_INFO_PANEL
or
HAS_MATERIAL_PANEL
or
HAS_TEXTURE_PANEL
or
HAS_CONFIG_PANEL
.isConfigurable
in interface PgGeometryIf
panel
- Identifier of panelpublic int getDimOfSimplex()
getDimOfSimplex
in interface PgGeometryIf
setDimOfSimplex(int)
public void setDimOfSimplex(int dim)
getDimOfSimplex()
public PgJvxSrc getJvx()
getJvx
in interface PgGeometryIf
public void setJvx(PgJvxSrc src)
setJvx
in interface PgGeometryIf
src
- a geometry source used to fill this instance with data.public java.lang.String toString()
toString
in interface PgGeometryIf
toString
in class PsObject
public java.lang.Object clone()
null
.
Display list is not cloned but set to null. Method menu is not cloned.
clone
in interface PgGeometryIf
clone
in class PsObject
copy(PsObject)
public void copy(PsObject object)
The argument was changed from PgGeometry to PsObject since there were problems in J/Link which preferred to use PsObject#copy(PsObject) instead of PgGeometry#copy(PsObject).
copy
in class PsObject
PsObject.clone()
public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in class PsObject
event
- carries a lot of informationPsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public void paint(PvGeometryIf dc)
jv.project.PgGeometryIf
for detailed information.paint
in interface PgGeometryIf
PgGeometryIf
public int getDimOfVertices()
getDimOfVertices
in interface PgGeometryIf
PgGeometry(int)
public void setDimOfVertices(int dim)
public int getAmbientSpace()
getAmbientSpace
in interface PgGeometryIf
public void setAmbientSpace(int mode)
setAmbientSpace
in interface PgGeometryIf
mode
- One of the values PgGeometryIf#AMBIENT_...public int getAmbientProjection()
getAmbientProjection
in interface PgGeometryIf
public void setAmbientProjection(int mode)
setAmbientProjection
in interface PgGeometryIf
mode
- One of the values PgGeometryIf#PROJ_...public boolean getState(int aKey)
This method catches unhandled keys of subclasses. Subclasses should overwrite this method and call super for unhandled keys.
aKey
- flag to be set, choose among PvGeometryIf.SHOW_...public void setState(int aKey, boolean aState)
This method catches unhandled keys of subclasses. Subclasses should overwrite this method and call super for unhandled keys.
setState
in interface PgGeometryIf
aKey
- flag to be set, choose among PvGeometryIf.SHOW_...aState
- enable or disable statepublic PdMatrix getModelMatrix()
getModelMatrix
in interface PgGeometryIf
public boolean hasModelMatrix()
hasModelMatrix
in interface PgGeometryIf
public void setModelMatrix(PdMatrix modelMat)
null
then model matrix is removed.setModelMatrix
in interface PgGeometryIf
public boolean applyModelingMatrix()
true
if this geometry has a model matrix.public boolean applyAmbientMatrix()
true
if this geometry has a ambient matrix.public PdMatrix getAmbientMatrix()
getAmbientMatrix
in interface PgGeometryIf
public PdMatrix getAmbientInvMatrix()
getAmbientInvMatrix
in interface PgGeometryIf
public boolean hasAmbientMatrix()
hasAmbientMatrix
in interface PgGeometryIf
public void setAmbientMatrix(PdMatrix ambientMat, PdMatrix ambientInvMat)
null
then the ambient model matrices are
removed. Note, the ambient projection remains unchanged.setAmbientMatrix
in interface PgGeometryIf
public boolean projectFromAmbientSpace()
true
if operation was applied successfully.public boolean isVisible()
isVisible
in interface PgGeometryIf
setVisible(boolean)
public void setVisible(boolean flag)
setVisible
in interface PgGeometryIf
isVisible()
public boolean isShowingTitle()
public void showTitle(boolean flag)
public boolean isShowingName()
showTitle(boolean)
,
PsObject.setName(String)
public void showName(boolean flag)
showTitle(boolean)
,
PsObject.setName(String)
public boolean isShowingBndBox()
public void showBndBox(boolean flag)
public boolean isShowingCenter()
public void showCenter(boolean flag)
public PiVector getLabelAttribute(int type)
PvGeometryIf#GEOM_ITEM_POINT
and other items.type
- type of label, vertex, polygon, element or title labels.public boolean setLabelAttribute(int type, int xOffset, int yOffset, int horAdjust, int verAdjust, int font)
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,
GEOM_ITEM_NAME and GEOM_ITEM_TITLE. For possible type see
PvGeometryIf#GEOM_ITEM_POINT
and other items.
type
- Type of geometry items affected by this settingxOffset
- Offset in x-direction in pixels.yOffset
- Offset in y-direction in pixels.horAdjust
- Layout in horizontal direction, see PgGeometryIf#LABEL_.verAdjust
- Layout in vertical direction, see PgGeometryIf#LABEL_.font
- Identifier of font, see PsConfig#FONT_false
if type is unknown.public boolean setLabelAttribute(int type, PiVector labelAtt)
setLabelAttribute(int,int,int,int,int,int)
with integer arguments.
Length of vector must be equal to (or larger than) 5.type
- Type of geometry items affected by this settinglabelAtt
- Vector with different attribute valuespublic java.awt.Color getLabelColor(int type)
Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON,
GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE.
For possible type see
PvGeometryIf#GEOM_ITEM_POINT
.
type
- Type of geometry items affected by this settingpublic void setLabelColor(int type, java.awt.Color color)
Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON,
GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE.
For possible type see
PvGeometryIf#GEOM_ITEM_POINT
.
type
- Type of geometry items affected by this settingcolor
- Color used to draw the labelpublic double getLabelSize(int type)
Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON,
GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE.
For possible type see
PvGeometryIf#GEOM_ITEM_POINT
.
type
- Type of geometry items affected by this settingpublic void setLabelSize(int type, double size)
Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON,
GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE.
For possible type see
PvGeometryIf#GEOM_ITEM_POINT
.
type
- Type of geometry items affected by this settingsize
- Font size used to draw the labelpublic java.lang.String getLabelFont(int type)
Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON,
GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE.
For possible type see
PvGeometryIf#GEOM_ITEM_POINT
.
type
- Type of geometry items affected by this settingpublic void setLabelFont(int type, java.lang.String font)
Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON,
GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE.
For possible type see
PvGeometryIf#GEOM_ITEM_POINT
.
type
- Type of geometry items affected by this settingfont
- Font used to draw the labelpublic int getLabelStyle(int type)
Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON,
GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE.
For possible type see
PvGeometryIf#GEOM_ITEM_POINT
.
type
- Type of geometry items affected by this settingpublic void setLabelStyle(int type, int style)
Basic primitive types are GEOM_ITEM_POINT, GEOM_ITEM_EDGE, GEOM_ITEM_POLYGON,
GEOM_ITEM_ELEMENT, GEOM_ITEM_TETRA, GEOM_ITEM_NAME and GEOM_ITEM_TITLE.
For possible type see
PvGeometryIf#GEOM_ITEM_POINT
.
type
- Type of geometry items affected by this settingstyle
- Font style used to draw the labelpublic PsPanel getMaterialPanel()
Method is a shortcut to avoid checking, creating, and adding the panel to the inspector list.
getMaterialPanel
in interface PgGeometryIf
public PsPanel getControlPanel()
Method is a shortcut to avoid checking, creating, and adding the panel to the inspector list.
getControlPanel
in interface PgGeometryIf
public java.awt.Menu fillMethodMenu(java.awt.Menu menu)
fillMethodMenu
in interface PgGeometryIf
public java.awt.Menu fillMethodMenu(java.awt.Menu menu, PvViewerIf viewer)
fillMethodMenu
in interface PgGeometryIf
menu
- parent menu to which this menu is added.viewer
- optional viewer manager from which methods may access displays and inspectors.public void removeMethodMenus()
removeMethodMenus
in interface PgGeometryIf
public boolean addDisplay(PvDisplayIf display)
update()
whenever geometry changes
require a repaint of the display.
For example, method is called from PvDisplay when registering the geometry in the
display.addDisplay
in interface PgGeometryIf
display
- Display to be registeredfalse
if instance already registered.getDisplays()
public java.util.Vector getDisplayList()
null
if no displays found.getDisplays()
public java.util.Enumeration getDisplays()
getDisplays
in interface PgGeometryIf
null
if no displays found.TODO: use getDisplayList() since Enumeration may become obsolete in multi-threading.
public boolean hasDisplay(PvDisplayIf display)
hasDisplay
in interface PgGeometryIf
display
- Display which is checked if registeredtrue
if registered display found.addDisplay(PvDisplayIf)
,
getDisplays()
public boolean removeDisplay(PvDisplayIf display)
removeDisplay
in interface PgGeometryIf
display
- Registered display to be removedfalse
if display does not exists.addDisplay(PvDisplayIf)
public int addVertex(PdVector aVertex)
addVertex
in interface PgGeometryIf
aVertex
- vector with new vertex coordinatespublic PdVector getVertex(int anIndex)
getVertex
in interface PgGeometryIf
anIndex
- index of vertex to be returnedpublic int[] removeVertex(int anIndex)
removeVertex
in interface PgGeometryIf
anIndex
- index of vertex to be removedpublic boolean setVertex(int anIndex, PdVector aVertex)
setVertex
in interface PgGeometryIf
anIndex
- index of vertex to be changedaVertex
- vector with new vertex coordinatespublic int addPolygon(PiVector aPolygon)
addPolygon
in interface PgGeometryIf
aPolygon
- vector with indices of vertices in global vertex arraypublic PiVector getPolygon(int anIndex)
getPolygon
in interface PgGeometryIf
anIndex
- index of polygon to be returnedpublic int[] removePolygon(int anIndex)
removePolygon
in interface PgGeometryIf
anIndex
- index of polygon to be removedpublic boolean setPolygon(int anIndex, PiVector aPolygon)
setPolygon
in interface PgGeometryIf
anIndex
- index of polygon to be changedaPolygon
- vector with indices of vertices in global vertex arraypublic int addElement(PiVector anElement)
addElement
in interface PgGeometryIf
anElement
- vector with indices of vertices in global vertex arraypublic PiVector getElement(int anIndex)
getElement
in interface PgGeometryIf
anIndex
- index of element to be returnedpublic int[] removeElement(int anIndex)
removeElement
in interface PgGeometryIf
anIndex
- index of element to be removedpublic boolean setElement(int anIndex, PiVector aElement)
setElement
in interface PgGeometryIf
anIndex
- index of element to be changedaElement
- vector with indices of vertices in global vertex arraypublic void clearTagVertex(int index, int aTag)
clearTagVertex
in interface PgGeometryIf
public boolean hasTagVertex(int index, int aTag)
hasTagVertex
in interface PgGeometryIf
public void setTagVertex(int index, int aTag)
setTagVertex
in interface PgGeometryIf
public void clearTagPolygon(int index, int aTag)
clearTagPolygon
in interface PgGeometryIf
public boolean hasTagPolygon(int index, int aTag)
hasTagPolygon
in interface PgGeometryIf
public void setTagPolygon(int index, int aTag)
setTagPolygon
in interface PgGeometryIf
public void clearTagElement(int index, int aTag)
clearTagElement
in interface PgGeometryIf
public boolean hasTagElement(int index, int aTag)
hasTagElement
in interface PgGeometryIf
public void setTagElement(int index, int aTag)
setTagElement
in interface PgGeometryIf
public static void convertWorldToModel(PgGeometryIf geom, PdVector baseWorld, PdVector dirWorld, PdVector baseModel, PdVector dirModel)
If geometry has no model matrix then no operation is performed.
geom
- geometry whose model matrix is used, if it existsbaseWorld
- 3D world coordinates of view pointdirWorld
- 3D world coordinates of view directionbaseModel
- 3D model coordinates of view pointdirModel
- 3D model coordinates of view directionpublic PvPickEvent intersectionWithLine(PdVector base, PdVector dir)
intersectionWithLine
in interface PgGeometryIf
public boolean blend(double s, PgGeometry a, double t, PgGeometry b)
this = s*a + t*b
.blend
in interface PgGeometryIf
s
- weight of vertices of first elementSett
- weight of vertices of second elementSeta
- first source geometry used for blendingb
- second source geometry used for blendingtrue
on successpublic boolean merge(PgGeometryIf geomIf)
Method applies model and ambient matrices to argument geometry if such local transformation matrices exist.
merge
in interface PgGeometryIf
geomIf
- geometry merged into the current geometrytrue
on successpublic static PdVector getCenterOfElement(PdVector center, PdVector[] vertex, int[] vertInd)
center
- existing vector of dimension m_dim which will be filled and returnedvertex
- vertex array to which the index vector refersvertInd
- index vector with indices in the vertex arraypublic PgGeometry reflect(PdMatrix mat, boolean bOrient, boolean bVector)
reflect
in interface PgGeometryIf
mat
- 3*3 or 4*4 transformation matrixbOrient
- flag whether to keep the orientation of the geometrybVector
- flag whether to keep the orientation of vectorspublic java.lang.String getTextureImageName()
getTextureImageName
in interface PgGeometryIf
public void setTextureImageName(java.lang.String name)
setTextureImageName
in interface PgGeometryIf
public java.awt.Image getTextureImage()
getTextureImage
in interface PgGeometryIf
public void setTextureImage(java.awt.Image img)
setTextureImage
in interface PgGeometryIf
"