cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : CompositeCoEdge.hpp 00003 // 00004 // Purpose : Combined set of CoEdgeSMs 00005 // 00006 // Special Notes : 00007 // 00008 // Creator : Jason Kraftcheck 00009 // 00010 // Creation Date : 01/11/02 00011 //------------------------------------------------------------------------- 00012 00013 #ifndef COMPOSITE_COEDGE_HPP 00014 #define COMPOSITE_COEDGE_HPP 00015 00016 #include "VGDefines.h" 00017 #include "CoEdgeSM.hpp" 00018 #include "TBOwner.hpp" 00019 #include "VGArray.hpp" 00020 00021 class CompositeCurve; 00022 class CompositeLoop; 00023 class CompositePoint; 00024 00025 class CompositeCoEdge : public CoEdgeSM, public TBOwner 00026 { 00027 friend class CompositeLoop; 00028 friend class CompositeCurve; 00029 00030 public: 00031 00032 CompositeCoEdge( CoEdgeSM* coedge_ptr ); 00033 CompositeCoEdge( CompositeCurve* point_curve ); 00034 00035 ~CompositeCoEdge(); 00036 00037 int num_coedges() const; 00038 00039 int index_of( CoEdgeSM* coedge_ptr ) const; 00040 int index_of( Curve* curve_ptr ) const; 00041 00042 CubitSense get_sense( int index ) const; 00043 CoEdgeSM* get_coedge( int index ) const; 00044 00045 CompositeCoEdge* next() const; 00046 CompositeCoEdge* prev() const; 00047 // Return next or previous coedge in a CompositeLoop. 00048 // If there is not a parent CompositeSurface, then 00049 // there is not a parent CompositeLoop and these will 00050 // return NULL. 00051 00052 CubitStatus combine( CompositeCoEdge* dead_coedge, bool prepend ); 00053 CubitStatus insert_coedge( int index, CoEdgeSM* coedge ); 00054 CubitStatus remove_coedge( int index ); 00055 CompositeCoEdge* split( int index ); 00056 00057 CompositePoint* start_point(); 00058 CompositePoint* end_point(); 00059 /* 00060 CoEdgeSM* remove_first(); 00061 CoEdgeSM* remove_last(); 00062 */ 00063 virtual CubitSense sense(); 00064 00065 void sense( CubitSense sense ); 00066 00067 CompositeLoop* get_loop() const; 00068 // void loop( CompositeLoop* ); 00069 00070 CompositeCurve* get_curve() const; 00071 // void curve( CompositeCurve* ); 00072 00073 LoopSM* get_parent_loop(); 00074 //- Get the parent loop at the composite level of 00075 //- the topo bridge graph. I.E. Get parent CompositeLoop 00076 //- if there is one. Otherwise get the SM-level loop. 00077 00078 void get_parents_virt( DLIList<TopologyBridge*>& parents ); 00079 void get_children_virt( DLIList<TopologyBridge*>& children ); 00080 GeometryQueryEngine* get_geometry_query_engine() const; 00081 int layer() const { return COMPOSITE_LAYER; } 00082 00083 void append_simple_attribute_virt( const CubitSimpleAttrib& simple_attrib_ptr ); 00084 void remove_simple_attribute_virt( const CubitSimpleAttrib& simple_attrib_ptr ); 00085 void remove_all_simple_attribute_virt(); 00086 CubitStatus get_simple_attribute( DLIList<CubitSimpleAttrib>& attrib_list ); 00087 CubitStatus get_simple_attribute( const CubitString& name, 00088 DLIList<CubitSimpleAttrib>& attrib_list ); 00089 00090 CubitStatus remove_bridge( TopologyBridge* bridge ); 00091 CubitStatus swap_bridge( TopologyBridge* old_tb, 00092 TopologyBridge* new_tb, 00093 bool reversed ); 00094 CubitBoolean contains_bridge( TopologyBridge* bridge ) const; 00095 void notify_reversed( TopologyBridge* bridge ); 00096 00097 void reverse(); 00098 00099 void print_debug_info( const char* line_prefix = 0, bool brief = false ); 00100 00101 private: 00102 00103 CompositeCoEdge(); 00104 00105 VGArray<CoEdgeSM*> coedgeSet; 00106 00107 CubitSense mySense; 00108 00109 CompositeLoop* myLoop; 00110 CompositeCoEdge* nextCoedge; 00111 CompositeCoEdge* prevCoedge; 00112 00113 CompositeCurve* myCurve; 00114 CompositeCoEdge* nextOnCurve; 00115 }; 00116 00117 inline int CompositeCoEdge::num_coedges() const 00118 { return coedgeSet.size(); } 00119 00120 inline CoEdgeSM* CompositeCoEdge::get_coedge( int index ) const 00121 { return coedgeSet[index]; } 00122 00123 inline int CompositeCoEdge::index_of( CoEdgeSM* coedge ) const 00124 { return coedgeSet.find( coedge ); } 00125 00126 inline void CompositeCoEdge::sense( CubitSense sense ) 00127 { assert( sense != CUBIT_UNKNOWN ); mySense = sense; } 00128 00129 inline CubitSense CompositeCoEdge::sense() 00130 { return mySense; } 00131 00132 inline CompositeCoEdge* CompositeCoEdge::next() const 00133 { return nextCoedge; } 00134 00135 inline CompositeLoop* CompositeCoEdge::get_loop() const 00136 { return myLoop; } 00137 00138 inline CompositeCurve* CompositeCoEdge::get_curve() const 00139 { return myCurve; } 00140 #endif