cgma
|
00001 //------------------------------------------------------------------------- 00002 // Class: TDDelaunay 00003 // Description: Support for TriDelaunayTool. Maintains circumcircle 00004 // info at the triangles. Do it up template style 00005 // Author: chynes 00006 // Date: 6/3/2002 00007 //------------------------------------------------------------------------- 00008 00009 #ifndef TD_DELAUNAY_HPP 00010 #define TD_DELAUNAY_HPP 00011 00012 #include "ToolData.hpp" 00013 #include "CubitVector.hpp" 00014 #include "MemoryManager.hpp" 00015 #include "CastTo.hpp" 00016 00017 template< class TRIA, class NODE > 00018 class TDDelaunay : public virtual ToolData 00019 { 00020 private: 00021 00022 // static MemoryManager memoryManager; 00023 // //- memory management object 00024 00025 CubitVector mCenter; 00026 double mRadius; 00027 int visitFlag; 00028 int sortIndex; 00029 00030 public: 00031 00032 TDDelaunay<TRIA, NODE>(); 00033 virtual ~TDDelaunay<TRIA, NODE>(); 00034 //-constructor and destructor 00035 00036 static int is_delaunay(const ToolData* td) 00037 {return (CAST_TO(td, const TDDelaunay) != NULL);} 00038 00039 void reset(); 00040 // reset members to default 00041 00042 CubitVector &circumcenter2d( TRIA *tri_ptr ); 00043 double radius2d( TRIA *tri_ptr ); 00044 //- compute radius and circumcircle info for a 2D triangle 00045 00046 CubitVector &circumcenter( TRIA *tri_ptr ); 00047 double radius( TRIA *tri_ptr ); 00048 //- compute radius and circumcircle info for a 2D triangle 00049 00050 int circumsphere( TRIA *tet_ptr, CubitVector ¢er, double &rad ); 00051 //- compute the radius and circumsphere of a tet 00052 00053 int visit_flag( ) {return visitFlag;}; 00054 void visit_flag( int visit ) {visitFlag = visit;}; 00055 //- get and set the visites flag 00056 00057 int tri_sort_list( ) {return sortIndex;}; 00058 void tri_sort_list( int index ) {sortIndex = index;}; 00059 //- get and set the index of the sorting array used for 00060 //- prioritizing which tris will be processed first 00061 00062 // SetDynamicMemoryAllocation(memoryManager) 00063 // //- class specific new and delete operators 00064 // 00065 // static void set_memory_allocation_increment(int increment = 0) 00066 // {memoryManager.set_memory_allocation_increment(increment);} 00067 // //- set block memory size increment 00068 // 00069 // static void destroy_memory() 00070 // {memoryManager.destroy_memory();} 00071 // //- destroy all memory allocted to this object*/ 00072 }; 00073 00074 #include "TDDelaunay.cpp" 00075 00076 #endif // TD_DELAUNAY_HPP 00077