cgma
GeoTet.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : GeoTet.hpp
00003 //
00004 // Purpose       : Tet class used for geometry operations.  See also GeoNode.
00005 //
00006 // Description   : light-weight entity used for computational geometry 
00007 //                 tools.  Don't load this up with extra stuff!
00008 //
00009 // Creator       : Steve Owen
00010 //
00011 // Creation Date : 8/13/2003
00012 //
00013 // Owner         : Steve Owen
00014 //-------------------------------------------------------------------------
00015 
00016 
00017 #ifndef GEOTET_HPP
00018 #define GEOTET_HPP
00019 
00020 #include "MemoryManager.hpp"
00021 #include "ToolDataUser.hpp"
00022 #include "CubitVector.hpp"
00023 
00024 class GeoNode;
00025 
00026 class GeoTet : public ToolDataUser
00027 {
00028 private:
00029 
00030   GeoNode *mNodes[4];
00031     // array ordered nodes on this tet
00032 
00033   cBit isMarked : 1;
00034     // generic flag for marking the tet
00035 
00036   cBit isInside : 1;
00037     // defines whether this tet is inside the domain
00038 
00039 public:
00040 
00041   GeoTet( GeoNode *nodes[4] );
00042     //constructor
00043 
00044   ~GeoTet();
00045     //destructor
00046 
00047   void tet_nodes( GeoNode *&na, GeoNode *&nb, GeoNode *&nc, GeoNode *&nd );
00048     // get the nodes from this tet
00049 
00050   void tet_face_nodes ( int face_index, GeoNode *&na, GeoNode *&nb, GeoNode *&nc );
00051     // get the nodes on a specific face of this tet.
00052 
00053   GeoTet *get_connected_tet( GeoNode *na, GeoNode *nb, GeoNode *nc );
00054 
00055   GeoTet *get_connected_tet ( int face_index );
00056 
00057     // get the adjacent tet
00058 
00059   int node_index( GeoNode *node_ptr );
00060     // return the index of the node in the tet
00061 
00062   void opposite_edge( GeoNode *a_node, GeoNode *b_node, 
00063                       GeoNode *&c_node, GeoNode *&d_node );
00064     // return nodes on the opposite edge of the tet.  a_node and 
00065     // b_node must be on this tet.  c_node and d_node are in
00066     // no particular order
00067 
00068   void marked( int flag ) { isMarked = flag; }
00069   int marked() { return isMarked; }
00070     // get and set the generic marked flag
00071 
00072   void inside( int is_inside ) { isInside = is_inside; }
00073   int inside() { return isInside; }
00074     // get and set the isInside flag that defines whether the tet is inside the domain
00075 
00076   CubitStatus circumsphere( CubitVector &circumcenter, double *radius = NULL );
00077 };
00078 
00079 // debug functions
00080 void dgtet( GeoTet *tet );
00081 void dgnode( GeoNode *node );
00082 
00083 #endif
00084 
00085 
00086 // EOF
00087 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines