Interface PgGeometryIf
-
- All Superinterfaces:
- PsUpdateIf
- All Known Subinterfaces:
- PvLightIf
- All Known Implementing Classes:
- MySurface, PgAxes, PgBezierCurve, PgBndElementSet, PgBndPolygon, PgCatenoid, PgCircle, PgCircleF, PgCubeBndElementSet, PgCubeSet, PgCurveF, PgDomain, PgElementSet, PgFunction, PgGenusSurface, PgGeometry, PgGraph, PgGraphF, PgHarmonicMap, PgHelicoid, PgJvxSrc, PgKleinBottle, PgLantern, PgMaxPrinciple, PgParmCurve, PgParmSurface, PgPlotF, PgPointF, PgPointSet, PgPointSetOnElementSet, PgPointSetOnPolygon, PgPolygon, PgPolygonOnElementSet, PgPolygonSet, PgPolygonSetOnElementSet, PgRuler, PgSegmentF, PgSmallCubes, PgSmallTetrahedra, PgSphere, PgSurface, PgSurfaceGraph, PgSurfaceOfRotation, PgSurfacePair, PgTetraSet, PgTube, PgVectorField, PgWeierstrass, PsKeyframe, PvGeometry, PvLight
public interface PgGeometryIf extends PsUpdateIf
This interface must be implemented by all geometries to allow registration and rendering in a display of JavaView. Displays call the methodpaint(PvGeometryIf)of a registered geometry where the geometry should pass its data to the display.paint()is the most important method of this interface.An implementation of the interface must assure that whenever a geometry has changed such that an update of the display is required, the update method of the display is called with the geometry as argument.
disp.update(geom)Then display automatically calls the method geom.paint(PvGeometryIf)to request data from geometry. Each display in JavaView implements the interface PvDisplayIf to be able to handle geometries implementing the interface PgGeometryIf.The interface PgGeometryIf is implemented by
PgGeometry. By subclassing from PgGeometry the user only needs to override a few methods.The class_name for info/control/material panel and methodMenu must follow special rules namely:
"name of main class"+"_BP" "name of main class"+"_CP" "name of main class"+"_IP" "name of main class"+"_MP" "name of main class"+"_TP" "name of main class"+"_Menu"- See Also:
PgGeometry,PgJvxSrc,PvDisplayIf,PvDisplay,PvDisplayIf- Author:
- Konrad Polthier
- Version:
- 18.06.06, 3.70 revised (kp) Static variables for texture handling moved here from PgTexture and PgJvxSrc.
02.05.04, 3.60 revised (kp) Clonable interface removed since declared in PgGeometry.
05.06.02, 3.50 revised (kp) New method removeMethodMenus() added.
06.01.02, 3.40 revised (kp) Use _CONFIG instead of _CONTROL as panel identifier.
20.12.01, 3.40 revised (ep) Internationalization.
03.06.01, 3.30 revised (kp) Texture added.
06.05.01, 3.20 revised (kp) Hyperbolic and spherical ambient spaces added.
16.11.00, 3.10 revised (kp) New method to reflect geometries.
08.10.00, 3.01 revised (kp) PROJ_STEREO renamed to PROJ_STEREOGRAPHIC.
02.04.00, 3.00 revised (kp) PdColor replaced with Color in lists.
05.03.00, 2.10 created (kp) Methods showIndices() and isShowingIndices() moved to PgPointSet.
04.03.00, 2.00 created (kp) Interface split into this and PgGeometrySrcIf.
29.12.99, 1.30 created (kp) Ambient spaces and their projections added.
21.12.99, 1.20 created (kp) Model matrix handling added.
30.09.99, 1.10 created (kp) Methods to print indices in display added.
09.02.98, 1.00 created (kp)
-
-
Field Summary
Fields Modifier and Type Field and Description static intAMBIENT_H2_HYPERBOLICAmbient space is hyperbolic 2d space in R3_L, used in model transformations.static intAMBIENT_H3_HYPERBOLICAmbient space is hyperbolic 3d space in R3_L, used in model transformations.static intAMBIENT_H4_HYPERBOLICAmbient space is hyperbolic 4d space in R5_L, used in model transformations.static java.lang.String[][]AMBIENT_PROJECTIONSList of names of projection methods from ambient spaces.static intAMBIENT_R1_EUCLIDEANAmbient space is 1d-euclidean, used in model transformations.static intAMBIENT_R2_EUCLIDEANAmbient space is 2d-euclidean, used in model transformations.static intAMBIENT_R3_EUCLIDEANAmbient space is 3d-euclidean, used in model transformations.static intAMBIENT_R4_EUCLIDEANAmbient space is 4d-euclidean, used in model transformations.static intAMBIENT_R5_EUCLIDEANAmbient space is 5d-euclidean, used in model transformations.static intAMBIENT_S1_SPHEREAmbient space is unit circle in 2d-euclidean, used in model transformations.static intAMBIENT_S2_SPHEREAmbient space is unit sphere in R3, used in model transformations.static intAMBIENT_S3_SPHEREAmbient space is unit sphere in R4, used in model transformations.static intAMBIENT_S4_SPHEREAmbient space is unit sphere in R5, used in model transformations.static java.lang.String[][]AMBIENT_SPACESList of names of possible ambient spaces of geometries.static intBLEND_ALPHAFlag if texture of a greyscale image is only used to make surface semi-transparent.static intBLEND_MATERIALFlag if texture is combined with surface color depending on texture transparency.static intBLEND_REPLACEFlag if texture overpaints all surface colors and a possible alpha channel makes surface semi-transparent.static intFILTER_DIRECTNo filtering, for each pixel the texture image is sampled at a single point.static intFILTER_LINEARBilinear filtering, for each pixel the texture image is sampled at a four points.static intFILTER_QUADRATICBiquadratic filtering, for each pixel the texture image is sampled at a nine points.static intHAS_METHOD_MENUTag object as having a method menu.static java.lang.StringINSPECTOR_CONTROLDeprecated.use PsPanel.CONFIG insteadstatic java.lang.StringINSPECTOR_CONTROL_EXTDeprecated.use PsPanel.CONFIG_EXT insteadstatic java.lang.StringINSPECTOR_MATERIALDeprecated.use PsPanel.MATERIAL insteadstatic java.lang.StringINSPECTOR_MATERIAL_EXTDeprecated.use PsPanel.MATERIAL_EXT insteadstatic java.lang.StringINSPECTOR_TEXTUREDeprecated.use PsPanel.TEXTURE insteadstatic java.lang.StringINSPECTOR_TEXTURE_EXTDeprecated.use PsPanel.TEXTURE_EXT insteadstatic intLABEL_BASEstatic intLABEL_CENTERstatic intLABEL_HEADstatic intLABEL_MIDDLEstatic intLABEL_TAILstatic intLABEL_TOPstatic intm_numLabelTypesNumber of labal types such as PvGeometryIf.GEOM_ITEM_POINT, _EDGE, _POLYGON.static java.lang.StringMETHOD_EXTFile name suffix of menu class to name of base class.static intPERIODIC_BOTHFlag determines that texture is continued periodically in both directions outside the unit texture domain.static intPERIODIC_HEIGHTFlag determines that texture is continued periodically in height directions outside the unit texture domain.static intPERIODIC_NONEFlag determines if and how texture is continued outside the unit texture domain.static intPERIODIC_WIDTHFlag determines that texture is continued periodically in width directions outside the unit texture domain.static intPROJ_KLEIN_BALLProjection into Klein's hyperbolic sphere, used in model transformations.static intPROJ_PARALLELParallel projection, used in model transformations.static intPROJ_POINCARE_BALLConformal projection into Poincare's sphere, used in model transformations.static intPROJ_STEREOGRAPHICStereographic projection, used in model transformations.static intPROJ_UPPER_HALFSPACEConformal projection into Poincare's hyperbolic upper half space model, used in model transformations.static intSIDE_BACKFlag determines if texture is applied to background side of a surface.static intSIDE_BOTHFlag determines if texture is applied to both sides of a surface.static intSIDE_FRONTFlag determines if texture is applied to foreground side of a surface.static intSIDE_NONEFlag determines if texture is applied to both sides of a surface.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method and Description booleanaddDisplay(PvDisplayIf display)Register a new display to render the geometry.intaddElement(PiVector anElement)Add a vector to a geometry, probably at the end of its element array.intaddPolygon(PiVector aPolygon)Add a polygon to a geometry, probably at the end of its polygon array.intaddVertex(PdVector aVertex)Add a vector to a geometry, probably at the end of its vertex array.PsPanelassureInspector(java.lang.String type, java.lang.String ext)Get a certain panel - if it does not exist then try to allocate it.booleanblend(double s, PgGeometry a, double t, PgGeometry b)Interpolate between two geometries, for example, in a smooth animation.voidclearTagElement(int index, int aTag)Clear a single tag of an element.voidclearTagPolygon(int index, int aTag)Clear a single tag of a polygon.voidclearTagVertex(int index, int aTag)Clear a single tag of a vertex.java.lang.Objectclone()Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners.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.PdMatrixgetAmbientInvMatrix()Get a reference of the ambient inverse 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 author information.PsPanelgetControlPanel()Get control panel - if it does not exist try to allocate it.intgetDimOfSimplex()Get dimension of simplicial complex, i.e. maximal dimension of occurring simplices.intgetDimOfVertices()Get dimension of points used in geometry, i.e. the number coordinates per point.java.util.EnumerationgetDisplays()Get all registered displays as Enumeration.PiVectorgetElement(int anIndex)Return reference to element with given index.PsGeometryInfogetGeometryInfo()Get geometry information.PsPanelgetInfoPanel()Get info panel - if it does not exist try to allocate it.PgJvxSrcgetJvx()Fills a geometry object with data from this instance, for example, to print to file.PsPanelgetMaterialPanel()Get material panel - if it does not exist try to allocate it.PdMatrixgetModelMatrix()Get model matrix of geometry.java.lang.StringgetName()Name of geometry, user should try to be unique inside JavaView.PiVectorgetPolygon(int anIndex)Return reference to polygon with given index.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 example,PvGeometry#GEOM_POINT_SET.PdVectorgetVertex(int anIndex)Return reference to vertex with given index anIndex.booleanhasAmbientMatrix()Check for ambient model matrix of geometry.booleanhasDisplay(PvDisplayIf display)Check for a registered display by name.booleanhasModelMatrix()Check for model matrix of geometry.booleanhasTag(int aBit)Check whether tag of object is set.booleanhasTagElement(int index, int aTag)Check whether element has given tag.booleanhasTagPolygon(int index, int aTag)Check whether polygon has given tag.booleanhasTagVertex(int index, int aTag)Check whether vertex has given tag.PvPickEventintersectionWithLine(PdVector base, PdVector dir)Find intersection with ray.booleanisConfigurable(int panel)Check whether class has a configuration panel to configure it.booleanisVisible()Check flag whether geometry is selected to be hidden or not in display.booleanmerge(PgGeometryIf geom)Add another geometry of same type to this geometry.voidpaint(PvGeometryIf dc)Major rendering method fills an internal container class supplied by the display.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)Remove an element with given index.voidremoveMethodMenus()Remove menu with items to invoke advanced methods of this geometry.int[]removePolygon(int anIndex)Remove polygon with given index.int[]removeVertex(int anIndex)Remove vertex with given index.voidsetAmbientMatrix(PdMatrix ambientMat, PdMatrix ambientInvMat)Set ambient model matrix of geometry and its inverse.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.booleansetElement(int anIndex, PiVector anElement)Allow setting the vertex indices of a single element.voidsetGeometryInfo(PsGeometryInfo geometryInfo)Set geometry information.voidsetJvx(PgJvxSrc src)Fill this instance with data from a geometry source, for example, previously read from file.voidsetModelMatrix(PdMatrix modelMat)Set model matrix of geometry.voidsetName(java.lang.String name)Set name of geometry, user should try to be unique inside JavaView.booleansetPolygon(int anIndex, PiVector aPolygon)Allow setting the vertex indices of a single polygon.voidsetState(int key, boolean state)Set drawing flags of this geometry from within the display.voidsetTagElement(int index, int aTag)Set a tag of an element.voidsetTagPolygon(int index, int aTag)Set a tag of a polygon.voidsetTagVertex(int index, int aTag)Set a tag of a vertex.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.booleansetVertex(int anIndex, PdVector aVertex)Allow setting the coordinates of a single vertex.voidsetVisible(boolean flag)Set geometry to be hidden or visible in display.java.lang.StringtoString()Get a detailed string representation of object, usually rather long.-
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent, update
-
-
-
-
Field Detail
-
HAS_METHOD_MENU
static final int HAS_METHOD_MENU
Tag object as having a method menu. Usually tag is set in the constructor.- Since:
- JavaView 2.43
- See Also:
PsObject.setTag(int), Constant Field Values
-
INSPECTOR_CONTROL_EXT
static final java.lang.String INSPECTOR_CONTROL_EXT
Deprecated. use PsPanel.CONFIG_EXT insteadFile name suffix of control panel class to name of base class.- See Also:
- Constant Field Values
-
INSPECTOR_MATERIAL_EXT
static final java.lang.String INSPECTOR_MATERIAL_EXT
Deprecated. use PsPanel.MATERIAL_EXT insteadFile name suffix of material panel class to name of base class.- See Also:
- Constant Field Values
-
INSPECTOR_TEXTURE_EXT
static final java.lang.String INSPECTOR_TEXTURE_EXT
Deprecated. use PsPanel.TEXTURE_EXT insteadFile name suffix of texture panel class to name of base class.- See Also:
- Constant Field Values
-
METHOD_EXT
static final java.lang.String METHOD_EXT
File name suffix of menu class to name of base class.- See Also:
- Constant Field Values
-
INSPECTOR_CONTROL
static final java.lang.String INSPECTOR_CONTROL
Deprecated. use PsPanel.CONFIG insteadName of default control panel under which panel is registered in panel list.- See Also:
- Constant Field Values
-
INSPECTOR_MATERIAL
static final java.lang.String INSPECTOR_MATERIAL
Deprecated. use PsPanel.MATERIAL insteadName of default material panel under which panel is registered in panel list.- See Also:
- Constant Field Values
-
INSPECTOR_TEXTURE
static final java.lang.String INSPECTOR_TEXTURE
Deprecated. use PsPanel.TEXTURE insteadName of default texture panel under which panel is registered in panel list.- See Also:
- Constant Field Values
-
m_numLabelTypes
static final int m_numLabelTypes
Number of labal types such as PvGeometryIf.GEOM_ITEM_POINT, _EDGE, _POLYGON.
-
LABEL_TOP
static final int LABEL_TOP
- See Also:
- Constant Field Values
-
LABEL_MIDDLE
static final int LABEL_MIDDLE
- See Also:
- Constant Field Values
-
LABEL_BASE
static final int LABEL_BASE
- See Also:
- Constant Field Values
-
LABEL_HEAD
static final int LABEL_HEAD
- See Also:
- Constant Field Values
-
LABEL_CENTER
static final int LABEL_CENTER
- See Also:
- Constant Field Values
-
LABEL_TAIL
static final int LABEL_TAIL
- See Also:
- Constant Field Values
-
SIDE_NONE
static final int SIDE_NONE
Flag determines if texture is applied to both sides of a surface. Numbers can be or-ed.- See Also:
- Constant Field Values
-
SIDE_BOTH
static final int SIDE_BOTH
Flag determines if texture is applied to both sides of a surface.- See Also:
- Constant Field Values
-
SIDE_FRONT
static final int SIDE_FRONT
Flag determines if texture is applied to foreground side of a surface.- See Also:
- Constant Field Values
-
SIDE_BACK
static final int SIDE_BACK
Flag determines if texture is applied to background side of a surface.- See Also:
- Constant Field Values
-
PERIODIC_NONE
static final int PERIODIC_NONE
Flag determines if and how texture is continued outside the unit texture domain. Numbers can be or-ed.- See Also:
- Constant Field Values
-
PERIODIC_BOTH
static final int PERIODIC_BOTH
Flag determines that texture is continued periodically in both directions outside the unit texture domain.- See Also:
- Constant Field Values
-
PERIODIC_WIDTH
static final int PERIODIC_WIDTH
Flag determines that texture is continued periodically in width directions outside the unit texture domain.- See Also:
- Constant Field Values
-
PERIODIC_HEIGHT
static final int PERIODIC_HEIGHT
Flag determines that texture is continued periodically in height directions outside the unit texture domain.- See Also:
- Constant Field Values
-
BLEND_REPLACE
static final int BLEND_REPLACE
Flag if texture overpaints all surface colors and a possible alpha channel makes surface semi-transparent.- See Also:
- Constant Field Values
-
BLEND_MATERIAL
static final int BLEND_MATERIAL
Flag if texture is combined with surface color depending on texture transparency.- See Also:
- Constant Field Values
-
BLEND_ALPHA
static final int BLEND_ALPHA
Flag if texture of a greyscale image is only used to make surface semi-transparent.- See Also:
- Constant Field Values
-
FILTER_DIRECT
static final int FILTER_DIRECT
No filtering, for each pixel the texture image is sampled at a single point.- See Also:
- Constant Field Values
-
FILTER_LINEAR
static final int FILTER_LINEAR
Bilinear filtering, for each pixel the texture image is sampled at a four points.- See Also:
- Constant Field Values
-
FILTER_QUADRATIC
static final int FILTER_QUADRATIC
Biquadratic filtering, for each pixel the texture image is sampled at a nine points.- See Also:
- Constant Field Values
-
AMBIENT_R1_EUCLIDEAN
static final int AMBIENT_R1_EUCLIDEAN
Ambient space is 1d-euclidean, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_R2_EUCLIDEAN
static final int AMBIENT_R2_EUCLIDEAN
Ambient space is 2d-euclidean, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_S1_SPHERE
static final int AMBIENT_S1_SPHERE
Ambient space is unit circle in 2d-euclidean, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_R3_EUCLIDEAN
static final int AMBIENT_R3_EUCLIDEAN
Ambient space is 3d-euclidean, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_S2_SPHERE
static final int AMBIENT_S2_SPHERE
Ambient space is unit sphere in R3, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_H2_HYPERBOLIC
static final int AMBIENT_H2_HYPERBOLIC
Ambient space is hyperbolic 2d space in R3_L, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_R4_EUCLIDEAN
static final int AMBIENT_R4_EUCLIDEAN
Ambient space is 4d-euclidean, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_S3_SPHERE
static final int AMBIENT_S3_SPHERE
Ambient space is unit sphere in R4, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_H3_HYPERBOLIC
static final int AMBIENT_H3_HYPERBOLIC
Ambient space is hyperbolic 3d space in R3_L, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_R5_EUCLIDEAN
static final int AMBIENT_R5_EUCLIDEAN
Ambient space is 5d-euclidean, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_S4_SPHERE
static final int AMBIENT_S4_SPHERE
Ambient space is unit sphere in R5, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_H4_HYPERBOLIC
static final int AMBIENT_H4_HYPERBOLIC
Ambient space is hyperbolic 4d space in R5_L, used in model transformations.- See Also:
- Constant Field Values
-
PROJ_PARALLEL
static final int PROJ_PARALLEL
Parallel projection, used in model transformations.- See Also:
- Constant Field Values
-
PROJ_STEREOGRAPHIC
static final int PROJ_STEREOGRAPHIC
Stereographic projection, used in model transformations.- See Also:
- Constant Field Values
-
PROJ_POINCARE_BALL
static final int PROJ_POINCARE_BALL
Conformal projection into Poincare's sphere, used in model transformations.- See Also:
- Constant Field Values
-
PROJ_KLEIN_BALL
static final int PROJ_KLEIN_BALL
Projection into Klein's hyperbolic sphere, used in model transformations.- See Also:
- Constant Field Values
-
PROJ_UPPER_HALFSPACE
static final int PROJ_UPPER_HALFSPACE
Conformal projection into Poincare's hyperbolic upper half space model, used in model transformations.- See Also:
- Constant Field Values
-
AMBIENT_SPACES
static final java.lang.String[][] AMBIENT_SPACES
List of names of possible ambient spaces of geometries.
-
AMBIENT_PROJECTIONS
static final java.lang.String[][] AMBIENT_PROJECTIONS
List of names of projection methods from ambient spaces. Each array contains the projection methods of a corresponding ambient space.- See Also:
AMBIENT_SPACES
-
-
Method Detail
-
getAmbientSpace
int getAmbientSpace()
Get ambient space used in model transformations.- Returns:
- One of the values PgGeometryIf#AMBIENT_...
-
setAmbientSpace
void setAmbientSpace(int mode)
Set ambient space used in model transformations.- Parameters:
mode- One of the values PgGeometryIf#AMBIENT_...
-
getAmbientProjection
int getAmbientProjection()
Get projection mode of ambient space used in model transformations.- Returns:
- One of the values PgGeometryIf#PROJ_...
-
setAmbientProjection
void setAmbientProjection(int mode)
Set projection mode of ambient space used in model transformations.- Parameters:
mode- One of the values PgGeometryIf#PROJ_...
-
getType
int getType()
Get type of geometry, for example,PvGeometry#GEOM_POINT_SET. This allows PvGeometry to check the class without accessing the real Java classes in jv.geom.The type should be set in the constructor of a geometry class.
- Returns:
- type of geometry such as PgGeometrIy#GEOM_POINT_SET.
- Version:
- 03.11.01, 1.00 created (kp)
-
setState
void setState(int key, boolean state)Set drawing flags of this geometry from within the display. Method used be overwritten by subclasses to catch specific states. Currently, this method is not intended for public use.Subclasses should overwrite this method and call super for unhandled keys.
- Parameters:
key- flag to be set, choose among PvGeometryIf.SHOW_...state- enable or disable state
-
getAuthorInfo
PsAuthorInfo getAuthorInfo()
Get author information.
-
setAuthorInfo
void setAuthorInfo(PsAuthorInfo authorInfo)
Set author information.
-
getGeometryInfo
PsGeometryInfo getGeometryInfo()
Get geometry information.
-
setGeometryInfo
void setGeometryInfo(PsGeometryInfo geometryInfo)
Set geometry information.
-
paint
void paint(PvGeometryIf dc)
Major rendering method fills an internal container class supplied by the display. Method is invoked by displays in which this instance is registered. Whenever the display receives an update event of this geometry instance, then the display calls the paint method. Therefore, it is essential to follow the following strategy to ensure update of the display container whenever the geometry has changed:PgGeometryIf geom; // An arbitrary geometry class disp.addGeometry(geom); // Register geometry in a JavaView display geom.computeSomething(); // Compute or modify geometry, e.g. surface coordinates etc. disp.update(geom); // After changing geometry invoke update of display.The calldisp.update(geom)invokes the methodgeom.paint(dc)to fill the container instance dc which is then rendered inside the display.Use methods supplied in
jv.project.PvGeometryIfto fill a container class. All data is duplicated allowing rendering and interaction while the geometry data in the current class may already be modified, e.g. by numerical processes.Note: Whenever a geometry is registered in a project
jv.project.PjProjectthen the project automatically registers the geometry in associated displays, and it is sufficient to send an update message to the project with the geometry as argument.Note: Display properties such as auto-rotation, camera choices etc. are made by calling methods of a display directly, see
jv.project.PvDisplayIf.
-
fillMethodMenu
java.awt.Menu fillMethodMenu(java.awt.Menu menu)
Deprecated. use fillMethodMenu(Menu,PvViewerIf)Fill menu with items to invoke advanced methods of this geometry.
-
fillMethodMenu
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.- 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
-
removeMethodMenus
void removeMethodMenus()
Remove menu with items to invoke advanced methods of this geometry.- Version:
- 05.06.02, 1.00 created (kp)
-
clone
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.
-
getJvx
PgJvxSrc getJvx()
Fills a geometry object with data from this instance, for example, to print to file.- Returns:
- src a geometry source filled with data from this instance.
-
setJvx
void setJvx(PgJvxSrc src)
Fill this instance with data from a geometry source, for example, previously read from file.- Parameters:
src- a geometry source used to fill this instance with data.
-
getInfoPanel
PsPanel getInfoPanel()
Get info panel - if it does not exist try to allocate it. Standard panel for inspecting standard internal data such as vertex arrays etc. of geometry.
-
getMaterialPanel
PsPanel getMaterialPanel()
Get material panel - if it does not exist try to allocate it. Standard panel for inspecting material properties of geometry.
-
assureInspector
PsPanel assureInspector(java.lang.String type, java.lang.String ext)
Get a certain panel - if it does not exist then try to allocate it. This method is a shortcut to avoid checking, creating, and adding the panel to the inspector list.- Parameters:
type- type of panel, e.g. PsPanel.INFOext- file name extension, e.g. PsPanel.INFO_EXT- Version:
- 03.06.01, 1.00 created (kp)
-
getControlPanel
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.
-
isConfigurable
boolean isConfigurable(int panel)
Check whether class has a configuration panel to configure it.- Version:
- 16.09.00, 1.10 revised (kp) Int argument panel added.
01.08.00, 1.00 created (kp)
-
getTitle
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.- See Also:
setName(String),setTitle(String)
-
setTitle
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.- See Also:
getTitle(),setName(String)
-
getName
java.lang.String getName()
Name of geometry, user should try to be unique inside JavaView.- Specified by:
getNamein interfacePsUpdateIf- See Also:
setName(String),setTitle(String)
-
setName
void setName(java.lang.String name)
Set name of geometry, user should try to be unique inside JavaView.- See Also:
getName(),setTitle(String)
-
toString
java.lang.String toString()
Get a detailed string representation of object, usually rather long.- Overrides:
toStringin classjava.lang.Object
-
intersectionWithLine
PvPickEvent intersectionWithLine(PdVector base, PdVector dir)
Find intersection with ray. Used to locate picking hits on the surface or polygon.
-
blend
boolean blend(double s, PgGeometry a, double t, PgGeometry b)Interpolate between two geometries, for example, in a smooth animation. This geometry is a linear blend of the two source geometries:this = s*a + t*b.- Parameters:
s- 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
-
merge
boolean merge(PgGeometryIf geom)
Add another geometry of same type to this geometry. If types of geometries are different then nothing is done.- Parameters:
geom- geometry added to current geometry- Returns:
- true on success
-
reflect
PgGeometry reflect(PdMatrix mat, boolean bOrient, boolean bVector)
Generate a cloned geometry and transform vertices by a matrix. For example, this method is called to calculate mirror images of a geometry. Orientation of geometry affects surface vectors.- Parameters:
mat- 3*3 or 4*4 transformation 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
- Version:
- 12.12.00, 1.10 revised (kp) Additional argument added for orientation of vectors.
16.11.00, 1.00 created (kp)
-
addDisplay
boolean addDisplay(PvDisplayIf display)
Register a new display to render the geometry. Method is called from display to register itself and query when geometry is added to a display. Method is implemented by PgGeometry and need not be overwritten.
-
getDisplays
java.util.Enumeration getDisplays()
Get all registered displays as Enumeration. Method is implemented by PgGeometry and need not be overwritten.
-
hasDisplay
boolean hasDisplay(PvDisplayIf display)
Check for a registered display by name. Method is implemented by PgGeometry and need not be overwritten.
-
removeDisplay
boolean removeDisplay(PvDisplayIf display)
Remove a registered display from list of registered displays. Method is implemented by PgGeometry and need not be overwritten.
-
isVisible
boolean isVisible()
Check flag whether geometry is selected to be hidden or not in display.
-
setVisible
void setVisible(boolean flag)
Set geometry to be hidden or visible in display.
-
getModelMatrix
PdMatrix getModelMatrix()
Get model matrix of geometry.
-
hasModelMatrix
boolean hasModelMatrix()
Check for model matrix of geometry.
-
setModelMatrix
void setModelMatrix(PdMatrix modelMat)
Set model matrix of geometry. If argument isnullthen model matrix is removed.
-
getAmbientMatrix
PdMatrix getAmbientMatrix()
Get a reference of the ambient model matrix of geometry.
-
getAmbientInvMatrix
PdMatrix getAmbientInvMatrix()
Get a reference of the ambient inverse model matrix of geometry.
-
hasAmbientMatrix
boolean hasAmbientMatrix()
Check for ambient model matrix of geometry.
-
setAmbientMatrix
void setAmbientMatrix(PdMatrix ambientMat, PdMatrix ambientInvMat)
Set ambient model matrix of geometry and its inverse. If argument isnullthen ambient model matrix is removed.
-
getDimOfVertices
int getDimOfVertices()
Get dimension of points used in geometry, i.e. the number coordinates per point. Dimension must be equal for all vertices of a class, ad must be specified as argument of the constructor.
-
getDimOfSimplex
int getDimOfSimplex()
Get dimension of simplicial complex, i.e. maximal dimension of occurring simplices. For example, polygonal curves have simplex dimension 1, triangulated surfaces 2, and volumes have 3.- Since:
- JavaView 1.95
-
addVertex
int addVertex(PdVector aVertex)
Add a vector to a geometry, probably at the end of its vertex array. The implementation of the method must copy the supplied vector. Method is called, for example, when picking new vertices in the display. Avoid using this method, but if, then call update() in its implementation.- Parameters:
aVertex- vector with new vertex coordinates
-
getVertex
PdVector getVertex(int anIndex)
Return reference to vertex with given index anIndex.- Parameters:
anIndex- index of vertex to be returned- Returns:
- reference to vertex vector with given index
-
removeVertex
int[] removeVertex(int anIndex)
Remove vertex with given index.- Parameters:
anIndex- index of vertex to be removed- Returns:
- array with indices of new positions of vertices
-
setVertex
boolean setVertex(int anIndex, PdVector aVertex)Allow setting the coordinates of a single vertex. The implementation of setVertex must copy the supplied vector. Method is called, for example, when dragging a picked vertex in the viewer.- Parameters:
anIndex- index of vertex to be changedaVertex- vector with new vertex coordinates
-
addPolygon
int addPolygon(PiVector aPolygon)
Add a polygon to a geometry, probably at the end of its polygon array. The implementation of the method must copy the supplied vector. Avoid using this method, but if, then call update() in its implementation.- Parameters:
aPolygon- vector with indices of vertices in global vertex array
-
getPolygon
PiVector getPolygon(int anIndex)
Return reference to polygon with given index.- Parameters:
anIndex- index of polygon to be returned- Returns:
- reference to polygon vector with given index
-
removePolygon
int[] removePolygon(int anIndex)
Remove polygon with given index.- Parameters:
anIndex- index of polygon to be removed- Returns:
- array with indices of new positions of polygons
-
setPolygon
boolean setPolygon(int anIndex, PiVector aPolygon)Allow setting the vertex indices of a single polygon. The implementation must copy the supplied vector.- Parameters:
anIndex- index of polygon to be changedaPolygon- vector with indices of vertices in global vertex array
-
addElement
int addElement(PiVector anElement)
Add a vector to a geometry, probably at the end of its element array. The implementation of the method must copy the supplied vector. Avoid using this method, but if, then call update() in its implementation.- Parameters:
anElement- vector with indices of vertices in global vertex array
-
getElement
PiVector getElement(int anIndex)
Return reference to element with given index.- Parameters:
anIndex- index of element to be returned- Returns:
- reference to element vector with given index
-
removeElement
int[] removeElement(int anIndex)
Remove an element with given index.- Parameters:
anIndex- index of element to be removed- Returns:
- array with indices of new positions of elements
-
setElement
boolean setElement(int anIndex, PiVector anElement)Allow setting the vertex indices of a single element. The implementation must copy the supplied vector.- Parameters:
anIndex- index of element to be changedanElement- vector with indices of vertices in global vertex array
-
hasTag
boolean hasTag(int aBit)
Check whether tag of object is set. For possible tags seePsObject.- Since:
- JavaView v.3.04.001
- Version:
- 16.01.04, 1.00 created (kp)
-
clearTagVertex
void clearTagVertex(int index, int aTag)Clear a single tag of a vertex. For possible tags seePsObject.
-
hasTagVertex
boolean hasTagVertex(int index, int aTag)Check whether vertex has given tag. For possible tags seePsObject.
-
setTagVertex
void setTagVertex(int index, int aTag)Set a tag of a vertex. For possible tags seePsObject.
-
clearTagPolygon
void clearTagPolygon(int index, int aTag)Clear a single tag of a polygon. For possible tags seePsObject.
-
hasTagPolygon
boolean hasTagPolygon(int index, int aTag)Check whether polygon has given tag. For possible tags seePsObject.
-
setTagPolygon
void setTagPolygon(int index, int aTag)Set a tag of a polygon. For possible tags seePsObject.
-
clearTagElement
void clearTagElement(int index, int aTag)Clear a single tag of an element. For possible tags seePsObject.
-
hasTagElement
boolean hasTagElement(int index, int aTag)Check whether element has given tag. For possible tags seePsObject.
-
setTagElement
void setTagElement(int index, int aTag)Set a tag of an element. For possible tags seePsObject.
-
getTextureImageName
java.lang.String getTextureImageName()
Get name of texture image, a full URL or a relative file name.
-
setTextureImageName
void setTextureImageName(java.lang.String name)
Set name of texture image, a URL or a relative file name.
-
getTextureImage
java.awt.Image getTextureImage()
Get image of texture.
-
setTextureImage
void setTextureImage(java.awt.Image img)
Set texture image for vertex and element textures.
-
-
"