// Draw hidden faces
if (enableHiddenFaces) {
for (int i = 0; i < hiddenFacesArray.length; i++) {
HullFace f = hiddenFacesArray[i];
HullVertex v = f.getVertex(0);
Vector4 worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
Vector4 screenPos = prj.project(worldPos);
PointData p1 = new PointData(worldPos, screenPos, v);
v = f.getVertex(1);
worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
screenPos = prj.project(worldPos);
PointData p2 = new PointData(worldPos, screenPos, v);
v = f.getVertex(2);
worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
screenPos = prj.project(worldPos);
PointData p3 = new PointData(worldPos, screenPos, v);
drawFace(g, p1, p2, p3, f);
}
}
// Draw visible faces
if (enableVisibleFaces) {
for (int i = 0; i < visibleFacesArray.length; i++) {
HullFace f = visibleFacesArray[i];
HullVertex v = f.getVertex(0);
Vector4 worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
Vector4 screenPos = prj.project(worldPos);
PointData p1 = new PointData(worldPos, screenPos, v);
v = f.getVertex(1);
worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
screenPos = prj.project(worldPos);
PointData p2 = new PointData(worldPos, screenPos, v);
v = f.getVertex(2);
worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
screenPos = prj.project(worldPos);
PointData p3 = new PointData(worldPos, screenPos, v);
drawFace(g, p1, p2, p3, f);
}
}
// Draw hidden edges
if (enableHiddenEdges) {
for (int i = 0; i < hiddenEdgesArray.length; i++) {
HullEdge e = hiddenEdgesArray[i];
HullVertex v = e.getEndPoint(0);
Vector4 worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
Vector4 screenPos = prj.project(worldPos);
PointData p1 = new PointData(worldPos, screenPos, v);
v = e.getEndPoint(1);
worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
screenPos = prj.project(worldPos);
PointData p2 = new PointData(worldPos, screenPos, v);
drawEdge(g, p1, p2, e, false);
}
}
// Draw hidden hull vertices
for (int i = 0; i < sortedHiddenVertices.length; i++) {
PointData p = sortedHiddenVertices[i];
if (p.vertex.getID() >= 0) {
drawVertex(g, p, false, true);
}
}
// Draws points inside
for (int i = 0; i < sortedVerticesInside.length; i++) {
PointData p = sortedVerticesInside[i];
if (enableInternalVertices || p.vertex.getName().equals(selectedStation) ) {
drawVertex(g, p, false, false);
}
}
drawAxes(g, true);
// Draw visible hull edges
if (enableVisibleEdges) {
for (int i = 0; i < visibleEdgesArray.length; i++) {
HullEdge e = visibleEdgesArray[i];
HullVertex v = e.getEndPoint(0);
Vector4 worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
Vector4 screenPos = prj.project(worldPos);
PointData p1 = new PointData(worldPos, screenPos, v);
v = e.getEndPoint(1);
worldPos = Vector4.createPoint3D(v.x(), v.y(), v.z());
screenPos = prj.project(worldPos);
PointData p2 = new PointData(worldPos, screenPos, v);
drawEdge(g, p1, p2, e, true);
}