cgma
CompositeBody.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : CompositeBody.hpp
00003 //
00004 // Purpose       : Composite of BodySMs
00005 //
00006 // Special Notes : 
00007 //
00008 // Creator       : Jason Kraftcheck
00009 //
00010 // Creation Date : 01/11/02
00011 //-------------------------------------------------------------------------
00012 
00013 #ifndef COMPOSITE_BODY_HPP
00014 #define COMPOSITE_BODY_HPP
00015 
00016 #include "VGDefines.h"
00017 #include "BodySM.hpp"
00018 #include "TBOwner.hpp"
00019 #include "VGArray.hpp"
00020 
00021 class CompositeLump;
00022 
00023 class CompositeBody: public BodySM, public TBOwner
00024 {
00025   public:
00026   
00027     CompositeBody();
00028     ~CompositeBody();
00029     
00030     CompositeLump* next_lump( CompositeLump* after_this = 0 ) const;
00031     
00032     CubitStatus add( CompositeLump* lump );
00033     CubitStatus remove( CompositeLump* lump );
00034     
00035     int num_bodies() const;
00036     BodySM* get_body( int index ) const;
00037     int index_of( BodySM* body ) const;
00038     
00039     CubitStatus add( BodySM* body );
00040     CubitStatus remove( BodySM* body );
00041     CubitStatus remove_body( int index );
00042 /*    
00043     CubitStatus move( const CubitVector& offset );
00044     CubitStatus rotate( const CubitVector& axis, double degrees );
00045     CubitStatus scale( double factor );
00046     CubitStatus scale( const CubitVector& factors );
00047     CubitStatus reflect( const CubitVector& axis );
00048     CubitStatus restore();
00049     CubitStatus reverse();
00050 */
00051     CubitStatus get_transforms( CubitTransformMatrix& tfm );
00052     
00053     void get_parents_virt( DLIList<TopologyBridge*>& parents );
00054     void get_children_virt( DLIList<TopologyBridge*>& children );
00055     int layer() const { return COMPOSITE_LAYER; }
00056     GeometryQueryEngine* get_geometry_query_engine() const;
00057 
00058     virtual void append_simple_attribute_virt( const CubitSimpleAttrib& simple_attrib_ptr );
00059     virtual void remove_simple_attribute_virt( const CubitSimpleAttrib& simple_attrib_ptr );
00060     virtual void remove_all_simple_attribute_virt();
00061     virtual CubitStatus get_simple_attribute( DLIList<CubitSimpleAttrib>& attrib_list );
00062     virtual CubitStatus get_simple_attribute( const CubitString& name,
00063                                     DLIList<CubitSimpleAttrib>& attrib_list );
00064  
00065     CubitStatus remove_bridge( TopologyBridge* bridge );
00066     CubitStatus swap_bridge( TopologyBridge* old_tb, 
00067                              TopologyBridge* new_tb, 
00068                              bool reversed );
00069     CubitBoolean contains_bridge( TopologyBridge* bridge ) const;
00070     void notify_reversed( TopologyBridge* bridge );
00071     
00072     CubitPointContainment point_containment( const CubitVector& pos, double tolerance = -1.0 );
00073     
00074     CubitStatus mass_properties( CubitVector& centroid, double& volume );
00075     
00076     void combine( CompositeBody* other );
00077     
00078   private:
00079   
00080     CompositeLump* firstLump;
00081     VGArray<BodySM*> realBodies;
00082     
00083 };
00084 
00085 inline int CompositeBody::num_bodies() const
00086   { return realBodies.size(); }
00087 
00088 inline BodySM* CompositeBody::get_body( int index ) const
00089   { return realBodies[index]; }
00090 
00091 inline int CompositeBody::index_of( BodySM* body ) const
00092   { return realBodies.find( body ); }
00093 
00094 
00095 
00096 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines