28package com.jogamp.graph.geom;
30import com.jogamp.math.VectorUtil;
31import com.jogamp.math.geom.plane.AffineTransform;
35 private final boolean[] boundaryEdges =
new boolean[3];
36 private boolean[] boundaryVertices =
null;
40 id = Integer.MAX_VALUE;
44 this.boundaryVertices = boundaryVertices;
49 vertices[0] = src.vertices[0].
copy();
50 vertices[1] = src.vertices[1].
copy();
51 vertices[2] = src.vertices[2].
copy();
52 System.arraycopy(src.boundaryEdges, 0, boundaryEdges, 0, 3);
53 boundaryVertices =
new boolean[3];
54 System.arraycopy(src.boundaryVertices, 0, boundaryVertices, 0, 3);
57 private Triangle(
final int id,
final boolean[] boundaryEdges,
final boolean[] boundaryVertices){
59 System.arraycopy(boundaryEdges, 0, this.boundaryEdges, 0, 3);
60 this.boundaryVertices =
new boolean[3];
61 System.arraycopy(boundaryVertices, 0, this.boundaryVertices, 0, 3);
95 public void setId(
final int id) {
105 return boundaryEdges[0] || boundaryEdges[1] || boundaryEdges[2];
109 return boundaryVertices[0] || boundaryVertices[1] || boundaryVertices[2];
113 return boundaryEdges;
117 return boundaryVertices;
121 this.boundaryVertices = boundaryVertices;
126 return "Tri ID: " +
id +
", onCurve "+
isOnCurve()+
"\n\t" +
127 vertices[0] +
", bound "+boundaryVertices[0]+
"\n\t" +
128 vertices[1] +
", bound "+boundaryVertices[1]+
"\n\t" +
129 vertices[2] +
", bound "+boundaryVertices[2];
Triangle(final Triangle src)
void setVerticesBoundary(final boolean[] boundaryVertices)
final boolean isOnCurve()
Returns true if all vertices are on-curve, otherwise false.
Vertex[] getVertices()
Returns array of 3 vertices, denominating the triangle.
final boolean isLine()
Returns true if all vertices are lines, i.e.
boolean isVerticesBoundary()
boolean[] getEdgeBoundary()
Triangle transform(final AffineTransform t)
Returns a transformed copy of this instance using the given AffineTransform.
Triangle(final Vertex v1, final Vertex v2, final Vertex v3, final boolean[] boundaryVertices)
boolean[] getVerticesBoundary()
boolean isEdgesBoundary()
A Vertex exposing Vec3f vertex- and texture-coordinates.
final boolean isOnCurve()
static boolean isVec2Zero(final Vec3f vec)
Return true if 2D vector components are zero, no FloatUtil#EPSILON is taken into consideration.