|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.project.PgGeometry
|
+--jv.geom.PgPointSet
Base class for most geometric objects with points resp. vertices, for example point sets, polygons, element set, and other simplicial complexes.
The class has an array of n-dimensional points where each point is an instance
of type PdVector containing the n coordinate components. Additionally,
there exist instance variables for vertex normals, vertex colors, vertex texture
coordinates, and other vertex properties. Note, that such vertex properties are not stored
with each vertex but each property is stored in an additional array of same length
as the array of vertices. If a property is not available then the corresponding array
is null.
The dimension of all points is determined as argument of the constructor and cannot be changed later. The dimension is the same for all points of the point set. There exist several utility functions to allocate and modify the number of points, for example,
setNumVertices(int)
allocates num vertices. Internally, there exists a cache to reduce the number
of actual memory allocations. The size of the cache is managed by protected methods.
Whenever the number of vertices is changed, the class automatically adjusts the size
of those vertex properties which are currently in use, i.e. whose array is not null.
Applications may modify the coordinates of vertices and of vertex properties by direct method calls such as
setVertex(int, PdVector)
which sets the vertex with index ind equal to the vertex v by copying the coordinates.
Alternatively, if an application modifies a larger number of vertices then the application
may prefer to obtain the coordinate array from the point set and directly modify the array
PdVector [] vertex = pointSet.getVertices();
for (int i=0; i<pointSet.getNumVertices(); i++)
vertex[i].copy(v);
The same choice is available for arrays containing vertex properties.
Note, that subclasses, such as PgElementSet, may not reference all vertices, e.g.
if the currently active elements consists of a subset of all vertices.
Also note, that the actual size of the vertex array may differ from m_numVertices
efficiency reasons. Therefore, do not use vertex.length but use getNumVertices().
A good starting to obtain further insight are methods like computeTorus
(if source code access to JavaView is available), or the tutorial applets of JavaView.
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS |
| Constructor Summary | |
PgPointSet()
Constructor of a point set in three-dimensional space. |
|
PgPointSet(int aVertexDim)
Constructor of a point set in n-dimensional space. |
|
| Method Summary | |
int |
addVectorField(PgVectorField aVectorField)
Add a vertex or element based vector field to geometry. |
int |
addVertex(PdVector aVertex)
Add new vertex to the end of the vertex list Method just calls setVertex(int, PdVector). |
void |
assureVertexColors()
Assures respectively allocates correct length of vertex color array. |
void |
assureVertexNormals()
Assures respectively allocates correct length of vertex normal array. |
void |
assureVertexTextures()
Assures respectively allocates correct length of vertex texture array. |
boolean |
blend(double s,
PgGeometry ag,
double t,
PgGeometry bg)
Blend between two pointSets, used in interpolation and computing the associate surfaces this = s*a + t*b. |
void |
clearTagVertex(int anIndex,
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. |
void |
computeCylinder(int numULines,
int numVLines,
double radius,
double length)
Generate cylinder in z-direction with given radius and length. |
void |
computeDisk(int numULines,
int numVLines,
double radius)
Generate disk in xy-plane with given radius. |
void |
computePlane(int numULines,
int numVLines,
double uMin,
double vMin,
double uMax,
double vMax)
Generate rectangle in z=0 plane with given min/max values. |
void |
computeRotation(PgPolygon meridian,
int numULines)
Generate rotational symmetric surface from given meridian around x-axis. |
void |
computeSnail(int numULines,
int numVLines,
double numWindings)
Generate a winding snail. |
void |
computeSphere(int numULines,
int numVLines,
double radius)
Generate sphere at origin with given radius. |
void |
computeTorus(int numULines,
int numVLines,
double radius,
double thick)
Generate torus in x-y plane with given radius of soal and thickness of tube. |
void |
copy(PgGeometry aGeom)
Copy instance variables by duplication, not by copying a reference. |
void |
flipOrientation()
Change orientation of normal vectors. |
PdVector[] |
getAmbientBounds()
Compute bounding box of this geometry from the set of all vertices, or return null if no vertices. |
PdVector[] |
getBounds()
Compute bounding box of the vertices which are transformed with ambient and model matrix. |
PdVector |
getCenterOfBndBox()
Compute center of geometry as midpoint of the bounding box. |
PdVector |
getCenterOfGravity()
Compute center of geometry as the mean all vertices, i.e. center of gravity. |
int |
getDimOfColors()
Get dimension of colors, i.e. number of components of each color vector. |
int |
getDimOfTextures()
Get dimension of textures, i.e. number of components of each of the texture vectors. |
int |
getDimOfVectors()
Get dimension of vectors, i.e. number of components of each of the vectors. |
java.awt.Color |
getGlobalVectorColor()
Get global vector color which is used if no local colors are available. |
double |
getGlobalVectorLength()
Get length factor of vectors when drawn in display. |
double |
getGlobalVectorSize()
Get thickness in pixels of vectors when drawn in display. |
java.awt.Color |
getGlobalVertexColor()
Get global vertex color which is used if no local colors are available. |
java.awt.Color |
getGlobalVertexNormalColor()
Get global vertex normal color which is used if no local colors are available. |
double |
getGlobalVertexNormalLength()
Get length factor of vertex normal vectors when drawn in display. |
double |
getGlobalVertexNormalSize()
Get thickness in pixels of vertex normals when drawn in display. |
int |
getGlobalVertexSize()
Get global radius in pixels of circle to visualize vertices in display. |
java.awt.Color |
getGlobalVertexTagColor()
Get global color of tagged vertices. |
int |
getIndexOfVectorField(PgVectorField aVectorField)
Get index of vector fields, assumes user data is stored in a vector. |
PgJvxSrc |
getJvx()
Fills a geometry container with data from this instance, for example, to print to file. |
int |
getMaxNumVertices()
Get total length of allocated vertex array. |
int |
getNumVectorFields()
Get number of vector fields. |
int |
getNumVertices()
Get number of vertices in vertex array. |
PgTexture |
getTexture()
Get current texture of surface. |
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. |
PgVectorField |
getVectorField(int anInd)
Get a vector field via its index. |
PgVectorField |
getVectorField(java.lang.String name)
Get a vector field via its name. |
PdVector |
getVertex(int anIndex)
Get a reference to an individual vertex. |
java.awt.Color |
getVertexColor(int anIndex)
Get a reference to an individual vertex color. |
java.awt.Color[] |
getVertexColors()
Get color array for read and write access, but do not modify the size of any color vector. |
PdVector |
getVertexNormal(int anIndex)
Get a reference to an individual vertex normal. |
PdVector[] |
getVertexNormals()
Get vertex normal array for read and write access, but do not modify the size of any normal vector. |
PdVector[] |
getVertexTextures()
Get vertex texture array for read and write access, but do not modify the size of any texture vector. |
PdVector[] |
getVertices()
Get vertex array for read and write access, but do not modify the size of any vector. |
boolean |
hasTagVertex(int anIndex,
int aTag)
Check whether vertex has given tag. |
int |
hasVertex(PdVector aVertex)
Looks in the vertex list if there is a vertex with same coordinates like the passed one. |
int |
hasVertex(PdVector aVertex,
double eps)
Looks in the vertex list if there is a vertex within a given euclidean distance. |
boolean |
hasVertexColors()
Check if vertex colors have been allocated. |
boolean |
hasVertexNormals()
Check if vertex normals have been allocated. |
boolean |
hasVertexTextures()
Check if vertex textures have been allocated. |
void |
init()
Initialize and reset instance variables after call to super.init(). |
PvPickEvent |
intersectionWithLine(PdVector rayBase,
PdVector rayDir)
Find intersection of this point set with a given ray. |
boolean |
isDefaultLabelEnabled()
Determine whether drawing of default labels, i.e. item indices, is enabled. |
boolean |
isShowingIndices()
Check whether showing of indices is switched on. |
boolean |
isShowingTaggedVertices()
Determine whether showing of tagged vertices is enabled. |
boolean |
isShowingVectorArrow()
Deprecated. use isShowingVectorArrows(boolean) |
boolean |
isShowingVectorArrows()
Determine whether showing of tip of vectors as arrow is enabled. |
boolean |
isShowingVectorColors()
Determine whether showing of vertex normals is enabled. |
boolean |
isShowingVectorField()
Determine whether showing of vectorfields is enabled. |
boolean |
isShowingVertexColors()
Determine whether showing of vertex colors is enabled. |
boolean |
isShowingVertexLabels()
Determine whether showing of vertex labels is enabled. |
boolean |
isShowingVertexNormalArrow()
Determines whether drawing of arrow of vertex normals is enabled. |
boolean |
isShowingVertexNormals()
Determine whether showing of vertex normals is enabled. |
boolean |
isShowingVertexTexture()
Determine whether showing of vertex textures is enabled. |
boolean |
isShowingVertices()
Determine whether showing of vertices is enabled. |
boolean |
makeColorFromVectorLength()
Create color from the length of vectors of the first vector field. |
boolean |
makeVertexColorsFromXYZ()
Create color from the vertex position within its bounding box which is interpreted as RGB cube. |
boolean |
makeVertexColorsFromZ()
Create color from the vertical z-height within its bounding box ranging from red to blue. |
boolean |
makeVertexColorsFromZHue()
Create color from the vertical z-height within its bounding box ranging through hue rainbow. |
boolean |
makeVertexNormals()
Method does nothing and should be overwritten by subclasses. |
boolean |
makeVertexTextureFromBndBox(int ix,
int iy)
Create vertex texture from a plane of the bounding box. |
boolean |
makeVertexTextureFromCylinder(PdVector center,
PdVector axis)
Create vertex texture from cylinder with given axis. |
boolean |
makeVertexTextureFromSphere(PdVector center)
Create vertex texture from sphere with given center. |
boolean |
merge(PgGeometryIf aGeom)
Merge two point sets and store union in this.
|
void |
paint(PvGeometryIf dc)
Major rendering method fills an internal container class supplied by the display. |
void |
projectToSphere(PdVector center,
double radius)
Project all vertices to the unit sphere with given center. |
PgGeometry |
reflect(PdMatrix mat,
boolean bOrient,
boolean bVector)
Generate a cloned geometry and transform vertices by a matrix. |
void |
removeAllVectorFields()
Remove all user added vector fields. |
int[] |
removeMarkedVertices()
Remove vertices marked with tag PsObject#IS_DELETED from the vertex list. |
boolean |
removeVectorField(PgGeometryIf aVectorField)
Remove a vector field from geometry. |
int[] |
removeVertex(int ind)
Remove vertex at specified position in the vertex list. |
void |
scale(double factor)
Scale each vertex of geometry by given factor w.r.t. its center using formula: vertex = (1-s)*center + s*vertex. |
void |
scale(double factor,
PdVector center)
Deprecated. use scale(double) instead |
void |
setCenterOfBndBox(PdVector center)
Move each vertex of geometry by vector center-oldCenter.
|
void |
setDefaultLabelEnabled(boolean flag)
Determine whether drawing of default labels, i.e. item indices, is enabled. |
void |
setDimOfColors(int aSize)
Let all colors have same number of components aSize<>0. |
void |
setDimOfTextures(int dim)
Set dimension of texture domain. |
void |
setDimOfVectors(int aSize)
Let all vectors have same number of components aSize<>0.
|
void |
setGlobalVectorColor(java.awt.Color color)
Set global vector color to be used if no local colors are available. |
void |
setGlobalVectorLength(double length)
Get length factor of vectors when drawn in display. |
void |
setGlobalVectorSize(double size)
Get thickness in pixels of vectors when drawn in display. |
void |
setGlobalVertexColor(java.awt.Color color)
Set global vertex color to be used if no local colors are available. |
void |
setGlobalVertexNormalColor(java.awt.Color color)
Set global vertex normal color to be used if no local colors are available. |
void |
setGlobalVertexNormalLength(double length)
Get length factor of vertex normal vectors when drawn in display. |
void |
setGlobalVertexNormalSize(double size)
Get thickness in pixels of vertex normals when drawn in display. |
void |
setGlobalVertexSize(int size)
Set global radius in pixels of circle to visualize vertices in display. |
void |
setGlobalVertexTagColor(java.awt.Color color)
Set global color of tagged vertices. |
void |
setJvx(PgJvxSrc src)
Fill this instance with data from a geometry source, for example, previously read from file. |
void |
setNumVertices(int aNumVertices)
Allocate given number of vertices, and allocate normals, colors etc. if they already exist. |
void |
setState(int aKey,
boolean aState)
Set drawing flags of this geometry from within the display. |
void |
setTagVertex(int anIndex,
int aTag)
Set a tag of a vertex. |
void |
setTexture(PgTexture texture)
Set current texture of surface with reference to texture image. |
void |
setTextureImage(java.awt.Image image)
Set texture image for vertex and element textures. |
void |
setTextureImageName(java.lang.String name)
Set name of texture image, a URL or a relative file name. |
void |
setTransparency(double alpha)
Set transparency of surface to be used in textures. |
void |
setVertex(int anIndex,
double x)
Copy new coordinate to vertex at specified position in the vertex list. |
void |
setVertex(int anIndex,
double x,
double y)
Copy new coordinates to vertex at specified position in the vertex list. |
void |
setVertex(int anIndex,
double x,
double y,
double z)
Copy new coordinates to vertex at specified position in the vertex list. |
boolean |
setVertex(int anIndex,
PdVector aVertex)
Copy new vertex to vertex at specified position in the vertex list. |
void |
setVertexColor(int anIndex,
java.awt.Color aVertex)
Copy new color to vertex color at specified position in the color list |
void |
setVertexColors(java.awt.Color[] aVertexColorList)
Copy vertex colors of list to existing array of vertex colors. |
void |
setVertexNormal(int anIndex,
PdVector aVertex)
Copy new normal to vertex normal at specified position in the normal list |
void |
setVertexNormals(PdVector[] aVertexNormalList)
Copy vertex normals of list to existing array of vertex normals. |
void |
setVertexTextures(PdVector[] aVertexTextureList)
Copy vertex textures of list to existing array of vertex textures. |
void |
setVertices(PdVector[] aVertexList)
Copy the first getNumVertices() vertices of source array into
an existing vertex array.
|
void |
showIndices(boolean flag)
Enable and disable showing of indices in display. |
void |
showTaggedVertices(boolean flag)
Set flag to enable drawing of tagged vertices. |
void |
showVectorArrow(boolean flag)
Deprecated. use showVectorArrows(boolean) |
void |
showVectorArrows(boolean flag)
Set flag to enable drawing of tip of vectors as arrow. |
void |
showVectorColors(boolean flag)
Set flag to enable drawing of individual vector colors. |
void |
showVectorField(boolean flag)
Deprecated. use showVectorFields(boolean) |
void |
showVectorFields(boolean flag)
Set flag to enable drawing of all vectorfields. |
void |
showVertexColors(boolean flag)
Set flag to enable drawing of individual vertex colors. |
void |
showVertexLabels(boolean flag)
Set flag to enable drawing of vertex labels in display. |
void |
showVertexNormalArrow(boolean flag)
Set flag to enable drawing of arrow of vertex normal. |
void |
showVertexNormals(boolean flag)
Set flag to enable drawing of vertex normals. |
void |
showVertexTexture(boolean flag)
Set flag to enable drawing of vertex textures. |
void |
showVertices(boolean flag)
Set flag to enable drawing of vertices. |
java.lang.String |
toString()
Create a multi-line string representation with detailed information about all instance variables. |
void |
translate(PdVector diff)
Translate each vertex of geometry by given vector. |
boolean |
update(java.lang.Object event)
Update the class whenever a child has changed. |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, updatePanels |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.project.PgGeometryIf |
assureInspector, getInfoPanel, getName, setName |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, setParent |
| Constructor Detail |
public PgPointSet()
public PgPointSet(int aVertexDim)
| Method Detail |
public void init()
init in class PgGeometry
public void setState(int aKey,
boolean aState)
setState in class PgGeometryaKey - flag to be set, choose among PvGeometryIf.SHOW_...aState - enable or disable statepublic PgJvxSrc getJvx()
getJvx in class PgGeometrypublic void setJvx(PgJvxSrc src)
setJvx in class PgGeometrysrc - a geometry source used to fill this instance with data.public java.lang.Object clone()
null.
Tags of this object are not copied but maybe copied of subclasses.clone in class PgGeometry#copy(PgPointSet)public void copy(PgGeometry aGeom)
copy in class PgGeometrypublic java.lang.String toString()
toString in class PgGeometrypublic boolean update(java.lang.Object event)
update in class PgGeometryjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)public PgTexture getTexture()
public void setTexture(PgTexture texture)
null as argument will remove texture.public java.lang.String getTextureImageName()
getTextureImageName in class PgGeometrypublic void setTextureImageName(java.lang.String name)
setTextureImageName in class PgGeometryname - Name of a texture image file.public java.awt.Image getTextureImage()
getTextureImage in class PgGeometrypublic void setTextureImage(java.awt.Image image)
setTextureImage in class PgGeometryname - Name of a texture image.public void setTransparency(double alpha)
public PdVector[] getBounds()
The two returned bounding box vectors are 3-dimensional. If dimension of vertices is less than 3 then remaining components are zeroed.
Note, transformation not supported yet.
getBounds in class PgGeometrygetAmbientBounds()public PdVector[] getAmbientBounds()
Note, the bounding box does not include transformations from the ambient or model matrix.
getAmbientBounds in class PgGeometrygetBounds()public PdVector getCenterOfBndBox()
The center has same dimension as all vertices.
getCenterOfGravity(),
PgGeometry.getCenter()public void setCenterOfBndBox(PdVector center)
center-oldCenter.
Method calls #translate to shift vertices.PgGeometry.getCenter(),
PgGeometry.setCenter(jv.vecmath.PdVector)public PdVector getCenterOfGravity()
The center has same dimension as all vertices.
PgGeometry.getCenter()public final int getNumVertices()
public final int getMaxNumVertices()
public PdVector[] getVertices()
Note, that the actual size of the vertex array may differ from getNumVertices() for efficiency reasons. Therefore, do not use vertex.length but use getNumVertices().
Note, the array is void as soon as the number of vertices changes. After issuing setNumVertices(int) then call this method again.
public PdVector getVertex(int anIndex)
getVertex in class PgGeometryanIndex - index of vertexpublic java.awt.Color getVertexColor(int anIndex)
anIndex - index of vertexpublic PdVector getVertexNormal(int anIndex)
anIndex - index of vertexpublic java.awt.Color getGlobalVertexColor()
public java.awt.Color getGlobalVertexTagColor()
public int getGlobalVertexSize()
public java.awt.Color getGlobalVertexNormalColor()
public double getGlobalVertexNormalLength()
public double getGlobalVertexNormalSize()
public double getGlobalVectorLength()
public double getGlobalVectorSize()
public java.awt.Color getGlobalVectorColor()
public void setGlobalVertexColor(java.awt.Color color)
public void setGlobalVertexTagColor(java.awt.Color color)
public void setGlobalVertexSize(int size)
public void setGlobalVertexNormalColor(java.awt.Color color)
public void setGlobalVertexNormalLength(double length)
public void setGlobalVertexNormalSize(double size)
public void setGlobalVectorLength(double length)
public void setGlobalVectorSize(double size)
public void setGlobalVectorColor(java.awt.Color color)
public java.awt.Color[] getVertexColors()
public PdVector[] getVertexNormals()
public PdVector[] getVertexTextures()
public boolean isDefaultLabelEnabled()
isShowingIndices()public boolean isShowingIndices()
isDefaultLabelEnabled(),
setDefaultLabelEnabled(boolean)public boolean isShowingVertexLabels()
public boolean isShowingVertices()
public boolean isShowingTaggedVertices()
public boolean isShowingVertexColors()
public boolean isShowingVertexNormals()
public boolean isShowingVertexNormalArrow()
public boolean isShowingVertexTexture()
public boolean isShowingVectorField()
public boolean isShowingVectorArrow()
public boolean isShowingVectorArrows()
public boolean isShowingVectorColors()
public void setDefaultLabelEnabled(boolean flag)
showIndices(boolean)public void showIndices(boolean flag)
isDefaultLabelEnabled(),
setDefaultLabelEnabled(boolean)public void showVertexLabels(boolean flag)
public void showVertices(boolean flag)
public void showTaggedVertices(boolean flag)
public void showVertexColors(boolean flag)
public void showVertexNormals(boolean flag)
public void showVertexNormalArrow(boolean flag)
public void showVertexTexture(boolean flag)
public void showVectorField(boolean flag)
public void showVectorFields(boolean flag)
public void showVectorArrow(boolean flag)
public void showVectorArrows(boolean flag)
public void showVectorColors(boolean flag)
public boolean makeVertexNormals()
public void setNumVertices(int aNumVertices)
public int getDimOfColors()
public void setDimOfColors(int aSize)
aSize<>0.aSize - Number of components of each color vector.public int getDimOfVectors()
public void setDimOfVectors(int aSize)
aSize<>0.
It is more efficient to call method before setNumVertices().
TODO: currently, only length of normal vectors is modified.aSize - Number of coordinates of each vertex.public int getDimOfTextures()
public void setDimOfTextures(int dim)
public boolean hasVertexColors()
assureVertexColors()public boolean hasVertexNormals()
assureVertexNormals()public boolean hasVertexTextures()
assureVertexTextures()public void assureVertexColors()
public void assureVertexNormals()
public void assureVertexTextures()
getDimOfTextures().public void paint(PvGeometryIf dc)
jv.project.PgGeometryIf for detailed information.paint in class PgGeometryPgGeometryIf
public void clearTagVertex(int anIndex,
int aTag)
PvGeometryIf.clearTagVertex in class PgGeometry
public boolean hasTagVertex(int anIndex,
int aTag)
PvGeometryIf.hasTagVertex in class PgGeometry
public void setTagVertex(int anIndex,
int aTag)
PvGeometryIf.setTagVertex in class PgGeometry
public int hasVertex(PdVector aVertex,
double eps)
PdVector.equals(PdVector, double).PdVector - vertex to be found in vertex listpublic int hasVertex(PdVector aVertex)
PdVector.equals(PdVector).PdVector - vertex to be found in vertex listpublic int addVertex(PdVector aVertex)
setVertex(int, PdVector).addVertex in class PgGeometryPdVector - vertex to be added to vertex listpublic int[] removeVertex(int ind)
PsObject.IS_DELETED
and invokes #removeMarkedVertices().
Note, when removeMarkedVertices() is called then many subclasses remove elements which refer to the deleted vertex. Therefore, it is not advised to use this method for frequent updating of a geometry.
removeVertex in class PgGeometrypublic void setVertices(PdVector[] aVertexList)
getNumVertices() vertices of source array into
an existing vertex array.
Length of argument vertex list must be equal or larger than getNumVertices().
The dimension of all argument vertices must be
equal to getDimOfVertices() of the geometry.aVertexList - array with new verticespublic int[] removeMarkedVertices()
public void setVertexColors(java.awt.Color[] aVertexColorList)
aVertexColorList - array with new vertex colorspublic void setVertexNormals(PdVector[] aVertexNormalList)
aVertexNormalList - array with new vertex normalspublic void setVertexTextures(PdVector[] aVertexTextureList)
aVertexTextureList - array with new vertex textures
public boolean setVertex(int anIndex,
PdVector aVertex)
setVertex in class PgGeometryint - index of vertex positionPdVector - vertex to be copied to vertex list
public void setVertex(int anIndex,
double x)
anIndex - index of vertexx - coordinate of vertex
public void setVertex(int anIndex,
double x,
double y)
anIndex - index of vertexx,y - coordinates of vertex
public void setVertex(int anIndex,
double x,
double y,
double z)
anIndex - index of vertexx,y,z - coordinates of vertex
public void setVertexColor(int anIndex,
java.awt.Color aVertex)
int - index of vertex positionPdColor - color to be copied to color list
public void setVertexNormal(int anIndex,
PdVector aVertex)
int - index of vertex positionPdVector - normal to be copied to normal listpublic int addVectorField(PgVectorField aVectorField)
public int getNumVectorFields()
public int getIndexOfVectorField(PgVectorField aVectorField)
public PgVectorField getVectorField(java.lang.String name)
public PgVectorField getVectorField(int anInd)
public boolean removeVectorField(PgGeometryIf aVectorField)
public void removeAllVectorFields()
public void computeRotation(PgPolygon meridian,
int numULines)
numULines - discretization in angular direction
public void computeCylinder(int numULines,
int numVLines,
double radius,
double length)
numULines - discretization in angular directionnumVLines - discretization in z-axis directionradius - radius of cylinderlength - height of cylinder
public void computeDisk(int numULines,
int numVLines,
double radius)
numULines - discretization in radial directionnumVLines - discretization in angular directionradius - radius of disk
public void computePlane(int numULines,
int numVLines,
double uMin,
double vMin,
double uMax,
double vMax)
numULines - discretization in x directionnumVLines - discretization in y directionuMin, - vMin, uMax, vMax size of rectangle
public void computeSphere(int numULines,
int numVLines,
double radius)
numULines - discretization in angular directionnumVLines - discretization in meridian directionradius - radius of sphere
public void computeTorus(int numULines,
int numVLines,
double radius,
double thick)
numULines - discretization in angular directionnumVLines - discretization in meridian directionradius - radius of soalthick - radius of torus tube
public void computeSnail(int numULines,
int numVLines,
double numWindings)
numULines - discretization in angular directionnumVLines - discretization in meridian directionnumWindings - number of half-turns of snail housepublic boolean merge(PgGeometryIf aGeom)
this.
Number of vertices is the sum of both objects.merge in class PgGeometryaGeom - Second geometry, will not be modified.true on success, false is argument null.
public boolean blend(double s,
PgGeometry ag,
double t,
PgGeometry bg)
this = s*a + t*b.blend in class PgGeometrydouble - s, t weights of vertices of each elementSetPgPointSet - a, b two pointSets used for blendingpublic void flipOrientation()
public void projectToSphere(PdVector center,
double radius)
public void translate(PdVector diff)
public void scale(double factor)
PgGeometry.getCenter()
public void scale(double factor,
PdVector center)
public boolean makeColorFromVectorLength()
public boolean makeVertexColorsFromXYZ()
public boolean makeVertexColorsFromZ()
public boolean makeVertexColorsFromZHue()
public boolean makeVertexTextureFromBndBox(int ix,
int iy)
ix - index of x-direction of planeiy - index of y-direction of plane
public boolean makeVertexTextureFromCylinder(PdVector center,
PdVector axis)
center - an arbitrary point on the axis of the cylinderaxis - unit length direction of the axis of the cylinderpublic boolean makeVertexTextureFromSphere(PdVector center)
public PgGeometry reflect(PdMatrix mat,
boolean bOrient,
boolean bVector)
reflect in class PgGeometrymat - 3*3 or 4*4 transformation matrixbOrient - flag whether to keep the orientation of the geometrybVector - flag whether to keep the orientation of vectors
public PvPickEvent intersectionWithLine(PdVector rayBase,
PdVector rayDir)
intersectionWithLine in class PgGeometryrayBase - base point of ray eventually hitting the point setrayDir - direction point of ray eventually hitting the point set
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||