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

janehu at mcs.anl.gov janehu at mcs.anl.gov
Mon May 19 15:20:15 CDT 2008


Author: janehu
Date: 2008-05-19 15:20:15 -0500 (Mon, 19 May 2008)
New Revision: 1824

Modified:
   cgm/trunk/test/Makefile.am
   cgm/trunk/test/makept.cpp
   cgm/trunk/test/modify.cpp
Log:
fixed makept errors, still need one more test on making a spline to pass.

Modified: cgm/trunk/test/Makefile.am
===================================================================
--- cgm/trunk/test/Makefile.am	2008-05-19 18:41:56 UTC (rev 1823)
+++ cgm/trunk/test/Makefile.am	2008-05-19 20:20:15 UTC (rev 1824)
@@ -25,6 +25,7 @@
   LINK_FLAGS += -R$(OCC_LIB_DIR)
 endif
 
+AM_CPPFLAGS =
 AM_CPPFLAGS += -DSRCDIR=@srcdir@ $(HAVE_ACIS_DEF) $(HAVE_OCC_DEF)
 check_PROGRAMS = $(TESTS)
 

Modified: cgm/trunk/test/makept.cpp
===================================================================
--- cgm/trunk/test/makept.cpp	2008-05-19 18:41:56 UTC (rev 1823)
+++ cgm/trunk/test/makept.cpp	2008-05-19 20:20:15 UTC (rev 1824)
@@ -137,20 +137,16 @@
   
   Body* CompBody = gmti->make_Body(ref_volume_list);
 
-  BodySM* CompBodySM = CompBody->get_body_sm_ptr();
-
-  OCCBody *occ_CompBody = CAST_TO(CompBodySM, OCCBody);
-
   test_bodies.clean_out();
   gti->bodies(test_bodies);
 
   CubitVector vi, vii;
-  vi = CompBody->center_point(); 
+  vi = test_bodies.get()->center_point(); 
 
   CubitVector axis(10,0,0);
 
-  gti->translate(CompBody,axis);
-  vi = CompBody->center_point();
+  gti->translate(test_bodies.get(),axis);
+  vi = test_bodies.get()->center_point();
   // After parellel move, center point moved by x (10)
 
   CubitVector vector1(10,10,10);
@@ -207,14 +203,14 @@
   gti->entity_entity_distance(gti->get_first_ref_volume(), vertex2,vi, vii,d);
   //first body and vertex2 's minimum distance(d) and locations for the minimum.
 
-  BodySM* body = bodies.get()->get_body_sm_ptr();
+  BodySM* body = CompBody->get_body_sm_ptr();
   OCCBody* occ_body = CAST_TO(body, OCCBody);
 
   gti->reflect(bodies, axis);
-  vi = bodies.get()->center_point();
+  vi = bodies.pop()->center_point();
   // After reflection, only x value should change.
 
-  gti->scale(bodies.get(),2);
+  gti->scale(CompBody,2);
   vi = bodies.get()->center_point();
   // After scale, center point moved by 2 times 
 
@@ -222,8 +218,10 @@
   vi = bodies.get()->center_point();
   // After parellel move, center point moved by x (10)
 
-  gti->rotate(bodies.get(), axis, 3.14/6);
-  vi = bodies.get()->center_point();
+  gti->delete_Body(bodies);
+
+  gti->rotate(CompBody, axis, 3.14/6);
+  vi = CompBody->center_point();
   // After rotation, center point changed in y and z value.
 
   occ_body->mass_properties(vi, d);
@@ -279,7 +277,7 @@
   for(int i = 1; i <= bodies.size(); i++)
   {
      bodies.step();
-     if( i != 4)
+     if( i != 2)
         continue;
      Body * entity = bodies.get();
      gti->translate(entity, i*vector1);
@@ -336,10 +334,10 @@
 
   double lower, upper;
   ref_face->get_param_range_U(lower, upper);
-  // get surface U direction boundaries. here it's (2.48, 3.91)
+  // get surface U direction boundaries. here it's (-0.003, 5.7413)
 
   ref_face->get_param_range_V(lower, upper);
-  // get surface V direction boundaries. here it's (-20010,-19998)
+  // get surface V direction boundaries. here it's (-20003,-19998)
 
   CubitBoolean closed = surface->is_closed_in_U();
   // check if surface is closed in U direction.
@@ -347,7 +345,7 @@
   closed = surface->is_closed_in_V();
   // check if surface is closed in V direction.
 
-  CubitPointContainment pc = ref_face->point_containment(1,-20000);
+  CubitPointContainment pc = ref_face->point_containment(7,-20000);
   // this (u,v) location should be outside of the surface.
 
   CubitPointContainment pc2 = ref_face->point_containment(3,-20000);
@@ -365,10 +363,15 @@
   CubitVector c_point, tangent, center;
 
   //make all kinds of curves.
-  CubitVector center_pnt(0,0,0);
-  RefEdge* new_edge_1 = gmti->make_RefEdge(SPLINE_CURVE_TYPE, vertex1,
-					vertex2, &center_pnt);
-  //Gives invalid curve type error.
+  CubitVector center_pnt(0,0,10);
+  DLIList<CubitVector*> list;
+  CubitVector center_pnt1(5,6,10);
+  CubitVector center_pnt2(5,-6,10);
+  list.append(&center_pnt1);
+  list.append(&center_pnt);
+  list.append(&center_pnt2);
+  //RefEdge* new_edge_1 = gmti->make_RefEdge(SPLINE_CURVE_TYPE, vertex1,
+  //                                         vertex2, list);
 
   //straight line
   RefEdge* new_edge_2 = gmti->make_RefEdge(STRAIGHT_CURVE_TYPE, vertex1,

Modified: cgm/trunk/test/modify.cpp
===================================================================
--- cgm/trunk/test/modify.cpp	2008-05-19 18:41:56 UTC (rev 1823)
+++ cgm/trunk/test/modify.cpp	2008-05-19 20:20:15 UTC (rev 1824)
@@ -321,20 +321,20 @@
   from_body2 = gti->make_Body(bodysm); 
 
   tool_body  = gmti->brick(4, 4, 4);
-  BodySM* copy_bodysm = ome->copy_body(tool_body->get_body_sm_ptr());
   CubitVector v_move3(0,1,0);
   gti->translate(tool_body,v_move3);
+  BodySM* copy_bodysm = ome->copy_body(tool_body->get_body_sm_ptr());
   from_bodies.clean_out();
   from_bodies.append(from_body2);
   new_bodies.clean_out();
 
   //test face body imprint
   TopoDS_Shape* tool_shape = CAST_TO(copy_bodysm,OCCBody)->get_TopoDS_Shape();  
-  TopoDS_Shape* from_shape = CAST_TO(body_list[0],OCCBody)->my_sheet_surface()->get_TopoDS_Face(); 
+/*  TopoDS_Shape* from_shape = CAST_TO(body_list[0],OCCBody)->my_sheet_surface()->get_TopoDS_Face(); 
   ome->imprint_toposhapes(tool_shape, from_shape);
-
+*/
   //test shell body imprint.
-  from_shape = CAST_TO(bodysm,OCCBody)->shell()->get_TopoDS_Shell();
+  TopoDS_Shape* from_shape = CAST_TO(bodysm,OCCBody)->shell()->get_TopoDS_Shell();
   ome->imprint_toposhapes(tool_shape, from_shape);
 
   //test body cutting a shell, one surface got cut as the result. 




More information about the cgma-dev mailing list