public class Edge
extends java.lang.Object
Constructor and Description |
---|
Edge(int index1,
int index2,
float crease,
boolean inFace,
TemporalMesh temporalMesh)
This constructor only stores the indexes of the vertices.
|
Edge(Vector3f v1,
Vector3f v2) |
Modifier and Type | Method and Description |
---|---|
Edge |
clone() |
Vector3f |
computeCentroid() |
boolean |
cross(Edge edge)
The crossing method first computes the points on both lines (that contain the edges)
who are closest in distance.
|
boolean |
equals(java.lang.Object obj) |
void |
flipIndexes()
Flips the order of the indexes.
|
float |
getCrease() |
Vector3f |
getCrossPoint(Edge edge)
The method computes the crossing pint of this edge and another edge.
|
Vector3f |
getCrossPoint(Edge edge,
boolean extendThisEdge,
boolean extendSecondEdge)
The method computes the crossing pint of this edge and another edge.
|
int |
getFirstIndex() |
Vector3f |
getFirstVertex() |
float |
getLength() |
int |
getOtherIndex(int index)
Returns the index other than the given.
|
int |
getSecondIndex() |
Vector3f |
getSecondVertex() |
TemporalMesh |
getTemporalMesh() |
int |
hashCode() |
boolean |
isInFace() |
static java.util.List<Edge> |
loadAll(Structure meshStructure,
TemporalMesh temporalMesh)
The method loads all edges from the given mesh structure that does not belong to any face.
|
void |
shiftIndexes(int shift,
IndexesLoop.IndexPredicate predicate)
Shifts indexes by a given amount.
|
java.lang.String |
toString() |
public Edge(int index1, int index2, float crease, boolean inFace, TemporalMesh temporalMesh)
index1
- the first index of the edgeindex2
- the second index of the edgecrease
- the weight of the faceinFace
- a variable that indicates if this edge belongs to any face or notpublic Edge clone()
clone
in class java.lang.Object
public int getFirstIndex()
public int getSecondIndex()
public Vector3f getFirstVertex()
public Vector3f getSecondVertex()
public int getOtherIndex(int index)
index
- index of the edgepublic float getCrease()
public boolean isInFace()
public float getLength()
public TemporalMesh getTemporalMesh()
public Vector3f computeCentroid()
public void shiftIndexes(int shift, IndexesLoop.IndexPredicate predicate)
shift
- how much the indexes should be shiftedpredicate
- the predicate that verifies which indexes should be shifted; if null then all will be shiftedpublic void flipIndexes()
public boolean cross(Edge edge)
edge
- the edge we check against crossingpublic Vector3f getCrossPoint(Edge edge)
edge
- the edge to compute corss point withpublic Vector3f getCrossPoint(Edge edge, boolean extendThisEdge, boolean extendSecondEdge)
edge
- the edge to compute corss point withextendThisEdge
- set to true to find a crossing point along the whole
straight that contains the current edgeextendSecondEdge
- set to true to find a crossing point along the whole
straight that contains the given edgepublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static java.util.List<Edge> loadAll(Structure meshStructure, TemporalMesh temporalMesh) throws BlenderFileException
meshStructure
- the mesh structuretemporalMesh
- the owner of the edgesBlenderFileException
- an exception is thrown when problems with file reading occur