[cgma-dev] r1515 - cgm/trunk/geom/OCC
janehu at mcs.anl.gov
janehu at mcs.anl.gov
Thu Jan 10 13:43:44 CST 2008
Author: janehu
Date: 2008-01-10 13:43:44 -0600 (Thu, 10 Jan 2008)
New Revision: 1515
Modified:
cgm/trunk/geom/OCC/OCCBody.cpp
cgm/trunk/geom/OCC/OCCBody.hpp
cgm/trunk/geom/OCC/OCCCurve.hpp
cgm/trunk/geom/OCC/OCCPoint.hpp
Log:
Updated for body translation unmark underlining curve/vertex marker, added getting all points, curves, surfaces for body.
Modified: cgm/trunk/geom/OCC/OCCBody.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCBody.cpp 2008-01-09 22:05:06 UTC (rev 1514)
+++ cgm/trunk/geom/OCC/OCCBody.cpp 2008-01-10 19:43:44 UTC (rev 1515)
@@ -273,7 +273,19 @@
lump->update_OCC_entity(aBRepTrsf);
}
set_TopoDS_Shape(compsolid);
- //unset_marks();
+
+ //unset marks.
+ DLIList<OCCCurve*> curves;
+ DLIList<OCCPoint*> points;
+ get_all_curves(curves);
+ get_all_points(points);
+
+ for(int i = 0; i < curves.size(); i++)
+ curves.get_and_step()->set_myMarked(CUBIT_FALSE);
+
+ for(int i = 0; i < points.size(); i++)
+ points.get_and_step()->set_myMarked(CUBIT_FALSE);
+
}
//----------------------------------------------------------------
// Function: update_bounding_box
@@ -371,4 +383,72 @@
return CUBIT_PNT_OUTSIDE;
}
+//-------------------------------------------------------------------------
+// Purpose : return all surfaces in this body.
+//
+// Special Notes :
+//
+// Creator : Jane Hu
+//
+// Creation Date : 01/10/08
+//-------------------------------------------------------------------------
+void OCCBody::get_all_surfaces(DLIList<OCCSurface*> &surfaces)
+{
+ TopTools_IndexedMapOfShape M;
+ TopExp::MapShapes(*myTopoDSShape, TopAbs_FACE, M);
+ int ii;
+ for (ii=1; ii<=M.Extent(); ii++) {
+ TopologyBridge *surface = OCCQueryEngine::instance()->occ_to_cgm(M(ii));
+ OCCSurface* occ_surface = CAST_TO(surface, OCCSurface);
+ if (occ_surface)
+ surfaces.append_unique(occ_surface);
+ }
+}
+
+//-------------------------------------------------------------------------
+// Purpose : return all curves in this body.
+//
+// Special Notes :
+//
+// Creator : Jane Hu
+//
+// Creation Date : 01/10/08
+//-------------------------------------------------------------------------
+
+void OCCBody::get_all_curves(DLIList<OCCCurve*> &curves)
+{
+ TopTools_IndexedMapOfShape M;
+ TopExp::MapShapes(*myTopoDSShape, TopAbs_EDGE, M);
+ int ii;
+ for (ii=1; ii<=M.Extent(); ii++) {
+ TopologyBridge *curve = OCCQueryEngine::instance()->occ_to_cgm(M(ii));
+ OCCCurve* occ_curve = CAST_TO(curve, OCCCurve);
+ if (occ_curve)
+ curves.append_unique(occ_curve);
+ }
+}
+
+//-------------------------------------------------------------------------
+// Purpose : return all points in this body.
+//
+// Special Notes :
+//
+// Creator : Jane Hu
+//
+// Creation Date : 01/10/08
+//-------------------------------------------------------------------------
+
+void OCCBody::get_all_points(DLIList<OCCPoint*> &points)
+{
+ TopTools_IndexedMapOfShape M;
+ TopExp::MapShapes(*myTopoDSShape, TopAbs_VERTEX, M);
+ int ii;
+ for (ii=1; ii<=M.Extent(); ii++) {
+ TopologyBridge *vertex = OCCQueryEngine::instance()->occ_to_cgm(M(ii));
+ OCCPoint* occ_point = CAST_TO(vertex, OCCPoint);
+ if (occ_point)
+ points.append_unique(occ_point);
+ }
+}
+
Modified: cgm/trunk/geom/OCC/OCCBody.hpp
===================================================================
--- cgm/trunk/geom/OCC/OCCBody.hpp 2008-01-09 22:05:06 UTC (rev 1514)
+++ cgm/trunk/geom/OCC/OCCBody.hpp 2008-01-10 19:43:44 UTC (rev 1515)
@@ -161,6 +161,10 @@
virtual void get_parents_virt( DLIList<TopologyBridge*>& parents );
virtual void get_children_virt( DLIList<TopologyBridge*>& children );
+ void get_all_surfaces(DLIList<OCCSurface*> &surfaces);
+ void get_all_curves(DLIList<OCCCurve*> &curves);
+ void get_all_points(DLIList<OCCPoint*> &points);
+
virtual CubitStatus mass_properties( CubitVector& result, double& volume );
virtual CubitPointContainment point_containment( const CubitVector& pos );
Modified: cgm/trunk/geom/OCC/OCCCurve.hpp
===================================================================
--- cgm/trunk/geom/OCC/OCCCurve.hpp 2008-01-09 22:05:06 UTC (rev 1514)
+++ cgm/trunk/geom/OCC/OCCCurve.hpp 2008-01-10 19:43:44 UTC (rev 1515)
@@ -50,6 +50,8 @@
virtual ~OCCCurve() ;
//- The destructor
+ void set_myMarked( CubitBoolean marked) {myMarked = marked;}
+
void add_loop(OCCLoop* loop) { myLoopList.append_unique(loop);}
DLIList<OCCLoop*> loops() {return myLoopList;}
void remove_loop(OCCLoop* loop) {myLoopList.remove(loop);}
Modified: cgm/trunk/geom/OCC/OCCPoint.hpp
===================================================================
--- cgm/trunk/geom/OCC/OCCPoint.hpp 2008-01-09 22:05:06 UTC (rev 1514)
+++ cgm/trunk/geom/OCC/OCCPoint.hpp 2008-01-10 19:43:44 UTC (rev 1515)
@@ -64,6 +64,7 @@
//- The destructor
void set_myMarked(CubitBoolean marked) {myMarked = marked;}
+
TopoDS_Vertex *get_TopoDS_Vertex(){return myTopoDSVertex; }
void set_TopoDS_Vertex(TopoDS_Vertex vertex){*myTopoDSVertex = vertex;}
More information about the cgma-dev
mailing list