cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : CompositeLump.hpp 00003 // 00004 // Purpose : Combine Lumps 00005 // 00006 // Special Notes : 00007 // 00008 // Creator : Jason Kraftcheck 00009 // 00010 // Creation Date : 01/11/02 00011 //------------------------------------------------------------------------- 00012 00013 #ifndef COMPOSITE_LUMP_HPP 00014 #define COMPOSITE_LUMP_HPP 00015 00016 #include "VGDefines.h" 00017 #include "Lump.hpp" 00018 #include "CompositeGeom.hpp" 00019 #include "TBOwner.hpp" 00020 #include "HiddenEntitySet.hpp" 00021 #include "CompositeShell.hpp" 00022 00023 class CompositeBody; 00024 class HiddenEntitySet; 00025 00026 class CompositeLump : public Lump, public TBOwner 00027 { 00028 friend class CompositeBody; 00029 public: 00030 00031 CompositeLump( Lump* real_lump ); 00032 CompositeLump( CompositeGeom* geom ); 00033 virtual ~CompositeLump(); 00034 00035 int num_lumps() const; 00036 Lump* get_lump( int index ) const; 00037 int index_of( Lump* ) const; 00038 void update(); 00039 00040 CubitStatus add( Lump* lump ); 00041 CubitStatus remove( Lump* lump ); 00042 CubitStatus remove_lump( int index ); 00043 00044 HiddenEntitySet& hidden_entities(); 00045 bool has_hidden_entities() const; 00046 void get_hidden_surfaces( DLIList<Surface*>& surfaces ); 00047 00048 CompositeShell* first_shell() const; 00049 CompositeShell* next_shell( CompositeShell* after_this ) const; 00050 00051 CubitStatus add( CompositeShell* shell ); 00052 CubitStatus remove( CompositeShell* shell ); 00053 00054 CompositeBody* get_body() const; 00055 00056 CubitBox bounding_box() const; 00057 double measure(); 00058 00059 void get_parents_virt( DLIList<TopologyBridge*>& parents ); 00060 void get_children_virt( DLIList<TopologyBridge*>& children ); 00061 int layer() const { return COMPOSITE_LAYER; } 00062 GeometryQueryEngine* get_geometry_query_engine() const; 00063 00064 void append_simple_attribute_virt( const CubitSimpleAttrib& simple_attrib_ptr ); 00065 void remove_simple_attribute_virt( const CubitSimpleAttrib& simple_attrib_ptr ); 00066 void remove_all_simple_attribute_virt(); 00067 CubitStatus get_simple_attribute( DLIList<CubitSimpleAttrib>& attrib_list ); 00068 CubitStatus get_simple_attribute( const CubitString& name, 00069 DLIList<CubitSimpleAttrib>& attrib_list ); 00070 00071 CubitStatus remove_bridge( TopologyBridge* bridge ); 00072 CubitStatus swap_bridge( TopologyBridge* old_tb, TopologyBridge* new_tb, bool ); 00073 CubitBoolean contains_bridge( TopologyBridge* bridge ) const; 00074 void notify_reversed( TopologyBridge* bridge ); 00075 00076 CompositeLump* split( VGArray<int>& indices_to_move ); 00077 CubitStatus combine( CompositeLump* dead_vol ); 00078 00079 void print_debug_info( const char* line_prefix = 0, bool brief = false ); 00080 00081 virtual CubitStatus mass_properties( CubitVector ¢roid, double &volume ); 00082 00083 private: 00084 00085 CompositeBody* myBody; 00086 CompositeLump* nextLump; 00087 00088 CompositeGeom* compGeom; 00089 00090 CompositeShell* firstShell; 00091 00092 HiddenEntitySet* hiddenSet; 00093 }; 00094 00095 inline CompositeShell* CompositeLump::first_shell() const 00096 { return firstShell; } 00097 00098 inline CompositeShell* CompositeLump::next_shell( CompositeShell* after ) const 00099 { return !after ? firstShell : after->myLump == this ? after->lumpNext : 0; } 00100 00101 inline int CompositeLump::num_lumps() const 00102 { return compGeom->num_entities(); } 00103 00104 inline Lump* CompositeLump::get_lump( int index ) const 00105 { return dynamic_cast<Lump*>(compGeom->entity( index )); } 00106 00107 inline int CompositeLump::index_of( Lump* lump ) const 00108 { return compGeom->index_of( lump ); } 00109 00110 inline void CompositeLump::update() 00111 { compGeom->update_cached_data(); } 00112 00113 inline CompositeBody* CompositeLump::get_body() const 00114 { return myBody; } 00115 00116 inline HiddenEntitySet& CompositeLump::hidden_entities() 00117 { 00118 if( !hiddenSet ) 00119 hiddenSet = new HiddenEntitySet(this); 00120 return *hiddenSet; 00121 } 00122 00123 00124 #endif