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

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Fri Jan 22 10:19:53 CST 2010


Author: kraftche
Date: 2010-01-22 10:19:52 -0600 (Fri, 22 Jan 2010)
New Revision: 3469

Modified:
   cgm/trunk/test/makept.cpp
   cgm/trunk/test/modify.cpp
   cgm/trunk/test/operation.cpp
   cgm/trunk/test/r_w.cpp
   cgm/trunk/test/sheet.cpp
   cgm/trunk/test/test_occ.cpp
   cgm/trunk/test/webcut.cpp
Log:
clean up CGM initialization and remove unused #includes

Modified: cgm/trunk/test/makept.cpp
===================================================================
--- cgm/trunk/test/makept.cpp	2010-01-22 15:42:47 UTC (rev 3468)
+++ cgm/trunk/test/makept.cpp	2010-01-22 16:19:52 UTC (rev 3469)
@@ -6,31 +6,19 @@
  * This program acts as a simple driver for CGM.  It reads in a geometry,
  * and performs varies checks for bodies, surfaces, curves and vertices.
  */
-#include "CpuTimer.hpp"
 #include "GeometryModifyTool.hpp"
 #include "GeometryQueryTool.hpp"
-#include "OCCQueryEngine.hpp"
-#include "CubitUtil.hpp"
 #include "CubitMessage.hpp"
-#include "CubitDefines.h"
-#include "RefEntity.hpp"
 #include "Body.hpp"
 #include "RefVolume.hpp"
 #include "RefFace.hpp"
 #include "RefEdge.hpp"
 #include "RefVertex.hpp"
-#include "CubitObserver.hpp"
-#include "CastTo.hpp"
-#include "OCCModifyEngine.hpp"
-#include "AppUtil.hpp"
-#include "RefEntityFactory.hpp"
-#include "RefEdge.hpp"
-#include "BodySM.hpp"
+#include "InitCGMA.hpp"
 #include "OCCBody.hpp"
 #include "OCCSurface.hpp"
 #include "OCCCurve.hpp"
 #include "OCCDrawTool.hpp"
-#include "OCCPoint.hpp"
 
 #ifndef SRCDIR
 # define SRCDIR .
