[cgma-dev] r5356 - cgm/trunk/geom/OCC

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Tue Jan 31 09:48:04 CST 2012


Author: janehu
Date: 2012-01-31 09:48:01 -0600 (Tue, 31 Jan 2012)
New Revision: 5356

Added:
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp_5317
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp_5345
Modified:
   cgm/trunk/geom/OCC/OCCBody.cpp
   cgm/trunk/geom/OCC/OCCCurve.cpp
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCPoint.cpp
   cgm/trunk/geom/OCC/OCCShell.cpp
Log:
Added offset non-straight curve functionality to OCC according to ACIS implementation. Currently code works this way:

Straight curve will offset according to offset-distance and offset-direction.

A non-straight curve will not honor offset-direction, rather give a warning of it, just as ACIS.

All input curves will be chained to form a wire to offset, if the wire is not obtainable for all curves, code will error out as in ACIS.

Closed curve(s) will be offset based on distance, positive distance will offset to outside and negative distance will offset to inside. The number of curves may be more than the original input if it's a closed spline.

Open curve(s) will be tricky, since the opencascade code offset the curves both ways and connected the end into a closed wire. CGM has to determine which curves are the needed, hopefully it works out correctly. However, if original curve causes more than one offset curves in the same direction, code will be errored out.

Passed new added tests, will be committed.




Modified: cgm/trunk/geom/OCC/OCCBody.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCBody.cpp	2012-01-30 20:21:58 UTC (rev 5355)
+++ cgm/trunk/geom/OCC/OCCBody.cpp	2012-01-31 15:48:01 UTC (rev 5356)
@@ -522,9 +522,9 @@
 
   TopoDS_Compound compsolid;
   TopoDS_Shape shape;
+  shape = aBRepTrsf->Shape();
   if(aBRepTrsf && myTopoDSShape)
   {
-    shape = aBRepTrsf->ModifiedShape(*myTopoDSShape);
     compsolid = TopoDS::Compound(shape);
   
     if(OCCQueryEngine::instance()->OCCMap->IsBound(*myTopoDSShape) )

Modified: cgm/trunk/geom/OCC/OCCCurve.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCCurve.cpp	2012-01-30 20:21:58 UTC (rev 5355)
+++ cgm/trunk/geom/OCC/OCCCurve.cpp	2012-01-31 15:48:01 UTC (rev 5356)
@@ -954,19 +954,9 @@
   assert(aBRepTrsf != NULL || op != NULL);
   
   TopoDS_Shape shape;
-  BRepBuilderAPI_Transform* pTrsf = NULL;
-  BRepBuilderAPI_GTransform* gTrsf = NULL;
   if(aBRepTrsf)
-  {
-    pTrsf = (BRepBuilderAPI_Transform*)aBRepTrsf;
-    if(!pTrsf)
-    {
-      gTrsf = (BRepBuilderAPI_GTransform*)aBRepTrsf;
-      shape = gTrsf->ModifiedShape(*get_TopoDS_Edge());
-    }
-    else
-      shape = pTrsf->ModifiedShape(*get_TopoDS_Edge());
-  }
+    shape = aBRepTrsf->ModifiedShape(*get_TopoDS_Edge());
+
   else
   {
     TopTools_ListOfShape shapes;

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2012-01-30 20:21:58 UTC (rev 5355)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2012-01-31 15:48:01 UTC (rev 5356)
@@ -24,6 +24,7 @@
 #include "gp_Cone.hxx"
 #include "gp_Sphere.hxx"
 #include "gp_Torus.hxx"


More information about the cgma-dev mailing list