cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : OCCShell.hpp 00003 // 00004 // Purpose : 00005 // 00006 // Special Notes : 00007 // 00008 // Creator : Jane Hu 00009 // 00010 // Creation Date : 11/16/07 00011 // 00012 // Owner : 00013 //------------------------------------------------------------------------- 00014 00015 #ifndef OCC_SHELL_HPP 00016 #define OCC_SHELL_HPP 00017 00018 // ********** BEGIN STANDARD INCLUDES ********** 00019 // ********** END STANDARD INCLUDES ********** 00020 00021 // ********** BEGIN CUBIT INCLUDES ********** 00022 #include "CubitDefines.h" 00023 #include "ShellSM.hpp" 00024 00025 #include "TopoDS_Shell.hxx" 00026 00027 class OCCBody; 00028 class OCCLump; 00029 class OCCSurface; 00030 class OCCLoop; 00031 class OCCCurve; 00032 class OCCPoint; 00033 class BRepAlgoAPI_BooleanOperation; 00034 class BRepBuilderAPI_ModifyShape; 00035 class BRepBuilderAPI_MakeShape; 00036 class LocOpe_SplitShape; 00037 // ********** END CUBIT INCLUDES ********** 00038 00039 class OCCShell : public ShellSM 00040 { 00041 public: 00042 00043 OCCShell(TopoDS_Shell *theShell, OCCSurface* surface = NULL); 00044 00045 virtual ~OCCShell() ; 00046 //- Destructor. 00047 00048 TopoDS_Shell* get_TopoDS_Shell() 00049 {if(myTopoDSShell && !myTopoDSShell->IsNull()) assert (myTopoDSShell->ShapeType() == TopAbs_SHELL); return myTopoDSShell;} 00050 void set_TopoDS_Shell(TopoDS_Shell shell); 00051 00052 OCCLump* my_lump() {return myLump;} 00053 OCCBody* my_body() {return myBody;} 00054 OCCSurface* my_surface() {return mySheetSurface;} 00055 void set_sheet_surface (OCCSurface* surface) {mySheetSurface = surface;} 00056 00057 void set_lump(OCCLump* lump) {myLump = lump;} 00058 void set_body(OCCBody* body) {myBody = body;} 00059 00060 bool is_sheet() const { return mySheetSurface != 0; } 00061 00062 virtual GeometryQueryEngine* 00063 get_geometry_query_engine() const; 00064 //R GeometryQueryEngine* 00065 //R- A pointer to the geometric modeling engine associated with 00066 //R- the object. 00067 //- This function returns a pointer to the geometric modeling engine 00068 //- associated with the object. 00069 00070 virtual void append_simple_attribute_virt(const CubitSimpleAttrib&); 00071 //R void 00072 //I 00073 //I- 00074 //I- that is to be appended to this OSME object. 00075 //- The purpose of this function is to append a 00076 //- attribute to the OSME. The is attached to each of the 00077 //- underlying solid model entities this one points to. 00078 00079 virtual void remove_simple_attribute_virt(const CubitSimpleAttrib&); 00080 //R void 00081 //I CubitSimpleAttrib* 00082 //I- A reference to a CubitSimpleAttrib object which is the object 00083 //I- that is to be removed to this OSME object. 00084 //- The purpose of this function is to remove a simple 00085 //- attribute from the OSME. The attribute is attached to each of the 00086 //- underlying solid model entities this one points to. 00087 00088 virtual void remove_all_simple_attribute_virt(); 00089 //R void 00090 //I- 00091 //- The purpose of this function is to remove all simple 00092 //- attributes from the OSME. 00093 00094 virtual CubitStatus get_simple_attribute(DLIList<CubitSimpleAttrib>&); 00095 virtual CubitStatus get_simple_attribute(const CubitString& name, 00096 DLIList<CubitSimpleAttrib>&); 00097 //R CubitSimpleAttrib* 00098 //R- the returned cubit simple attribute. 00099 //- The purpose of this function is to get the attributes 00100 //- of the geometry entity. The name is attached to the underlying solid 00101 //- model entity(ies) this one points to. 00102 //- MJP Note: 00103 //- This is the code that implements the requirement that names 00104 //- of VGI Entities propagate across solid model boolean 00105 //- operations. The success of this relies, of course, on the underlying 00106 //- solid modeler being able to propagate attributes across 00107 //- such operations on its entities. If it cannot, then "names" 00108 //- of VGI entities will not propagate. 00109 00110 virtual void get_parents_virt( DLIList<TopologyBridge*>& parents ); 00111 virtual void get_children_virt( DLIList<TopologyBridge*>& children ); 00112 00113 //ModifyShape refers only to Transform and GTransform for now 1/10/11) 00114 CubitStatus update_OCC_entity( BRepBuilderAPI_ModifyShape *aBRepTrsf, 00115 BRepAlgoAPI_BooleanOperation *op = NULL); 00116 double measure(); //area of the shell 00117 static CubitStatus update_OCC_entity(TopoDS_Shell& old_shell, 00118 TopoDS_Shape& new_shell, 00119 BRepBuilderAPI_MakeShape *op, 00120 LocOpe_SplitShape* sp = NULL); 00121 00122 DLIList<OCCSurface*> getMemberSurfaces() { return memberSurfaces; } 00123 void setMemberSurfaces(DLIList<OCCSurface*> surfaceList) 00124 { 00125 memberSurfaces = surfaceList; 00126 } 00127 protected: 00128 00129 private: 00130 TopoDS_Shell *myTopoDSShell; 00131 OCCSurface* mySheetSurface; 00132 OCCLump* myLump; 00133 OCCBody* myBody; 00134 DLIList<OCCSurface*> memberSurfaces; 00135 }; 00136 00137 #endif 00138