cgma
|
#include <OCCLoop.hpp>
Definition at line 37 of file OCCLoop.hpp.
OCCLoop::OCCLoop | ( | TopoDS_Wire * | theLoop | ) |
Definition at line 55 of file OCCLoop.cpp.
{ myTopoDSWire = theWire; }
OCCLoop::~OCCLoop | ( | ) | [virtual] |
Definition at line 66 of file OCCLoop.cpp.
{ disconnect_all_curves(); if (myTopoDSWire) { myTopoDSWire->Nullify(); delete (TopoDS_Wire*)myTopoDSWire; myTopoDSWire = NULL; } }
void OCCLoop::append_simple_attribute_virt | ( | const CubitSimpleAttrib & | ) | [virtual] |
CubitBox OCCLoop::bounding_box | ( | void | ) | const [virtual] |
Definition at line 225 of file OCCLoop.cpp.
{ CubitBox box; for (int i = myCoEdgeList.size(); i > 0; i--) { DLIList<OCCCoEdge*> coedges = myCoEdgeList; OCCCoEdge* coedge = coedges.get_and_step(); box |= coedge->curve()->bounding_box(); } return box; }
void OCCLoop::coedges | ( | DLIList< OCCCoEdge * > | coedges | ) | [inline] |
Definition at line 43 of file OCCLoop.hpp.
{myCoEdgeList = coedges;}
DLIList<OCCCoEdge*> OCCLoop::coedges | ( | ) | [inline] |
Definition at line 45 of file OCCLoop.hpp.
{return myCoEdgeList;}
void OCCLoop::disconnect_all_curves | ( | ) |
Definition at line 118 of file OCCLoop.cpp.
{ myCoEdgeList.clean_out(); }
void OCCLoop::get_children_virt | ( | DLIList< TopologyBridge * > & | children | ) | [virtual] |
Implements TopologyBridge.
Definition at line 214 of file OCCLoop.cpp.
{ CAST_LIST_TO_PARENT(myCoEdgeList, children); }
GeometryQueryEngine * OCCLoop::get_geometry_query_engine | ( | ) | const [virtual] |
Implements TopologyBridge.
Definition at line 243 of file OCCLoop.cpp.
{ return OCCQueryEngine::instance(); }
void OCCLoop::get_parents_virt | ( | DLIList< TopologyBridge * > & | parents | ) | [virtual] |
Implements TopologyBridge.
Definition at line 185 of file OCCLoop.cpp.
{ OCCQueryEngine* oqe = (OCCQueryEngine*) get_geometry_query_engine(); OCCSurface * surf = NULL; DLIList <OCCSurface* > *surfs = oqe->SurfaceList; TopTools_IndexedDataMapOfShapeListOfShape M; for(int i = 0; i < surfs->size(); i++) { surf = surfs->get_and_step(); TopExp::MapShapesAndAncestors(*(surf->get_TopoDS_Face()), TopAbs_WIRE, TopAbs_FACE, M); if (!M.Contains(*(get_TopoDS_Wire()))) continue; const TopTools_ListOfShape& ListOfShapes = M.FindFromKey(*(get_TopoDS_Wire())); if (!ListOfShapes.IsEmpty()) { TopTools_ListIteratorOfListOfShape it(ListOfShapes) ; for (;it.More(); it.Next()) { TopoDS_Face Face = TopoDS::Face(it.Value()); int k = oqe->OCCMap->Find(Face); parents.append_unique((OCCSurface*)(oqe->OccToCGM->find(k))->second); } } } }
CubitStatus OCCLoop::get_simple_attribute | ( | DLIList< CubitSimpleAttrib > & | ) | [virtual] |
CubitStatus OCCLoop::get_simple_attribute | ( | const CubitString & | name, |
DLIList< CubitSimpleAttrib > & | |||
) | [virtual] |
TopoDS_Wire* OCCLoop::get_TopoDS_Wire | ( | ) | [inline] |
Definition at line 51 of file OCCLoop.hpp.
{return myTopoDSWire;}
virtual LoopType OCCLoop::loop_type | ( | ) | [inline, virtual] |
void OCCLoop::remove_all_simple_attribute_virt | ( | ) | [virtual] |
OCCCoEdge * OCCLoop::remove_coedge | ( | OCCCoEdge * | coedge | ) |
Definition at line 123 of file OCCLoop.cpp.
{ if(myCoEdgeList.remove(coedge)) return coedge; return NULL; }
void OCCLoop::remove_simple_attribute_virt | ( | const CubitSimpleAttrib & | ) | [virtual] |
void OCCLoop::set_TopoDS_Wire | ( | TopoDS_Wire | loop | ) |
Definition at line 77 of file OCCLoop.cpp.
{ if(myTopoDSWire && loop.IsEqual(*myTopoDSWire)) return; if(myTopoDSWire && !loop.IsSame(*myTopoDSWire)) { DLIList<OCCCoEdge*> coedges = this->coedges(); for(int i = 0; i < coedges.size(); i++) { OCCCoEdge* coedge = coedges.get_and_step(); OCCCurve* curve = CAST_TO(coedge->curve(), OCCCurve); TopoDS_Edge *edge = curve->get_TopoDS_Edge( ); BRepTools_WireExplorer Ex; CubitBoolean found = false; for (Ex.Init(loop); Ex.More(); Ex.Next()) { TopoDS_Shape crv = Ex.Current(); if(edge->IsPartner(crv)) { found = true; break; } } if (!found) curve->remove_loop(this); } } TopoDS_Wire* the_wire = new TopoDS_Wire(loop); if(myTopoDSWire) delete (TopoDS_Wire*)myTopoDSWire; myTopoDSWire = the_wire; }
CubitStatus OCCLoop::update_OCC_entity | ( | BRepBuilderAPI_ModifyShape * | aBRepTrsf, |
BRepAlgoAPI_BooleanOperation * | op = NULL |
||
) |
Definition at line 254 of file OCCLoop.cpp.
{ assert(aBRepTrsf != NULL || op != NULL); TopoDS_Shape shape; CubitBoolean need_update = CUBIT_TRUE; BRepBuilderAPI_Transform* pTrsf = NULL; BRepBuilderAPI_GTransform* gTrsf = NULL; if(aBRepTrsf) { pTrsf = (BRepBuilderAPI_Transform*)aBRepTrsf; shape = pTrsf->ModifiedShape(*get_TopoDS_Wire()); if(shape.IsNull()) { gTrsf = (BRepBuilderAPI_GTransform*)aBRepTrsf; shape = gTrsf->ModifiedShape(*get_TopoDS_Wire()); } } else { TopTools_ListOfShape shapes; shapes.Assign(op->Modified(*get_TopoDS_Wire())); if(shapes.Extent() == 0) shapes.Assign(op->Generated(*get_TopoDS_Wire())); if(shapes.Extent()) shape = shapes.First(); else if (op->IsDeleted(*get_TopoDS_Wire())) ; else need_update = CUBIT_FALSE; } //set the curves for (int i = 1; i <= myCoEdgeList.size(); i++) { OCCCurve *curve = CAST_TO(myCoEdgeList.get_and_step()->curve(), OCCCurve); curve->update_OCC_entity(aBRepTrsf, op); } TopoDS_Wire loop; if (need_update) { loop = TopoDS::Wire(shape); OCCQueryEngine::instance()->update_OCC_map(*myTopoDSWire, loop); } return CUBIT_SUCCESS; }
CubitStatus OCCLoop::update_OCC_entity | ( | TopoDS_Wire & | old_loop, |
LocOpe_SplitShape * | sp | ||
) | [static] |
Definition at line 307 of file OCCLoop.cpp.
{ TopTools_ListOfShape shapes; shapes.Assign(sp->DescendantShapes(old_loop)); assert(shapes.Extent() == 1); TopoDS_Shape new_loop = shapes.First(); TopoDS_Shape shape_edge; //set curves BRepTools_WireExplorer Ex; for(Ex.Init(old_loop); Ex.More();Ex.Next()) { TopoDS_Edge edge = Ex.Current(); shapes.Assign(sp->DescendantShapes(edge)); if(shapes.Extent() > 1) { shape_edge = shapes.First(); OCCQueryEngine::instance()->update_OCC_map(edge, shape_edge); } } OCCQueryEngine::instance()->update_OCC_map(old_loop , new_loop ); return CUBIT_SUCCESS; }
DLIList<OCCCoEdge *> OCCLoop::myCoEdgeList [private] |
Definition at line 122 of file OCCLoop.hpp.
TopoDS_Wire* OCCLoop::myTopoDSWire [private] |
Definition at line 121 of file OCCLoop.hpp.