public class Face
extends java.lang.Object
implements java.util.Comparator<java.lang.Integer>
Modifier and Type | Class and Description |
---|---|
static class |
Face.TriangulationWarning
A warning that indicates a problem with face triangulation.
|
Constructor and Description |
---|
Face(java.lang.Integer[] indexes,
boolean smooth,
int materialNumber,
java.util.Map<java.lang.String,java.util.List<Vector2f>> faceUVCoords,
java.util.List<byte[]> vertexColors,
TemporalMesh temporalMesh)
Creates a complete face with all available data.
|
Modifier and Type | Method and Description |
---|---|
Face |
clone() |
int |
compare(java.lang.Integer index1,
java.lang.Integer index2) |
Vector3f |
computeCentroid() |
boolean |
equals(java.lang.Object obj) |
void |
flipIndexes()
Flips the order of the indexes.
|
void |
flipUV(boolean u,
boolean v)
Flips UV coordinates.
|
java.util.List<java.util.List<java.lang.Integer>> |
getCurrentIndexes() |
IndexesLoop |
getIndexes() |
int |
getMaterialNumber() |
TemporalMesh |
getTemporalMesh() |
java.util.Map<java.lang.String,java.util.List<Vector2f>> |
getUvSets() |
java.util.List<byte[]> |
getVertexColors() |
int |
hashCode() |
boolean |
isSmooth() |
static java.util.List<Face> |
loadAll(Structure meshStructure,
java.util.Map<java.lang.String,java.util.List<Vector2f>> userUVGroups,
java.util.List<byte[]> verticesColors,
TemporalMesh temporalMesh,
BlenderContext blenderContext)
Loads all faces of a given mesh.
|
void |
setTemporalMesh(TemporalMesh temporalMesh)
Sets the temporal mesh for the face.
|
java.lang.String |
toString() |
Face.TriangulationWarning |
triangulate()
The method triangulates the face.
|
int |
vertexCount() |
public Face(java.lang.Integer[] indexes, boolean smooth, int materialNumber, java.util.Map<java.lang.String,java.util.List<Vector2f>> faceUVCoords, java.util.List<byte[]> vertexColors, TemporalMesh temporalMesh)
indexes
- the indexes of the face (required)smooth
- indicates if the face is smooth or solidmaterialNumber
- the material index of the facefaceUVCoords
- UV coordinate sets of the face (optional)vertexColors
- the vertex colors of the face (optional)temporalMesh
- the temporal mesh the face belongs to (required)public Face clone()
clone
in class java.lang.Object
public TemporalMesh getTemporalMesh()
public IndexesLoop getIndexes()
public Vector3f computeCentroid()
public java.util.List<java.util.List<java.lang.Integer>> getCurrentIndexes()
public void setTemporalMesh(TemporalMesh temporalMesh)
temporalMesh
- the temporal mesh of the facejava.lang.IllegalArgumentException
- thrown if given temporal mesh is nullpublic void flipIndexes()
public void flipUV(boolean u, boolean v)
u
- indicates if U coords should be flippedv
- indicates if V coords should be flippedpublic java.util.Map<java.lang.String,java.util.List<Vector2f>> getUvSets()
public int vertexCount()
public Face.TriangulationWarning triangulate()
public boolean isSmooth()
public int getMaterialNumber()
public java.util.List<byte[]> getVertexColors()
public 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 interface java.util.Comparator<java.lang.Integer>
equals
in class java.lang.Object
public static java.util.List<Face> loadAll(Structure meshStructure, java.util.Map<java.lang.String,java.util.List<Vector2f>> userUVGroups, java.util.List<byte[]> verticesColors, TemporalMesh temporalMesh, BlenderContext blenderContext) throws BlenderFileException
meshStructure
- the mesh structure we read the faces fromuserUVGroups
- UV groups defined by the userverticesColors
- the vertices colors of the meshtemporalMesh
- the temporal mesh the faces will belong toblenderContext
- the blender contextBlenderFileException
- an exception is thrown when problems with file reading occurpublic int compare(java.lang.Integer index1, java.lang.Integer index2)
compare
in interface java.util.Comparator<java.lang.Integer>