cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : FacetLump.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 "FacetAttribSet.hpp" 00023 // ********** END CUBIT INCLUDES ********** 00024 00025 // ********** BEGIN FORWARD DECLARATIONS ********** 00026 class TopologyEntity; 00027 class BodySM; 00028 class FacetAttrib; 00029 00030 class FacetBody; 00031 class FacetShell; 00032 class FacetSurface; 00033 class FacetLoop; 00034 class FacetCoEdge; 00035 class FacetCurve; 00036 class FacetPoint; 00037 00038 // ********** END FORWARD DECLARATIONS ********** 00039 00040 class FacetLump : public Lump 00041 { 00042 public: 00043 00044 FacetLump(DLIList<ShellSM*> &my_shells, 00045 BodySM *body_sm_ptr = NULL); 00046 //Pass in a list of shells attached to this lump if you have them. 00047 //Also pass in the body that this lump belongs to. 00048 virtual ~FacetLump(); 00049 //- The destructor 00050 00051 void add_body(BodySM* new_body) 00052 {myBodyPtr = new_body;} 00053 00054 virtual void append_simple_attribute_virt(const CubitSimpleAttrib&); 00055 //R void 00056 //I 00057 //I- 00058 //I- that is to be appended to this OSME object. 00059 //- The purpose of this function is to append a 00060 //- attribute to the OSME. The is attached to each of the 00061 //- underlying solid model entities this one points to. 00062 00063 virtual void remove_simple_attribute_virt(const CubitSimpleAttrib&); 00064 //R void 00065 //I CubitSimpleAttrib* 00066 //I- A reference to a CubitSimpleAttrib object which is the object 00067 //I- that is to be removed to this OSME object. 00068 //- The purpose of this function is to remove a simple 00069 //- attribute from the OSME. The attribute is attached to each of the 00070 //- underlying solid model entities this one points to. 00071 00072 virtual void remove_all_simple_attribute_virt(); 00073 //R void 00074 //I- 00075 //- The purpose of this function is to remove all simple 00076 //- attributes from the OSME. 00077 00078 virtual CubitStatus get_simple_attribute(DLIList<CubitSimpleAttrib>&); 00079 virtual CubitStatus get_simple_attribute(const CubitString& name, 00080 DLIList<CubitSimpleAttrib>&); 00081 //R CubitSimpleAttrib* 00082 //R- the returned cubit simple attribute. 00083 //- The purpose of this function is to get the attributes 00084 //- of the geometry entity. The name is attached to the underlying solid 00085 //- model entity(ies) this one points to. 00086 //- MJP Note: 00087 //- This is the code that implements the requirement that names 00088 //- of VGI Entities propagate across solid model boolean 00089 //- operations. The success of this relies, of course, on the underlying 00090 //- solid modeler being able to propagate attributes across 00091 //- such operations on its entities. If it cannot, then "names" 00092 //- of VGI entities will not propagate. 00093 00094 virtual CubitBox bounding_box() const ; 00095 00096 virtual GeometryQueryEngine* 00097 get_geometry_query_engine() const; 00098 //R GeometryQueryEngine* 00099 //R- A pointer to the geometric modeling engine associated with 00100 //R- the object. 00101 //- This function returns a pointer to the geometric modeling engine 00102 //- associated with the object. 00103 00104 virtual CubitStatus merge( GeometryEntity* /*GEPtr*/) 00105 { 00106 PRINT_ERROR("BUG: In FacetLump::merge\n" 00107 " This function should not be called at all\n" 00108 " This is a Bug -- please report it!\n"); 00109 return CUBIT_FAILURE; 00110 } 00111 00112 virtual TopologyEntity* unmerge(DLIList<RefVolume*>) 00113 { 00114 PRINT_ERROR( "BUG: In FacetLump::unmerge\n" 00115 " This function should not be called\n" 00116 " This is a Bug -- please report it!\n" ); 00117 return (TopologyEntity*)NULL; 00118 } 00119 00120 virtual double measure(); 00121 //R double 00122 //R- The numeric value of the measure (its units depend on the dimension 00123 //R- of the RefEntity being "measured") 00124 //- A generic geometric extent function. 00125 //- Returns volume for Lump, area for Surface, length for Curve and 00126 //- 1.0 for Point 00127 00128 CubitStatus save_attribs( FILE* file_ptr ); 00129 // Write FactAttribs out to file 00130 00131 CubitStatus restore_attribs( FILE* file_ptr, unsigned int endian ); 00132 // Read FactAttribs from file 00133 00134 void get_bodies ( DLIList<FacetBody *>& bodies ); 00135 void get_shells ( DLIList<FacetShell *>& shells ); 00136 void get_surfaces( DLIList<FacetSurface*>& surfaces ); 00137 void get_coedges ( DLIList<FacetCoEdge *>& coedges ); 00138 void get_curves ( DLIList<FacetCurve *>& curves ); 00139 00140 void get_parents_virt( DLIList<TopologyBridge*>& parents ); 00141 void get_children_virt( DLIList<TopologyBridge*>& children ); 00142 00143 inline BodySM* get_body() const { return myBodyPtr; } 00144 00145 inline void remove_body() {myBodyPtr = 0;} 00146 00147 void add_shell( FacetShell *shell ); 00148 void remove_shell( FacetShell *shell ); 00149 00150 void disconnect_all_shells(); 00151 00152 CubitStatus mass_properties( CubitVector& centroid, double& volume ); 00153 00154 CubitPointContainment point_containment( const CubitVector &point, double tolerance ); 00155 00156 //is this lump a sheet 00157 CubitBoolean is_sheet( ); 00158 00159 protected: 00160 00161 private: 00162 DLIList<ShellSM*> myShells; 00163 BodySM *myBodyPtr; 00164 00165 FacetAttribSet attribSet; 00166 //List of FacetAttrib*'s instead of CubitSimpleAttribs 00167 } ; 00168 00169 00170 // ********** BEGIN INLINE FUNCTIONS ********** 00171 // ********** END INLINE FUNCTIONS ********** 00172 00173 // ********** BEGIN FRIEND FUNCTIONS ********** 00174 // ********** END FRIEND FUNCTIONS ********** 00175 00176 // ********** BEGIN EXTERN FUNCTIONS ********** 00177 // ********** END EXTERN FUNCTIONS ********** 00178 00179 #endif 00180