[cgma-dev] r3471 - cgm/branches/merge-cubit12/test
kraftche at cae.wisc.edu
kraftche at cae.wisc.edu
Fri Jan 22 11:16:43 CST 2010
Author: kraftche
Date: 2010-01-22 11:16:42 -0600 (Fri, 22 Jan 2010)
New Revision: 3471
Modified:
cgm/branches/merge-cubit12/test/
cgm/branches/merge-cubit12/test/Makefile.am
cgm/branches/merge-cubit12/test/brick.cpp
cgm/branches/merge-cubit12/test/hollow_acis.cpp
cgm/branches/merge-cubit12/test/init.cpp
cgm/branches/merge-cubit12/test/makept.cpp
cgm/branches/merge-cubit12/test/modify.cpp
cgm/branches/merge-cubit12/test/operation.cpp
cgm/branches/merge-cubit12/test/r_w.cpp
cgm/branches/merge-cubit12/test/sheet.cpp
cgm/branches/merge-cubit12/test/test_occ.cpp
cgm/branches/merge-cubit12/test/webcut.cpp
Log:
merge with trunk
Property changes on: cgm/branches/merge-cubit12/test
___________________________________________________________________
Added: svn:mergeinfo
+ /cgm/branches/cubit/test:1041-3427
/cgm/trunk/test:3424-3470
Modified: cgm/branches/merge-cubit12/test/Makefile.am
===================================================================
--- cgm/branches/merge-cubit12/test/Makefile.am 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/Makefile.am 2010-01-22 17:16:42 UTC (rev 3471)
@@ -12,23 +12,24 @@
-I$(srcdir) \
$(OCC_INC_FLAG)
-TESTS = init sheet brick
+TESTS = init sheet brick_facet
if build_ACIS
- TESTS += webcut hollow_acis
+ TESTS += webcut hollow_acis brick_acis
else
if WITH_CUBIT
- TESTS += webcut
+ TESTS += webcut brick_acis
endif
endif
if build_OCC
- TESTS += modify makept r_w test_occ operation
+ TESTS += modify makept r_w test_occ operation brick_occ
endif
AM_CPPFLAGS =
AM_CPPFLAGS += -DSRCDIR=@srcdir@ $(HAVE_ACIS_DEF) $(HAVE_OCC_DEF)
check_PROGRAMS = $(TESTS)
-LINK_FLAGS = $(CGM_EXT_LDFLAGS) $(CGM_EXT_LTFLAGS)
+LDADD = ../libcgm.la
+LDFLAGS += $(CGM_EXT_LDFLAGS) $(CGM_EXT_LTFLAGS)
webcut_SOURCES = webcut.cpp
hollow_acis_SOURCES = hollow_acis.cpp
@@ -38,20 +39,16 @@
r_w_SOURCES = r_w.cpp
test_occ_SOURCES = test_occ.cpp
operation_SOURCES = operation.cpp
-LDADD = ../libcgm.la
-webcut_LDFLAGS = $(LDFLAGS) $(LINK_FLAGS)
-hollow_acis_LDFLAGS = $(LDFLAGS) $(LINK_FLAGS)
-makept_LDFLAGS = $(LDFLAGS) $(LINK_FLAGS)
-modify_LDFLAGS = $(LDFLAGS) $(LINK_FLAGS)
-sheet_LDFLAGS = $(LDFLAGS) $(LINK_FLAGS)
-r_w_LDFLAGS = $(LDFLAGS) $(LINK_FLAGS)
-test_occ_LDFLAGS = $(LDFLAGS) $(LINK_FLAGS)
-operation_LDFLAGS = $(LDFLAGS) $(LINK_FLAGS)
-brick_SOURCES = brick.cpp
-brick_LDFLAGS = $(LDFLAGS) $(LINK_FLAGS)
init_SOURCES = init.cpp
init_LDFLAGS= $(LDFLAGS) $(LINK_FLAGS)
+brick_sources = brick.cpp
+brick_acis_SOURCES = $(brick_sources)
+brick_acis_CPPFLAGS = $(CPPFLAGS) '-DTEST_ENGINE="ACIS"'
+brick_occ_SOURCES = $(brick_sources)
+brick_occ_CPPFLAGS = $(CPPFLAGS) '-DTEST_ENGINE="OCC"'
+brick_facet_SOURCES = $(brick_sources)
+brick_facet_CPPFLAGS = $(CPPFLAGS) '-DTEST_ENGINE="FACET"'
# Files that are used as input to tests, and therefore
# must be included in tarball for tests to run.
Modified: cgm/branches/merge-cubit12/test/brick.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/brick.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/brick.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -1,3 +1,7 @@
+
+#undef NDEBUG
+#include <cassert>
+
#include "GeometryModifyTool.hpp"
#include "GeometryQueryTool.hpp"
#include "ModelQueryEngine.hpp"
@@ -10,7 +14,6 @@
#include "CoEdge.hpp"
#include "InitCGMA.hpp"
-#include <assert.h>
#include <algorithm>
@@ -20,6 +23,10 @@
*/
+#ifndef TEST_ENGINE
+# define TEST_ENGINE 0
+#endif
+
void check_valid_edge( RefEdge* edge );
void check_valid_face( RefFace* face );
void check_valid_loop( Loop* loop );
@@ -27,7 +34,7 @@
int main( int argc, char* argv[] )
{
// Start up CGM
- CubitStatus result = InitCGMA::initialize_cgma();
+ CubitStatus result = InitCGMA::initialize_cgma(TEST_ENGINE);
if (CUBIT_SUCCESS != result) return 1;
// Create a brick
@@ -202,8 +209,10 @@
face->get_child_ref_entities( edges );
double u_min, u_max, v_min, v_max, u, v;
- face->get_param_range_U( u_min, u_max );
- face->get_param_range_V( v_min, v_max );
+ if (face->is_parametric()) {
+ face->get_param_range_U( u_min, u_max );
+ face->get_param_range_V( v_min, v_max );
+ }
// Check that each edge is on the face
for (int i = 0; i < edges.size(); ++i) {
@@ -223,15 +232,18 @@
face->move_to_surface( close );
assert( (close - p[j]).length() < 1e-6 );
// Check that point is within UV bounds
- CubitStatus s = face->u_v_from_position( p[j], u, v );
- assert( CUBIT_SUCCESS == s );
- assert( (u - u_min) > -1e-6 );
- assert( (u_max - u) > -1e-6 );
- assert( (v - v_min) > -1e-6 );
- assert( (v_max - v) > -1e-6 );
+ if (face->is_parametric()) {
+ CubitStatus s = face->u_v_from_position( p[j], u, v );
+ assert( CUBIT_SUCCESS == s );
+ assert( (u - u_min) > -1e-6 );
+ assert( (u_max - u) > -1e-6 );
+ assert( (v - v_min) > -1e-6 );
+ assert( (v_max - v) > -1e-6 );
+ }
}
}
+
// Check reverse query from edge to face brings us back to the
// input face.
for (int i = 0; i < edges.size(); ++i) {
Modified: cgm/branches/merge-cubit12/test/hollow_acis.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/hollow_acis.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/hollow_acis.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -10,27 +10,17 @@
*
*/
-#include "CpuTimer.hpp"
+#undef NDEBUG
+#include <cassert>
+
#include "GeometryModifyTool.hpp"
#include "GeometryQueryTool.hpp"
-#include "AcisQueryEngine.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 "AcisQueryEngine.hpp"
-#include "AcisModifyEngine.hpp"
-#include "AppUtil.hpp"
-#include "RefEntityFactory.hpp"
-#include "RefEdge.hpp"
+#include "InitCGMA.hpp"
#define STRINGIFY(S) XSTRINGIFY(S)
#define XSTRINGIFY(S) #S
@@ -48,25 +38,10 @@
// main program - initialize, then send to proper function
int main (int argc, char **argv)
{
+ // Start up CGM
+ CubitStatus status = InitCGMA::initialize_cgma("ACIS");
+ if (CUBIT_SUCCESS != status) return 1;
- CubitObserver::init_static_observers();
- // Initialize the GeometryTool
-
- CGMApp::instance()->startup( argc, argv );
- GeometryQueryTool::instance();
- AcisQueryEngine::instance();
- AcisModifyEngine::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 hollow operation to make thick body.
status = hollow();
if (status == CUBIT_FAILURE)
Modified: cgm/branches/merge-cubit12/test/init.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/init.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/init.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -6,7 +6,6 @@
#include "InitCGMA.hpp"
#include <typeinfo>
-#include <assert.h>
// main program - initialize, then send to proper function
Modified: cgm/branches/merge-cubit12/test/makept.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/makept.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/makept.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -6,31 +6,23 @@
* 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"
+
+#undef NDEBUG
+#include <cassert>
+
#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 +42,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 +90,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/branches/merge-cubit12/test/modify.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/modify.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/modify.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -6,36 +6,28 @@
* 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"
+
+#undef NDEBUG
+#include <cassert>
+
#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 +47,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/branches/merge-cubit12/test/operation.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/operation.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/operation.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -6,36 +6,20 @@
* 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"
+
+#undef NDEBUG
+#include <cassert>
+
#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 +41,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 +111,6 @@
GeometryQueryTool *gti = GeometryQueryTool::instance();
GeometryModifyTool *gmti = GeometryModifyTool::instance();
- OCCQueryEngine::instance();
-
DLIList<Body*> bodies;
DLIList<RefEntity*> free_entities;
Modified: cgm/branches/merge-cubit12/test/r_w.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/r_w.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/r_w.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -6,36 +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 "config.h"
-#include "CpuTimer.hpp"
+
+#undef NDEBUG
+#include <cassert>
+
#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 +40,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 +111,6 @@
GeometryQueryTool *gti = GeometryQueryTool::instance();
GeometryModifyTool *gmti = GeometryModifyTool::instance();
- OCCQueryEngine::instance();
-
DLIList<Body*> bodies;
DLIList<RefEntity*> free_entities;
Modified: cgm/branches/merge-cubit12/test/sheet.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/sheet.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/sheet.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -17,7 +17,6 @@
#include "DLIList.hpp"
#include <typeinfo>
-#include <assert.h>
int test_sheet_query( GeometryModifyEngine* engine );
Modified: cgm/branches/merge-cubit12/test/test_occ.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/test_occ.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/test_occ.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -1,3 +1,4 @@
+#undef NDEBUG
#include <cassert>
#include <cstdio>
#include <cstdlib>
@@ -5,11 +6,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 +15,7 @@
#include "RefEdge.hpp"
#include "RefFace.hpp"
#include "RefVolume.hpp"
+#include "InitCGMA.hpp"
#define STRINGIFY(S) XSTRINGIFY(S)
#define XSTRINGIFY(S) #S
@@ -34,20 +31,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/branches/merge-cubit12/test/webcut.cpp
===================================================================
--- cgm/branches/merge-cubit12/test/webcut.cpp 2010-01-22 16:23:53 UTC (rev 3470)
+++ cgm/branches/merge-cubit12/test/webcut.cpp 2010-01-22 17:16:42 UTC (rev 3471)
@@ -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