cgma
|
#include <OCCPoint.hpp>
Definition at line 35 of file OCCPoint.hpp.
OCCPoint::OCCPoint | ( | const CubitVector & | location | ) |
Definition at line 52 of file OCCPoint.cpp.
{ gp_Pnt pt = gp_Pnt( location.x(), location.y(), location.z()); TopoDS_Vertex theVertex = BRepBuilderAPI_MakeVertex(pt); myTopoDSVertex = new TopoDS_Vertex(theVertex); }
OCCPoint::OCCPoint | ( | TopoDS_Vertex * | thePoint | ) | [inline] |
Definition at line 50 of file OCCPoint.hpp.
:myTopoDSVertex(thePoint), myMarked(CUBIT_FALSE){};
OCCPoint::OCCPoint | ( | gp_Pnt & | thePoint | ) |
Definition at line 68 of file OCCPoint.cpp.
{ TopoDS_Vertex theVertex = BRepBuilderAPI_MakeVertex(thePoint); myTopoDSVertex = new TopoDS_Vertex(theVertex); }
OCCPoint::~OCCPoint | ( | ) | [virtual] |
Definition at line 83 of file OCCPoint.cpp.
{ if (myTopoDSVertex) { delete (TopoDS_Vertex*)myTopoDSVertex; myTopoDSVertex = NULL; } }
void OCCPoint::add_curve | ( | OCCCurve * | curve | ) |
Definition at line 92 of file OCCPoint.cpp.
{ assert(curve != NULL); myCurveList.append_unique(curve); }
void OCCPoint::append_simple_attribute_virt | ( | const CubitSimpleAttrib & | csa | ) | [virtual] |
Implements TopologyBridge.
Definition at line 124 of file OCCPoint.cpp.
{ OCCAttribSet::append_attribute(csa, *myTopoDSVertex); }
CubitBox OCCPoint::bounding_box | ( | void | ) | const [virtual] |
Reimplemented from TBPoint.
Definition at line 237 of file OCCPoint.cpp.
{ CubitVector temp_vector = this->coordinates(); CubitBox temp_box(temp_vector); return temp_box; }
void OCCPoint::clear_curves | ( | ) | [inline] |
Definition at line 67 of file OCCPoint.hpp.
{myCurveList.clean_out();}
CubitVector OCCPoint::coordinates | ( | void | ) | const [virtual] |
Implements TBPoint.
Definition at line 188 of file OCCPoint.cpp.
{ gp_Pnt pt = BRep_Tool::Pnt(*myTopoDSVertex); CubitVector p(pt.X(), pt.Y(), pt.Z()); return p; }
double OCCPoint::distance | ( | OCCPoint & | other | ) |
Definition at line 203 of file OCCPoint.cpp.
{ gp_Pnt pt = BRep_Tool::Pnt(*myTopoDSVertex); return pt.Distance(BRep_Tool::Pnt(*(other.get_TopoDS_Vertex()))); }
void OCCPoint::get_children_virt | ( | DLIList< TopologyBridge * > & | children | ) | [virtual] |
GeometryQueryEngine * OCCPoint::get_geometry_query_engine | ( | ) | const [virtual] |
Implements TopologyBridge.
Definition at line 223 of file OCCPoint.cpp.
{ return OCCQueryEngine::instance(); }
void OCCPoint::get_parents_virt | ( | DLIList< TopologyBridge * > & | parents | ) | [virtual] |
Implements TopologyBridge.
Definition at line 245 of file OCCPoint.cpp.
{ CAST_LIST_TO_PARENT(myCurveList, parents); }
CubitStatus OCCPoint::get_simple_attribute | ( | DLIList< CubitSimpleAttrib > & | csa_list | ) | [virtual] |
Implements TopologyBridge.
Definition at line 169 of file OCCPoint.cpp.
{ return OCCAttribSet::get_attributes(*myTopoDSVertex,csa_list); }
CubitStatus OCCPoint::get_simple_attribute | ( | const CubitString & | name, |
DLIList< CubitSimpleAttrib > & | csa_list | ||
) | [virtual] |
Implements TopologyBridge.
Definition at line 174 of file OCCPoint.cpp.
{ return OCCAttribSet::get_attributes( name, *myTopoDSVertex, csa_list ); }
TopoDS_Vertex* OCCPoint::get_TopoDS_Vertex | ( | ) | [inline] |
Definition at line 74 of file OCCPoint.hpp.
{assert (myTopoDSVertex->ShapeType() == TopAbs_VERTEX); return myTopoDSVertex; }
CubitBoolean OCCPoint::is_equal | ( | OCCPoint & | other, |
double | Tol | ||
) |
Definition at line 195 of file OCCPoint.cpp.
{ gp_Pnt pt = BRep_Tool::Pnt(*myTopoDSVertex); TopoDS_Vertex otherVertex = *(other.get_TopoDS_Vertex()); const gp_Pnt otherPnt = BRep_Tool::Pnt(otherVertex); return pt.IsEqual(otherPnt, Tol); }
DLIList<OCCCurve * > OCCPoint::my_curve_list | ( | ) | [inline] |
Definition at line 68 of file OCCPoint.hpp.
{return myCurveList;}
int OCCPoint::num_curves | ( | ) | [inline] |
Definition at line 69 of file OCCPoint.hpp.
{return myCurveList.size();}
void OCCPoint::remove_all_simple_attribute_virt | ( | ) | [virtual] |
Implements TopologyBridge.
Definition at line 153 of file OCCPoint.cpp.
void OCCPoint::remove_curve | ( | OCCCurve * | curve | ) |
Definition at line 98 of file OCCPoint.cpp.
{ assert(curve != NULL); myCurveList.remove(curve); }
void OCCPoint::remove_simple_attribute_virt | ( | const CubitSimpleAttrib & | csa | ) | [virtual] |
Implements TopologyBridge.
Definition at line 138 of file OCCPoint.cpp.
{ OCCAttribSet::remove_attribute(csa, *myTopoDSVertex); }
void OCCPoint::set_myMarked | ( | CubitBoolean | marked | ) | [inline] |
Definition at line 72 of file OCCPoint.hpp.
{myMarked = marked;}
void OCCPoint::set_TopoDS_Vertex | ( | TopoDS_Vertex | vertex | ) |
Definition at line 104 of file OCCPoint.cpp.
{ if(myTopoDSVertex && vertex.IsEqual(*myTopoDSVertex)) return; if(myTopoDSVertex) myTopoDSVertex->Nullify(); *myTopoDSVertex = vertex; }
double OCCPoint::SquareDistance | ( | OCCPoint & | other | ) |
Definition at line 209 of file OCCPoint.cpp.
{ gp_Pnt pt = BRep_Tool::Pnt(*myTopoDSVertex); return pt.SquareDistance(BRep_Tool::Pnt(*(other.get_TopoDS_Vertex()))); }
void OCCPoint::update_OCC_entity | ( | BRepBuilderAPI_ModifyShape * | aBRepTrsf, |
BRepAlgoAPI_BooleanOperation * | op = NULL |
||
) |
Definition at line 257 of file OCCPoint.cpp.
{ if (this->myMarked == CUBIT_TRUE) return; assert(aBRepTrsf != NULL || op != NULL); TopoDS_Shape shape; if(aBRepTrsf) shape = aBRepTrsf->ModifiedShape(*get_TopoDS_Vertex()); else { TopTools_ListOfShape shapes; shapes.Assign(op->Modified(*get_TopoDS_Vertex())); if(shapes.Extent() == 0) shapes.Assign(op->Generated(*get_TopoDS_Vertex())); if(shapes.Extent() == 1) shape = shapes.First(); else if(shapes.Extent() > 1) { //update all attributes first. TopTools_ListIteratorOfListOfShape it; it.Initialize(shapes); shape = shapes.First(); } else if(op->IsDeleted(*get_TopoDS_Vertex())) ; else return ; } TopoDS_Vertex vertex; if(!shape.IsNull()) vertex = TopoDS::Vertex(shape); OCCQueryEngine::instance()->update_OCC_map(*myTopoDSVertex, vertex); set_myMarked(CUBIT_TRUE); set_TopoDS_Vertex(vertex); }
DLIList<OCCCurve * > OCCPoint::myCurveList [private] |
Definition at line 41 of file OCCPoint.hpp.
CubitBoolean OCCPoint::myMarked [private] |
Definition at line 40 of file OCCPoint.hpp.
TopoDS_Vertex* OCCPoint::myTopoDSVertex [private] |
Definition at line 39 of file OCCPoint.hpp.