|
cgma
|
#include <OCCShell.hpp>
Definition at line 39 of file OCCShell.hpp.
| OCCShell::OCCShell | ( | TopoDS_Shell * | theShell, |
| OCCSurface * | surface = NULL |
||
| ) |
Definition at line 63 of file OCCShell.cpp.
{
myTopoDSShell = theShell;
mySheetSurface = surface;
if(myTopoDSShell && !myTopoDSShell->IsNull())
assert (myTopoDSShell->ShapeType() == TopAbs_SHELL);
}
| OCCShell::~OCCShell | ( | ) | [virtual] |
Definition at line 77 of file OCCShell.cpp.
{
if(myTopoDSShell)
{
myTopoDSShell->Nullify();
delete (TopoDS_Shell*)myTopoDSShell;
myTopoDSShell = NULL;
}
}
| void OCCShell::append_simple_attribute_virt | ( | const CubitSimpleAttrib & | ) | [virtual] |
| void OCCShell::get_children_virt | ( | DLIList< TopologyBridge * > & | children | ) | [virtual] |
Implements TopologyBridge.
Definition at line 176 of file OCCShell.cpp.
{
if(mySheetSurface)
{
children.append(mySheetSurface);
return;
}
TopTools_IndexedMapOfShape M;
TopExp::MapShapes(*myTopoDSShell, TopAbs_FACE, M);
int ii;
for (ii=1; ii<=M.Extent(); ii++) {
TopologyBridge *surface = OCCQueryEngine::instance()->occ_to_cgm(M(ii));
if(surface)
children.append_unique(surface);
}
}
| GeometryQueryEngine * OCCShell::get_geometry_query_engine | ( | ) | const [virtual] |
Implements TopologyBridge.
Definition at line 105 of file OCCShell.cpp.
{
return OCCQueryEngine::instance();
}
| void OCCShell::get_parents_virt | ( | DLIList< TopologyBridge * > & | parents | ) | [virtual] |
Implements TopologyBridge.
Definition at line 136 of file OCCShell.cpp.
{
if(mySheetSurface)
{
parents.append(mySheetSurface->my_lump());
return;
}
OCCQueryEngine* oqe = (OCCQueryEngine*) get_geometry_query_engine();
OCCBody * body = NULL;
DLIList <OCCBody* > *bodies = oqe->BodyList;
TopTools_IndexedDataMapOfShapeListOfShape M;
for(int i = 0; i < bodies->size(); i++)
{
body = bodies->get_and_step();
TopoDS_Shape* shape ;
body->get_TopoDS_Shape(shape);
assert(shape != NULL);
TopExp::MapShapesAndAncestors(*shape,
TopAbs_SHELL, TopAbs_SOLID, M);
TopoDS_Shell *shell = get_TopoDS_Shell();
if (!M.Contains(*shell))
continue;
const TopTools_ListOfShape& ListOfShapes =
M.FindFromKey(*(get_TopoDS_Shell()));
if (!ListOfShapes.IsEmpty())
{
TopTools_ListIteratorOfListOfShape it(ListOfShapes) ;
for (;it.More(); it.Next())
{
TopoDS_Solid Solid = TopoDS::Solid(it.Value());
int k = oqe->OCCMap->Find(Solid);
parents.append((OCCLump*)(oqe->OccToCGM->find(k))->second);
}
}
}
}
| CubitStatus OCCShell::get_simple_attribute | ( | DLIList< CubitSimpleAttrib > & | ) | [virtual] |
| CubitStatus OCCShell::get_simple_attribute | ( | const CubitString & | name, |
| DLIList< CubitSimpleAttrib > & | |||
| ) | [virtual] |
| TopoDS_Shell* OCCShell::get_TopoDS_Shell | ( | ) | [inline] |
Definition at line 48 of file OCCShell.hpp.
{if(myTopoDSShell && !myTopoDSShell->IsNull()) assert (myTopoDSShell->ShapeType() == TopAbs_SHELL); return myTopoDSShell;}
| DLIList<OCCSurface*> OCCShell::getMemberSurfaces | ( | ) | [inline] |
Definition at line 122 of file OCCShell.hpp.
{ return memberSurfaces; }
| bool OCCShell::is_sheet | ( | ) | const [inline] |
Definition at line 60 of file OCCShell.hpp.
{ return mySheetSurface != 0; }
| double OCCShell::measure | ( | ) |
Definition at line 244 of file OCCShell.cpp.
{
GProp_GProps myProps;
BRepGProp::SurfaceProperties(*myTopoDSShell, myProps);
return myProps.Mass();
}
| OCCBody* OCCShell::my_body | ( | ) | [inline] |
Definition at line 53 of file OCCShell.hpp.
{return myBody;}
| OCCLump* OCCShell::my_lump | ( | ) | [inline] |
Definition at line 52 of file OCCShell.hpp.
{return myLump;}
| OCCSurface* OCCShell::my_surface | ( | ) | [inline] |
Definition at line 54 of file OCCShell.hpp.
{return mySheetSurface;}
| void OCCShell::remove_all_simple_attribute_virt | ( | ) | [virtual] |
| void OCCShell::remove_simple_attribute_virt | ( | const CubitSimpleAttrib & | ) | [virtual] |
| void OCCShell::set_body | ( | OCCBody * | body | ) | [inline] |
Definition at line 58 of file OCCShell.hpp.
{myBody = body;}
| void OCCShell::set_lump | ( | OCCLump * | lump | ) | [inline] |
Definition at line 57 of file OCCShell.hpp.
| void OCCShell::set_sheet_surface | ( | OCCSurface * | surface | ) | [inline] |
Definition at line 55 of file OCCShell.hpp.
{mySheetSurface = surface;}
| void OCCShell::set_TopoDS_Shell | ( | TopoDS_Shell | shell | ) |
Definition at line 87 of file OCCShell.cpp.
{
if(myTopoDSShell && shell.IsEqual(*myTopoDSShell))
return;
if (myTopoDSShell)
myTopoDSShell->Nullify();
*myTopoDSShell = shell;
}
| void OCCShell::setMemberSurfaces | ( | DLIList< OCCSurface * > | surfaceList | ) | [inline] |
Definition at line 123 of file OCCShell.hpp.
{
memberSurfaces = surfaceList;
}
| CubitStatus OCCShell::update_OCC_entity | ( | BRepBuilderAPI_ModifyShape * | aBRepTrsf, |
| BRepAlgoAPI_BooleanOperation * | op = NULL |
||
| ) |
Definition at line 198 of file OCCShell.cpp.
{
if(mySheetSurface && op == NULL)
return CUBIT_FAILURE;
assert (aBRepTrsf != NULL || op != NULL);
TopoDS_Shape shape;
if(aBRepTrsf)
shape = aBRepTrsf->ModifiedShape(*get_TopoDS_Shell());
else if(!mySheetSurface)
{
TopTools_ListOfShape shapes;
shapes.Assign(op->Modified(*get_TopoDS_Shell()));
if(shapes.Extent() == 0)
shapes.Assign(op->Generated(*get_TopoDS_Shell()));
if (shapes.Extent())
shape = shapes.First();
else if(op->IsDeleted(*get_TopoDS_Shell()))
;
else
return CUBIT_SUCCESS;
}
TopoDS_Shell shell;
if (!shape.IsNull())
shell = TopoDS::Shell(shape);
//set the surfaces
DLIList<TopologyBridge *> surfaces;
this->get_children_virt(surfaces);
for (int i = 1; i <= surfaces.size(); i++)
{
OCCSurface *surface = CAST_TO(surfaces.get_and_step(), OCCSurface);
surface->update_OCC_entity(aBRepTrsf, op);
}
OCCQueryEngine::instance()->update_OCC_map(*myTopoDSShell, shell);
return CUBIT_SUCCESS;
}
| CubitStatus OCCShell::update_OCC_entity | ( | TopoDS_Shell & | old_shell, |
| TopoDS_Shape & | new_shell, | ||
| BRepBuilderAPI_MakeShape * | op, | ||
| LocOpe_SplitShape * | sp = NULL |
||
| ) | [static] |
Definition at line 256 of file OCCShell.cpp.
{
//set the surfaces
TopTools_IndexedMapOfShape M;
TopoDS_Shape shape;
TopExp::MapShapes(old_shell, TopAbs_FACE, M);
TopTools_ListOfShape shapes;
for(int ii=1; ii<=M.Extent(); ii++)
{
TopoDS_Face face = TopoDS::Face(M(ii));
if (op)
{
shapes.Assign(op->Modified(face));
if(shapes.Extent() == 0)
shapes.Assign(op->Generated(face));
}
else if(sp)
shapes.Assign(sp->DescendantShapes(face));
if(shapes.Extent() == 1)
shape = shapes.First();
else if(shapes.Extent() > 1)
{
shape = shapes.First() ;
}
else
{
TopoDS_Face nullFace;
shape = nullFace;
}
if(shapes.Extent() > 0 || (op && op->IsDeleted(face)))
OCCSurface::update_OCC_entity(face,shape, op, NULL, sp);
}
if(!old_shell.IsSame(new_shell))
OCCQueryEngine::instance()->update_OCC_map(old_shell, new_shell);
return CUBIT_SUCCESS;
}
DLIList<OCCSurface*> OCCShell::memberSurfaces [private] |
Definition at line 134 of file OCCShell.hpp.
OCCBody* OCCShell::myBody [private] |
Definition at line 133 of file OCCShell.hpp.
OCCLump* OCCShell::myLump [private] |
Definition at line 132 of file OCCShell.hpp.
OCCSurface* OCCShell::mySheetSurface [private] |
Definition at line 131 of file OCCShell.hpp.
TopoDS_Shell* OCCShell::myTopoDSShell [private] |
Definition at line 130 of file OCCShell.hpp.