Changeset 1509
- Timestamp:
- 01/07/08 12:40:57 (2 years ago)
- Location:
- cgm/trunk/geom/OCC
- Files:
-
- 2 modified
-
OCCBody.cpp (modified) (3 diffs)
-
OCCBody.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cgm/trunk/geom/OCC/OCCBody.cpp
r1466 r1509 67 67 void OCCBody::lumps(DLIList<Lump*>& my_lumps) 68 68 { 69 myLumps.clean_out(); 69 70 myLumps += my_lumps; 70 71 } … … 205 206 //---------------------------------------------------------------- 206 207 // Function: reflect 207 // Description: reflect the body about a exis 208 // Description: reflect the body about an plane given the normal 209 // vector. 208 210 // 209 211 // Author: Jane Hu 210 212 //---------------------------------------------------------------- 211 213 CubitStatus OCCBody::reflect( double reflect_axis_x, 212 double reflect_axis_y,213 double reflect_axis_z )214 double reflect_axis_y, 215 double reflect_axis_z ) 214 216 { 215 217 gp_Pnt aOrigin(0,0,0); … … 221 223 222 224 BRepBuilderAPI_Transform aBRepTrsf(*myTopoDSShape, aTrsf); 223 update_bounding_box(); 224 return CUBIT_SUCCESS; 225 } 226 225 TopoDS_Shape shape = aBRepTrsf.ModifiedShape(*myTopoDSShape); 226 227 update_OCC_entity(shape); 228 update_bounding_box(); 229 return CUBIT_SUCCESS; 230 } 231 232 //---------------------------------------------------------------- 233 // Function: private function to update the core compsolid and 234 // for any movement of the body. 235 // Note: input shape must have the same number of CompSolids 236 // as the body's lumps number. 237 // Author: Jane Hu 238 //---------------------------------------------------------------- 239 CubitStatus OCCBody::update_OCC_entity( TopoDS_Shape shape) 240 { 241 TopoDS_CompSolid compsolid = TopoDS::CompSolid(shape); 242 set_TopoDS_Shape(compsolid); 243 244 //set the lumps 245 DLIList<Lump *> lumps; 246 lumps = this->lumps(); 247 TopTools_IndexedMapOfShape M; 248 TopExp::MapShapes(*myTopoDSShape, TopAbs_SOLID, M); 249 for (int i = 0; i < lumps.size(); i++) 250 { 251 OCCLump *lump = CAST_TO(lumps.get_and_step(), OCCLump); 252 lump->set_TopoDS_Solid(TopoDS::Solid(M(i))); 253 } 254 } 227 255 //---------------------------------------------------------------- 228 256 // Function: update_bounding_box -
cgm/trunk/geom/OCC/OCCBody.hpp
r1466 r1509 62 62 63 63 TopoDS_CompSolid *get_TopoDS_Shape() {return myTopoDSShape; } 64 void set_TopoDS_Shape( TopoDS_CompSolid shape){*myTopoDSShape =shape;}64 void set_TopoDS_Shape( TopoDS_CompSolid theshape){*myTopoDSShape = theshape;} 65 65 66 66 virtual CubitStatus get_transforms( CubitTransformMatrix &tfm ); … … 176 176 177 177 CubitBox boundingbox; 178 CubitStatus update_OCC_entity( TopoDS_Shape shape); //update the lumps 178 179 }; 179 180
![(please configure the [header_logo] section in trac.ini)](/projects/ITAPS/chrome/common/trac_banner.png)