public class Vertex extends Object implements ISamplePoint
Modifier and Type | Field and Description |
---|---|
protected byte |
auxiliary
The auxiliary index used for graph coloring algorithms
and other applications.
|
static int |
BIT_CONSTRAINT
A bit flag indicating that the vertex is a member of a constraint edge.
|
static int |
BIT_SYNTHETIC
A bit flag indicating that the vertex is synthetic and was created
through some form of mesh processing rather than being supplied
as a data sample.
|
protected byte |
reserved0
An unused field reserved for use by applications and derived classes
|
protected byte |
reserved1
An unused field reserved for use by applications and derived classes
|
protected byte |
status
The bit-mapped status flags for the vertex.
|
double |
x
The Cartesian coordinate of the vertex (immutable).
|
double |
y
The Cartesian coordinate of the vertex (immutable).
|
Constructor and Description |
---|
Vertex(double x,
double y,
double z)
Construct a vertex with the specified coordinates and z value.
|
Vertex(double x,
double y,
double z,
int index)
Construct a vertex with the specified coordinates and ID value.
|
Modifier and Type | Method and Description |
---|---|
int |
getAuxiliaryIndex()
Gets the auxiliary index for the vertex.
|
double |
getDistance(double x,
double y)
Gets the distance from the vertex to an arbitrary point.
|
double |
getDistance(Vertex v)
Get the distance to the vertex.
|
double |
getDistanceSq(double x,
double y)
Gets the square of the distance from the vertex to an arbitrary point.
|
double |
getDistanceSq(Vertex v)
Get the square of the distance to the vertex.
|
int |
getIndex()
Gets the arbitrary index associated with the vertex.
|
String |
getLabel()
Gets a string intended for labeling the vertex in images or
reports.
|
int |
getStatus()
Gets the current value of the status flags for this vertex.
|
double |
getX()
Get the x coordinate associated with the vertex.
|
double |
getY()
Get the y coordinate associated with the vertex.
|
double |
getZ()
Get the z value associated with the vertex.
|
boolean |
isConstraintMember()
Indicates whether a vertex is part of a constraint definition or
lies on the border of an area constraint.
|
boolean |
isNull()
Indicates whether the vertex has been marked as having a null data value.
|
boolean |
isSynthetic()
Indicates whether a vertex is synthetic (was created through
a Tinfour procedure rather than supplied by an application).
|
void |
setAuxiliaryIndex(int auxiliaryIndex)
Sets the auxiliary index for the vertex.
|
void |
setConstraintMember(boolean constraintMember)
Sets or clears the is-constraint-member status of a vertex.
|
void |
setIndex(int index)
Sets the arbitrary index associated with the vertex.
|
void |
setStatus(int status)
Sets the status value of the vertex.
|
void |
setSynthetic(boolean synthetic)
Sets or clears the is-synthetic status of a vertex.
|
String |
toString() |
public static final int BIT_SYNTHETIC
public static final int BIT_CONSTRAINT
public final double x
public final double y
protected byte status
protected byte reserved0
protected byte reserved1
protected byte auxiliary
public Vertex(double x, double y, double z)
x
- the coordinate on the surface on which the vertex is definedy
- the coordinate on the surface on which the vertex is definedz
- the data value (z coordinate of the surface)public Vertex(double x, double y, double z, int index)
x
- the coordinate on the surface on which the vertex is definedy
- the coordinate on the surface on which the vertex is definedz
- the data value (z coordinate of the surface)index
- the ID of the vertex (intended as a diagnostic)public String getLabel()
public double getDistanceSq(Vertex v)
v
- a valid vertexpublic double getDistanceSq(double x, double y)
getDistanceSq
in interface ISamplePoint
x
- coordinate of arbitrary pointy
- coordinate of arbitrary pointpublic double getDistance(double x, double y)
x
- coordinate of arbitrary pointy
- coordinate of arbitrary pointpublic double getDistance(Vertex v)
v
- a valid vertexpublic double getX()
getX
in interface ISamplePoint
public double getY()
getY
in interface ISamplePoint
public double getZ()
getZ
in interface ISamplePoint
public boolean isNull()
public int getIndex()
This method permits public readonly access to the index.
public void setIndex(int index)
index
- an integer value.public boolean isSynthetic()
public void setSynthetic(boolean synthetic)
synthetic
- true if vertex is synthetic; otherwise, falsepublic void setConstraintMember(boolean constraintMember)
constraintMember
- true if vertex is a part of a constraint definition
or lies on the border of an area constraint; otherwise, falsepublic void setStatus(int status)
status
- a valid status value. Because the status is defined as
a single byte, higher-order bytes will be ignored.public int getStatus()
public boolean isConstraintMember()
public int getAuxiliaryIndex()
public void setAuxiliaryIndex(int auxiliaryIndex)
auxiliaryIndex
- a value in the range 0 to 255Copyright © 2021. All rights reserved.