| 1 | //------------------------------------------------------------------------- |
|---|
| 2 | // Filename : CompositeBody.hpp |
|---|
| 3 | // |
|---|
| 4 | // Purpose : Composite of BodySMs |
|---|
| 5 | // |
|---|
| 6 | // Special Notes : |
|---|
| 7 | // |
|---|
| 8 | // Creator : Jason Kraftcheck |
|---|
| 9 | // |
|---|
| 10 | // Creation Date : 01/11/02 |
|---|
| 11 | //------------------------------------------------------------------------- |
|---|
| 12 | |
|---|
| 13 | #ifndef COMPOSITE_BODY_HPP |
|---|
| 14 | #define COMPOSITE_BODY_HPP |
|---|
| 15 | |
|---|
| 16 | #include "VGDefines.h" |
|---|
| 17 | #include "BodySM.hpp" |
|---|
| 18 | #include "TBOwner.hpp" |
|---|
| 19 | #include "VGArray.hpp" |
|---|
| 20 | |
|---|
| 21 | class CompositeLump; |
|---|
| 22 | |
|---|
| 23 | class CompositeBody: public BodySM, public TBOwner |
|---|
| 24 | { |
|---|
| 25 | public: |
|---|
| 26 | |
|---|
| 27 | CompositeBody(); |
|---|
| 28 | ~CompositeBody(); |
|---|
| 29 | |
|---|
| 30 | #ifdef BOYD15 |
|---|
| 31 | int num_lumps() const; |
|---|
| 32 | #endif |
|---|
| 33 | CompositeLump* next_lump( CompositeLump* after_this = 0 ) const; |
|---|
| 34 | |
|---|
| 35 | CubitStatus add( CompositeLump* lump ); |
|---|
| 36 | CubitStatus remove( CompositeLump* lump ); |
|---|
| 37 | |
|---|
| 38 | int num_bodies() const; |
|---|
| 39 | BodySM* get_body( int index ) const; |
|---|
| 40 | int index_of( BodySM* body ) const; |
|---|
| 41 | |
|---|
| 42 | CubitStatus add( BodySM* body ); |
|---|
| 43 | CubitStatus remove( BodySM* body ); |
|---|
| 44 | CubitStatus remove_body( int index ); |
|---|
| 45 | /* |
|---|
| 46 | CubitStatus move( const CubitVector& offset ); |
|---|
| 47 | CubitStatus rotate( const CubitVector& axis, double degrees ); |
|---|
| 48 | CubitStatus scale( double factor ); |
|---|
| 49 | CubitStatus scale( const CubitVector& factors ); |
|---|
| 50 | CubitStatus reflect( const CubitVector& axis ); |
|---|
| 51 | CubitStatus restore(); |
|---|
| 52 | CubitStatus reverse(); |
|---|
| 53 | */ |
|---|
| 54 | CubitStatus get_transforms( CubitTransformMatrix& tfm ); |
|---|
| 55 | |
|---|
| 56 | void get_parents_virt( DLIList<TopologyBridge*>& parents ); |
|---|
| 57 | void get_children_virt( DLIList<TopologyBridge*>& children ); |
|---|
| 58 | int layer() const { return COMPOSITE_LAYER; } |
|---|
| 59 | GeometryQueryEngine* get_geometry_query_engine() const; |
|---|
| 60 | |
|---|
| 61 | virtual void append_simple_attribute_virt( CubitSimpleAttrib* simple_attrib_ptr ); |
|---|
| 62 | virtual void remove_simple_attribute_virt( CubitSimpleAttrib* simple_attrib_ptr ); |
|---|
| 63 | virtual void remove_all_simple_attribute_virt(); |
|---|
| 64 | virtual CubitStatus get_simple_attribute( DLIList<CubitSimpleAttrib*>& attrib_list ); |
|---|
| 65 | virtual CubitStatus get_simple_attribute( const CubitString& name, |
|---|
| 66 | DLIList<CubitSimpleAttrib*>& attrib_list ); |
|---|
| 67 | |
|---|
| 68 | CubitStatus remove_bridge( TopologyBridge* bridge ); |
|---|
| 69 | CubitStatus swap_bridge( TopologyBridge* old_tb, |
|---|
| 70 | TopologyBridge* new_tb, |
|---|
| 71 | bool reversed ); |
|---|
| 72 | CubitBoolean contains_bridge( TopologyBridge* bridge ) const; |
|---|
| 73 | void notify_reversed( TopologyBridge* bridge ); |
|---|
| 74 | |
|---|
| 75 | CubitPointContainment point_containment( const CubitVector& pos ); |
|---|
| 76 | |
|---|
| 77 | CubitStatus mass_properties( CubitVector& centroid, double& volume ); |
|---|
| 78 | |
|---|
| 79 | void combine( CompositeBody* other ); |
|---|
| 80 | |
|---|
| 81 | private: |
|---|
| 82 | |
|---|
| 83 | CompositeLump* firstLump; |
|---|
| 84 | VGArray<BodySM*> realBodies; |
|---|
| 85 | |
|---|
| 86 | }; |
|---|
| 87 | |
|---|
| 88 | inline int CompositeBody::num_bodies() const |
|---|
| 89 | { return realBodies.size(); } |
|---|
| 90 | |
|---|
| 91 | inline BodySM* CompositeBody::get_body( int index ) const |
|---|
| 92 | { return realBodies[index]; } |
|---|
| 93 | |
|---|
| 94 | inline int CompositeBody::index_of( BodySM* body ) const |
|---|
| 95 | { return realBodies.find( body ); } |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | #endif |
|---|