[cgma-dev] r5093 - cgm/trunk/itaps

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Thu Aug 11 10:38:31 CDT 2011


Author: janehu
Date: 2011-08-11 10:38:31 -0500 (Thu, 11 Aug 2011)
New Revision: 5093

Added:
   cgm/trunk/itaps/test_edge_orient.cc
Log:
Added the edge_orient check code from Hong-Jun.

Added: cgm/trunk/itaps/test_edge_orient.cc
===================================================================
--- cgm/trunk/itaps/test_edge_orient.cc	                        (rev 0)
+++ cgm/trunk/itaps/test_edge_orient.cc	2011-08-11 15:38:31 UTC (rev 5093)
@@ -0,0 +1,134 @@
+#include "iGeom.h"
+#include "RefEntity.hpp"
+#include "RefFace.hpp"
+#include "RefEdge.hpp"
+#include "RefVertex.hpp"
+#include "Body.hpp"
+#include "CubitVector.hpp"
+#include "ModelQueryEngine.hpp"
+#include "GeometryQueryTool.hpp"
+#include <iostream>
+#define CHECK( STR ) if (err != iBase_SUCCESS) return print_error( STR, err, geom, __FILE__, __LINE__ )
+
+#ifdef HAVE_ACIS
+#  define ENGINE "ACIS"
+#  define FORMAT "ACIS_SAT"
+#  define FILE_NAME "brick_2.sat"
+#elif defined (HAVE_OCC)
+#  define ENGINE "OCC"
+#  define FORMAT "OCC"
+#  define FILE_NAME "brick_2.stp"
+#else
+#  error "Which engine to test?"
+#endif
+
+static bool print_error( const char* desc, 
+                         int err,
+                         iGeom_Instance geom,
+                         const char* file,
+                         int line )
+{
+  char buffer[1024];
+  iGeom_getDescription( geom, buffer, sizeof(buffer) );
+  buffer[sizeof(buffer)-1] = '\0';
+  
+  std::cerr << "ERROR: " << desc << std::endl
+            << "  Error code: " << err << std::endl
+            << "  Error desc: " << buffer << std::endl
+            << "  At        : " << file << ':' << line << std::endl
+            ;
+  
+  return false; // must always return false or CHECK macro will break
+}
+
+int main(int argc, char *argv[])
+{
+  // initialize the Mesh


More information about the cgma-dev mailing list