public class Vertex3d extends Feature implements Clonable, Boundable
Modifier and Type | Field and Description |
---|---|
Point3d |
myRenderPnt |
Point3d |
pnt
3D point associated with this vertex.
|
int |
uniqueIndex |
Constructor and Description |
---|
Vertex3d()
Creates a new Vertex3d with a point initialized to (0,0,0) and an index
value of -1.
|
Vertex3d(double x,
double y,
double z)
Creates a new Vertex3d with a specified point and index value.
|
Vertex3d(double x,
double y,
double z,
int idx)
Creates a new Vertex3d with a specified point and index value.
|
Vertex3d(int idx)
Creates a new Vertex3d with point initialized to (0,0,0) and a specified
index value.
|
Vertex3d(Point3d pnt)
Creates a new Vertex3d with a specified point and an index value of -1.
|
Vertex3d(Point3d pnt,
int idx)
Creates a new Vertex3d with a specified point and index value.
|
Modifier and Type | Method and Description |
---|---|
void |
addIncidentHalfEdge(HalfEdge he)
Adds a half-edge to the list of half-edges incident onto this vertex.
|
Vertex3d |
clone() |
boolean |
computeAngleWeightedNormal(Vector3d nrm)
Computes a normal for this vertex by averaging the cross products of all
the incident half edges.
|
void |
computeCentroid(Vector3d centroid)
Computed the centroid of this element.
|
double |
computeCovariance(Matrix3d C)
Computes the covariance of the element, assuming a uniform density
of one.
|
boolean |
computeNormal(Vector3d nrm)
Computes a normal for this vertex by taking the average of all the
associated face normals.
|
boolean |
computeRenderNormal(Vector3d nrm) |
Vertex3d |
copy() |
HalfEdge |
firstIncidentHalfEdge()
Returns the first incident half-edge listed for this vertex, or null if
there are no incident half-edges.
|
java.awt.Color |
getColor()
Returns the color of this vertex, or null if no color has been set.
|
float[] |
getColorArray() |
java.util.Iterator<HalfEdge> |
getIncidentHalfEdges()
Returns an iterator for all the half-edges which are incident onto this
vertex.
|
int |
getIndex()
Returns the index value associated with this vertex.
|
MeshBase |
getMesh() |
Point3d |
getPoint(int idx)
Returns the
idx -th point associated with this element. |
Point3d |
getPosition() |
Point3d |
getWorldPoint()
Returns the point value of this vertex in world coordinates.
|
void |
getWorldPoint(Point3d pnt)
Returns the point value of this vertex in world coordinates.
|
Vertex3d |
interpolate(double s,
Vertex3d vb) |
int |
numIncidentHalfEdges()
Returns the number of half-edges which are incident onto this
vertex.
|
int |
numPoints()
Returns the number of points associated with this element, if any, or
zero otherwise.
|
boolean |
removeIncidentHalfEdge(HalfEdge hedge)
Removes a half-edge from the list of half-edges incident onto this vertex.
|
void |
saveRenderInfo() |
void |
setColor(java.awt.Color color)
Sets a color for this vertex, or removes the color if null is specified.
|
void |
setColor(java.awt.Color color,
float alpha) |
void |
setColor(double r,
double g,
double b) |
void |
setColor(double r,
double g,
double b,
double a) |
void |
setColor(float r,
float g,
float b) |
void |
setColor(float r,
float g,
float b,
float a) |
void |
setColorHSV(double h,
double s,
double b)
Sets the vertex color based on hue, saturation, and value (brightness).
|
void |
setColorHSV(double h,
double s,
double b,
double a)
Sets the vertex color based on hue, saturation, and value (brightness).
|
void |
setIndex(int idx)
Sets the index value for this vertex.
|
void |
setMesh(MeshBase mesh) |
void |
setPosition(Point3d pos) |
void |
updateBounds(Point3d min,
Point3d max)
Updates the axis-aligned bounds of this element.
|
checkFlag, clearFlag, clearVisited, getType, getTypeName, isVisited, setFlag, setVisited, voronoiCheck
public Point3d pnt
public Point3d myRenderPnt
public int uniqueIndex
public Vertex3d()
public Vertex3d(int idx)
idx
- desired index valuepublic Vertex3d(Point3d pnt, int idx)
pnt
field is set to refer directly to the supplied point.pnt
- point to use for the pnt
fieldidx
- desired index valuepublic Vertex3d(double x, double y, double z)
x
- vertex x coordinatey
- vertex y coordinatez
- vertex z coordinatepublic Vertex3d(double x, double y, double z, int idx)
x
- vertex x coordinatey
- vertex y coordinatez
- vertex z coordinateidx
- desired index valuepublic java.util.Iterator<HalfEdge> getIncidentHalfEdges()
HalfEdge
.public int numIncidentHalfEdges()
public boolean computeNormal(Vector3d nrm)
nrm
- returns the computed normalpublic boolean computeAngleWeightedNormal(Vector3d nrm)
nrm
- returns the computed normalpublic boolean computeRenderNormal(Vector3d nrm)
public void addIncidentHalfEdge(HalfEdge he)
he
- HalfEdgeNode containing the half edge in questionpublic boolean removeIncidentHalfEdge(HalfEdge hedge)
hedge
- half-edge to removepublic HalfEdge firstIncidentHalfEdge()
public int getIndex()
public void setIndex(int idx)
idx
- new index valuepublic void setColor(java.awt.Color color)
color
- color to set for this vertex.public void setColor(java.awt.Color color, float alpha)
public void setColor(float r, float g, float b)
public void setColor(float r, float g, float b, float a)
public void setColor(double r, double g, double b)
public void setColor(double r, double g, double b, double a)
public void setColorHSV(double h, double s, double b)
h
- hue (in the range 0-1)s
- saturation (in the range 0-1)b
- brightness (in the range 0-1)public void setColorHSV(double h, double s, double b, double a)
h
- hue (in the range 0-1)s
- saturation (in the range 0-1)b
- brightness (in the range 0-1)a
- alpha (in the range of 0-1)public java.awt.Color getColor()
public float[] getColorArray()
public void saveRenderInfo()
public Point3d getWorldPoint()
public void getWorldPoint(Point3d pnt)
public MeshBase getMesh()
public void setMesh(MeshBase mesh)
public Point3d getPosition()
public void setPosition(Point3d pos)
public Vertex3d copy()
public Vertex3d clone()
public int numPoints()
Boundable
public Point3d getPoint(int idx)
Boundable
idx
-th point associated with this element.getPoint
in interface Boundable
idx
- index of the point (must be on the range 0 to
Boundable.numPoints()
).idx
-th point associated with this element.
Must not be modified.public void updateBounds(Point3d min, Point3d max)
Boundable
min
and max
should be decreased or increased,
respectively, so that all spatial points associated with this element lie
within the axis-aligned box defined by min
and
max
.updateBounds
in interface Boundable
min
- minimum values to be updatedmax
- maximum values to be updatedpublic void computeCentroid(Vector3d centroid)
Boundable
computeCentroid
in interface Boundable
centroid
- returns the computed centroid value.public double computeCovariance(Matrix3d C)
Boundable
int_V \rho x x^T dV,where
\rho
is the density, x
is any
spatial point within the element, and the integral is evaluated
over the element's spatial extent. The method returns the element's
spatial size, which for elements of dimension 3, 2, 1, or 0 will
be a volume, area, length, or discrete value.
Implementation of this method is optional, with non-implementation indicated by having the method return -1. Non-implementation may prevent the element from being enclosed within certain types of oriented bounding box (OBB) constructions.
computeCovariance
in interface Boundable
C
- returns the covariance