cgma
|
00001 //------------------------------------------------------------------------- 00002 // Class: TDChordal 00003 // Description: Support for Chordal Axis. 00004 // Author: jitken 00005 // Date: 1/20/2002 00006 //------------------------------------------------------------------------- 00007 00008 #ifndef TD_CHORDAL_HPP 00009 #define TD_CHORDAL_HPP 00010 00011 #include "ToolData.hpp" 00012 #include "CubitVector.hpp" 00013 #include "MemoryManager.hpp" 00014 #include "CastTo.hpp" 00015 #include "DLIList.hpp" 00016 00017 enum TriType {UNDEFINED, JUNCTION, SLEEVE, TERMINATED, DISCARDED}; 00018 00019 class CubitPoint; 00020 00021 class TDChordal : public virtual ToolData 00022 { 00023 private: 00024 //bool computedMidpoint[3]; 00025 bool boundaryEdge[3]; 00026 //CubitPoint *midPoint[3]; 00027 TriType triGenre; 00028 int numOfBoundaryEdges; 00029 bool visited; 00030 00031 public: 00032 00033 TDChordal(); 00034 virtual ~TDChordal(); 00035 //-constructor and destructor 00036 00037 static int is_chordal(const ToolData* td) 00038 { return ((dynamic_cast<const TDChordal*> (td)) != NULL); } 00039 00040 CubitStatus flag_boundary_edge(int index); 00041 00042 void set_tritype(TriType new_type){ triGenre = new_type; } 00043 00044 TriType get_tritype(){ return triGenre; } 00045 00046 CubitStatus determine_tritype(); 00047 00048 void get_non_boundary_edges(DLIList <int> &edge_index); 00049 00050 void mark_visited(){ visited = TRUE; } 00051 00052 void unmark_visited(){ visited = FALSE; } 00053 00054 bool get_visited(){ return visited; } 00055 00056 // CubitPoint *get_midpoint(int index); 00057 00058 }; 00059 00060 inline CubitStatus TDChordal::flag_boundary_edge(int index){ 00061 assert(index >=0 && index < 3); 00062 00063 //should only be flag once. 00064 if(boundaryEdge[index]) 00065 return CUBIT_FAILURE; 00066 00067 boundaryEdge[index] = true; 00068 numOfBoundaryEdges++; 00069 00070 return CUBIT_SUCCESS; 00071 } 00072 00073 #endif 00074