@@ -50,24 +38,9 @@
 // main program - initialize, then send to proper function
 int main (int argc, char **argv)
 {
+  CubitStatus status = InitCGMA::initialize_cgma("OCC");
+  if (CUBIT_SUCCESS != status) return 1;
 
-  CubitObserver::init_static_observers();
-    // Initialize the GeometryTool
-  
-  CGMApp::instance()->startup( argc, argv );
-  OCCQueryEngine::instance();
-  OCCModifyEngine::instance();
-
-    // If there aren't any file arguments, print usage and exit
-  //if (argc == 1) {
-  //  PRINT_INFO("Usage: mergechk <geom_file> [<geom_file> ...]\n");
-  //  exit(0);
-  //}
-  
-  CubitStatus status = CUBIT_SUCCESS;
-
-
-
   //Do make point.
   status = make_Point();
   if (status == CUBIT_FAILURE) 
@@ -113,9 +86,6 @@
   GeometryQueryTool *gti = GeometryQueryTool::instance();
   GeometryModifyTool *gmti = GeometryModifyTool::instance();
 
-  OCCQueryEngine::instance();
-  OCCModifyEngine::instance();
-
   //test for creating prisms
   Body* prism1 = gmti->prism(10, 7, 5, 2); 
   Body* prism2 = gmti->prism(10, 7, 5, 5);

Modified: cgm/trunk/test/modify.cpp
===================================================================
--- cgm/trunk/test/modify.cpp	2010-01-22 15:42:47 UTC (rev 3468)
+++ cgm/trunk/test/modify.cpp	2010-01-22 16:19:52 UTC (rev 3469)
@@ -6,36 +6,24 @@
  * This program acts as a simple driver for CGM.  It reads in a geometry,
  * and performs varies checks for bodies, surfaces, curves and vertices.
  */
-#include "config.h"
-#include "CpuTimer.hpp"
 #include "GeometryModifyTool.hpp"
 #include "GeometryQueryTool.hpp"
 #include "OCCQueryEngine.hpp"
-#include "CubitUtil.hpp"
 #include "CubitMessage.hpp"
-#include "CubitDefines.h"
-#include "RefEntity.hpp"
 #include "Body.hpp"
 #include "RefVolume.hpp"
 #include "RefFace.hpp"
 #include "RefEdge.hpp"
 #include "RefVertex.hpp"
-#include "CubitObserver.hpp"
 #include "CastTo.hpp"
 #include "OCCModifyEngine.hpp"
-#include "AppUtil.hpp"
-#include "RefEntityFactory.hpp"
-#include "RefEdge.hpp"
-#include "BodySM.hpp"
-#include "Lump.hpp"
 #include "OCCLump.hpp"
 #include "OCCBody.hpp"
 #include "OCCSurface.hpp"
 #include "OCCCurve.hpp"
 #include "OCCShell.hpp"
 #include "TopoDS_Shape.hxx"
-#include "RefEntityName.hpp"
-#include "RefEntityFactory.hpp"
+#include "InitCGMA.cpp"
 
 #ifndef SRCDIR
 # define SRCDIR .
@@ -55,24 +43,9 @@
 // main program - initialize, then send to proper function
 int main (int argc, char **argv)
 {
+  CubitStatus status = InitCGMA::initialize_cgma("OCC");
+  if (CUBIT_SUCCESS != status) return 1;
 
-  CubitObserver::init_static_observers();
-    // Initialize the GeometryTool
-  
-  CGMApp::instance()->startup( argc, argv );
-  OCCQueryEngine::instance();
-  OCCModifyEngine::instance();
-
-    // If there aren't any file arguments, print usage and exit
-  //if (argc == 1) {
-  //  PRINT_INFO("Usage: mergechk <geom_file> [<geom_file> ...]\n");
-  //  exit(0);
-  //}
-  
-  CubitStatus status = CUBIT_SUCCESS;
-
-
-
   //Do make point.
   status = make_Point();
   if (status == CUBIT_FAILURE) 

Modified: cgm/trunk/test/operation.cpp
===================================================================
--- cgm/trunk/test/operation.cpp	2010-01-22 15:42:47 UTC (rev 3468)
+++ cgm/trunk/test/operation.cpp	2010-01-22 16:19:52 UTC (rev 3469)
@@ -6,36 +6,16 @@
  * This program acts as a simple driver for CGM.  It reads in a geometry,
  * and performs varies checks for bodies, surfaces, curves and vertices.
  */
-#include "config.h"
-#include "CpuTimer.hpp"
 #include "GeometryModifyTool.hpp"
 #include "GeometryQueryTool.hpp"
-#include "OCCQueryEngine.hpp"
-#include "CubitUtil.hpp"
 #include "CubitMessage.hpp"
-#include "CubitDefines.h"
-#include "RefEntity.hpp"
 #include "Body.hpp"
 #include "RefVolume.hpp"
 #include "RefFace.hpp"
 #include "RefEdge.hpp"
 #include "RefVertex.hpp"
-#include "CubitObserver.hpp"
-#include "CastTo.hpp"
+#include "InitCGMA.hpp"
 #include "OCCModifyEngine.hpp"
-#include "AppUtil.hpp"
-#include "RefEntityFactory.hpp"
-#include "RefEdge.hpp"
-#include "BodySM.hpp"
-#include "Lump.hpp"
-#include "OCCLump.hpp"
-#include "OCCBody.hpp"
-#include "OCCSurface.hpp"
-#include "OCCCurve.hpp"
-#include "OCCShell.hpp"
-#include "TopoDS_Shape.hxx"
-#include "RefEntityName.hpp"
-#include "RefEntityFactory.hpp"
 
 #include <algorithm>
 
@@ -57,24 +37,9 @@
 // main program - initialize, then send to proper function
 int main (int argc, char **argv)
 {
+  CubitStatus status = InitCGMA::initialize_cgma("OCC");
+  if (CUBIT_SUCCESS != status) return 1;
 
-  CubitObserver::init_static_observers();
-    // Initialize the GeometryTool
-  
-  CGMApp::instance()->startup( argc, argv );
-  OCCQueryEngine::instance();
-  OCCModifyEngine::instance();
-
-    // If there aren't any file arguments, print usage and exit
-  //if (argc == 1) {
-  //  PRINT_INFO("Usage: mergechk <geom_file> [<geom_file> ...]\n");
-  //  exit(0);
-  //}
-  
-  CubitStatus status = CUBIT_SUCCESS;
-
-
-
   //Do make point.
   status = make_Point();
   if (status == CUBIT_FAILURE) 
@@ -142,8 +107,6 @@
   GeometryQueryTool *gti = GeometryQueryTool::instance();
   GeometryModifyTool *gmti = GeometryModifyTool::instance();
 
-  OCCQueryEngine::instance();
-
   DLIList<Body*> bodies;
   DLIList<RefEntity*>  free_entities;
 

Modified: cgm/trunk/test/r_w.cpp
===================================================================
--- cgm/trunk/test/r_w.cpp	2010-01-22 15:42:47 UTC (rev 3468)
+++ cgm/trunk/test/r_w.cpp	2010-01-22 16:19:52 UTC (rev 3469)
@@ -6,36 +6,15 @@
  * This program acts as a simple driver for CGM.  It reads in a geometry,
  * and performs varies checks for bodies, surfaces, curves and vertices.
  */
-#include "config.h"
-#include "CpuTimer.hpp"
 #include "GeometryModifyTool.hpp"
 #include "GeometryQueryTool.hpp"
-#include "OCCQueryEngine.hpp"
-#include "CubitUtil.hpp"
 #include "CubitMessage.hpp"
-#include "CubitDefines.h"
-#include "RefEntity.hpp"
 #include "Body.hpp"
 #include "RefVolume.hpp"
 #include "RefFace.hpp"
 #include "RefEdge.hpp"
 #include "RefVertex.hpp"
-#include "CubitObserver.hpp"
-#include "CastTo.hpp"
-#include "OCCModifyEngine.hpp"
-#include "AppUtil.hpp"
-#include "RefEntityFactory.hpp"
-#include "RefEdge.hpp"
-#include "BodySM.hpp"
-#include "Lump.hpp"
-#include "OCCLump.hpp"
-#include "OCCBody.hpp"
-#include "OCCSurface.hpp"
-#include "OCCCurve.hpp"
-#include "OCCShell.hpp"
-#include "TopoDS_Shape.hxx"
-#include "RefEntityName.hpp"
-#include "RefEntityFactory.hpp"
+#include "InitCGMA.hpp"
 
 #include <algorithm>
 
@@ -57,24 +36,9 @@
 // main program - initialize, then send to proper function
 int main (int argc, char **argv)
 {
+  CubitStatus status = InitCGMA::initialize_cgma("OCC");
+  if (CUBIT_SUCCESS != status) return 1;
 
-  CubitObserver::init_static_observers();
-    // Initialize the GeometryTool
-  
-  CGMApp::instance()->startup( argc, argv );
-  OCCQueryEngine::instance();
-  OCCModifyEngine::instance();
-
-    // If there aren't any file arguments, print usage and exit
-  //if (argc == 1) {
-  //  PRINT_INFO("Usage: mergechk <geom_file> [<geom_file> ...]\n");
-  //  exit(0);
-  //}
-  
-  CubitStatus status = CUBIT_SUCCESS;
-
-
-
   //Do make point.
   status = make_Point();
   if (status == CUBIT_FAILURE) 
@@ -143,8 +107,6 @@
   GeometryQueryTool *gti = GeometryQueryTool::instance();
   GeometryModifyTool *gmti = GeometryModifyTool::instance();
 
-  OCCQueryEngine::instance();
-
   DLIList<Body*> bodies;
   DLIList<RefEntity*>  free_entities;
 

Modified: cgm/trunk/test/sheet.cpp
===================================================================
--- cgm/trunk/test/sheet.cpp	2010-01-22 15:42:47 UTC (rev 3468)
+++ cgm/trunk/test/sheet.cpp	2010-01-22 16:19:52 UTC (rev 3469)
@@ -17,7 +17,6 @@
 #include "DLIList.hpp"
 
 #include <typeinfo>
-#include <assert.h>
 
 int test_sheet_query( GeometryModifyEngine* engine );
 

Modified: cgm/trunk/test/test_occ.cpp
===================================================================
--- cgm/trunk/test/test_occ.cpp	2010-01-22 15:42:47 UTC (rev 3468)
+++ cgm/trunk/test/test_occ.cpp	2010-01-22 16:19:52 UTC (rev 3469)
@@ -5,11 +5,6 @@
 #include <map>
 #include <string>
 
-#include "AppUtil.hpp"
-#include "CGMApp.hpp"
-#include "CubitObserver.hpp"
-#include "CubitVector.hpp"
-#include "DLIList.hpp"
 #include "GeometryModifyTool.hpp"
 #include "GeometryQueryTool.hpp"
 #include "GMem.hpp"
@@ -19,6 +14,7 @@
 #include "RefEdge.hpp"
 #include "RefFace.hpp"
 #include "RefVolume.hpp"
+#include "InitCGMA.hpp"
 
 #define STRINGIFY(S) XSTRINGIFY(S)
 #define XSTRINGIFY(S) #S
@@ -34,20 +30,13 @@
 
 int main( int argc, char** argv ) {
 
-  AppUtil::instance()->startup(argc, argv);
-  CGMApp::instance()->startup(argc, argv);
-
-  CubitObserver::init_static_observers();
-
-  OCCQueryEngine::instance();
-  OCCModifyEngine::instance();
+  CubitStatus status = InitCGMA::initialize_cgma("OCC");
+  if (CUBIT_SUCCESS != status) return 1;
   GeometryQueryTool *gti = GeometryQueryTool::instance();
-  GeometryModifyTool::instance();
-  assert(gti);
-  
+   
   // Read in the geometry from files specified on the command line
   const char* filename = STRINGIFY(SRCDIR) "/LeverArm.brep";
-  CubitStatus status = gti->import_solid_model(filename, "OCC");
+  status = gti->import_solid_model(filename, "OCC");
   if (status != CUBIT_SUCCESS) {
     PRINT_ERROR("Problems reading geometry file %s.\n", filename);
     return 1;

Modified: cgm/trunk/test/webcut.cpp
===================================================================
--- cgm/trunk/test/webcut.cpp	2010-01-22 15:42:47 UTC (rev 3468)
+++ cgm/trunk/test/webcut.cpp	2010-01-22 16:19:52 UTC (rev 3469)
@@ -13,21 +13,11 @@
 #include "CpuTimer.hpp"
 #include "GeometryModifyTool.hpp"
 #include "GeometryQueryTool.hpp"
-#include "MergeTool.hpp"
-#include "CubitUtil.hpp"
-#include "CubitMessage.hpp"
-#include "CubitDefines.h"
-#include "RefEntity.hpp"
 #include "Body.hpp"
 #include "RefVolume.hpp"
 #include "RefFace.hpp"
 #include "RefEdge.hpp"
 #include "RefVertex.hpp"
-#include "CubitObserver.hpp"
-#include "CastTo.hpp"
-#include "AppUtil.hpp"
-#include "RefEntityFactory.hpp"
-#include "RefEdge.hpp"
 #include "InitCGMA.hpp"
 
 #define STRINGIFY(S) XSTRINGIFY(S)



More information about the cgma-dev mailing list