Modifier and Type | Field and Description |
---|---|
protected List<T> |
neighbors
The neighboring facets of this facet.
|
protected List<Vertex> |
vertices
The vertices of this facet in counter clock wise orientation.
|
Constructor and Description |
---|
TriangularFacet()
Creates a new empty facet.
|
TriangularFacet(Vertex v0,
Vertex v1,
Vertex v2)
Creates a new facet of three vertices.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsAll(List<Vertex> vertexList)
Returns true if all vertices are part of this polygon
|
double |
distanceToPlane(Vector3D p)
Computes the distance from a point to this facet
|
boolean |
equals(Object obj) |
double |
getArea()
Get the area of this facet.
|
Vector3D |
getCentroid()
Get the centroid of this facet.
|
Vertex |
getLastVertex()
Get the last vertex.
|
Vertex |
getMaximumDistanceVertex()
The vertex which is in front and farthest apart of the plane
|
T |
getNeighbor(int position)
Get the neighbor at position.
|
List<T> |
getNeighbors()
Get all neighbors.
|
Vector3D |
getNormal()
Get the normal of this facet.
|
Vertex |
getP0() |
Vertex |
getP1() |
Vertex |
getP2() |
double |
getPlaneOffset()
Computes the offset of this facet
|
Vertex |
getVertex(int i)
Get the vertex at index i.
|
List<Vertex> |
getVertices()
The list of vertices.
|
List<Vertex> |
getVerticesInFront()
All points which are in front of this plane.
|
boolean |
hasEdge(Vertex tail,
Vertex head)
Returns true if this facet has the edge from tail to head.
|
int |
hashCode() |
int |
indexOfNeighbor(T facet)
Get index of a neighbor.
|
int |
indexOfVertex(Vertex vertex)
Returns the index of the first occurrence of vertex.
|
void |
replaceNeighbor(int i,
T f)
Replaces a neighbor.
|
void |
setNeighbor(int position,
T n)
Sets the n-th neighbor of this facet.
|
void |
setVertexInFront(Vertex v,
double distanceToPlane)
Adds a vertex to the points in front of this facet.
|
int |
size()
Get the number of vertices.
|
protected List<Vertex> vertices
public double getArea()
public Vector3D getCentroid()
public Vector3D getNormal()
public double getPlaneOffset()
public double distanceToPlane(Vector3D p)
p
- the pointpublic void setVertexInFront(Vertex v, double distanceToPlane)
v
- the vertexdistanceToPlane
- of this vertexpublic List<Vertex> getVerticesInFront()
public Vertex getMaximumDistanceVertex()
public Vertex getP0()
public Vertex getP1()
public Vertex getP2()
public int indexOfVertex(Vertex vertex)
vertex
- the vertexpublic Vertex getVertex(int i)
i
- the positionpublic int size()
public Vertex getLastVertex()
public boolean containsAll(List<Vertex> vertexList)
vertexList
- to checkpublic boolean hasEdge(Vertex tail, Vertex head)
tail
- vertex of the edgehead
- vertex of the edgepublic void setNeighbor(int position, T n)
position
- of the neighborn
- the neighborpublic T getNeighbor(int position)
position
- the positionpublic void replaceNeighbor(int i, T f)
i
- index of the neighbor to replacef
- the new neighborpublic int indexOfNeighbor(T facet)
facet
- the neighboring facetCopyright © 2014–2022 ImageJ. All rights reserved.