Class PgGeometry
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PgGeometry
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf
- Direct Known Subclasses:
- PgAxes, PgJvxSrc, PgPointSet, PgSurfacePair, PgVectorField, PsKeyframe
public abstract class PgGeometry extends PsObject implements PgGeometryIf
Abstract class for all geometry classes in JavaView, and implementation ofPgGeometryIf. 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.- See Also:
PgGeometryIf,PvDisplayIf, Serialized Form- Author:
- Konrad Polthier
- Version:
- 11.11.07, 3.80 revised (kp) Correct get/setJVX() when geometry has ambient space or projection.
12.06.04, 3.70 revised (kp) Color of labels improved.
29.07.03, 3.60 revised (kp) Get/setState() methods implemented to replace some of the internal flags.
25.07.03, 3.50 revised (kp) Adjust the default labeling of elements to be at the element center.
28.12.01, 3.40 revised (kp) New method getDisplayList() which replaces getDisplays().
20.12.01, 3.40 revised (ep) Internationalization.
15.09.01, 3.30 revised (ur) Modification of method fillMethodMenu for reorganization 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 hash table.
14.11.98, 2.00 revised (kp) Clean up and documenting.
00.00.97, 1.00 created (kp)
-
-
Field Summary
-
Fields inherited from class jv.object.PsObject
HAS_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
-
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, 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 Summary
Constructors Constructor and Description PgGeometry()Constructor.PgGeometry(int aDim)Constructor with dimension of geometric points, must be constant for all points.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description booleanaddDisplay(PvDisplayIf display)Register a new display.intaddElement(PiVector anElement)Method does nothing and may be overridden by subclasses.intaddPolygon(PiVector aPolygon)Method does nothing and may be overridden by subclasses.intaddVertex(PdVector aVertex)Method does nothing and may be overridden by subclasses.booleanapplyAmbientMatrix()Multiply the ambient matrix to all geometry items.booleanapplyModelingMatrix()Multiply the modeling matrix to all geometry items.booleanblend(double s, PgGeometry a, double t, PgGeometry b)Blend between two geometries, used in interpolation and computing the associate surfacesthis = s*a + t*b.voidclearTagElement(int index, int aTag)Method does nothing and may be overridden by subclasses.voidclearTagPolygon(int index, int aTag)Method does nothing and may be overridden by subclasses.voidclearTagVertex(int index, int aTag)Method does nothing and may be overridden by subclasses.java.lang.Objectclone()Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.static voidconvertWorldToModel(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.voidcopy(PsObject object)Copy argument object into this object by recursively copying all instance variables.java.awt.MenufillMethodMenu(java.awt.Menu menu)Deprecated.use fillMethodMenu(Menu, PvViewerIf)java.awt.MenufillMethodMenu(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.PdMatrixgetAmbientInvMatrix()Get a reference of the inverse ambient model matrix of geometry.PdMatrixgetAmbientMatrix()Get a reference of the ambient model matrix of geometry.intgetAmbientProjection()Get projection mode of ambient space used in model transformations.intgetAmbientSpace()Get ambient space used in model transformations.PsAuthorInfogetAuthorInfo()Get a reference to this author information.PsAuthorInfogetAuthors()Deprecated.used getAuthorInfo()PdVector[]getBounds()Compute bounding box of the vertices which are transformed with ambient and model matrix.PdVectorgetCenter()Get center of geometry which local transformations use as origin.static PdVectorgetCenterOfElement(PdVector center, PdVector[] vertex, int[] vertInd)Compute the barycenter of a geometry element like face or polygon edge.PsPanelgetControlPanel()Get control panel - if it does not exist try to allocate it.doublegetDiameter()Get diameter of object which is the diagonal in the bounding box.intgetDimOfSimplex()Get dimension of simplicial complex, i.e. maximal dimension of occurring simplices.intgetDimOfVertices()Retrieve dimension of vertices, which must be the same for all vertices.java.util.VectorgetDisplayList()Get all registered displays as vector.java.util.EnumerationgetDisplays()Get all registered displays as enumeration.PiVectorgetElement(int anIndex)Method does nothing and may be overridden by subclasses.PsGeometryInfogetGeometryInfo()Get geometry information.PgJvxSrcgetJvx()Fills a geometry object with data from this instance, for example, to print to file.PiVectorgetLabelAttribute(int type)Get offset vector in pixel coordinates of label w.r.t. base point.java.awt.ColorgetLabelColor(int type)Get color of specified label type.java.lang.StringgetLabelFont(int type)Get font name of specified label type.doublegetLabelSize(int type)Get font size of specified label type.intgetLabelStyle(int type)Get font style of specified label type.PsPanelgetMaterialPanel()Get material panel - if it does not exist try to allocate it.PdMatrixgetModelMatrix()Get a copy of the model matrix of geometry.PiVectorgetPolygon(int anIndex)Method does nothing and may be overridden by subclasses.booleangetState(int aKey)Get a drawing flag of this geometry.java.awt.ImagegetTextureImage()Get image of texture.java.lang.StringgetTextureImageName()Get name of texture image, a full URL or a relative file name.java.lang.StringgetTitle()Get the title of a geometry which may be the same for several geometries of a scene indicating a grouping or other purposes.intgetType()Get type of geometry, for examplePvGeometryIf#GEOM_POINT_SETandPvGeometryIf#GEOM_ELEMENT_SET.java.lang.StringgetVersion()java.lang.StringgetVersionType()PdVectorgetVertex(int anIndex)Method does nothing and may be overridden by subclasses.booleanhasAmbientMatrix()Check for ambient model matrix of geometry.booleanhasDisplay(PvDisplayIf display)Check if a given display is registered in this geometry.booleanhasModelMatrix()Check if geometry has a model matrix.booleanhasTagElement(int index, int aTag)Method does nothing and may be overridden by subclasses.booleanhasTagPolygon(int index, int aTag)Method does nothing and may be overridden by subclasses.booleanhasTagVertex(int index, int aTag)Method does nothing and may be overridden by subclasses.voidinit()Initializes and resets geometry.PvPickEventintersectionWithLine(PdVector base, PdVector dir)Method used for picking, should be overridden by subclasses.booleanisConfigurable(int panel)Determine whether class has a configuration panel of a given type.booleanisEnabledInstanceSharing()Determines if sharing of vertices and other instances with a base geometry is enabled when this instance is filled in PgGeomtry#getJvx().booleanisShowingBndBox()Get flag if drawing of bounding box is enabled.booleanisShowingCenter()Get flag if drawing of center of geometry is enabled.booleanisShowingName()Check whether showing of name of geometry is switched on.booleanisShowingTitle()Check whether showing of title of geometry is switched on.booleanisVisible()Check the visibility flag of the geometry.booleanmerge(PgGeometryIf geomIf)Add another of same geometry of same type to this geometry.voidpaint(PvGeometryIf dc)Major rendering method fills an internal container class supplied by the display.booleanprojectFromAmbientSpace()Apply projection matrix and perform projection determined by projection flag of the surface in a Euclidean model R3, R2, or R1 with parallel projection.PgGeometryreflect(PdMatrix mat, boolean bOrient, boolean bVector)Generate a cloned geometry and transform vertices by a matrix.booleanremoveDisplay(PvDisplayIf display)Remove a registered display from list of registered displays.int[]removeElement(int anIndex)Method does nothing and may be overridden by subclasses.voidremoveMethodMenus()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.voidsetAmbientMatrix(PdMatrix ambientMat, PdMatrix ambientInvMat)Set ambient model matrix of geometry to copy of argument matrix.voidsetAmbientProjection(int mode)Set projection mode of ambient space used in model transformations.voidsetAmbientSpace(int mode)Set ambient space used in model transformations.voidsetAuthorInfo(PsAuthorInfo authorInfo)Set author information by copying or cloning the argument author info.voidsetAuthors(PsAuthorInfo author)Deprecated.used setAuthorInfo(PsAuthorInfo)voidsetCenter(PdVector center)Set center of geometry which local transformations use as origin.voidsetDimOfSimplex(int dim)Set dimension of simplicial complex, i.e. maximal dimension of occurring simplices.voidsetDimOfVertices(int dim)Set dimension of vertices.booleansetElement(int anIndex, PiVector aElement)Method does nothing and may be overridden by subclasses.voidsetEnabledInstanceSharing(boolean flag)Determines if sharing of vertices and other instances with a base geometry is enabled when this instance is filled in PgGeomtry#getJvx().voidsetGeometryInfo(PsGeometryInfo geometryInfo)Set geometry information by copying or cloning the argument geometry info.voidsetJvx(PgJvxSrc src)Fill this instance with data from a geometry source, for example, previously read from file.booleansetLabelAttribute(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.booleansetLabelAttribute(int type, PiVector labelAtt)Set attributes of labels of given type.voidsetLabelColor(int type, java.awt.Color color)Set color of specified label type.voidsetLabelFont(int type, java.lang.String font)Set font name of specified label type.voidsetLabelSize(int type, double size)Set font size of specified label type.voidsetLabelStyle(int type, int style)Set font style of specified label type.voidsetModelMatrix(PdMatrix modelMat)Set model matrix of geometry to copy of argument matrix.booleansetPolygon(int anIndex, PiVector aPolygon)Method does nothing and may be overridden by subclasses.voidsetState(int aKey, boolean aState)Set a drawing flag of this geometry.voidsetTagElement(int index, int aTag)Method does nothing and may be overridden by subclasses.voidsetTagPolygon(int index, int aTag)Method does nothing and may be overridden by subclasses.voidsetTagVertex(int index, int aTag)Method does nothing and may be overridden by subclasses.voidsetTextureImage(java.awt.Image img)Set texture image for vertex and element textures.voidsetTextureImageName(java.lang.String name)Set name of texture image, a URL or a relative file name.voidsetTitle(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.voidsetType(int type)Set type of geometry, for examplePvGeometryIf#GEOM_POINT_SETandPvGeometryIf#GEOM_ELEMENT_SET.voidsetVersion(java.lang.String version)voidsetVersionType(java.lang.String versionType)booleansetVertex(int anIndex, PdVector aVertex)Method does nothing and may be overridden by subclasses.voidsetVisible(boolean flag)Set the visibility flag of the geometry.voidshowBndBox(boolean flag)Set flag to enable drawing of bounding box.voidshowCenter(boolean flag)Set flag to enable drawing of center of geometry.voidshowName(boolean flag)Enable and disable showing of name of geometry in display.voidshowTitle(boolean flag)Enable and disable showing of title of geometry in display.java.lang.StringtoString()Create a multi-line string representation with detailed information about all instance variables.booleanupdate(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, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, 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, hasTag, 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
-
isEnabledInstanceSharing
public boolean isEnabledInstanceSharing()
Determines if sharing of vertices and other instances with a base geometry is enabled when this instance is filled in PgGeomtry#getJvx().- Since:
- JavaView 3.84.012
- Version:
- 04.02.05, 1.00 created (kp)
-
setEnabledInstanceSharing
public 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().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.
- Since:
- JavaView 3.84.012
- Version:
- 04.02.05, 1.00 created (kp)
-
getAuthorInfo
public PsAuthorInfo getAuthorInfo()
Get a reference to this author information.- Specified by:
getAuthorInfoin interfacePgGeometryIf
-
setAuthorInfo
public void setAuthorInfo(PsAuthorInfo authorInfo)
Set author information by copying or cloning the argument author info. If argument is null then this author info is also nulled.- Specified by:
setAuthorInfoin interfacePgGeometryIf
-
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.- Specified by:
getGeometryInfoin interfacePgGeometryIf
-
setGeometryInfo
public void setGeometryInfo(PsGeometryInfo geometryInfo)
Set geometry information by copying or cloning the argument geometry info. If argument is null then this geometry info is also nulled.- Specified by:
setGeometryInfoin interfacePgGeometryIf
-
getType
public int getType()
Get type of geometry, for examplePvGeometryIf#GEOM_POINT_SETandPvGeometryIf#GEOM_ELEMENT_SET.- Specified by:
getTypein interfacePgGeometryIf- Returns:
- type of geometry such as PgGeometrIy#GEOM_POINT_SET.
-
setType
public void setType(int type)
Set type of geometry, for examplePvGeometryIf#GEOM_POINT_SETandPvGeometryIf#GEOM_ELEMENT_SET. Change display of vertices to default setting depending on geometry type.
-
getVersion
public java.lang.String getVersion()
-
setVersion
public void setVersion(java.lang.String version)
-
getVersionType
public java.lang.String getVersionType()
-
setVersionType
public void setVersionType(java.lang.String versionType)
-
getTitle
public 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.- Specified by:
getTitlein interfacePgGeometryIf- See Also:
PsObject.setName(String),showTitle(boolean),setTitle(String)
-
setTitle
public 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.- Specified by:
setTitlein interfacePgGeometryIf- See Also:
PsObject.setName(String),showTitle(boolean),getTitle()
-
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()- Version:
- 14.05.01, 1.10 revised (kp) Dimension of bounding box vectors now always 3.
-
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 dimension 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.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.
- Returns:
- two vectors which are the extremal corners of the bounding cube
- See Also:
getBounds()- Version:
- 14.05.01, 1.00 created (kp)
-
getCenter
public PdVector getCenter()
Get center of geometry which local transformations 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
- Version:
- 21.10.00, 1.10 revised (kp) Allocate center of it does not exist.
-
setCenter
public void setCenter(PdVector center)
Set center of geometry which local transformations use as origin. This method sets an instance variable and does not modify vertices.- Parameters:
center- vector which becomes the local origin of the geometry- Version:
- 21.10.00, 1.10 revised (kp) Allocate center of it does not exist.
-
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 areHAS_INFO_PANELorHAS_MATERIAL_PANELorHAS_TEXTURE_PANELorHAS_CONFIG_PANEL.- Specified by:
isConfigurablein interfacePgGeometryIf- Parameters:
panel- Identifier of panel- Version:
- 16.09.00, 1.10 revised (kp) Int argument panel added.
01.08.00, 1.00 created (kp)
-
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:
getDimOfSimplexin interfacePgGeometryIf- Since:
- JavaView 1.95
- See Also:
setDimOfSimplex(int)
-
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:
getDimOfSimplex()
-
getJvx
public PgJvxSrc getJvx()
Fills a geometry object with data from this instance, for example, to print to file.- Specified by:
getJvxin interfacePgGeometryIf- 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:
setJvxin interfacePgGeometryIf- 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:
toStringin interfacePgGeometryIf- Overrides:
toStringin classPsObject
-
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 tonull.Display list is not cloned but set to null. Method menu is not cloned.
- Specified by:
clonein interfacePgGeometryIf- Overrides:
clonein classPsObject- See Also:
copy(PsObject)- Version:
- 21.12.00, 1.25 revised (kp) No longer clone method menu.
12.12.00, 1.20 revised (kp) Descriptions moved from PgJvxSrc to this class.
21.10.00, 1.10 revised (kp) Missing cloning of method menu added.
05.07.00, 1.00 created (kp)
-
copy
public void copy(PsObject object)
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.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).
- Overrides:
copyin classPsObject- See Also:
PsObject.clone()- Version:
- 24.03.02, 2.10 revised (kp) No longer copy the type.
19.03.02, 2.00 revised (kp) Additional instance variables copied.
08.11.02, 1.10 revised (kp) Argument changed to PsObject from PgGeometry.
-
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.
- 4. event == else : unhandled event, error.
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:
updatein interfacePsUpdateIf- Overrides:
updatein classPsObject- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
paint
public void paint(PvGeometryIf dc)
Major rendering method fills an internal container class supplied by the display. Seejv.project.PgGeometryIffor detailed information.- Specified by:
paintin interfacePgGeometryIf- See Also:
PgGeometryIf- Version:
- 10.06.05, 1.10 revised (kp) Assign center.
-
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:
getDimOfVerticesin interfacePgGeometryIf- See Also:
PgGeometry(int)
-
setDimOfVertices
public void setDimOfVertices(int dim)
Set dimension of vertices. Internal use only, public access must assign dimension of vertices in the constructor.- Version:
- 14.11.07, 1.10 revised (kp) Made public since interfaces need access.
-
getAmbientSpace
public int getAmbientSpace()
Get ambient space used in model transformations.- Specified by:
getAmbientSpacein interfacePgGeometryIf- Returns:
- One of the values PgGeometryIf#AMBIENT_...
-
setAmbientSpace
public void setAmbientSpace(int mode)
Set ambient space used in model transformations.- Specified by:
setAmbientSpacein interfacePgGeometryIf- Parameters:
mode- One of the values PgGeometryIf#AMBIENT_...
-
getAmbientProjection
public int getAmbientProjection()
Get projection mode of ambient space used in model transformations.- Specified by:
getAmbientProjectionin interfacePgGeometryIf- 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:
setAmbientProjectionin interfacePgGeometryIf- Parameters:
mode- One of the values PgGeometryIf#PROJ_...
-
getState
public boolean getState(int aKey)
Get a drawing flag of this geometry. 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.
- Parameters:
aKey- flag to be set, choose among PvGeometryIf.SHOW_...- Returns:
- boolean state of this key
- Since:
- JavaView 2.89.000
- Version:
- 29.07.03, 1.00 created (kp)
-
setState
public void setState(int aKey, boolean aState)Set a drawing flag of this geometry. 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:
setStatein interfacePgGeometryIf- Parameters:
aKey- flag to be set, choose among PvGeometryIf.SHOW_...aState- enable or disable state- Since:
- JavaView 2.89.000
- Version:
- 29.07.03, 1.00 created (kp)
-
getModelMatrix
public PdMatrix getModelMatrix()
Get a copy of the model matrix of geometry. If geometry has no model matrix, then create and assign the identity matrix and return it.- Specified by:
getModelMatrixin interfacePgGeometryIf
-
hasModelMatrix
public boolean hasModelMatrix()
Check if geometry has a model matrix.- Specified by:
hasModelMatrixin interfacePgGeometryIf
-
setModelMatrix
public void setModelMatrix(PdMatrix modelMat)
Set model matrix of geometry to copy of argument matrix. If argument isnullthen model matrix is removed.- Specified by:
setModelMatrixin interfacePgGeometryIf
-
applyModelingMatrix
public boolean applyModelingMatrix()
Multiply the modeling matrix to all geometry items. Method of this class does nothing. Subclasses are expected to reset the modeling matrix of this geometry to the identity matrix.- Returns:
trueif this geometry has a model matrix.- Since:
- JavaView 3.24
- Version:
- 16.05.04, 1.00 created (kp)
-
applyAmbientMatrix
public boolean applyAmbientMatrix()
Multiply the ambient matrix to all geometry items. Method of this class does nothing. Subclasses are expected to reset the ambient matrix of this geometry to the identity matrix.- Returns:
trueif this geometry has a ambient matrix.- Since:
- JavaView 3.24
- Version:
- 16.05.04, 1.00 created (kp)
-
getAmbientMatrix
public PdMatrix getAmbientMatrix()
Get a reference of the ambient model matrix of geometry. If geometry has no ambient matrix, then create and assign the identity matrix and return it.- Specified by:
getAmbientMatrixin interfacePgGeometryIf
-
getAmbientInvMatrix
public PdMatrix getAmbientInvMatrix()
Get a reference of the inverse ambient model matrix of geometry. If geometry has no ambient matrix, then create and assign the identity matrix and return it.- Specified by:
getAmbientInvMatrixin interfacePgGeometryIf
-
hasAmbientMatrix
public boolean hasAmbientMatrix()
Check for ambient model matrix of geometry.- Specified by:
hasAmbientMatrixin interfacePgGeometryIf
-
setAmbientMatrix
public void setAmbientMatrix(PdMatrix ambientMat, PdMatrix ambientInvMat)
Set ambient model matrix of geometry to copy of argument matrix. If one argument isnullthen the ambient model matrices are removed. Note, the ambient projection remains unchanged.- Specified by:
setAmbientMatrixin interfacePgGeometryIf
-
projectFromAmbientSpace
public 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. Dimension of vertices may be decremented by one after this operation.- Returns:
trueif operation was applied successfully.- Since:
- JavaView 3.24.001
- Version:
- 16.05.04, 1.00 created (kp) Moved here from PgPointSet.
-
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:
isVisiblein interfacePgGeometryIf- 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:
setVisiblein interfacePgGeometryIf- 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.
-
isShowingName
public boolean isShowingName()
Check whether showing of name of geometry is switched on. On default, showing of name is disabled.- Since:
- JavaView 2.47
- See Also:
showTitle(boolean),PsObject.setName(String)- Version:
- 26.11.02, 1.00 created (kp)
-
showName
public void showName(boolean flag)
Enable and disable showing of name of geometry in display. On default, showing of title is disabled.- Since:
- JavaView 2.47
- See Also:
showTitle(boolean),PsObject.setName(String)- Version:
- 26.11.02, 1.00 created (kp)
-
isShowingBndBox
public boolean isShowingBndBox()
Get flag if drawing of bounding box is enabled.
-
showBndBox
public void showBndBox(boolean flag)
Set flag to enable drawing of bounding box.
-
isShowingCenter
public boolean isShowingCenter()
Get flag if drawing of center of geometry is enabled.
-
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 seePvGeometryIf#GEOM_ITEM_POINTand 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_HEADorPgGeometryIf.LABEL_CENTERorPgGeometryIf.LABEL_TAILand indicates whether head, tail, or center of label is located at base+offset.Fourth component of attr is
PgGeometryIf.LABEL_TOPorPgGeometryIf.LABEL_MIDDLEorPgGeometryIf.LABEL_BASEand 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_POINTand other items.- Parameters:
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_- Returns:
falseif type is unknown.- Version:
- 11.09.00, 1.10 revised (kp) Argument changes to sequence of int's from PiVector.
10.08.00, 1.00 created (kp)
-
setLabelAttribute
public boolean setLabelAttribute(int type, PiVector labelAtt)Set attributes of labels of given type. Methods just callssetLabelAttribute(int,int,int,int,int,int)with integer arguments. Length of vector must be equal to (or larger than) 5.- Parameters:
type- Type of geometry items affected by this settinglabelAtt- Vector with different attribute values
-
getLabelColor
public java.awt.Color getLabelColor(int type)
Get color of specified label 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.- Parameters:
type- Type of geometry items affected by this setting- Since:
- JavaView 3.28.002
- Version:
- 12.06.04, 1.00 created (kp)
-
setLabelColor
public void setLabelColor(int type, java.awt.Color color)Set color of specified label 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.- Parameters:
type- Type of geometry items affected by this settingcolor- Color used to draw the label- Since:
- JavaView 3.05.003
- Version:
- 22.01.04, 1.00 created (kp)
-
getLabelSize
public double getLabelSize(int type)
Get font size of specified label 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.- Parameters:
type- Type of geometry items affected by this setting- Since:
- JavaView 3.52.001
- Version:
- 15.08.04, 1.00 created (kp)
-
setLabelSize
public void setLabelSize(int type, double size)Set font size of specified label 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.- Parameters:
type- Type of geometry items affected by this settingsize- Font size used to draw the label- Since:
- JavaView 3.52.001
- Version:
- 15.08.04, 1.00 created (kp)
-
getLabelFont
public java.lang.String getLabelFont(int type)
Get font name of specified label 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.- Parameters:
type- Type of geometry items affected by this setting- Since:
- JavaView 3.52.001
- Version:
- 15.08.04, 1.00 created (kp)
-
setLabelFont
public void setLabelFont(int type, java.lang.String font)Set font name of specified label 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.- Parameters:
type- Type of geometry items affected by this settingfont- Font used to draw the label- Since:
- JavaView 3.52.001
- Version:
- 15.08.04, 1.00 created (kp)
-
getLabelStyle
public int getLabelStyle(int type)
Get font style of specified label 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.- Parameters:
type- Type of geometry items affected by this setting- Since:
- JavaView 3.52.001
- Version:
- 15.08.04, 1.00 created (kp)
-
setLabelStyle
public void setLabelStyle(int type, int style)Set font style of specified label 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.- Parameters:
type- Type of geometry items affected by this settingstyle- Font style used to draw the label- Since:
- JavaView 3.52.001
- Version:
- 15.08.04, 1.00 created (kp)
-
getMaterialPanel
public PsPanel getMaterialPanel()
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:
getMaterialPanelin interfacePgGeometryIf- Version:
- 03.06.01, 2.00 revised (kp) Method simply calls assureInspector().
07.06.00, 1.10 revised (kp) Recreate panel if language has changed.
-
getControlPanel
public PsPanel getControlPanel()
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:
getControlPanelin interfacePgGeometryIf- Version:
- 03.06.01, 2.00 revised (kp) Method simply calls assureInspector().
07.06.00, 1.10 revised (kp) Recreate panel if language has changed.
-
fillMethodMenu
public java.awt.Menu fillMethodMenu(java.awt.Menu menu)
Deprecated. use fillMethodMenu(Menu, PvViewerIf)Fill menu with items to invoke advanced methods of this geometry.- Specified by:
fillMethodMenuin interfacePgGeometryIf- Version:
- 04.02.02, 1.20 revised (kp) Initiate an update of a menu right after calling its init() method.
11.09.01, 1.10 revised (ur) Adding contents of jvx methods to m_methodMenu modified.
-
fillMethodMenu
public java.awt.Menu fillMethodMenu(java.awt.Menu menu, PvViewerIf viewer)Fill menu with items to invoke advanced methods of this geometry. Via the optional parameter viewer the methods invoked by the menu may access the displays and inspectors of the environment.- Specified by:
fillMethodMenuin interfacePgGeometryIf- Parameters:
menu- parent menu to which this menu is added.viewer- optional viewer manager from which methods may access displays and inspectors.- Since:
- JavaView 2.45
- Version:
- 08.02.07, 1.60 revised (kp) Further method menus may be specified, comma separated in PsJavaView.FILE_MENU.
05.07.04, 1.50 revised (kp) Menus from archive dev added (currently only in application mode).
04.02.02, 1.20 revised (kp) Initiate an update of a menu right after calling its init() method.
11.09.01, 1.10 revised (ur) Adding contents of jvx methods to m_methodMenu modified.
-
removeMethodMenus
public void removeMethodMenus()
Remove all menus with items to invoke advanced methods of this geometry.- Specified by:
removeMethodMenusin interfacePgGeometryIf- Version:
- 05.06.02, 1.00 revised (kp)
05.06.02, 1.00 created (kp)
-
addDisplay
public boolean addDisplay(PvDisplayIf display)
Register a new display. Display will be informed byupdate()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:
addDisplayin interfacePgGeometryIf- Parameters:
display- Display to be registered- Returns:
falseif instance already registered.- See Also:
getDisplays()
-
getDisplayList
public java.util.Vector getDisplayList()
Get all registered displays as vector.- Returns:
- Enumeration of registered displays,
nullif no displays found. - See Also:
getDisplays()
-
getDisplays
public java.util.Enumeration getDisplays()
Get all registered displays as enumeration.- Specified by:
getDisplaysin interfacePgGeometryIf- Returns:
- Enumeration of registered displays,
nullif no displays found. - See Also:
TODO: use getDisplayList() since Enumeration may become obsolete in multi-threading.
-
hasDisplay
public boolean hasDisplay(PvDisplayIf display)
Check if a given display is registered in this geometry.- Specified by:
hasDisplayin interfacePgGeometryIf- Parameters:
display- Display which is checked if registered- Returns:
trueif 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:
removeDisplayin interfacePgGeometryIf- Parameters:
display- Registered display to be removed- Returns:
falseif display does not exists.- See Also:
addDisplay(PvDisplayIf)
-
addVertex
public int addVertex(PdVector aVertex)
Method does nothing and may be overridden by subclasses.- Specified by:
addVertexin interfacePgGeometryIf- Parameters:
aVertex- vector with new vertex coordinates
-
getVertex
public PdVector getVertex(int anIndex)
Method does nothing and may be overridden by subclasses.- Specified by:
getVertexin interfacePgGeometryIf- 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 overridden by subclasses.- Specified by:
removeVertexin interfacePgGeometryIf- 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 overridden by subclasses.- Specified by:
setVertexin interfacePgGeometryIf- Parameters:
anIndex- index of vertex to be changedaVertex- vector with new vertex coordinates
-
addPolygon
public int addPolygon(PiVector aPolygon)
Method does nothing and may be overridden by subclasses.- Specified by:
addPolygonin interfacePgGeometryIf- Parameters:
aPolygon- vector with indices of vertices in global vertex array
-
getPolygon
public PiVector getPolygon(int anIndex)
Method does nothing and may be overridden by subclasses.- Specified by:
getPolygonin interfacePgGeometryIf- 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 overridden by subclasses.- Specified by:
removePolygonin interfacePgGeometryIf- 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 overridden by subclasses.- Specified by:
setPolygonin interfacePgGeometryIf- Parameters:
anIndex- index of polygon to be changedaPolygon- vector with indices of vertices in global vertex array
-
addElement
public int addElement(PiVector anElement)
Method does nothing and may be overridden by subclasses.- Specified by:
addElementin interfacePgGeometryIf- Parameters:
anElement- vector with indices of vertices in global vertex array
-
getElement
public PiVector getElement(int anIndex)
Method does nothing and may be overridden by subclasses.- Specified by:
getElementin interfacePgGeometryIf- 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 overridden by subclasses.- Specified by:
removeElementin interfacePgGeometryIf- 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 overridden by subclasses.- Specified by:
setElementin interfacePgGeometryIf- Parameters:
anIndex- index of element to be changedaElement- vector with indices of vertices in global vertex array
-
clearTagVertex
public void clearTagVertex(int index, int aTag)Method does nothing and may be overridden by subclasses.- Specified by:
clearTagVertexin interfacePgGeometryIf
-
hasTagVertex
public boolean hasTagVertex(int index, int aTag)Method does nothing and may be overridden by subclasses.- Specified by:
hasTagVertexin interfacePgGeometryIf
-
setTagVertex
public void setTagVertex(int index, int aTag)Method does nothing and may be overridden by subclasses.- Specified by:
setTagVertexin interfacePgGeometryIf
-
clearTagPolygon
public void clearTagPolygon(int index, int aTag)Method does nothing and may be overridden by subclasses.- Specified by:
clearTagPolygonin interfacePgGeometryIf
-
hasTagPolygon
public boolean hasTagPolygon(int index, int aTag)Method does nothing and may be overridden by subclasses.- Specified by:
hasTagPolygonin interfacePgGeometryIf
-
setTagPolygon
public void setTagPolygon(int index, int aTag)Method does nothing and may be overridden by subclasses.- Specified by:
setTagPolygonin interfacePgGeometryIf
-
clearTagElement
public void clearTagElement(int index, int aTag)Method does nothing and may be overridden by subclasses.- Specified by:
clearTagElementin interfacePgGeometryIf
-
hasTagElement
public boolean hasTagElement(int index, int aTag)Method does nothing and may be overridden by subclasses.- Specified by:
hasTagElementin interfacePgGeometryIf
-
setTagElement
public void setTagElement(int index, int aTag)Method does nothing and may be overridden by subclasses.- Specified by:
setTagElementin interfacePgGeometryIf
-
convertWorldToModel
public 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.If geometry has no model matrix then no operation is performed.
- Parameters:
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 direction- Version:
- 01.04.06, 1.00 created (kp)
-
intersectionWithLine
public PvPickEvent intersectionWithLine(PdVector base, PdVector dir)
Method used for picking, should be overridden by subclasses.- Specified by:
intersectionWithLinein interfacePgGeometryIf
-
blend
public boolean blend(double s, PgGeometry a, double t, PgGeometry b)Blend between two geometries, used in interpolation and computing the associate surfacesthis = s*a + t*b.- Specified by:
blendin interfacePgGeometryIf- Parameters:
s- weight of vertices of first elementSett- weight of vertices of second elementSeta- first source geometry used for blendingb- second source geometry used for blending- Returns:
trueon success- Author:
- Konrad Polthier
- Version:
- 02.08.03, 1.10 revised (kp) Copying of status tags added.
31.12.97, 1.00 created (kp)
-
merge
public boolean merge(PgGeometryIf geomIf)
Add another of same geometry of same type to this geometry. If types of geometries are different then nothing is done.Method applies model and ambient matrices to argument geometry if such local transformation matrices exist.
- Specified by:
mergein interfacePgGeometryIf- Parameters:
geomIf- geometry merged into the current geometry- Returns:
trueon success- Version:
- 16.05.04, 2.00 revised (kp) Apply ambient and model matrices before merging.
-
getCenterOfElement
public static PdVector getCenterOfElement(PdVector center, PdVector[] vertex, int[] vertInd)
Compute the barycenter of a geometry element like face or polygon edge.- Parameters:
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 array- Returns:
- Argument center is filled with the position of the barycenter
- Author:
- Konrad Polthier
- Version:
- 03.07.07, 1.10 revised (fk) First argument may now be null. 23.08.00, 1.00 created (kp)
-
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:
reflectin interfacePgGeometryIf- Parameters:
mat- 3*3 or 4*4 transformation matrixbOrient- flag whether to keep the orientation of the geometrybVector- flag whether to keep the orientation of vectors- Returns:
- new reflected copy of the geometry
- Author:
- Konrad Polthier
- Version:
- 12.12.00, 1.10 revised (kp) Additional argument added for orientation of vectors.
16.11.00, 1.00 created (kp)
-
getTextureImageName
public java.lang.String getTextureImageName()
Get name of texture image, a full URL or a relative file name.- Specified by:
getTextureImageNamein interfacePgGeometryIf
-
setTextureImageName
public void setTextureImageName(java.lang.String name)
Set name of texture image, a URL or a relative file name.- Specified by:
setTextureImageNamein interfacePgGeometryIf
-
getTextureImage
public java.awt.Image getTextureImage()
Get image of texture.- Specified by:
getTextureImagein interfacePgGeometryIf
-
setTextureImage
public void setTextureImage(java.awt.Image img)
Set texture image for vertex and element textures.- Specified by:
setTextureImagein interfacePgGeometryIf
-
-
"