00001
00002
00003
00004 #ifndef __edu_mines_jtk_mesh_TriSurf__
00005 #define __edu_mines_jtk_mesh_TriSurf__
00006
00007 #pragma interface
00008
00009 #include <java/lang/Object.h>
00010 #include <gcj/array.h>
00011
00012 extern "Java"
00013 {
00014 namespace edu
00015 {
00016 namespace mines
00017 {
00018 namespace jtk
00019 {
00020 namespace mesh
00021 {
00022 class TetMesh;
00023 class TetMesh$Edge;
00024 class TetMesh$Face;
00025 class TetMesh$Node;
00026 class TriSurf;
00027 class TriSurf$Edge;
00028 class TriSurf$EdgeFace;
00029 class TriSurf$Face;
00030 class TriSurf$FaceIterator;
00031 class TriSurf$FaceList;
00032 class TriSurf$Node;
00033 class TriSurf$NodeIterator;
00034 }
00035 }
00036 }
00037 }
00038 }
00039
00040 class edu::mines::jtk::mesh::TriSurf : public ::java::lang::Object
00041 {
00042
00043 public:
00044 TriSurf();
00045 virtual jboolean addNode(::edu::mines::jtk::mesh::TriSurf$Node *);
00046 virtual jboolean addNodes(JArray< ::edu::mines::jtk::mesh::TriSurf$Node * > *);
00047 virtual jboolean removeNode(::edu::mines::jtk::mesh::TriSurf$Node *);
00048 virtual jboolean removeNodes(JArray< ::edu::mines::jtk::mesh::TriSurf$Node * > *);
00049 virtual jint countNodes();
00050 virtual jint countFaces();
00051 virtual ::edu::mines::jtk::mesh::TriSurf$NodeIterator * getNodes();
00052 virtual ::edu::mines::jtk::mesh::TriSurf$FaceIterator * getFaces();
00053 virtual ::edu::mines::jtk::mesh::TriSurf$Node * findNodeNearest(jfloat, jfloat, jfloat);
00054 virtual JArray< ::edu::mines::jtk::mesh::TriSurf$Face * > * getFaceNabors(::edu::mines::jtk::mesh::TriSurf$Node *);
00055 virtual void getFaceNabors(::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$FaceList *);
00056 virtual ::edu::mines::jtk::mesh::TriSurf$Face * findFace(::edu::mines::jtk::mesh::TriSurf$Node *);
00057 virtual ::edu::mines::jtk::mesh::TriSurf$Face * findFace(::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00058 virtual ::edu::mines::jtk::mesh::TriSurf$Face * findFace(::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00059 virtual ::edu::mines::jtk::mesh::TriSurf$Edge * findEdge(::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00060 private:
00061 void validate();
00062 static jdouble distanceSquared(::edu::mines::jtk::mesh::TriSurf$Node *, jdouble, jdouble, jdouble);
00063 ::edu::mines::jtk::mesh::TriSurf$Face * findFace(::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00064 ::edu::mines::jtk::mesh::TriSurf$Face * findFace(::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00065 void mark(::edu::mines::jtk::mesh::TriSurf$Face *);
00066 void markRed(::edu::mines::jtk::mesh::TriSurf$Face *);
00067 void markBlue(::edu::mines::jtk::mesh::TriSurf$Face *);
00068 jboolean isMarked(::edu::mines::jtk::mesh::TriSurf$Face *);
00069 jboolean isMarkedRed(::edu::mines::jtk::mesh::TriSurf$Face *);
00070 jboolean isMarkedBlue(::edu::mines::jtk::mesh::TriSurf$Face *);
00071 void clearFaceMarks();
00072 void getFaceNabors(::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$FaceList *);
00073 ::edu::mines::jtk::mesh::TriSurf$Edge * getEdge(::edu::mines::jtk::mesh::TetMesh$Edge *);
00074 ::edu::mines::jtk::mesh::TriSurf$EdgeFace * getEdgeFace(::edu::mines::jtk::mesh::TriSurf$Edge *);
00075 ::edu::mines::jtk::mesh::TriSurf$EdgeFace * getBestEdgeFace();
00076 ::edu::mines::jtk::mesh::TriSurf$EdgeFace * getNextEdgeFace(::edu::mines::jtk::mesh::TriSurf$EdgeFace *);
00077 ::edu::mines::jtk::mesh::TriSurf$EdgeFace * addEdge(::edu::mines::jtk::mesh::TriSurf$Edge *);
00078 void removeEdge(::edu::mines::jtk::mesh::TriSurf$Edge *);
00079 void addFace(::edu::mines::jtk::mesh::TriSurf$Face *);
00080 void removeFace(::edu::mines::jtk::mesh::TriSurf$Face *);
00081 void init(::edu::mines::jtk::mesh::TriSurf$Face *);
00082 void extend(::edu::mines::jtk::mesh::TriSurf$Edge *, ::edu::mines::jtk::mesh::TriSurf$Face *);
00083 void fillEar(::edu::mines::jtk::mesh::TriSurf$Edge *, ::edu::mines::jtk::mesh::TriSurf$Face *);
00084 void fillHole(::edu::mines::jtk::mesh::TriSurf$Edge *, ::edu::mines::jtk::mesh::TriSurf$Face *);
00085 ::edu::mines::jtk::mesh::TriSurf$EdgeFace * findTwin(::edu::mines::jtk::mesh::TriSurf$EdgeFace *);
00086 void glue(::edu::mines::jtk::mesh::TriSurf$Edge *, ::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$Edge *, ::edu::mines::jtk::mesh::TriSurf$Face *);
00087 jboolean stitch(::edu::mines::jtk::mesh::TriSurf$EdgeFace *);
00088 void rebuild();
00089 void init();
00090 jboolean surf();
00091 static jboolean nodesInOrder(::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00092 static ::edu::mines::jtk::mesh::TriSurf$Node * otherNode(::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00093 static ::edu::mines::jtk::mesh::TetMesh$Node * otherNode(::edu::mines::jtk::mesh::TetMesh$Face *, ::edu::mines::jtk::mesh::TetMesh$Node *, ::edu::mines::jtk::mesh::TetMesh$Node *);
00094 static void linkFaces(::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00095 public:
00096 static jfloat normalVector(::edu::mines::jtk::mesh::TetMesh$Face *, JArray< jfloat > *);
00097 static jdouble normalVector(::edu::mines::jtk::mesh::TetMesh$Face *, JArray< jdouble > *);
00098 private:
00099 static jdouble angle(::edu::mines::jtk::mesh::TetMesh$Face *, ::edu::mines::jtk::mesh::TetMesh$Face *);
00100 ::edu::mines::jtk::mesh::TetMesh$Edge * findMeshEdge(::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00101 ::edu::mines::jtk::mesh::TriSurf$Edge * makeEdge(::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Face *);
00102 ::edu::mines::jtk::mesh::TriSurf$EdgeFace * makeEdgeFace(::edu::mines::jtk::mesh::TriSurf$Edge *);
00103 jboolean hasInternalEdge(::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00104 jboolean validForFace(::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00105 static void trace(::java::lang::String *);
00106 public:
00107 static ::edu::mines::jtk::mesh::TriSurf$Node * access$0(::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00108 static jboolean access$1(::edu::mines::jtk::mesh::TriSurf$Face *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *, ::edu::mines::jtk::mesh::TriSurf$Node *);
00109 static jdouble access$2(::edu::mines::jtk::mesh::TriSurf$Node *, jdouble, jdouble, jdouble);
00110 static ::edu::mines::jtk::mesh::TetMesh * access$3(::edu::mines::jtk::mesh::TriSurf *);
00111 static ::java::util::Map * access$4(::edu::mines::jtk::mesh::TriSurf *);
00112 private:
00113 static const jint FACE_MARK_MAX = 2147483646;
00114 ::edu::mines::jtk::mesh::TetMesh * __attribute__((aligned(__alignof__( ::java::lang::Object)))) _mesh;
00115 ::java::util::Set * _faceSet;
00116 ::java::util::Map * _faceMap;
00117 ::java::util::Map * _edgeMap;
00118 ::java::util::SortedSet * _edgeQueue;
00119 jint _faceMarkRed;
00120 jint _faceMarkBlue;
00121 static jdouble VV_SLIVER;
00122 static jdouble VV_LARGE;
00123 static const jboolean TRACE = 0;
00124 public:
00125 static jboolean $assertionsDisabled;
00126 public:
00127 static ::java::lang::Class class$;
00128 };
00129
00130 #endif // __edu_mines_jtk_mesh_TriSurf__