[cgma-dev] r2507 - cgm/trunk/test

janehu at mcs.anl.gov janehu at mcs.anl.gov
Tue Jan 6 14:27:57 CST 2009


Author: janehu
Date: 2009-01-06 14:27:57 -0600 (Tue, 06 Jan 2009)
New Revision: 2507

Modified:
   cgm/trunk/test/operation.cpp
Log:
Added tests to create multiple mid-planes.

Modified: cgm/trunk/test/operation.cpp
===================================================================
--- cgm/trunk/test/operation.cpp	2009-01-06 20:27:06 UTC (rev 2506)
+++ cgm/trunk/test/operation.cpp	2009-01-06 20:27:57 UTC (rev 2507)
@@ -161,12 +161,12 @@
   CubitVector v1(1,1,3);
   CubitVector v2(1,2,2);
   CubitVector v3(1,1,1);
-  BodySM* mid_plane;
-  status = OCCModifyEngine::instance()->get_mid_plane(v1, v2, v3, from_body, mid_plane);
-  if(mid_plane)
+  DLIList<BodySM*> mid_planes;
+  status = OCCModifyEngine::instance()->get_mid_plane(v1, v2, v3, from_body, mid_planes);
+  if(mid_planes.size() > 0)
   {
     Body *midplane_body;
-    midplane_body = gti->make_Body(mid_plane);
+    midplane_body = gti->make_Body(mid_planes.pop());
     double d = midplane_body->measure();
     //d = 100
   }
@@ -174,15 +174,31 @@
   v1.x(2);
   v2.x(2);
   v3.x(2);
-  status = OCCModifyEngine::instance()->get_mid_plane(v1, v2, v3, from_body, mid_plane);
-  if(mid_plane)
+  
+  status = OCCModifyEngine::instance()->get_mid_plane(v1, v2, v3, from_body, mid_planes);
+  if(mid_planes.size() > 0)
   {
     Body *midplane_body;
-    midplane_body = gti->make_Body(mid_plane);
+    midplane_body = gti->make_Body(mid_planes.pop());
     double d = midplane_body->measure();
     //d = 70
   }
 
+  CubitVector v4(0,0,0);
+  CubitVector v5(1,0,2); 
+  CubitVector v6(0,1,0);
+  status = OCCModifyEngine::instance()->get_mid_plane(v4, v5, v6, from_body, mid_planes);
+  if(mid_planes.size() > 0)
+  {
+    Body *midplane_body;
+    for(int i = 0; i < mid_planes.size(); i++)
+    {
+      midplane_body = gti->make_Body(mid_planes.get_and_step());
+      double d = midplane_body->measure();
+      //d = 22.36 & 78.26
+    }
+  }
+
   status = gmti->webcut_with_plane(from_bodies, v1, v2, v3, new_bodies, CUBIT_TRUE);
   //double d = new_bodies.step_and_get()->measure();
   //CubitVector v = new_bodies.get()->center_point();




More information about the cgma-dev mailing list