cgma
FacetBody.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : FacetBody.hpp
00003 //
00004 // Purpose       : 
00005 //
00006 // Special Notes :
00007 //
00008 // Creator       : David White
00009 //
00010 // Creation Date : 7/18/00
00011 //
00012 //-------------------------------------------------------------------------
00013 
00014 #ifndef FACET_BODY_HPP
00015 #define FACET_BODY_HPP
00016 
00017 // ********** BEGIN STANDARD INCLUDES      **********
00018 // ********** END STANDARD INCLUDES        **********
00019 
00020 // ********** BEGIN CUBIT INCLUDES         **********
00021 #include "CubitDefines.h"
00022 #include "BodySM.hpp"
00023 #include "CubitTransformMatrix.hpp"
00024 #include "FacetAttribSet.hpp"
00025 // ********** END CUBIT INCLUDES           **********
00026 
00027 // ********** BEGIN FORWARD DECLARATIONS   **********
00028 class Body;
00029 class TopologyEntity;
00030 class CubitString;
00031 class FacetAttrib;
00032 
00033 class FacetLump;
00034 class FacetShell;
00035 class FacetSurface;
00036 class FacetLoop;
00037 class FacetCoEdge;
00038 class FacetCurve;
00039 class FacetPoint;
00040 
00041 // ********** END FORWARD DECLARATIONS     **********
00042 
00043 class FacetBody : public BodySM
00044 {
00045 public:
00046   
00047   FacetBody(DLIList<Lump*> &myLumps);
00048     //- Constructor with a pointer to a BODY.
00049   virtual ~FacetBody() ;
00050     //- The destructor.
00051 
00052   CubitBoolean can_be_deleted( DLIList <Body*> &body_list );
00053   
00054   virtual GeometryQueryEngine* get_geometry_query_engine() const;
00055     //R GeometryQueryEngine*
00056     //R- A pointer to the geometric modeling engine associated with
00057     //R- the object.
00058     //- This function returns a pointer to the geometric modeling engine
00059     //- associated with the object.
00060   
00061   virtual void append_simple_attribute_virt(const CubitSimpleAttrib&);
00062     //R void
00063     //I 
00064     //I- 
00065     //I- that is to be appended to this OSME object.
00066     //- The purpose of this function is to append a 
00067     //- attribute to the OSME. The  is attached to each of the 
00068     //- underlying solid model entities this one points to.
00069   
00070   virtual void remove_simple_attribute_virt(const CubitSimpleAttrib&);
00071     //R void
00072     //I CubitSimpleAttrib*
00073     //I- A reference to a CubitSimpleAttrib object which is the object
00074     //I- that is to be removed to this OSME object.
00075     //- The purpose of this function is to remove a simple
00076     //- attribute from the OSME. The attribute is attached to each of the
00077     //- underlying solid model entities this one points to.
00078   
00079   virtual void remove_all_simple_attribute_virt();
00080     //R void
00081     //I-
00082     //- The purpose of this function is to remove all simple
00083     //- attributes from the OSME.
00084   
00085   virtual CubitStatus get_simple_attribute(DLIList<CubitSimpleAttrib>&);
00086   virtual CubitStatus get_simple_attribute(const CubitString& name,
00087                                            DLIList<CubitSimpleAttrib>&);
00088     //R CubitSimpleAttrib*
00089     //R- the returned cubit simple attribute.
00090     //- The purpose of this function is to get the attributes
00091     //- of the geometry entity. The name is attached to the underlying solid
00092     //- model entity(ies) this one points to.
00093     //- MJP Note:
00094     //- This is the code that implements the requirement that names
00095     //- of VGI Entities propagate across solid model boolean
00096     //- operations.  The success of this relies, of course, on the underlying
00097     //- solid modeler being able to propagate attributes across
00098     //- such operations on its entities. If it cannot, then "names"
00099     //- of VGI entities will not propagate.
00100   
00101   virtual BodySM* copy();
00102     //R FacetBody*
00103     //R- Pointer to a FacetBody object
00104     //- Copies this FacetBody object (including the  BODY that it
00105     //- contains) and returns a pointer to a new FacetBody object.
00106   
00107   virtual CubitStatus move(double , double , double );
00108     //R CubitStatus
00109     //R- CUBIT_SUCCESS/FAILURE
00110     //I dx, dy, dz
00111     //I- Offset values in each of the 3 Cartesian coordinate directions
00112     //- Move the  BODY by dx, dy and dz
00113   
00114   virtual CubitStatus rotate( double , double , double , 
00115                               double );
00116     //R CubitStatus
00117     //R- CUBIT_SUCCESS/FAILURE
00118     //I x, y, z
00119     //I- Axis of rotation
00120     //I angle_in_degrees
00121     //I- Angle of rotation in degrees
00122     //- Rotate the  BODY angle degrees about a vector defined by
00123     //- x, y and z
00124   
00125   virtual CubitStatus scale(double, double, double);
00126   
00127   virtual CubitStatus scale(double);
00128     //R CubitStatus
00129     //R- CUBIT_SUCCESS/FAILURE
00130     //I scaling_factor
00131     //I- Scaling factor
00132     //- Scale the  BODY by the factor, scaling_factor
00133 
00134   CubitStatus reflect(double,double,double);
00135     //- reflect about an axis
00136 
00137   virtual CubitStatus restore();
00138     //R CubitStatus
00139     //R- CUBIT_SUCCESS/FAILURE
00140     //- Restore the  BODY by replacing the transformation matrix
00141     //- associated with it with a unit matrix
00142   
00143   CubitStatus get_transforms( CubitTransformMatrix &tfm );
00144     //R CubitStatus
00145     //R- CUBIT_SUCCESS/CUBIT_FAILURE
00146     //I BODYPtr
00147     //- return the transformation matrix for this body
00148   
00149   CubitStatus set_transforms( CubitTransformMatrix tfm );
00150     //R CubitStatus
00151     //R- CUBIT_SUCCESS/CUBIT_FAILURE that myTransforms was 
00152     // set correctly
00153     //I BODYPtr
00154 
00155   int validate(const CubitString &, DLIList <TopologyEntity*>&);
00156     //- does an api_entity_check for the body.
00157   
00158   CubitStatus save_attribs( FILE* file_ptr );
00159     // Write FactAttribs out to file
00160 
00161   CubitStatus restore_attribs( FILE* file_ptr, unsigned int endian );
00162     // Read FactAttribs from file
00163 
00164   void get_lumps   ( DLIList<FacetLump   *>& lumps    );
00165   void get_shells  ( DLIList<FacetShell  *>& shells   );
00166   void get_surfaces( DLIList<FacetSurface*>& surfaces );
00167   void get_loops   ( DLIList<FacetLoop   *>& loops    );
00168   void get_coedges ( DLIList<FacetCoEdge *>& coedges  );
00169   void get_curves  ( DLIList<FacetCurve  *>& curves   );
00170   void get_points  ( DLIList<FacetPoint  *>& points   );
00171 
00172   void get_parents_virt( DLIList<TopologyBridge*>& parents );
00173   void get_children_virt( DLIList<TopologyBridge*>& children );
00174   
00175   void disconnect_all_lumps();
00176   void add_lump( FacetLump *lump_to_add );
00177   void remove_lump( FacetLump *lump_to_remove );
00178 
00179   virtual CubitStatus mass_properties( CubitVector& result, double& volume );
00180   
00181   virtual CubitPointContainment point_containment( const CubitVector& pos, double tolerance );
00182 
00183 protected: 
00184   
00185 private:
00186   CubitStatus transform( CubitTransformMatrix &tfmat, CubitBoolean is_rotation );
00187     // main function for applying transforms to facet-based bodies
00188 
00189   void init_edge_flags( DLIList<Surface *>&surf_list, int flag );
00190     // set the flags on the facet edges
00191 
00192   CubitTransformMatrix myTransforms;
00193   DLIList<Lump*> myLumps;
00194     //List of the attached lumps for the traversal functions.
00195   FacetAttribSet attribSet;
00196     //List of FacetAttrib*'s instead of CubitSimpleAttribs 
00197 };
00198 
00199 
00200 
00201 #endif
00202 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines