|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This interface must be implemented by all geometries to allow registration and
rendering in a display of JavaView. Displays call the method
paint(PvGeometryIf) of
a registered geometry where the geometry should pass its data to the display.
paint() is the most important method of this interface.
An implementation of the interface must assure that whenever a geometry has changed such that an update of the display is required, the update method of the display is called with the geometry as argument.
disp.update(geom)
Then display automatically calls the method geom.paint(PvGeometryIf)
to request data from geometry. Each display in JavaView implements the interface
PvDisplayIf to be able to handle geometries implementing the interface PgGeometryIf.
The interface PgGeometryIf is implemented by PgGeometry.
By subclassing from PgGeometry the user only needs to override a few methods.
The class_name for info/control/material panel and methodMenu must follow special rules namely:
"name of main class"+"_CP"
"name of main class"+"_IP"
"name of main class"+"_MP"
"name of main class"+"_Menu"
PgGeometry,
PgGeometrySrcIf,
PvDisplayIf,
PvDisplay,
PvDisplayIf| Field Summary | |
static int |
AMBIENT_H2_HYPERBOLIC
Ambient space is hyperbolic 2d space in R3_L, used in model transformations. |
static int |
AMBIENT_H3_HYPERBOLIC
Ambient space is hyperbolic 3d space in R3_L, used in model transformations. |
static int |
AMBIENT_H4_HYPERBOLIC
Ambient space is hyperbolic 4d space in R5_L, used in model transformations. |
static java.lang.String[][] |
AMBIENT_PROJECTIONS
List of names of projection methods from ambient spaces. |
static int |
AMBIENT_R1_EUCLIDEAN
Ambient space is 1d-euclidean, used in model transformations. |
static int |
AMBIENT_R2_EUCLIDEAN
Ambient space is 2d-euclidean, used in model transformations. |
static int |
AMBIENT_R3_EUCLIDEAN
Ambient space is 3d-euclidean, used in model transformations. |
static int |
AMBIENT_R4_EUCLIDEAN
Ambient space is 4d-euclidean, used in model transformations. |
static int |
AMBIENT_R5_EUCLIDEAN
Ambient space is 5d-euclidean, used in model transformations. |
static int |
AMBIENT_S1_SPHERE
Ambient space is unit circle in 2d-euclidean, used in model transformations. |
static int |
AMBIENT_S2_SPHERE
Ambient space is unit sphere in R3, used in model transformations. |
static int |
AMBIENT_S3_SPHERE
Ambient space is unit sphere in R4, used in model transformations. |
static int |
AMBIENT_S4_SPHERE
Ambient space is unit sphere in R5, used in model transformations. |
static java.lang.String[][] |
AMBIENT_SPACES
List of names of possible ambient spaces of geometries. |
static java.lang.String |
INSPECTOR_CONTROL
Name of default control panel under which panel is registered in panel list. |
static java.lang.String |
INSPECTOR_CONTROL_EXT
File name suffix of control panel class to name of base class. |
static java.lang.String |
INSPECTOR_MATERIAL
Name of default material panel under which panel is registered in panel list. |
static java.lang.String |
INSPECTOR_MATERIAL_EXT
File name suffix of material panel class to name of base class. |
static java.lang.String |
INSPECTOR_TEXTURE
Name of default texture panel under which panel is registered in panel list. |
static java.lang.String |
INSPECTOR_TEXTURE_EXT
File name suffix of texture panel class to name of base class. |
static int |
LABEL_BASE
|
static int |
LABEL_CENTER
|
static int |
LABEL_HEAD
|
static int |
LABEL_MIDDLE
|
static int |
LABEL_TAIL
|
static int |
LABEL_TOP
|
static java.lang.String |
METHOD_EXT
File name suffix of menu class to name of base class. |
static int |
PROJ_KLEIN_BALL
Projection into Klein's hyperbolic sphere, used in model transformations. |
static int |
PROJ_PARALLEL
Parallel projection, used in model transformations. |
static int |
PROJ_POINCARE_BALL
Conformal projection into Poincare's sphere, used in model transformations. |
static int |
PROJ_STEREOGRAPHIC
Stereographic projection, used in model transformations. |
static int |
PROJ_UPPER_HALFSPACE
Conformal projection into Poincare's hyperbolic upper half space model, used in model transformations. |
| Method Summary | |
boolean |
addDisplay(PvDisplayIf display)
Register a new display to render the geometry. |
int |
addElement(PiVector aElement)
Add a vector to a geometry, probably at the end of its element array. |
int |
addPolygon(PiVector aPolygon)
Add a polygon to a geometry, probably at the end of its polygon array. |
int |
addVertex(PdVector aVertex)
Add a vector to a geometry, probably at the end of its vertex array. |
PsPanel |
assureInspector(java.lang.String type,
java.lang.String ext)
Get a certain panel - if it does not exist then try to allocate it. |
boolean |
blend(double s,
PgGeometry a,
double t,
PgGeometry b)
Interpolate between two geometries, for example, in a smooth animation. |
void |
clearTagElement(int index,
int aTag)
Clear a single tag of an element. |
void |
clearTagPolygon(int index,
int aTag)
Clear a single tag of a polygon. |
void |
clearTagVertex(int index,
int aTag)
Clear a single tag of a vertex. |
java.lang.Object |
clone()
Duplicate geometry by recursively cloning all instance variables except inspector panels and lists of registered listeners. |
java.awt.Menu |
fillMethodMenu(java.awt.Menu aMenu)
Fill menu with items to invoke advanced methods of this geometry. |
PdMatrix |
getAmbientInvMatrix()
Get a reference of the ambient inverse model matrix of geometry. |
PdMatrix |
getAmbientMatrix()
Get a reference of the ambient model matrix of geometry. |
int |
getAmbientProjection()
Get projection mode of ambient space used in model transformations. |
int |
getAmbientSpace()
Get ambient space used in model transformations. |
PsPanel |
getControlPanel()
Deprecated. use assureInspector(String, String) |
int |
getDimOfSimplex()
Get dimension of simplicial complex, i.e. maximal dimension of occurring simplices. |
int |
getDimOfVertices()
Get dimension of points used in geometry, i.e. the number coordinates per point. |
java.util.Enumeration |
getDisplays()
Get all registered displays as Enumeration. |
PiVector |
getElement(int anIndex)
Return reference to element with given index. |
PsPanel |
getInfoPanel()
Get info panel - if it does not exist try to allocate it. |
PgJvxSrc |
getJvx()
Fills a geometry object with data from this instance, for example, to print to file. |
PsPanel |
getMaterialPanel()
Deprecated. use assureInspector(String, String) |
PdMatrix |
getModelMatrix()
Get model matrix of geometry. |
java.lang.String |
getName()
Name of geometry, should be unique inside JavaView. |
PiVector |
getPolygon(int anIndex)
Return reference to polygon with given index. |
java.awt.Image |
getTextureImage()
Get image of texture. |
java.lang.String |
getTextureImageName()
Get name of texture image, a full URL or a relative file name. |
PdVector |
getVertex(int anIndex)
Return reference to vertex with given index anIndex. |
boolean |
hasAmbientMatrix()
Check for ambient model matrix of geometry. |
boolean |
hasDisplay(PvDisplayIf display)
Check for a registered display by name. |
boolean |
hasModelMatrix()
Check for model matrix of geometry. |
boolean |
hasTagElement(int index,
int aTag)
Check whether element has given tag. |
boolean |
hasTagPolygon(int index,
int aTag)
Check whether polygon has given tag. |
boolean |
hasTagVertex(int index,
int aTag)
Check whether vertex has given tag. |
PvPickEvent |
intersectionWithLine(PdVector base,
PdVector dir)
Find intersection with ray. |
boolean |
isConfigurable(int panel)
Check whether class has a configuration panel to configure it. |
boolean |
isVisible()
Check flag whether geometry is selected to be hidden or not in display. |
boolean |
merge(PgGeometryIf geom)
Add another geometry of same type to this geometry. |
void |
paint(PvGeometryIf dc)
Major rendering method fills an internal container class supplied by the display. |
PgGeometry |
reflect(PdMatrix mat,
boolean bOrient,
boolean bVector)
Generate a cloned geometry and transform vertices by a matrix. |
boolean |
removeDisplay(PvDisplayIf display)
Remove a registered display from list of registered displays. |
int[] |
removeElement(int anIndex)
Remove an element with given index. |
int[] |
removePolygon(int anIndex)
Remove polygon with given index. |
int[] |
removeVertex(int anIndex)
Remove vertex with given index. |
void |
setAmbientMatrix(PdMatrix ambientMat,
PdMatrix ambientInvMat)
Set ambient model matrix of geometry and its inverse. |
void |
setAmbientProjection(int mode)
Set projection mode of ambient space used in model transformations. |
void |
setAmbientSpace(int mode)
Set ambient space used in model transformations. |
boolean |
setElement(int anIndex,
PiVector aElement)
Allow setting the vertex indices of a single element. |
void |
setJvx(PgJvxSrc src)
Fill this instance with data from a geometry source, for example, previously read from file. |
void |
setModelMatrix(PdMatrix modelMat)
Set model matrix of geometry. |
void |
setName(java.lang.String name)
Set name of geometry, should be unique inside JavaView. |
boolean |
setPolygon(int anIndex,
PiVector aPolygon)
Allow setting the vertex indices of a single polygon. |
void |
setState(int aKey,
boolean aState)
Set drawing flags of this geometry from within the display. |
void |
setTagElement(int index,
int aTag)
Set a tag of an element. |
void |
setTagPolygon(int index,
int aTag)
Set a tag of a polygon. |
void |
setTagVertex(int index,
int aTag)
Set a tag of a vertex. |
void |
setTextureImage(java.awt.Image img)
Set texture image for vertex and element textures. |
void |
setTextureImageName(java.lang.String name)
Set name of texture image, a URL or a relative file name. |
boolean |
setVertex(int anIndex,
PdVector aVertex)
Allow setting the coordinates of a single vertex. |
void |
setVisible(boolean flag)
Set geometry to be hidden or visible in display. |
java.lang.String |
toString()
Get a detailed string representation of object, usually rather long. |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, setParent, update |
| Field Detail |
public static final java.lang.String INSPECTOR_CONTROL_EXT
public static final java.lang.String INSPECTOR_MATERIAL_EXT
public static final java.lang.String INSPECTOR_TEXTURE_EXT
public static final java.lang.String METHOD_EXT
public static final java.lang.String INSPECTOR_CONTROL
public static final java.lang.String INSPECTOR_MATERIAL
public static final java.lang.String INSPECTOR_TEXTURE
public static final int LABEL_TOP
public static final int LABEL_MIDDLE
public static final int LABEL_BASE
public static final int LABEL_HEAD
public static final int LABEL_CENTER
public static final int LABEL_TAIL
public static final int AMBIENT_R1_EUCLIDEAN
public static final int AMBIENT_R2_EUCLIDEAN
public static final int AMBIENT_S1_SPHERE
public static final int AMBIENT_R3_EUCLIDEAN
public static final int AMBIENT_S2_SPHERE
public static final int AMBIENT_H2_HYPERBOLIC
public static final int AMBIENT_R4_EUCLIDEAN
public static final int AMBIENT_S3_SPHERE
public static final int AMBIENT_H3_HYPERBOLIC
public static final int AMBIENT_R5_EUCLIDEAN
public static final int AMBIENT_S4_SPHERE
public static final int AMBIENT_H4_HYPERBOLIC
public static final int PROJ_PARALLEL
public static final int PROJ_STEREOGRAPHIC
public static final int PROJ_POINCARE_BALL
public static final int PROJ_KLEIN_BALL
public static final int PROJ_UPPER_HALFSPACE
public static final java.lang.String[][] AMBIENT_SPACES
public static final java.lang.String[][] AMBIENT_PROJECTIONS
AMBIENT_SPACES| Method Detail |
public int getAmbientSpace()
public void setAmbientSpace(int mode)
mode - One of the values PgGeometryIf#AMBIENT_...public int getAmbientProjection()
public void setAmbientProjection(int mode)
mode - One of the values PgGeometryIf#PROJ_...
public void setState(int aKey,
boolean aState)
Subclasses should overwrite this method and call super for unhandled keys.
aKey - flag to be set, choose among PvGeometryIf.SHOW_...aState - enable or disable statepublic void paint(PvGeometryIf dc)
PgGeometryIf geom; // An arbitrary geometry class disp.addGeometry(geom); // Register geometry in a JavaView display geom.computeSomething(); // Compute or modify geometry, e.g. surface coordinates etc. disp.update(geom); // After changing geometry invoke update of display.The call
disp.update(geom) invokes the method geom.paint(dc)
to fill the container instance dc which is then rendered inside the display.
Use methods supplied in jv.project.PvGeometryIf to
fill a container class. All data is duplicated allowing rendering and interaction
while the geometry data in the current class may already be modified, e.g. by
numerical processes.
Note: Whenever a geometry is registered in a project
jv.project.PjProject then the project automatically
registers the geometry in associated displays, and it is sufficient to send an
update message to the project with the geometry as argument.
Note: Display properties such as auto-rotation, camera choices etc. are made
by calling methods of a display directly, see
jv.project.PvDisplayIf.
public java.awt.Menu fillMethodMenu(java.awt.Menu aMenu)
public java.lang.Object clone()
null.
Tags of this object are not copied but maybe copied of subclasses.public PgJvxSrc getJvx()
public void setJvx(PgJvxSrc src)
src - a geometry source used to fill this instance with data.public PsPanel getInfoPanel()
public PsPanel getMaterialPanel()
public PsPanel assureInspector(java.lang.String type,
java.lang.String ext)
type - type of panel, e.g. PsObject.INSPECTOR_INFOext - file name extension, e.g. PsObject.INSPECTOR_INFO_EXTpublic PsPanel getControlPanel()
public boolean isConfigurable(int panel)
public java.lang.String getName()
getName in interface PsUpdateIfpublic void setName(java.lang.String name)
public java.lang.String toString()
toString in class java.lang.Object
public PvPickEvent intersectionWithLine(PdVector base,
PdVector dir)
public boolean blend(double s,
PgGeometry a,
double t,
PgGeometry b)
this = s*a + t*b.s, - t weights of vertices of each elementSeta, - b two source geometries used for blendingpublic boolean merge(PgGeometryIf geom)
geom - geometry added to current geometry
public PgGeometry reflect(PdMatrix mat,
boolean bOrient,
boolean bVector)
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 boolean addDisplay(PvDisplayIf display)
public java.util.Enumeration getDisplays()
public boolean hasDisplay(PvDisplayIf display)
public boolean removeDisplay(PvDisplayIf display)
public boolean isVisible()
public void setVisible(boolean flag)
public PdMatrix getModelMatrix()
public boolean hasModelMatrix()
public void setModelMatrix(PdMatrix modelMat)
null then model matrix is removed.public PdMatrix getAmbientMatrix()
public PdMatrix getAmbientInvMatrix()
public boolean hasAmbientMatrix()
public void setAmbientMatrix(PdMatrix ambientMat,
PdMatrix ambientInvMat)
null then ambient model matrix is removed.public int getDimOfVertices()
public int getDimOfSimplex()
public int addVertex(PdVector aVertex)
aVertex - vector with new vertex coordinatespublic PdVector getVertex(int anIndex)
anIndex - index of vertex to be returnedpublic int[] removeVertex(int anIndex)
anIndex - index of vertex to be removed
public boolean setVertex(int anIndex,
PdVector aVertex)
anIndex - index of vertex to be changedaVertex - vector with new vertex coordinatespublic int addPolygon(PiVector aPolygon)
aPolygon - vector with indices of vertices in global vertex arraypublic PiVector getPolygon(int anIndex)
anIndex - index of polygon to be returnedpublic int[] removePolygon(int anIndex)
anIndex - index of polygon to be removed
public boolean setPolygon(int anIndex,
PiVector aPolygon)
anIndex - index of polygon to be changedaPolygon - vector with indices of vertices in global vertex arraypublic int addElement(PiVector aElement)
aPolygon - vector with indices of vertices in global vertex arraypublic PiVector getElement(int anIndex)
anIndex - index of element to be returnedpublic int[] removeElement(int anIndex)
anIndex - index of element to be removed
public boolean setElement(int anIndex,
PiVector aElement)
anIndex - index of element to be changedaVertex - vector with indices of vertices in global vertex array
public void clearTagVertex(int index,
int aTag)
PsObject.
public boolean hasTagVertex(int index,
int aTag)
PsObject.
public void setTagVertex(int index,
int aTag)
PsObject.
public void clearTagPolygon(int index,
int aTag)
PsObject.
public boolean hasTagPolygon(int index,
int aTag)
PsObject.
public void setTagPolygon(int index,
int aTag)
PsObject.
public void clearTagElement(int index,
int aTag)
PsObject.
public boolean hasTagElement(int index,
int aTag)
PsObject.
public void setTagElement(int index,
int aTag)
PsObject.public java.lang.String getTextureImageName()
public void setTextureImageName(java.lang.String name)
public java.awt.Image getTextureImage()
public void setTextureImage(java.awt.Image img)
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||