$search
00001 #ifndef EDGE_HH 00002 #define EDGE_HH 00003 00004 /* 00005 James R. Diebel 00006 Stanford University 00007 00008 Started: 27 August 2004 00009 Last revised: 27 Sugust 2004 00010 00011 edge.hh - class definition for an edge in a 3d surface mesh as defined 00012 in the header file mesh.hh. 00013 00014 Depends on: 00015 - Vec3d class (vec3d.hh) 00016 - Vert class (vert.hh) 00017 - Face class (face.hh) 00018 00019 Used almost exclusively by Mesh class (mesh.hh) 00020 */ 00021 00022 #include <iostream> 00023 #include "vec3d.hh" 00024 #include "mesh.hh" 00025 #include "vert.hh" 00026 #include "face.hh" 00027 00028 namespace bmtk { 00029 00030 using namespace std; 00031 00032 class Edge { 00033 public: 00034 int flag; // visitation flag 00035 int nf; // number of adjacent faces 00036 int i; // index of self within global edge list 00037 float psi; // the edge potential 00038 float a; // max angle between adjacent faces 00039 float l; // the length of the edge 00040 00041 class Mesh *m; // link to parent mesh 00042 class Face *f[2]; // list of adjacent faces 00043 class Vert *v[2]; // list of vertices of edge 00044 00045 // Constructor/Destructor 00046 Edge(); 00047 ~Edge(); 00048 00049 // Member functions 00050 void findAngle(); 00051 void findLength(); 00052 void findPotential(); 00053 Vec3d gradient(Vert& vi); 00054 int indexOf(Vert& vp); 00055 00056 // Equality tests 00057 bool operator == (const Edge &e) const; 00058 bool operator != (const Edge &e) const; 00059 }; 00060 00061 // Membership tests 00062 bool operator < (Vert &vp, Edge &ep); 00063 00064 // Define << operator to handle output to screen 00065 ostream& operator << (ostream& os, const Edge &e); 00066 00067 } // namespace bmtk 00068 00069 #endif