cgma
OCCPoint Class Reference

#include <OCCPoint.hpp>

Inheritance diagram for OCCPoint:
TBPoint GeometryEntity TopologyBridge

List of all members.

Public Member Functions

 OCCPoint (const CubitVector &location)
 OCCPoint (TopoDS_Vertex *thePoint)
 OCCPoint (gp_Pnt &thePoint)
virtual ~OCCPoint ()
void add_curve (OCCCurve *curve)
void remove_curve (OCCCurve *curve)
void clear_curves ()
DLIList< OCCCurve * > my_curve_list ()
int num_curves ()
void set_myMarked (CubitBoolean marked)
TopoDS_Vertex * get_TopoDS_Vertex ()
void set_TopoDS_Vertex (TopoDS_Vertex vertex)
virtual void append_simple_attribute_virt (const CubitSimpleAttrib &)
virtual void remove_simple_attribute_virt (const CubitSimpleAttrib &)
virtual void remove_all_simple_attribute_virt ()
virtual CubitStatus get_simple_attribute (DLIList< CubitSimpleAttrib > &)
virtual CubitStatus get_simple_attribute (const CubitString &name, DLIList< CubitSimpleAttrib > &)
virtual CubitVector coordinates () const
CubitBoolean is_equal (OCCPoint &other, double Tol)
double distance (OCCPoint &other)
double SquareDistance (OCCPoint &other)
virtual CubitBox bounding_box () const
virtual GeometryQueryEngineget_geometry_query_engine () const
virtual void get_parents_virt (DLIList< TopologyBridge * > &parents)
virtual void get_children_virt (DLIList< TopologyBridge * > &children)
void update_OCC_entity (BRepBuilderAPI_ModifyShape *aBRepTrsf, BRepAlgoAPI_BooleanOperation *op=NULL)

Private Attributes

TopoDS_Vertex * myTopoDSVertex
CubitBoolean myMarked
DLIList< OCCCurve * > myCurveList

Detailed Description

Definition at line 35 of file OCCPoint.hpp.


Constructor & Destructor Documentation

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.

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;
  }
}

Member Function Documentation

void OCCPoint::add_curve ( OCCCurve curve)

Definition at line 92 of file OCCPoint.cpp.

{
  assert(curve != NULL);
  myCurveList.append_unique(curve);
}

Implements TopologyBridge.

Definition at line 124 of file OCCPoint.cpp.

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.

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]

Implements TopologyBridge.

Definition at line 249 of file OCCPoint.cpp.

  {  }

Implements TopologyBridge.

Definition at line 223 of file OCCPoint.cpp.

void OCCPoint::get_parents_virt ( DLIList< TopologyBridge * > &  parents) [virtual]

Implements TopologyBridge.

Definition at line 245 of file OCCPoint.cpp.

Implements TopologyBridge.

Definition at line 169 of file OCCPoint.cpp.

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);
}   

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_curve ( OCCCurve curve)

Definition at line 98 of file OCCPoint.cpp.

{
  assert(curve != NULL);
  myCurveList.remove(curve);
}

Implements TopologyBridge.

Definition at line 138 of file OCCPoint.cpp.

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);
}

Member Data Documentation

Definition at line 41 of file OCCPoint.hpp.

Definition at line 40 of file OCCPoint.hpp.

TopoDS_Vertex* OCCPoint::myTopoDSVertex [private]

Definition at line 39 of file OCCPoint.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines