cgma
OCCLump.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : OCCLump.hpp
00003 //
00004 // Purpose       : 
00005 //
00006 // Special Notes :
00007 //
00008 // Creator       : David White
00009 //
00010 // Creation Date : 7/18/2000
00011 //-------------------------------------------------------------------------
00012 
00013 #ifndef FACET_LUMP_HPP
00014 #define FACET_LUMP_HPP
00015 
00016 // ********** BEGIN STANDARD INCLUDES      **********
00017 // ********** END STANDARD INCLUDES        **********
00018 
00019 // ********** BEGIN CUBIT INCLUDES         **********
00020 #include "CubitDefines.h"
00021 #include "Lump.hpp"
00022 #include <stdio.h>
00023 #include "TopoDS_Solid.hxx"
00024 // ********** END CUBIT INCLUDES           **********
00025 
00026 // ********** BEGIN FORWARD DECLARATIONS   **********
00027 class TopologyEntity;
00028 class BodySM;
00029 class OCCAttrib;
00030 
00031 class OCCBody;
00032 class OCCShell;
00033 class OCCSurface;
00034 class OCCLoop;
00035 class OCCCoEdge;
00036 class OCCCurve;
00037 class OCCPoint;
00038 class BRepBuilderAPI_MakeShape;
00039 class BRepBuilderAPI_ModifyShape;
00040 class BRepAlgoAPI_BooleanOperation;
00041 class LocOpe_SplitShape;
00042 // ********** END FORWARD DECLARATIONS     **********
00043 
00044 class OCCLump : public Lump
00045 {
00046 public:
00047   
00048   OCCLump(TopoDS_Solid *theSolid, OCCSurface* surface = NULL, 
00049           OCCShell* shell = NULL);
00050   
00051   OCCSurface* my_sheet_surface() {return mySheetSurface;}
00052   OCCShell * my_shell() {return myShell;}
00053   void set_surface(OCCSurface* surface) {mySheetSurface = surface;}
00054   void set_shell(OCCShell* shell) {myShell = shell;}
00055 
00056   virtual ~OCCLump();
00057     //- The destructor
00058 
00059   void add_body(BodySM* new_body)
00060     {myBodyPtr = new_body;}
00061     
00062   TopoDS_Solid *get_TopoDS_Solid()
00063   {if(myTopoDSSolid && !myTopoDSSolid->IsNull()) assert (myTopoDSSolid->ShapeType() == TopAbs_SOLID); return myTopoDSSolid; }
00064   void set_TopoDS_Solid(TopoDS_Solid solid); 
00065 
00066   virtual void append_simple_attribute_virt(const CubitSimpleAttrib&);
00067     //R void
00068     //I 
00069     //I- 
00070     //I- that is to be appended to this OSME object.
00071     //- The purpose of this function is to append a 
00072     //- attribute to the OSME. The  is attached to each of the 
00073     //- underlying solid model entities this one points to.
00074   
00075   virtual void remove_simple_attribute_virt(const CubitSimpleAttrib&);
00076     //R void
00077     //I CubitSimpleAttrib*
00078     //I- A reference to a CubitSimpleAttrib object which is the object
00079     //I- that is to be removed to this OSME object.
00080     //- The purpose of this function is to remove a simple
00081     //- attribute from the OSME. The attribute is attached to each of the
00082     //- underlying solid model entities this one points to.
00083   
00084   virtual void remove_all_simple_attribute_virt();
00085     //R void
00086     //I-
00087     //- The purpose of this function is to remove all simple
00088     //- attributes from the OSME. 
00089   
00090   virtual CubitStatus get_simple_attribute(DLIList<CubitSimpleAttrib>&);
00091   virtual CubitStatus get_simple_attribute(const CubitString& name,
00092                                            DLIList<CubitSimpleAttrib>&);
00093     //R CubitSimpleAttrib*
00094     //R- the returned cubit simple attribute.
00095     //- The purpose of this function is to get the attributes
00096     //- of the geometry entity. The name is attached to the underlying solid
00097     //- model entity(ies) this one points to.
00098     //- MJP Note:
00099     //- This is the code that implements the requirement that names
00100     //- of VGI Entities propagate across solid model boolean
00101     //- operations.  The success of this relies, of course, on the underlying
00102     //- solid modeler being able to propagate attributes across
00103     //- such operations on its entities. If it cannot, then "names"
00104     //- of VGI entities will not propagate.
00105   
00106   virtual CubitBox bounding_box() const ;
00107   
00108   virtual GeometryQueryEngine* 
00109   get_geometry_query_engine() const;
00110     //R GeometryQueryEngine*
00111     //R- A pointer to the geometric modeling engine associated with
00112     //R- the object.
00113     //- This function returns a pointer to the geometric modeling engine
00114     //- associated with the object.
00115   
00116   virtual CubitStatus merge( GeometryEntity* /*GEPtr*/)
00117     {
00118       PRINT_ERROR("BUG: In OCCLump::merge\n"
00119                   "     This function should not be called at all\n"
00120                   "  This is a Bug -- please report it!\n");
00121       return CUBIT_FAILURE;
00122     }
00123   
00124   virtual TopologyEntity* unmerge(DLIList<RefVolume*>)
00125     {
00126       PRINT_ERROR( "BUG: In OCCLump::unmerge\n"
00127                    "     This function should not be called\n"
00128                    "  This is a Bug -- please report it!\n" );
00129       return (TopologyEntity*)NULL;
00130     }
00131   
00132   virtual double measure();
00133     //R double
00134     //R- The numeric value of the measure (its units depend on the dimension
00135     //R- of the RefEntity being "measured")
00136     //- A generic geometric extent function.
00137     //- Returns volume for Lump, area for Surface, length for Curve and 
00138     //- 1.0 for Point
00139 
00140   virtual void get_parents_virt( DLIList<TopologyBridge*>& parents );
00141   virtual void get_children_virt( DLIList<TopologyBridge*>& children );
00142 
00143   BodySM* get_body() const; 
00144     
00145   inline void remove_body() {myBodyPtr = 0;}
00146  
00147   CubitStatus mass_properties( CubitVector& centroid, double& volume );
00148 
00149   CubitPointContainment point_containment( const CubitVector &point );
00150 
00151   CubitStatus update_OCC_entity( BRepBuilderAPI_ModifyShape *aBRepTrsf,
00152                                 BRepAlgoAPI_BooleanOperation *op = NULL);
00153   static CubitStatus update_OCC_entity(TopoDS_Solid& old_shape,
00154                                        TopoDS_Shape& new_shape,
00155                                        BRepBuilderAPI_MakeShape *op,
00156                                        LocOpe_SplitShape* sp = NULL);
00157 protected: 
00158   
00159 private:
00160   BodySM *myBodyPtr;
00161 
00162   TopoDS_Solid *myTopoDSSolid;
00163 
00164   OCCSurface *mySheetSurface;
00165   OCCShell * myShell;
00166 } ;
00167 
00168 
00169 // ********** BEGIN INLINE FUNCTIONS       **********
00170 // ********** END INLINE FUNCTIONS         **********
00171 
00172 // ********** BEGIN FRIEND FUNCTIONS       **********
00173 // ********** END FRIEND FUNCTIONS         **********
00174 
00175 // ********** BEGIN EXTERN FUNCTIONS       **********
00176 // ********** END EXTERN FUNCTIONS         **********
00177 
00178 #endif
00179 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines