[cgma-dev] r1310 - cgm/trunk/geom/OCC
janehu at mcs.anl.gov
janehu at mcs.anl.gov
Thu Oct 11 14:30:24 CDT 2007
Author: janehu
Date: 2007-10-11 14:30:24 -0500 (Thu, 11 Oct 2007)
New Revision: 1310
Modified:
cgm/trunk/geom/OCC/Makefile.am
cgm/trunk/geom/OCC/OCCModifyEngine.cpp
cgm/trunk/geom/OCC/OCCPoint.cpp
cgm/trunk/geom/OCC/OCCPoint.hpp
cgm/trunk/geom/OCC/OCCQueryEngine.hpp
Log:
OCCPoint update.
Modified: cgm/trunk/geom/OCC/Makefile.am
===================================================================
--- cgm/trunk/geom/OCC/Makefile.am 2007-10-11 19:09:08 UTC (rev 1309)
+++ cgm/trunk/geom/OCC/Makefile.am 2007-10-11 19:30:24 UTC (rev 1310)
@@ -27,6 +27,7 @@
# The non-template sources
libcubit_OCC_la_SOURCES = \
+ OCCAttrib.cpp \
OCCAttribSet.cpp \
OCCBody.cpp \
OCCCoEdge.cpp \
Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp 2007-10-11 19:09:08 UTC (rev 1309)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp 2007-10-11 19:30:24 UTC (rev 1310)
@@ -99,11 +99,8 @@
//===============================================================================
Point* OCCModifyEngine::make_Point( CubitVector const& point) const
{
- gp_Pnt pt(point.x(), point.y(), point.z());
-
- OCCPoint *occ_pt = new OCCPoint(pt);
+ OCCPoint *occ_pt = new OCCPoint(point);
return CAST_TO(occ_pt, Point);
-
}
//===============================================================================
Modified: cgm/trunk/geom/OCC/OCCPoint.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCPoint.cpp 2007-10-11 19:09:08 UTC (rev 1309)
+++ cgm/trunk/geom/OCC/OCCPoint.cpp 2007-10-11 19:30:24 UTC (rev 1310)
@@ -21,7 +21,8 @@
#include "OCCPoint.hpp"
#include "OCCQueryEngine.hpp"
#include "CastTo.hpp"
-
+#include "OCCAttribSet.hpp"
+#include "CubitSimpleAttrib.hpp"
#include "BRep_Tool.hxx"
// ********** END CUBIT INCLUDES **********
@@ -40,9 +41,10 @@
//
// Creation Date : 10/08/07
//-------------------------------------------------------------------------
-OCCPoint::OCCPoint( CubitVector &location )
+OCCPoint::OCCPoint( const CubitVector &location )
{
- myPoint = gp_Pnt( location.x(), location.y(), location.z());
+ gp_Pnt pt = gp_Pnt( location.x(), location.y(), location.z());
+ myPoint = BRepBuilderAPI_MakeVertex(pt);
}
//-------------------------------------------------------------------------
@@ -71,7 +73,7 @@
// Creation Date : 07/16/00
//-------------------------------------------------------------------------
void OCCPoint::append_simple_attribute_virt(CubitSimpleAttrib *csa)
- { /*attribSet.append_attribute(csa); */}
+ { attribSet.append_attribute(csa); }
//-------------------------------------------------------------------------
// Purpose : The purpose of this function is to remove a simple
@@ -85,7 +87,7 @@
// Creation Date : 07/16/00
//-------------------------------------------------------------------------
void OCCPoint::remove_simple_attribute_virt(CubitSimpleAttrib *csa)
- { /*attribSet.remove_attribute(csa);*/ }
+ { attribSet.remove_attribute(csa); }
//-------------------------------------------------------------------------
// Purpose : The purpose of this function is to remove all simple
@@ -100,7 +102,7 @@
// Creation Date : 07/16/00
//-------------------------------------------------------------------------
void OCCPoint::remove_all_simple_attribute_virt()
- { /*attribSet.remove_all_attributes();*/ }
+ { attribSet.remove_all_attributes(); }
//-------------------------------------------------------------------------
// Purpose : The purpose of this function is to get the
@@ -115,35 +117,31 @@
//-------------------------------------------------------------------------
CubitStatus OCCPoint::get_simple_attribute(DLIList<CubitSimpleAttrib*>&
csa_list)
- { /*return attribSet.get_attributes(csa_list);*/
- return CUBIT_SUCCESS;
+ { return attribSet.get_attributes(csa_list);
}
CubitStatus OCCPoint::get_simple_attribute(const CubitString& name,
DLIList<CubitSimpleAttrib*>& csa_list )
- { /*return attribSet.get_attributes( name, csa_list );*/
- return CUBIT_SUCCESS;
+ { return attribSet.get_attributes( name, csa_list );
}
CubitStatus OCCPoint::save_attribs( FILE *file_ptr )
- { //return attribSet.save_attributes(file_ptr);
- return CUBIT_SUCCESS;
+ { return attribSet.save_attributes(file_ptr);
}
CubitStatus OCCPoint::restore_attribs( FILE *file_ptr, unsigned int endian )
- { //return attribSet.restore_attributes(file_ptr, endian);
- return CUBIT_SUCCESS;
+ { return attribSet.restore_attributes(file_ptr, endian);
}
-gp_Pnt OCCPoint::get_gp()const
+TopoDS_Vertex OCCPoint::get_pnt()const
{
return myPoint;
}
-void OCCPoint::set_gp(const gp_Pnt gp_point)
+void OCCPoint::set_pnt( TopoDS_Vertex &v_point)
{
- myPoint = gp_point;
+ myPoint = v_point;
}
//-------------------------------------------------------------------------
// Purpose : Returns the coordinates of this Point.
@@ -156,33 +154,27 @@
//-------------------------------------------------------------------------
CubitVector OCCPoint::coordinates() const
{
- CubitVector p(myPoint.X(), myPoint.Y(), myPoint.Z());
+ gp_Pnt pt = BRep_Tool::Pnt(myPoint);
+ CubitVector p(pt.X(), pt.Y(), pt.Z());
return p;
}
-void OCCPoint::set_coord(CubitVector &location )
-{
- myPoint.SetCoord(location.x(), location.y(), location.z());
-}
-
-void OCCPoint::set_coord(double x, double y, double z)
-{
- myPoint.SetCoord(x, y, z);
-}
-
CubitBoolean OCCPoint::is_equal(const OCCPoint & other, double Tol)
{
- return myPoint.IsEqual(other.get_gp(), Tol);
-}
-
+ gp_Pnt pt = BRep_Tool::Pnt(myPoint);
+ return pt.IsEqual(BRep_Tool::Pnt(other.get_pnt()), Tol);
+}
+
double OCCPoint::distance(const OCCPoint & other)
{
- return myPoint.Distance(other.get_gp());
+ gp_Pnt pt = BRep_Tool::Pnt(myPoint);
+ return pt.Distance(BRep_Tool::Pnt(other.get_pnt()));
}
double OCCPoint::SquareDistance (const OCCPoint & other)
{
- return myPoint.SquareDistance(other.get_gp());
+ gp_Pnt pt = BRep_Tool::Pnt(myPoint);
+ return pt.SquareDistance(BRep_Tool::Pnt(other.get_pnt()));
}
//-------------------------------------------------------------------------
// Purpose : Get geometry modeling engine: AcisGeometryEngine
Modified: cgm/trunk/geom/OCC/OCCPoint.hpp
===================================================================
--- cgm/trunk/geom/OCC/OCCPoint.hpp 2007-10-11 19:09:08 UTC (rev 1309)
+++ cgm/trunk/geom/OCC/OCCPoint.hpp 2007-10-11 19:30:24 UTC (rev 1310)
@@ -22,53 +22,100 @@
#include "Point.hpp"
#include <stdio.h>
#include "gp_Pnt.hxx"
+#include "TopoDS_Vertex.hxx"
+#include "BRepBuilderAPI_MakeVertex.hxx"
+#include "OCCAttribSet.hpp"
// ********** END CUBIT INCLUDES **********
// ********** BEGIN FORWARD DECLARATIONS **********
class CubitSimpleAttrib;
-class OCCAttrib;
// ********** END FORWARD DECLARATIONS **********
class OCCPoint : public Point
{
private:
- gp_Pnt myPoint;
+ TopoDS_Vertex myPoint;
+
+ OCCAttribSet attribSet;
public :
- OCCPoint(CubitVector &location );
+ OCCPoint(const CubitVector &location );
//I- CubitVector &location
//I- location of point (creates a CubiPoint).
//I- DLIList<Curve*> curves
//I- curves attaced to point
- OCCPoint(gp_Pnt& thePoint ):myPoint(thePoint){};
+ OCCPoint(TopoDS_Vertex& thePoint ):myPoint(thePoint){};
//I- gp_Pnt *thePoint
//I- pointer to the TopoDS_Vertex associated with OCCPoint
//I- DLIList<Curve*> curves
//I- curves attaced to point
-
- gp_Pnt get_gp()const;
- void set_gp( const
-gp_Pnt gp_ptr);
- // - get/set the gp_Pnt associated with this object
+
+ OCCPoint(gp_Pnt& thePoint ):myPoint(BRepBuilderAPI_MakeVertex(thePoint)){};
+ //I- gp_Pnt *thePoint
+ //I- pointer to the TopoDS_Vertex associated with OCCPoint
+ //I- DLIList<Curve*> curves
+ //I- curves attaced to point
+
virtual ~OCCPoint();
//- The destructor
+ TopoDS_Vertex get_pnt()const;
+ void set_pnt( TopoDS_Vertex& gp_pnt);
+ // - get/set the gp_Pnt associated with this object
+
#ifdef BOYD14
OCCPoint *copy();
// make a new copy of this point and return it
#endif
+ virtual void append_simple_attribute_virt(CubitSimpleAttrib*);
+ //R void
+ //I
+ //I-
+ //I- that is to be appended to this OSME object.
+ //- The purpose of this function is to append a
+ //- attribute to the OSME. The is attached to each of the
+ //- underlying solid model entities this one points to.
+
+ virtual void remove_simple_attribute_virt(CubitSimpleAttrib*);
+ //R void
+ //I CubitSimpleAttrib*
+ //I- A reference to a CubitSimpleAttrib object which is the object
+ //I- that is to be removed to this OSME object.
+ //- The purpose of this function is to remove a simple
+ //- attribute from the OSME. The attribute is attached to each of the
+ //- underlying solid model entities this one points to.
+
+ virtual void remove_all_simple_attribute_virt();
+ //R void
+ //I-
+ //- The purpose of this function is to remove all simple
+ //- attributes from the OSME.
+
+ virtual CubitStatus get_simple_attribute(DLIList<CubitSimpleAttrib*>&);
+ virtual CubitStatus get_simple_attribute(const CubitString& name,
+ DLIList<CubitSimpleAttrib*>&);
+ //R CubitSimpleAttrib*
+ //R- the returned cubit simple attribute.
+ //- The purpose of this function is to get the attributes
+ //- of the geometry entity. The name is attached to the underlying solid
+ //- model entity(ies) this one points to.
+ //- MJP Note:
+ //- This is the code that implements the requirement that names
+ //- of VGI Entities propagate across solid model boolean
+ //- operations. The success of this relies, of course, on the underlying
+ //- solid modeler being able to propagate attributes across
+ //- such operations on its entities. If it cannot, then "names"
+ //- of VGI entities will not propagate.
+
virtual CubitVector coordinates() const;
//R CubitVector
//R- Contains the coordinate values {x y z} of this Point
//- Returns the spatial coordinates of this Point.
- virtual void set_coord(CubitVector &location );
- virtual void set_coord(double x, double y, double z);
-
CubitBoolean is_equal(const OCCPoint & other, double Tol);
double distance(const OCCPoint & other);
@@ -88,13 +135,6 @@
void get_parents_virt( DLIList<TopologyBridge*>& parents );
void get_children_virt( DLIList<TopologyBridge*>& children );
- virtual void append_simple_attribute_virt(CubitSimpleAttrib*);
- virtual void remove_simple_attribute_virt(CubitSimpleAttrib*);
- virtual void remove_all_simple_attribute_virt();
- virtual CubitStatus get_simple_attribute(DLIList<CubitSimpleAttrib*>&);
- virtual CubitStatus get_simple_attribute(const CubitString&,
- DLIList<CubitSimpleAttrib*>&);
-
CubitStatus save_attribs( FILE *file_ptr );
CubitStatus restore_attribs( FILE *file_ptr, unsigned int endian );
Modified: cgm/trunk/geom/OCC/OCCQueryEngine.hpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.hpp 2007-10-11 19:09:08 UTC (rev 1309)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.hpp 2007-10-11 19:30:24 UTC (rev 1310)
@@ -28,11 +28,11 @@
// ********** END STANDARD INCLUDES **********
// ********** BEGIN CUBIT INCLUDES **********
-
+#include "config.h"
#include "CubitFileIOWrapper.hpp"
#include "GeometryQueryEngine.hpp"
-#include "TopTools_DataMapOfShapeInteger.hxx"
+#include <TopTools_DataMapOfShapeInteger.hxx>
#include <map>
// ********** END CUBIT INCLUDES **********
More information about the cgma-dev
mailing list