[MOAB-dev] commit/MOAB: 91 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue May 20 01:01:55 CDT 2014
91 new commits in MOAB:
https://bitbucket.org/fathomteam/moab/commits/26dbacbd995f/
Changeset: 26dbacbd995f
Branch: None
User: pshriwise
Date: 2014-02-14 00:56:36
Summary: Created a new file for basic tests on ReadCGM using a simple geometry. Old ReadCGM test filed renamed to reduce confusion.
Affected #: 1 file
diff --git a/test/io/read_cgm_load_test.cpp b/test/io/read_cgm_load_test.cpp
index 5377220..9704ee7 100644
--- a/test/io/read_cgm_load_test.cpp
+++ b/test/io/read_cgm_load_test.cpp
@@ -43,7 +43,8 @@ void read_multiple_test()
int main(int /* argc */, char** /* argv */)
{
- int result = RUN_TEST( read_multiple_test );
+
+ int result = RUN_TEST( read_multiple_test ) ;
return result;
}
https://bitbucket.org/fathomteam/moab/commits/e1b9d54d39a3/
Changeset: e1b9d54d39a3
Branch: None
User: pshriwise
Date: 2014-02-14 00:56:37
Summary: Removed unused tag_get_handle call in read_cgm testing
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 7a2d07d..14e03fd 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -37,10 +37,6 @@ void read_cube_test()
ErrorCode rval = mb.load_file(input_cube); CHECK_ERR(rval);
- Tag geom_tag;
-
- rval = mb.tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
- geom_tag, MB_TAG_SPARSE|MB_TAG_CREAT);
CHECK_ERR(rval);
int number_of_tris;
https://bitbucket.org/fathomteam/moab/commits/ee59212f9cb7/
Changeset: ee59212f9cb7
Branch: None
User: pshriwise
Date: 2014-02-14 01:02:37
Summary: Attempt at fixing the problem with loading a file multiple times in clean MOAB instances.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 14e03fd..40d75be 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -31,22 +31,32 @@ static const char input_cube[] = "cube.sat";
#endif
#endif
-void read_cube_test()
-{
- Core mb;
-
- ErrorCode rval = mb.load_file(input_cube); CHECK_ERR(rval);
+void read_file( Interface* moab, const char* input_file );
+void read_cube_test();
+
+void read_file( Interface* moab, const char* input_file )
+{
+ ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
+}
+
+void read_cube_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ mb->delete_mesh();
+ read_file( mb, input_cube );
int number_of_tris;
- rval = mb.get_number_entities_by_type(0, MBTRI , number_of_tris);
+ rval = mb->get_number_entities_by_type(0, MBTRI , number_of_tris);
std::cout << "Number of Triangles = " << number_of_tris << std::endl;
CHECK_ERR(rval);
int number_of_vertices;
- rval = mb.get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
+ rval = mb->get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
CHECK_ERR(rval);
@@ -54,13 +64,14 @@ void read_cube_test()
if( number_of_vertices !=8) rval = MB_FAILURE; CHECK_ERR(rval);
+
}
int main(int /* argc */, char** /* argv */)
{
int result = 0;
-
+
result += RUN_TEST( read_cube_test );
-
+
return result;
}
https://bitbucket.org/fathomteam/moab/commits/7eb2f8c1296f/
Changeset: 7eb2f8c1296f
Branch: None
User: pshriwise
Date: 2014-02-14 01:04:11
Summary: More changes to decypher how to create new moab instances.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 40d75be..3be49d2 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -46,7 +46,6 @@ void read_cube_test()
ErrorCode rval;
Core moab;
Interface* mb = &moab;
- mb->delete_mesh();
read_file( mb, input_cube );
int number_of_tris;
@@ -66,12 +65,59 @@ void read_cube_test()
}
+
+void delete_mesh_test()
+{
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ ErrorCode rval;
+
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range geom_sets[4];
+
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, geom_sets[dim] );
+ CHECK_ERR(rval);
+
+ if( geom_sets[dim].size() == 0 ) std::cout << "Warning: No geom sets to begin with" << std::endl;
+
+ }
+
+ mb->delete_mesh();
+
+ Range geom_sets_after[4];
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val_after[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val_after, 1, geom_sets_after[dim] );
+ CHECK_ERR(rval);
+
+ if( 0 != geom_sets_after[dim].size() ) rval = MB_FAILURE;
+
+ CHECK_ERR(rval);
+ }
+
+}
int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_test );
+
+ result += RUN_TEST( read_cube_test );
+ result += RUN_TEST( delete_mesh_test );
+
return result;
}
https://bitbucket.org/fathomteam/moab/commits/1b0dcfa41a99/
Changeset: 1b0dcfa41a99
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Separated test for cube verts and test for cube triangles. Updated method of value comparison.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 3be49d2..cdce4fd 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -41,7 +41,22 @@ void read_file( Interface* moab, const char* input_file )
CHECK_ERR(rval);
}
-void read_cube_test()
+void read_cube_verts_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ int number_of_vertices;
+ rval = mb->get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
+ CHECK_ERR(rval);
+
+ CHECK_EQUAL( 8, number_of_vertices);
+}
+
+
+void read_cube_tris_test()
{
ErrorCode rval;
Core moab;
@@ -54,18 +69,20 @@ void read_cube_test()
std::cout << "Number of Triangles = " << number_of_tris << std::endl;
CHECK_ERR(rval);
- int number_of_vertices;
- rval = mb->get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
- CHECK_ERR(rval);
-
+ CHECK_EQUAL( 12, number_of_tris);
- if( number_of_tris != 12) rval = MB_FAILURE; CHECK_ERR(rval);
-
- if( number_of_vertices !=8) rval = MB_FAILURE; CHECK_ERR(rval);
+}
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+ result += RUN_TEST( read_cube_tris_test );
+ return result;
}
+
void delete_mesh_test()
{
Core moab;
@@ -109,15 +126,4 @@ void delete_mesh_test()
}
}
-
-int main(int /* argc */, char** /* argv */)
-{
- int result = 0;
-
-
- result += RUN_TEST( read_cube_test );
- result += RUN_TEST( delete_mesh_test );
-
- return result;
-}
https://bitbucket.org/fathomteam/moab/commits/c6c383b22a79/
Changeset: c6c383b22a79
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Added multiple new tests for the correct number of geometric entities in read_cgm_basic_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index cdce4fd..4977497 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -32,7 +32,6 @@ static const char input_cube[] = "cube.sat";
#endif
void read_file( Interface* moab, const char* input_file );
-void read_cube_test();
void read_file( Interface* moab, const char* input_file )
@@ -72,12 +71,90 @@ void read_cube_tris_test()
CHECK_EQUAL( 12, number_of_tris);
}
-
+
+void read_cube_curves_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range curves;
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+
+
+ CHECK_EQUAL( 12, number_of_curves);
+
+}
+
+void read_cube_surfs_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range curves;
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_surfs;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_surfs );
+ CHECK_ERR(rval);
+
+
+ CHECK_EQUAL( 6, number_of_surfs);
+
+}
+
+void read_cube_vols_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range curves;
+ int dim = 3;
+ void *val[] = {&dim};
+ int number_of_vols;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_vols );
+ CHECK_ERR(rval);
+
+
+ CHECK_EQUAL( 1, number_of_vols);
+
+}
+
int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_tris_test );
+ result += RUN_TEST( read_cube_vols_test );
return result;
}
https://bitbucket.org/fathomteam/moab/commits/e8d47e3c83a9/
Changeset: e8d47e3c83a9
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Added a function to verify that mesh vertices are in the correct locations.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 4977497..4eafe96 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -150,11 +150,81 @@ void read_cube_vols_test()
}
+void read_cube_vertex_pos_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //First check that the correct number of vertices are present
+ int number_of_verts;
+ rval = mb->get_number_entities_by_type( 0 , MBVERTEX , number_of_verts);
+ CHECK_ERR(rval);
+
+ CHECK_EQUAL(8, number_of_verts);
+
+ //Retrieve all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
+ CHECK_ERR(rval);
+
+ //Get the vertex coordinates
+ double x[verts.size()];
+ double y[verts.size()];
+ double z[verts.size()];
+ rval = mb-> get_coords( verts, &x[0], &y[0], &z[0]);
+ CHECK_ERR(rval);
+
+ //Check against known locations of the vertices
+
+ // Vertex 1
+ CHECK_EQUAL( x[0], 5);
+ CHECK_EQUAL( y[0], -5);
+ CHECK_EQUAL( z[0], 5);
+
+ // Vertex 2
+ CHECK_EQUAL( x[1], 5);
+ CHECK_EQUAL( y[1], 5);
+ CHECK_EQUAL( z[1], 5);
+
+ // Vertex 3
+ CHECK_EQUAL( x[2], -5);
+ CHECK_EQUAL( y[2], 5);
+ CHECK_EQUAL( z[2], 5);
+
+ // Vertex 4
+ CHECK_EQUAL( x[3], -5);
+ CHECK_EQUAL( y[3], -5);
+ CHECK_EQUAL( z[3], 5);
+
+ // Vertex 5
+ CHECK_EQUAL( x[4], 5);
+ CHECK_EQUAL( y[4], 5);
+ CHECK_EQUAL( z[4], -5);
+
+ // Vertex 6
+ CHECK_EQUAL( x[5], 5);
+ CHECK_EQUAL( y[5], -5);
+ CHECK_EQUAL( z[5], -5);
+
+ // Vertex 7
+ CHECK_EQUAL( x[6], -5);
+ CHECK_EQUAL( y[6], -5);
+ CHECK_EQUAL( z[6], -5);
+
+ // Vertex 8
+ CHECK_EQUAL( x[7], -5);
+ CHECK_EQUAL( y[7], 5);
+ CHECK_EQUAL( z[7], -5);
+
+}
+
int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_vols_test );
+ result += RUN_TEST( read_cube_vertex_pos_test );
return result;
}
https://bitbucket.org/fathomteam/moab/commits/57579949cf8e/
Changeset: 57579949cf8e
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Added some comments to read_cgm_basic_test.cpp for clarity.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 4eafe96..d225837 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -43,6 +43,7 @@ void read_file( Interface* moab, const char* input_file )
void read_cube_verts_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
@@ -58,6 +59,7 @@ void read_cube_verts_test()
void read_cube_tris_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
@@ -75,6 +77,7 @@ void read_cube_tris_test()
void read_cube_curves_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
@@ -92,7 +95,6 @@ void read_cube_curves_test()
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
CHECK_ERR(rval);
-
CHECK_EQUAL( 12, number_of_curves);
@@ -101,6 +103,7 @@ void read_cube_curves_test()
void read_cube_surfs_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
@@ -127,12 +130,12 @@ void read_cube_surfs_test()
void read_cube_vols_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
Tag geom_tag;
-
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
@@ -152,7 +155,9 @@ void read_cube_vols_test()
void read_cube_vertex_pos_test()
{
+
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
https://bitbucket.org/fathomteam/moab/commits/0fad33850f9b/
Changeset: 0fad33850f9b
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Restructured the read_cgm_basic_test file. Added comments for clarity.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index d225837..13f7bac 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -31,8 +31,29 @@ static const char input_cube[] = "cube.sat";
#endif
#endif
+// Function used to load the test file
void read_file( Interface* moab, const char* input_file );
+// List of tests in this file
+void read_cube_verts_test();
+void read_cube_curves_test();
+void read_cube_surfs_test();
+void read_cube_vols_test();
+void read_cube_vertes_pos_test();
+void read_cube_curve_senses_test();
+void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST( read_cube_curve_senses_test );
+
+ return result;
+}
+
+
void read_file( Interface* moab, const char* input_file )
{
@@ -225,16 +246,6 @@ void read_cube_vertex_pos_test()
}
-int main(int /* argc */, char** /* argv */)
-{
- int result = 0;
-
- result += RUN_TEST( read_cube_vertex_pos_test );
-
- return result;
-}
-
-
void delete_mesh_test()
{
Core moab;
https://bitbucket.org/fathomteam/moab/commits/b61782a8128a/
Changeset: b61782a8128a
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Created a new file for testing the loading of sense data with READ_CGM.
This was done for a simple cube geometry. Cleanup of the code is needed.
Affected #: 2 files
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index 6cf835a..31049a1 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -25,7 +25,7 @@ else
endif
if HAVE_CGM
- CGM_TEST = read_cgm_load_test read_cgm_basic_test
+ CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test
else
CGM_TEST =
endif
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
new file mode 100644
index 0000000..f42abed
--- /dev/null
+++ b/test/io/read_cgm_senses_test.cpp
@@ -0,0 +1,233 @@
+
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+#include "MBTagConventions.hpp"
+#include "moab/GeomTopoTool.hpp"
+using namespace moab;
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+ std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+ << __LINE__ << std::endl; \
+ return A; } } while(false)
+
+
+#ifdef MESHDIR
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+#else
+static const char input_cube[] = "/io/cube.sat";
+#endif
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// Functions containing known sense data
+void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+
+// Functions used to compare sense information found in
+// the model to reference information
+
+void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses);
+
+//Function used to get id's from entity handles
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+// List of tests in this file
+void read_cube_curve_senses_test();
+void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST( read_cube_curve_senses_test );
+
+ return result;
+}
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+void read_cube_curve_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all curve handles
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of curves exist
+
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ CHECK_EQUAL(12 , number_of_curves);
+
+ // Get curve handles
+ Range curves;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, curves );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get curve data
+ moab::GeomTopoTool gt(mb, false);
+ std::vector<EntityHandle> surfs;
+ std::vector<int> senses;
+ std::vector<int> known_surf_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < curves.size() ; i++)
+ {
+
+ surfs.clear();
+ senses.clear();
+ //Curve 1
+ gt.get_senses( curves[i], surfs, senses);
+ CHECK_ERR(rval);
+
+ //Load known curve-sense data
+
+ known_surf_ids.clear();
+ known_senses.clear();
+ load_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+
+ check_curve_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
+ }
+
+}
+
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set ) {
+
+ErrorCode rval;
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE);
+ assert(MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result);
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ assert(MB_SUCCESS == result);
+ return id;
+ }
+
+void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses)
+{
+
+ std::vector<int> wrt_ent_ids;
+ for( unsigned int i=0 ; i<wrt_ents.size() ; i++)
+ {
+ wrt_ent_ids.push_back(geom_id_by_handle(moab, wrt_ents[i]));
+ }
+
+ for (unsigned int i=0; i< wrt_ent_ids.size() ; i++)
+ {
+ for(unsigned int j=0; j< known_wrt_ids.size(); j++)
+ {
+ if(wrt_ent_ids[i] == known_wrt_ids [j])
+ {
+ CHECK_EQUAL(senses[i],known_senses[j]);
+ known_wrt_ids.erase(known_wrt_ids.begin()+j);
+ known_senses.erase(known_senses.begin()+j);
+ }
+ }
+ }
+
+ int leftovers = known_wrt_ids.size();
+
+ CHECK_EQUAL(leftovers, 0 );
+
+}
+void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out ){
+
+ int curve_id = geom_id_by_handle( moab, curve);
+
+ std::cout << curve_id << std::endl;
+
+
+ switch(curve_id)
+ {
+ case 1:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(6);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 2:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(5);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 3:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(4);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 4:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(3);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 5:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(6);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 6:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(3);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 7:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(4);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 8:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(5);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 9:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(4);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 10:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(6);
+ senses_out.push_back(-1); senses_out.push_back(1);
+
+ break;
+ case 11:
+ surf_ids_out.push_back(4); surf_ids_out.push_back(5);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 12:
+ surf_ids_out.push_back(5); surf_ids_out.push_back(6);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ }
+
+}
+
https://bitbucket.org/fathomteam/moab/commits/53113cb2d2c0/
Changeset: 53113cb2d2c0
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Removed curve sense test from read_cgm_basic_test.
This was still there from before the creation of the new file read_cgm_senses_test where this function now lives.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 13f7bac..c43b365 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -40,7 +40,6 @@ void read_cube_curves_test();
void read_cube_surfs_test();
void read_cube_vols_test();
void read_cube_vertes_pos_test();
-void read_cube_curve_senses_test();
void delete_mesh_test();
@@ -48,7 +47,7 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_curve_senses_test );
+ result += RUN_TEST( read_cube_verts_test );
return result;
}
https://bitbucket.org/fathomteam/moab/commits/b8d03b7fd655/
Changeset: b8d03b7fd655
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Added a new test to check the sense loading of a simple cube geometry using READ_CGM.
Again, this new function read_cgm_surf_senses_test along with read_cgm_curve_senses_test needs some cleanup.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index f42abed..fcc2281 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -28,11 +28,11 @@ void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
-
+void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
// Functions used to compare sense information found in
// the model to reference information
-void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
std::vector<int> known_wrt_ids, std::vector<int> known_senses);
//Function used to get id's from entity handles
@@ -40,6 +40,7 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set );
// List of tests in this file
void read_cube_curve_senses_test();
+void read_cube_surf_senses_test();
void delete_mesh_test();
@@ -47,7 +48,7 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_curve_senses_test );
+ result += RUN_TEST( read_cube_surf_senses_test );
return result;
}
@@ -112,7 +113,7 @@ for(unsigned int i = 0; i < curves.size() ; i++)
known_senses.clear();
load_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
- check_curve_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
+ check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
}
}
@@ -130,7 +131,7 @@ ErrorCode rval;
return id;
}
-void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
std::vector<int> known_wrt_ids, std::vector<int> known_senses)
{
@@ -158,6 +159,7 @@ void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents
CHECK_EQUAL(leftovers, 0 );
}
+
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out ){
int curve_id = geom_id_by_handle( moab, curve);
@@ -231,3 +233,113 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
}
+
+
+
+///SURFACE SENSE CHECKING
+
+void read_cube_surf_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all curve handles
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of curves exist
+
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ CHECK_EQUAL(6 , number_of_curves);
+
+ // Get curve handles
+ Range surfs;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, surfs );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get curve data
+ moab::GeomTopoTool gt(mb, false);
+ std::vector<EntityHandle> vols;
+ std::vector<int> senses;
+ std::vector<int> known_vol_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < surfs.size() ; i++)
+ {
+
+ vols.clear();
+ senses.clear();
+ //Curve 1
+ gt.get_senses( surfs[i], vols, senses);
+ CHECK_ERR(rval);
+
+ //Load known curve-sense data
+
+ known_vol_ids.clear();
+ known_senses.clear();
+ load_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+
+ check_sense_data( mb, vols, senses, known_vol_ids, known_senses);
+ }
+
+}
+
+void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+
+ int surf_id = geom_id_by_handle( moab, surf);
+
+
+
+
+ switch(surf_id)
+ {
+ case 1:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ case 2:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+
+ case 3:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ case 4:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ case 5:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ case 6:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ }
+
+}
+
+
+
+
https://bitbucket.org/fathomteam/moab/commits/616f53a60bed/
Changeset: 616f53a60bed
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Cleaned up read_cgm_basic_tests.cpp.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index c43b365..23b2c72 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -127,11 +127,11 @@ void read_cube_surfs_test()
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
-
+
+ //Get geometry tag for pulling curve data from the mesh
Tag geom_tag;
-
- rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
Range curves;
@@ -140,10 +140,10 @@ void read_cube_surfs_test()
int number_of_surfs;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_surfs );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
- CHECK_EQUAL( 6, number_of_surfs);
+ CHECK_EQUAL( 6, number_of_surfs );
}
@@ -154,11 +154,12 @@ void read_cube_vols_test()
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
-
+
+ //Get geometry tag for pulling curve data from the mesh
Tag geom_tag;
- rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR(rval);
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR( rval );
Range curves;
int dim = 3;
@@ -166,10 +167,10 @@ void read_cube_vols_test()
int number_of_vols;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_vols );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
- CHECK_EQUAL( 1, number_of_vols);
+ CHECK_EQUAL( 1, number_of_vols );
}
@@ -184,64 +185,64 @@ void read_cube_vertex_pos_test()
//First check that the correct number of vertices are present
int number_of_verts;
- rval = mb->get_number_entities_by_type( 0 , MBVERTEX , number_of_verts);
- CHECK_ERR(rval);
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
+ CHECK_ERR( rval );
- CHECK_EQUAL(8, number_of_verts);
+ CHECK_EQUAL( 8, number_of_verts );
//Retrieve all vertex handles from the mesh
Range verts;
- rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
- CHECK_ERR(rval);
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR( rval );
//Get the vertex coordinates
double x[verts.size()];
double y[verts.size()];
double z[verts.size()];
- rval = mb-> get_coords( verts, &x[0], &y[0], &z[0]);
- CHECK_ERR(rval);
+ rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
+ CHECK_ERR( rval );
//Check against known locations of the vertices
// Vertex 1
- CHECK_EQUAL( x[0], 5);
- CHECK_EQUAL( y[0], -5);
- CHECK_EQUAL( z[0], 5);
+ CHECK_EQUAL( x[0], 5 );
+ CHECK_EQUAL( y[0], -5 );
+ CHECK_EQUAL( z[0], 5 );
// Vertex 2
- CHECK_EQUAL( x[1], 5);
- CHECK_EQUAL( y[1], 5);
- CHECK_EQUAL( z[1], 5);
+ CHECK_EQUAL( x[1], 5 );
+ CHECK_EQUAL( y[1], 5 );
+ CHECK_EQUAL( z[1], 5 );
// Vertex 3
- CHECK_EQUAL( x[2], -5);
- CHECK_EQUAL( y[2], 5);
- CHECK_EQUAL( z[2], 5);
+ CHECK_EQUAL( x[2], -5 );
+ CHECK_EQUAL( y[2], 5 );
+ CHECK_EQUAL( z[2], 5 );
// Vertex 4
- CHECK_EQUAL( x[3], -5);
- CHECK_EQUAL( y[3], -5);
- CHECK_EQUAL( z[3], 5);
+ CHECK_EQUAL( x[3], -5 );
+ CHECK_EQUAL( y[3], -5 );
+ CHECK_EQUAL( z[3], 5 );
// Vertex 5
- CHECK_EQUAL( x[4], 5);
- CHECK_EQUAL( y[4], 5);
- CHECK_EQUAL( z[4], -5);
+ CHECK_EQUAL( x[4], 5 );
+ CHECK_EQUAL( y[4], 5 );
+ CHECK_EQUAL( z[4], -5 );
// Vertex 6
- CHECK_EQUAL( x[5], 5);
- CHECK_EQUAL( y[5], -5);
- CHECK_EQUAL( z[5], -5);
+ CHECK_EQUAL( x[5], 5 );
+ CHECK_EQUAL( y[5], -5 );
+ CHECK_EQUAL( z[5], -5 );
// Vertex 7
- CHECK_EQUAL( x[6], -5);
- CHECK_EQUAL( y[6], -5);
- CHECK_EQUAL( z[6], -5);
+ CHECK_EQUAL( x[6], -5 );
+ CHECK_EQUAL( y[6], -5 );
+ CHECK_EQUAL( z[6], -5 );
// Vertex 8
- CHECK_EQUAL( x[7], -5);
- CHECK_EQUAL( y[7], 5);
- CHECK_EQUAL( z[7], -5);
+ CHECK_EQUAL( x[7], -5 );
+ CHECK_EQUAL( y[7], 5 );
+ CHECK_EQUAL( z[7], -5 );
}
@@ -253,10 +254,10 @@ void delete_mesh_test()
ErrorCode rval;
+ //Get geometry tag for pulling curve data from the mesh
Tag geom_tag;
-
- rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
Range geom_sets[4];
@@ -266,7 +267,7 @@ void delete_mesh_test()
void *val[] = {&dim};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, geom_sets[dim] );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
if( geom_sets[dim].size() == 0 ) std::cout << "Warning: No geom sets to begin with" << std::endl;
@@ -280,11 +281,11 @@ void delete_mesh_test()
void *val_after[] = {&dim};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val_after, 1, geom_sets_after[dim] );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
if( 0 != geom_sets_after[dim].size() ) rval = MB_FAILURE;
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
}
}
https://bitbucket.org/fathomteam/moab/commits/4f40271e3ba4/
Changeset: 4f40271e3ba4
Branch: None
User: pshriwise
Date: 2014-02-14 01:07:51
Summary: Clean up of read_cgm_senses_test.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index fcc2281..aa11cae 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -33,7 +33,7 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
// the model to reference information
void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
- std::vector<int> known_wrt_ids, std::vector<int> known_senses);
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses );
//Function used to get id's from entity handles
int geom_id_by_handle( Interface* moab, const EntityHandle set );
@@ -57,7 +57,7 @@ int main(int /* argc */, char** /* argv */)
void read_file( Interface* moab, const char* input_file )
{
ErrorCode rval = moab->load_file( input_file );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
}
void read_cube_curve_senses_test()
@@ -73,7 +73,7 @@ void read_cube_curve_senses_test()
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
// Check that the proper number of curves exist
@@ -82,17 +82,17 @@ void read_cube_curve_senses_test()
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
- CHECK_ERR(rval);
- CHECK_EQUAL(12 , number_of_curves);
+ CHECK_ERR( rval );
+ CHECK_EQUAL( 12 , number_of_curves );
// Get curve handles
Range curves;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, curves );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
// Establish GeomTopoTool instance needed to get curve data
- moab::GeomTopoTool gt(mb, false);
+ moab::GeomTopoTool gt( mb, false );
std::vector<EntityHandle> surfs;
std::vector<int> senses;
std::vector<int> known_surf_ids;
@@ -100,17 +100,18 @@ void read_cube_curve_senses_test()
for(unsigned int i = 0; i < curves.size() ; i++)
{
-
- surfs.clear();
- senses.clear();
- //Curve 1
- gt.get_senses( curves[i], surfs, senses);
- CHECK_ERR(rval);
- //Load known curve-sense data
+ //Clean data from previous curve
+ surfs.clear();
+ senses.clear();
+ //Get sense info for the current curve
+ gt.get_senses( curves[i], surfs, senses);
+ CHECK_ERR(rval);
+ //Clear reference data from previous curve
known_surf_ids.clear();
known_senses.clear();
+ //Load known curve-sense data
load_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
@@ -119,52 +120,58 @@ for(unsigned int i = 0; i < curves.size() ; i++)
}
-int geom_id_by_handle( Interface* moab, const EntityHandle set ) {
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
-ErrorCode rval;
+ ErrorCode rval;
+
Tag id_tag;
- rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE);
- assert(MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result);
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
- assert(MB_SUCCESS == result);
+ CHECK_ERR( rval );
return id;
}
void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
- std::vector<int> known_wrt_ids, std::vector<int> known_senses)
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses )
{
+ //Get ID's of the wrt entities
std::vector<int> wrt_ent_ids;
- for( unsigned int i=0 ; i<wrt_ents.size() ; i++)
+ for( unsigned int i=0 ; i<wrt_ents.size() ; i++ )
{
- wrt_ent_ids.push_back(geom_id_by_handle(moab, wrt_ents[i]));
+ wrt_ent_ids.push_back( geom_id_by_handle( moab, wrt_ents[i] ));
}
- for (unsigned int i=0; i< wrt_ent_ids.size() ; i++)
+ for ( unsigned int i=0; i< wrt_ent_ids.size() ; i++ )
{
- for(unsigned int j=0; j< known_wrt_ids.size(); j++)
+ for( unsigned int j=0; j< known_wrt_ids.size(); j++ )
{
- if(wrt_ent_ids[i] == known_wrt_ids [j])
+ if( wrt_ent_ids[i] == known_wrt_ids [j] )
{
- CHECK_EQUAL(senses[i],known_senses[j]);
- known_wrt_ids.erase(known_wrt_ids.begin()+j);
- known_senses.erase(known_senses.begin()+j);
+ // Make sure the senses of the matching wrt entities
+ // are correct
+ CHECK_EQUAL( senses[i],known_senses[j] );
+ //Once a wrt entity is matched with a known entity,
+ // remove it from the list
+ known_wrt_ids.erase( known_wrt_ids.begin()+j );
+ known_senses.erase( known_senses.begin()+j );
}
}
}
+ // After both loops are complete, known_wrt_ents should be empty
int leftovers = known_wrt_ids.size();
-
- CHECK_EQUAL(leftovers, 0 );
+ CHECK_EQUAL( leftovers, 0 );
}
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out ){
- int curve_id = geom_id_by_handle( moab, curve);
-
- std::cout << curve_id << std::endl;
+ int curve_id = geom_id_by_handle( moab, curve );
switch(curve_id)
@@ -233,11 +240,7 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
}
-
-
-
///SURFACE SENSE CHECKING
-
void read_cube_surf_senses_test()
{
ErrorCode rval;
@@ -246,62 +249,59 @@ void read_cube_surf_senses_test()
Interface* mb = &moab;
read_file( mb, input_cube );
- //Get all curve handles
+ //Get geometry tag for gathering surface information from the mesh
Tag geom_tag;
-
- rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR(rval);
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR( rval );
// Check that the proper number of curves exist
-
int dim = 2;
void *val[] = {&dim};
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
- CHECK_ERR(rval);
- CHECK_EQUAL(6 , number_of_curves);
+ CHECK_ERR( rval );
+ CHECK_EQUAL( 6, number_of_curves );
// Get curve handles
Range surfs;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, surfs );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
// Establish GeomTopoTool instance needed to get curve data
- moab::GeomTopoTool gt(mb, false);
+ moab::GeomTopoTool gt( mb, false );
std::vector<EntityHandle> vols;
std::vector<int> senses;
std::vector<int> known_vol_ids;
std::vector<int> known_senses;
-for(unsigned int i = 0; i < surfs.size() ; i++)
+for( unsigned int i = 0; i < surfs.size() ; i++ )
{
-
- vols.clear();
- senses.clear();
- //Curve 1
- gt.get_senses( surfs[i], vols, senses);
- CHECK_ERR(rval);
-
- //Load known curve-sense data
-
+ //Clean data from previous surface
+ vols.clear();
+ senses.clear();
+ // Get sense information for the current
+ // surface from the mesh
+ gt.get_senses( surfs[i], vols, senses);
+ CHECK_ERR(rval);
+
+ //Load known curve-sense data
known_vol_ids.clear();
known_senses.clear();
load_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
-
+ // Check sense information from the loaded mesh against
+ // reference sense information
check_sense_data( mb, vols, senses, known_vol_ids, known_senses);
+
}
}
void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
- int surf_id = geom_id_by_handle( moab, surf);
-
-
-
+ int surf_id = geom_id_by_handle( moab, surf );
switch(surf_id)
{
@@ -329,17 +329,12 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
case 5:
vol_ids_out.push_back(1);
senses_out.push_back(1);
-
break;
case 6:
vol_ids_out.push_back(1);
senses_out.push_back(1);
-
break;
}
}
-
-
-
https://bitbucket.org/fathomteam/moab/commits/ae3fb718fcdc/
Changeset: ae3fb718fcdc
Branch: None
User: pshriwise
Date: 2014-02-14 01:10:44
Summary: Added cgm flags to read_cgm_basic_test
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index bb9eb9a..e854a2e 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -16,7 +16,7 @@
#pragma warning(disable:4786)
#endif
-#include "cgm_version.h"
+//#include "cgm_version.h"
#include "GeometryQueryTool.hpp"
#include "ModelQueryEngine.hpp"
#include "RefEntityName.hpp"
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 23b2c72..a23f4e9 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -8,6 +8,8 @@
#include "Internals.hpp"
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
using namespace moab;
@@ -56,6 +58,8 @@ int main(int /* argc */, char** /* argv */)
void read_file( Interface* moab, const char* input_file )
{
+ InitCGMA::initialize_cgma();
+
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
}
https://bitbucket.org/fathomteam/moab/commits/da0546b2ad37/
Changeset: da0546b2ad37
Branch: None
User: pshriwise
Date: 2014-02-14 01:10:44
Summary: Finished fix for building ReadCGM tests with linked CGM libs.
Affected #: 3 files
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index 31049a1..4389075 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -73,7 +73,9 @@ ccmio_test_SOURCES = $(srcdir)/../TestUtil.hpp ccmio_test.cpp
read_cgm_load_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_load_test.cpp
read_cgm_load_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS)
read_cgm_basic_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_basic_test.cpp
-read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS)
+read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_senses_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_senses_test.cpp
+read_cgm_senses_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
readutil_test_SOURCES = $(srcdir)/../TestUtil.hpp readutil_test.cpp
cgns_test_SOURCES=$(srcdir)/../TestUtil.hpp cgns_test.cpp
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index a23f4e9..fb9d796 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -59,6 +59,7 @@ int main(int /* argc */, char** /* argv */)
void read_file( Interface* moab, const char* input_file )
{
InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index aa11cae..9fa9cd9 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -9,6 +9,9 @@
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
#include "moab/GeomTopoTool.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+
using namespace moab;
#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
@@ -49,13 +52,17 @@ int main(int /* argc */, char** /* argv */)
int result = 0;
result += RUN_TEST( read_cube_surf_senses_test );
-
+
return result;
}
void read_file( Interface* moab, const char* input_file )
{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR( rval );
}
https://bitbucket.org/fathomteam/moab/commits/a8042f20a9a1/
Changeset: a8042f20a9a1
Branch: None
User: pshriwise
Date: 2014-02-14 01:10:44
Summary: Added all tests back into the read_cgm test files after fixing problems with the CGM instance's persistent geometry.
Affected #: 2 files
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index fb9d796..0211b1f 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -39,18 +39,24 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void read_cube_verts_test();
void read_cube_curves_test();
+void read_cube_tris_test();
void read_cube_surfs_test();
void read_cube_vols_test();
-void read_cube_vertes_pos_test();
+void read_cube_vertex_pos_test();
void delete_mesh_test();
int main(int /* argc */, char** /* argv */)
{
int result = 0;
-
+
+ result += RUN_TEST( read_cube_vertex_pos_test );
result += RUN_TEST( read_cube_verts_test );
-
+ result += RUN_TEST( read_cube_curves_test );
+ result += RUN_TEST( read_cube_tris_test );
+ result += RUN_TEST( read_cube_surfs_test );
+ result += RUN_TEST( read_cube_vols_test );
+
return result;
}
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 9fa9cd9..3b0072e 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -51,6 +51,7 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
+ result += RUN_TEST( read_cube_curve_senses_test );
result += RUN_TEST( read_cube_surf_senses_test );
return result;
@@ -62,7 +63,6 @@ void read_file( Interface* moab, const char* input_file )
InitCGMA::initialize_cgma();
GeometryQueryTool::instance()->delete_geometry();
-
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR( rval );
}
https://bitbucket.org/fathomteam/moab/commits/66ea188993d2/
Changeset: 66ea188993d2
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Updated the ReadCGM test for vertex positions so it doesn't rely on a load order.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 0211b1f..55bbe43 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -50,12 +50,12 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_vertex_pos_test );
result += RUN_TEST( read_cube_verts_test );
result += RUN_TEST( read_cube_curves_test );
result += RUN_TEST( read_cube_tris_test );
result += RUN_TEST( read_cube_surfs_test );
result += RUN_TEST( read_cube_vols_test );
+ result += RUN_TEST( read_cube_vertex_pos_test );
return result;
}
@@ -215,45 +215,71 @@ void read_cube_vertex_pos_test()
//Check against known locations of the vertices
+ std::vector<double> x_ref;
+ std::vector<double> y_ref;
+ std::vector<double> z_ref;
+
// Vertex 1
- CHECK_EQUAL( x[0], 5 );
- CHECK_EQUAL( y[0], -5 );
- CHECK_EQUAL( z[0], 5 );
+
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
// Vertex 2
- CHECK_EQUAL( x[1], 5 );
- CHECK_EQUAL( y[1], 5 );
- CHECK_EQUAL( z[1], 5 );
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
// Vertex 3
- CHECK_EQUAL( x[2], -5 );
- CHECK_EQUAL( y[2], 5 );
- CHECK_EQUAL( z[2], 5 );
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
// Vertex 4
- CHECK_EQUAL( x[3], -5 );
- CHECK_EQUAL( y[3], -5 );
- CHECK_EQUAL( z[3], 5 );
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
// Vertex 5
- CHECK_EQUAL( x[4], 5 );
- CHECK_EQUAL( y[4], 5 );
- CHECK_EQUAL( z[4], -5 );
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
// Vertex 6
- CHECK_EQUAL( x[5], 5 );
- CHECK_EQUAL( y[5], -5 );
- CHECK_EQUAL( z[5], -5 );
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
// Vertex 7
- CHECK_EQUAL( x[6], -5 );
- CHECK_EQUAL( y[6], -5 );
- CHECK_EQUAL( z[6], -5 );
-
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
// Vertex 8
- CHECK_EQUAL( x[7], -5 );
- CHECK_EQUAL( y[7], 5 );
- CHECK_EQUAL( z[7], -5 );
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+
+ std::cout << verts.size() << std::endl;
+ std::cout << x_ref.size() << std::endl;
+
+ for (unsigned int i=0; i<verts.size(); i++)
+ {
+ for (unsigned int j=0; j<x_ref.size(); j++)
+ {
+ if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j])
+ {
+ x_ref.erase( x_ref.begin()+j );
+ y_ref.erase( y_ref.begin()+j );
+ z_ref.erase( z_ref.begin()+j );
+
+ }
+ }
+ }
+
+ int leftovers = x_ref.size();
+ CHECK_EQUAL(0, leftovers );
}
https://bitbucket.org/fathomteam/moab/commits/77e8fefa7942/
Changeset: 77e8fefa7942
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Added a function set_options to ReadCGM.
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index e854a2e..bc56c08 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -114,6 +114,48 @@ ErrorCode ReadCGM::read_tag_values( const char* /* file_name */,
return MB_NOT_IMPLEMENTED;
}
+//Sets options passed into ReadCGM::load_file
+ErrorCode ReadCGM::set_options( const FileOptions& opts,
+ int& norm_tol,
+ double& faceting_tol,
+ double& len_tol,
+ bool& act_att,
+ bool& verbose_warnings)
+{
+
+ ErrorCode rval;
+
+ //Default Values
+ int DEFAULT_NORM = 5;
+ double DEFAULT_FACET_TOL = 0.001;
+ double DEFAULT_LEN_TOL = 0.0;
+ act_att = true;
+
+ //check for the options.
+ if (MB_SUCCESS != opts.get_int_option( "FACET_NORMAL_TOLERANCE", norm_tol ))
+ norm_tol = DEFAULT_NORM;
+
+ if (MB_SUCCESS != opts.get_real_option("FACET_DISTANCE_TOLERANCE", faceting_tol))
+ faceting_tol = DEFAULT_FACET_TOL;
+
+ if (MB_SUCCESS != opts.get_real_option("MAX_FACET_EDGE_LENGTH", len_tol))
+ len_tol = DEFAULT_LEN_TOL;
+
+
+ if (MB_SUCCESS == opts.get_null_option("VERBOSE_CGM_WARNINGS"))
+ verbose_warnings = true;
+
+ const char* name = "CGM_ATTRIBS";
+ const char* value = "no";
+ rval = opts.match_option(name,value);
+ if(MB_SUCCESS == rval)
+ act_att = false;
+
+
+
+ return MB_SUCCESS;
+}
+
// copy geometry into mesh database
@@ -132,8 +174,16 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
}
int norm_tol, DEFAULT_NORM = 5;
- double faceting_tol, DEFAULT_FACET_TOL = 0.001, len_tol, DEFAULT_LEN_TOL = 0.0;
+ double faceting_tol, DEFAULT_FACET_TOL = 0.001;
+ double len_tol, DEFAULT_LEN_TOL = 0.0;
bool act_att = true;
+ bool verbose_warnings = false;
+
+ rval = set_options( opts, norm_tol, faceting_tol, len_tol, act_att, verbose_warnings);
+
+
+
+ /*
//check for the options.
if (MB_SUCCESS != opts.get_int_option( "FACET_NORMAL_TOLERANCE", norm_tol ))
norm_tol = DEFAULT_NORM;
@@ -144,7 +194,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
if (MB_SUCCESS != opts.get_real_option("MAX_FACET_EDGE_LENGTH", len_tol))
len_tol = DEFAULT_LEN_TOL;
- bool verbose_warnings = false;
+
if (MB_SUCCESS == opts.get_null_option("VERBOSE_CGM_WARNINGS"))
verbose_warnings = true;
@@ -153,6 +203,8 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
rval = opts.match_option(name,value);
if(MB_SUCCESS == rval)
act_att = false;
+ */
+
// always tag with the faceting_tol and geometry absolute resolution
// if file_set is defined, use that, otherwise (file_set == NULL) tag the interface
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 531bdd9..2919cce 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -70,6 +70,14 @@ public:
std::vector<int>& tag_values_out,
const SubsetList* subset_list = 0 );
+ ErrorCode set_options( const FileOptions& opts,
+ int& norm_tol,
+ double& faceting_tol,
+ double& len_tol,
+ bool& act_att,
+ bool& verbose_warnings);
+
+
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/593265a8c269/
Changeset: 593265a8c269
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Created new file for testing that ReadCGM is loading entities with the correct connectivity.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
new file mode 100644
index 0000000..cbd0849
--- /dev/null
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -0,0 +1,193 @@
+
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+#include "MBTagConventions.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+
+using namespace moab;
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+ std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+ << __LINE__ << std::endl; \
+ return A; } } while(false)
+
+
+#ifdef MESHDIR
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+#else
+static const char input_cube[] = "/io/cube.sat";
+#endif
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+void read_cube_tris_test();
+
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST( read_cube_verts_test );
+ result += RUN_TEST( read_cube_curves_test );
+ result += RUN_TEST( read_cube_tris_test );
+ result += RUN_TEST( read_cube_surfs_test );
+ result += RUN_TEST( read_cube_vols_test );
+ result += RUN_TEST( read_cube_vertex_pos_test );
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+void read_cube_tris_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ int number_of_tris;
+
+ rval = mb->get_number_entities_by_type(0, MBTRI , number_of_tris);
+ std::cout << "Number of Triangles = " << number_of_tris << std::endl;
+ CHECK_ERR(rval);
+
+ CHECK_EQUAL( 12, number_of_tris);
+
+}
+
+
+void read_cube_vertex_pos_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //First check that the correct number of vertices are present
+ int number_of_verts;
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
+ CHECK_ERR( rval );
+
+ CHECK_EQUAL( 8, number_of_verts );
+
+ //Retrieve all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR( rval );
+
+ //Get the vertex coordinates
+ double x[verts.size()];
+ double y[verts.size()];
+ double z[verts.size()];
+ rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
+ CHECK_ERR( rval );
+
+ //Check against known locations of the vertices
+
+ std::vector<double> x_ref;
+ std::vector<double> y_ref;
+ std::vector<double> z_ref;
+
+ // Vertex 1
+
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 2
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 3
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 4
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 5
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 6
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 7
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 8
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+
+ std::cout << verts.size() << std::endl;
+ std::cout << x_ref.size() << std::endl;
+
+ for (unsigned int i=0; i<verts.size(); i++)
+ {
+ for (unsigned int j=0; j<x_ref.size(); j++)
+ {
+ if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j])
+ {
+ x_ref.erase( x_ref.begin()+j );
+ y_ref.erase( y_ref.begin()+j );
+ z_ref.erase( z_ref.begin()+j );
+
+ }
+ }
+ }
+
+ int leftovers = x_ref.size();
+ CHECK_EQUAL(0, leftovers );
+
+}
+
+
+void read_cube_connectivity_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all triangles from the mesh
+ std::vector<EntityHandle> tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ CHECK_ERR(rval);
+
+}
https://bitbucket.org/fathomteam/moab/commits/c5b9601e6611/
Changeset: c5b9601e6611
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Removed non-existant test calls from read_cgm_connectivity_test.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index cbd0849..e297bfa 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -37,12 +37,7 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_verts_test );
- result += RUN_TEST( read_cube_curves_test );
- result += RUN_TEST( read_cube_tris_test );
- result += RUN_TEST( read_cube_surfs_test );
- result += RUN_TEST( read_cube_vols_test );
- result += RUN_TEST( read_cube_vertex_pos_test );
+
return result;
}
https://bitbucket.org/fathomteam/moab/commits/a72cecb90ca7/
Changeset: a72cecb90ca7
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Added read_cgm_connectivity_test to the MOAB make check system.
Affected #: 1 file
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index 4389075..e9a73b3 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -25,7 +25,7 @@ else
endif
if HAVE_CGM
- CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test
+ CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test read_cgm_connectivity_test
else
CGM_TEST =
endif
@@ -76,6 +76,8 @@ read_cgm_basic_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_basic_test.cpp
read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
read_cgm_senses_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_senses_test.cpp
read_cgm_senses_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_connectivity_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_connectivity_test.cpp
+read_cgm_connectivity_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
readutil_test_SOURCES = $(srcdir)/../TestUtil.hpp readutil_test.cpp
cgns_test_SOURCES=$(srcdir)/../TestUtil.hpp cgns_test.cpp
https://bitbucket.org/fathomteam/moab/commits/d6f966f14835/
Changeset: d6f966f14835
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Updates to read_cgm_connectivity_test
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index e297bfa..843f2db 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -30,14 +30,18 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void read_cube_tris_test();
+void read_cube_connectivity_test();
+//Function used to match triangle connectivity and verts
+void match_tri_connectivity( Range connectivity,
+ std::vector<EntityHandle> &reference_verts);
int main(int /* argc */, char** /* argv */)
{
int result = 0;
-
+ RUN_TEST(read_cube_connectivity_test);
return result;
}
@@ -180,9 +184,57 @@ void read_cube_connectivity_test()
Interface* mb = &moab;
read_file( mb, input_cube );
+ //Get all vertex handles from the mesh
+ std::vector<EntityHandle> verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
+ CHECK_ERR(rval);
+
+ //Duplicate the vertex handles to match the number of tris
+ //they should be connected to upon a correct load
+ std::vector<EntityHandle> ref_verts=verts;
+ int copy_count = 0;
+ while (copy_count<4)
+ {
+ copy(verts.begin(),verts.end(),back_inserter(ref_verts));
+ copy_count++;
+ }
+
+ //Make sure everything duplicated without a problem
+ if( ref_verts.size()!=40 ) CHECK_ERR(MB_FAILURE);
+
//Get all triangles from the mesh
- std::vector<EntityHandle> tris;
+ Range tris;
rval = mb->get_entities_by_type( 0, MBTRI, tris);
CHECK_ERR(rval);
+
+ //Test connectivity
+ for (Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get the connectivity of a triangle
+ Range connect;
+ rval = mb->get_connectivity( &(*i), 1, connect);
+ CHECK_ERR(rval);
+
+ match_tri_connectivity( connect, ref_verts);
+ std::cout << "ref_verts size = " << ref_verts.size() << std::endl;
+ }
+
+
+}
+
+void match_tri_connectivity( Range connectivity, std::vector<EntityHandle> &reference_verts)
+{
+
+ for(Range::const_iterator i=connectivity.begin(); i!=connectivity.end(); i++)
+ {
+
+ for(unsigned int j=0; j<reference_verts.size(); j++)
+ {
+
+ std::cout << "Triangle Vert Handle = " << *i << std::endl;
+ if( *i == reference_verts[j]) reference_verts.erase(reference_verts.begin()+j);
+
+ }
+ }
}
https://bitbucket.org/fathomteam/moab/commits/502684839b4c/
Changeset: 502684839b4c
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Removed commented lines in ReadCGM that have are performed by set_options.
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index bc56c08..55c5038 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -180,30 +180,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
bool verbose_warnings = false;
rval = set_options( opts, norm_tol, faceting_tol, len_tol, act_att, verbose_warnings);
-
-
-
- /*
- //check for the options.
- if (MB_SUCCESS != opts.get_int_option( "FACET_NORMAL_TOLERANCE", norm_tol ))
- norm_tol = DEFAULT_NORM;
- if (MB_SUCCESS != opts.get_real_option("FACET_DISTANCE_TOLERANCE", faceting_tol))
- faceting_tol = DEFAULT_FACET_TOL;
-
- if (MB_SUCCESS != opts.get_real_option("MAX_FACET_EDGE_LENGTH", len_tol))
- len_tol = DEFAULT_LEN_TOL;
-
-
- if (MB_SUCCESS == opts.get_null_option("VERBOSE_CGM_WARNINGS"))
- verbose_warnings = true;
-
- const char* name = "CGM_ATTRIBS";
- const char* value = "no";
- rval = opts.match_option(name,value);
- if(MB_SUCCESS == rval)
- act_att = false;
- */
// always tag with the faceting_tol and geometry absolute resolution
https://bitbucket.org/fathomteam/moab/commits/4886877cc809/
Changeset: 4886877cc809
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Added a new test to check that the cube vertices are connected reasonable numbers of triangles.
Updated int main so that it is properly connected to the testing framework.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 843f2db..8d5f103 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -30,18 +30,19 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void read_cube_tris_test();
-void read_cube_connectivity_test();
+void cube_verts_connectivity_test();
//Function used to match triangle connectivity and verts
-void match_tri_connectivity( Range connectivity,
- std::vector<EntityHandle> &reference_verts);
+//void match_tri_connectivity( Range connectivity,
+// std::vector<EntityHandle> &reference_verts);
int main(int /* argc */, char** /* argv */)
{
int result = 0;
- RUN_TEST(read_cube_connectivity_test);
+ result += RUN_TEST(cube_verts_connectivity_test);
+ result += RUN_TEST(read_cube_tris_test);
return result;
}
@@ -76,165 +77,34 @@ void read_cube_tris_test()
}
-void read_cube_vertex_pos_test()
+void cube_verts_connectivity_test()
{
-
- ErrorCode rval;
- //Open the test file
- Core moab;
- Interface* mb = &moab;
- read_file( mb, input_cube );
-
- //First check that the correct number of vertices are present
- int number_of_verts;
- rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
- CHECK_ERR( rval );
-
- CHECK_EQUAL( 8, number_of_verts );
-
- //Retrieve all vertex handles from the mesh
- Range verts;
- rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
- CHECK_ERR( rval );
-
- //Get the vertex coordinates
- double x[verts.size()];
- double y[verts.size()];
- double z[verts.size()];
- rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
- CHECK_ERR( rval );
-
- //Check against known locations of the vertices
-
- std::vector<double> x_ref;
- std::vector<double> y_ref;
- std::vector<double> z_ref;
-
- // Vertex 1
-
- x_ref.push_back( 5 );
- y_ref.push_back( -5 );
- z_ref.push_back( 5 );
-
- // Vertex 2
- x_ref.push_back( 5 );
- y_ref.push_back( 5 );
- z_ref.push_back( 5 );
-
- // Vertex 3
- x_ref.push_back( -5 );
- y_ref.push_back( 5 );
- z_ref.push_back( 5 );
-
- // Vertex 4
- x_ref.push_back( -5 );
- y_ref.push_back( -5 );
- z_ref.push_back( 5 );
-
- // Vertex 5
- x_ref.push_back( 5 );
- y_ref.push_back( 5 );
- z_ref.push_back( -5 );
-
- // Vertex 6
- x_ref.push_back( 5 );
- y_ref.push_back( -5 );
- z_ref.push_back( -5 );
-
- // Vertex 7
- x_ref.push_back( -5 );
- y_ref.push_back( -5 );
- z_ref.push_back( -5 );
-
- // Vertex 8
- x_ref.push_back( -5 );
- y_ref.push_back( 5 );
- z_ref.push_back( -5 );
-
-
- std::cout << verts.size() << std::endl;
- std::cout << x_ref.size() << std::endl;
-
- for (unsigned int i=0; i<verts.size(); i++)
- {
- for (unsigned int j=0; j<x_ref.size(); j++)
- {
- if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j])
- {
- x_ref.erase( x_ref.begin()+j );
- y_ref.erase( y_ref.begin()+j );
- z_ref.erase( z_ref.begin()+j );
-
- }
- }
- }
-
- int leftovers = x_ref.size();
- CHECK_EQUAL(0, leftovers );
-}
-
-
-void read_cube_connectivity_test()
-{
-
- ErrorCode rval;
+ ErrorCode rval;
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube );
+ read_file( mb, input_cube);
//Get all vertex handles from the mesh
- std::vector<EntityHandle> verts;
+ Range verts;
rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
CHECK_ERR(rval);
-
- //Duplicate the vertex handles to match the number of tris
- //they should be connected to upon a correct load
- std::vector<EntityHandle> ref_verts=verts;
- int copy_count = 0;
- while (copy_count<4)
- {
- copy(verts.begin(),verts.end(),back_inserter(ref_verts));
- copy_count++;
- }
-
- //Make sure everything duplicated without a problem
- if( ref_verts.size()!=40 ) CHECK_ERR(MB_FAILURE);
- //Get all triangles from the mesh
- Range tris;
- rval = mb->get_entities_by_type( 0, MBTRI, tris);
- CHECK_ERR(rval);
+ //Check that each vertex connects to less than 4 triangles and no more than 6
-
- //Test connectivity
- for (Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ for(Range::const_iterator i = verts.begin(); i!=verts.end(); i++)
{
- //Get the connectivity of a triangle
- Range connect;
- rval = mb->get_connectivity( &(*i), 1, connect);
+ std::vector<EntityHandle> adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
CHECK_ERR(rval);
-
- match_tri_connectivity( connect, ref_verts);
- std::cout << "ref_verts size = " << ref_verts.size() << std::endl;
- }
-
-
-}
-
-void match_tri_connectivity( Range connectivity, std::vector<EntityHandle> &reference_verts)
-{
- for(Range::const_iterator i=connectivity.begin(); i!=connectivity.end(); i++)
- {
+ int adj_size = adj_tris.size();
- for(unsigned int j=0; j<reference_verts.size(); j++)
- {
+ CHECK( adj_size >= 4 && adj_size <= 6);
- std::cout << "Triangle Vert Handle = " << *i << std::endl;
- if( *i == reference_verts[j]) reference_verts.erase(reference_verts.begin()+j);
-
- }
}
+
+
}
+
https://bitbucket.org/fathomteam/moab/commits/a015b4b9c416/
Changeset: a015b4b9c416
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Corrected formatting in read_cgm_senses_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 3b0072e..9b3f038 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -32,9 +32,9 @@ void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+
// Functions used to compare sense information found in
// the model to reference information
-
void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
std::vector<int> known_wrt_ids, std::vector<int> known_senses );
https://bitbucket.org/fathomteam/moab/commits/e91a151bf5c6/
Changeset: e91a151bf5c6
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Added a test to ensure that each triangle in the loaded file is adjacent to 3 other triangles.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 8d5f103..686ebaa 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -10,7 +10,7 @@
#include "MBTagConventions.hpp"
#include "InitCGMA.hpp"
#include "GeometryQueryTool.hpp"
-
+#include "moab/MeshTopoUtil.hpp"
using namespace moab;
#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
@@ -31,6 +31,7 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void read_cube_tris_test();
void cube_verts_connectivity_test();
+void cube_tris_connectivity_test();
//Function used to match triangle connectivity and verts
//void match_tri_connectivity( Range connectivity,
@@ -43,6 +44,7 @@ int main(int /* argc */, char** /* argv */)
result += RUN_TEST(cube_verts_connectivity_test);
result += RUN_TEST(read_cube_tris_test);
+ result += RUN_TEST(cube_tris_connectivity_test);
return result;
}
@@ -100,11 +102,34 @@ void cube_verts_connectivity_test()
CHECK_ERR(rval);
int adj_size = adj_tris.size();
-
CHECK( adj_size >= 4 && adj_size <= 6);
-
}
+}
+
+void cube_tris_connectivity_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube);
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ CHECK_ERR(rval);
+
+
+ for(Range::const_iterator i = tris.begin()+1; i!=tris.end(); i++)
+ {
+ Range adj_tris;
+ moab::MeshTopoUtil mu(mb);
+ rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris);
+ CHECK_ERR(rval);
+ int number_of_adj_tris=adj_tris.size();
+ CHECK_EQUAL( 3, number_of_adj_tris);
+ }
}
https://bitbucket.org/fathomteam/moab/commits/83f8b9da56cb/
Changeset: 83f8b9da56cb
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Removed read_cube_tris_test from the connectivity test file.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 686ebaa..651f635 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -29,7 +29,6 @@ static const char input_cube[] = "/io/cube.sat";
void read_file( Interface* moab, const char* input_file );
// List of tests in this file
-void read_cube_tris_test();
void cube_verts_connectivity_test();
void cube_tris_connectivity_test();
@@ -43,7 +42,6 @@ int main(int /* argc */, char** /* argv */)
int result = 0;
result += RUN_TEST(cube_verts_connectivity_test);
- result += RUN_TEST(read_cube_tris_test);
result += RUN_TEST(cube_tris_connectivity_test);
return result;
@@ -60,25 +58,6 @@ void read_file( Interface* moab, const char* input_file )
CHECK_ERR(rval);
}
-void read_cube_tris_test()
-{
- ErrorCode rval;
- //Open the test file
- Core moab;
- Interface* mb = &moab;
- read_file( mb, input_cube );
-
- int number_of_tris;
-
- rval = mb->get_number_entities_by_type(0, MBTRI , number_of_tris);
- std::cout << "Number of Triangles = " << number_of_tris << std::endl;
- CHECK_ERR(rval);
-
- CHECK_EQUAL( 12, number_of_tris);
-
-}
-
-
void cube_verts_connectivity_test()
{
https://bitbucket.org/fathomteam/moab/commits/18f8435d6fa8/
Changeset: 18f8435d6fa8
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Removed deprecated and commented test prototype.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 651f635..f82d8cd 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -32,10 +32,6 @@ void read_file( Interface* moab, const char* input_file );
void cube_verts_connectivity_test();
void cube_tris_connectivity_test();
-//Function used to match triangle connectivity and verts
-//void match_tri_connectivity( Range connectivity,
-// std::vector<EntityHandle> &reference_verts);
-
int main(int /* argc */, char** /* argv */)
{
https://bitbucket.org/fathomteam/moab/commits/62b903bdb191/
Changeset: 62b903bdb191
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Added a test for triangle-edge coincidence in the case of a cube read by ReadCGM
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index f82d8cd..903dfcb 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -31,7 +31,10 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void cube_verts_connectivity_test();
void cube_tris_connectivity_test();
+void cube_tri_curve_coincidence_test();
+//Other functions
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves);
int main(int /* argc */, char** /* argv */)
{
@@ -39,6 +42,7 @@ int main(int /* argc */, char** /* argv */)
result += RUN_TEST(cube_verts_connectivity_test);
result += RUN_TEST(cube_tris_connectivity_test);
+ result += RUN_TEST(cube_tri_curve_coincidence_test);
return result;
}
@@ -84,7 +88,7 @@ void cube_verts_connectivity_test()
void cube_tris_connectivity_test()
{
- ErrorCode rval;
+ ErrorCode rval;
//Open the test file
Core moab;
Interface* mb = &moab;
@@ -108,3 +112,58 @@ void cube_tris_connectivity_test()
}
+void cube_tri_curve_coincidence_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube);
+
+ //Get curves from the mesh
+ Range curves;
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves);
+ CHECK_ERR(rval);
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get the any curve edges that are a part of the triangle
+ Range tri_edges;
+ rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges);
+ CHECK_ERR(rval);
+
+ int num_of_tri_edges = tri_edges.size();
+ CHECK_EQUAL(2, num_of_tri_edges);
+ rval = match_tri_edges_w_curve( mb, tri_edges, curves);
+ CHECK_ERR(rval);
+
+ }
+
+}
+
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves)
+{
+
+ ErrorCode rval;
+ int match_counter;
+ std::cout << "Size of curves = " << curves.size() << std::endl;
+ for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
+ {
+ for(Range::const_iterator j=curves.begin(); j!=curves.end(); j++)
+ {
+ std::cout << "Tri edge ID = " << *i << std::endl;
+ std::cout << "Curve edge ID = " << *j << std::endl;
+ if( *i == *j ) match_counter++;
+ }
+ }
+
+ int num_of_tri_edges = tri_edges.size();
+ CHECK_EQUAL( num_of_tri_edges, match_counter );
+ return MB_SUCCESS;
+}
https://bitbucket.org/fathomteam/moab/commits/4333cf5321f9/
Changeset: 4333cf5321f9
Branch: None
User: pshriwise
Date: 2014-02-14 01:11:21
Summary: Added a test to read_cgm_connectivity_test to ensure that each triangle has three different vertices.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 903dfcb..4d4bebf 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -32,6 +32,8 @@ void read_file( Interface* moab, const char* input_file );
void cube_verts_connectivity_test();
void cube_tris_connectivity_test();
void cube_tri_curve_coincidence_test();
+void cube_edge_adjacencies_test();
+void cube_tri_vertex_test();
//Other functions
ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves);
@@ -43,6 +45,8 @@ int main(int /* argc */, char** /* argv */)
result += RUN_TEST(cube_verts_connectivity_test);
result += RUN_TEST(cube_tris_connectivity_test);
result += RUN_TEST(cube_tri_curve_coincidence_test);
+ result += RUN_TEST(cube_tri_curve_coincidence_test);
+ result += RUN_TEST(cube_tri_vertex_test);
return result;
}
@@ -167,3 +171,59 @@ ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curve
CHECK_EQUAL( num_of_tri_edges, match_counter );
return MB_SUCCESS;
}
+
+void cube_edge_adjacencies_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube);
+
+ //Get the curves
+ Range curves;
+ rval = mb->get_entities_by_type(0, MBEDGE, curves);
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=curves.begin(); i!=curves.end(); i++)
+ {
+ //Get triangle adjacent to each edge
+ Range adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris);
+ CHECK_ERR(rval);
+
+ int num_adj_tris = adj_tris.size();
+ //Ensure that an edge isn't adjacent to more than two triangles
+ CHECK( num_adj_tris <= 2);
+ }
+
+}
+
+void cube_tri_vertex_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube);
+
+ //Get all triangles
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get all triangle vertices
+ Range verts;
+ rval = mb->get_connectivity( &(*i), 1, verts);
+ CHECK_ERR(rval);
+
+ int number_of_verts = verts.size();
+ CHECK( 3 == number_of_verts);
+ CHECK(verts[0]!=verts[1]);
+ CHECK(verts[1]!=verts[2]);
+ CHECK(verts[2]!=verts[0]);
+ }
+
+}
https://bitbucket.org/fathomteam/moab/commits/097a292213a1/
Changeset: 097a292213a1
Branch: None
User: pshriwise
Date: 2014-02-14 01:12:05
Summary: Added an error check to the new function set_options and removed commented code.
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 55c5038..aa5d972 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -180,8 +180,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
bool verbose_warnings = false;
rval = set_options( opts, norm_tol, faceting_tol, len_tol, act_att, verbose_warnings);
-
-
+ if(MB_SUCCESS != rval) return rval;
// always tag with the faceting_tol and geometry absolute resolution
// if file_set is defined, use that, otherwise (file_set == NULL) tag the interface
https://bitbucket.org/fathomteam/moab/commits/01ea84f470e5/
Changeset: 01ea84f470e5
Branch: None
User: pshriwise
Date: 2014-02-14 01:12:05
Summary: Added a check that all entities in cube_tris_connectivity_test are triangles and removed deprecated print outs.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 4d4bebf..65e8237 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -108,10 +108,18 @@ void cube_tris_connectivity_test()
{
Range adj_tris;
moab::MeshTopoUtil mu(mb);
+ //Use Triangle edges to get all adjacent triangles
rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris);
CHECK_ERR(rval);
int number_of_adj_tris=adj_tris.size();
CHECK_EQUAL( 3, number_of_adj_tris);
+
+ //Check that the entities we found from bridge_adjacencies
+ //are triangles
+ Range adj_tri_test = adj_tris.subset_by_type(MBTRI);
+ int number_tris_in_adj_tris = adj_tri_test.size();
+ CHECK_EQUAL( number_of_adj_tris, number_tris_in_adj_tris);
+
}
}
@@ -155,14 +163,11 @@ ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curve
{
ErrorCode rval;
- int match_counter;
- std::cout << "Size of curves = " << curves.size() << std::endl;
+ int match_counter=0;
for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
{
for(Range::const_iterator j=curves.begin(); j!=curves.end(); j++)
{
- std::cout << "Tri edge ID = " << *i << std::endl;
- std::cout << "Curve edge ID = " << *j << std::endl;
if( *i == *j ) match_counter++;
}
}
https://bitbucket.org/fathomteam/moab/commits/1769209e741a/
Changeset: 1769209e741a
Branch: None
User: pshriwise
Date: 2014-02-14 01:12:05
Summary: Formatting corrections for read_cgm_connectivity_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 65e8237..7137666 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -36,7 +36,7 @@ void cube_edge_adjacencies_test();
void cube_tri_vertex_test();
//Other functions
-ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves);
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves );
int main(int /* argc */, char** /* argv */)
{
@@ -69,11 +69,11 @@ void cube_verts_connectivity_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get all vertex handles from the mesh
Range verts;
- rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
CHECK_ERR(rval);
//Check that each vertex connects to less than 4 triangles and no more than 6
@@ -85,7 +85,7 @@ void cube_verts_connectivity_test()
CHECK_ERR(rval);
int adj_size = adj_tris.size();
- CHECK( adj_size >= 4 && adj_size <= 6);
+ CHECK( adj_size >= 4 && adj_size <= 6 );
}
}
@@ -96,11 +96,11 @@ void cube_tris_connectivity_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get triangles from the mesh
Range tris;
- rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
CHECK_ERR(rval);
@@ -109,16 +109,16 @@ void cube_tris_connectivity_test()
Range adj_tris;
moab::MeshTopoUtil mu(mb);
//Use Triangle edges to get all adjacent triangles
- rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris);
+ rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris );
CHECK_ERR(rval);
int number_of_adj_tris=adj_tris.size();
- CHECK_EQUAL( 3, number_of_adj_tris);
+ CHECK_EQUAL( 3, number_of_adj_tris );
//Check that the entities we found from bridge_adjacencies
//are triangles
- Range adj_tri_test = adj_tris.subset_by_type(MBTRI);
+ Range adj_tri_test = adj_tris.subset_by_type( MBTRI );
int number_tris_in_adj_tris = adj_tri_test.size();
- CHECK_EQUAL( number_of_adj_tris, number_tris_in_adj_tris);
+ CHECK_EQUAL( number_of_adj_tris, number_tris_in_adj_tris );
}
@@ -131,35 +131,35 @@ void cube_tri_curve_coincidence_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get curves from the mesh
Range curves;
- rval = mb->get_entities_by_type( 0, MBEDGE, curves);
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
CHECK_ERR(rval);
//Get triangles from the mesh
Range tris;
- rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
CHECK_ERR(rval);
for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
{
//Get the any curve edges that are a part of the triangle
Range tri_edges;
- rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges);
+ rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges );
CHECK_ERR(rval);
int num_of_tri_edges = tri_edges.size();
- CHECK_EQUAL(2, num_of_tri_edges);
- rval = match_tri_edges_w_curve( mb, tri_edges, curves);
+ CHECK_EQUAL( 2, num_of_tri_edges );
+ rval = match_tri_edges_w_curve( mb, tri_edges, curves );
CHECK_ERR(rval);
}
}
-ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves)
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves )
{
ErrorCode rval;
@@ -183,23 +183,23 @@ void cube_edge_adjacencies_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get the curves
Range curves;
- rval = mb->get_entities_by_type(0, MBEDGE, curves);
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
CHECK_ERR(rval);
for(Range::const_iterator i=curves.begin(); i!=curves.end(); i++)
{
//Get triangle adjacent to each edge
Range adj_tris;
- rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris);
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
CHECK_ERR(rval);
int num_adj_tris = adj_tris.size();
//Ensure that an edge isn't adjacent to more than two triangles
- CHECK( num_adj_tris <= 2);
+ CHECK( num_adj_tris <= 2 );
}
}
@@ -210,25 +210,25 @@ void cube_tri_vertex_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get all triangles
Range tris;
- rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
CHECK_ERR(rval);
for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
{
//Get all triangle vertices
Range verts;
- rval = mb->get_connectivity( &(*i), 1, verts);
+ rval = mb->get_connectivity( &(*i), 1, verts );
CHECK_ERR(rval);
int number_of_verts = verts.size();
- CHECK( 3 == number_of_verts);
- CHECK(verts[0]!=verts[1]);
- CHECK(verts[1]!=verts[2]);
- CHECK(verts[2]!=verts[0]);
+ CHECK( 3 == number_of_verts );
+ CHECK( verts[0]!=verts[1] );
+ CHECK( verts[1]!=verts[2] );
+ CHECK( verts[2]!=verts[0] );
}
}
https://bitbucket.org/fathomteam/moab/commits/bcea7088a3e2/
Changeset: bcea7088a3e2
Branch: None
User: pshriwise
Date: 2014-02-14 01:12:06
Summary: Formatting corrections for read_cgm_load_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_load_test.cpp b/test/io/read_cgm_load_test.cpp
index 9704ee7..6791f50 100644
--- a/test/io/read_cgm_load_test.cpp
+++ b/test/io/read_cgm_load_test.cpp
@@ -33,10 +33,10 @@ void read_multiple_test()
{
Core mb;
- ErrorCode rval = mb.load_file(input_file);
+ ErrorCode rval = mb.load_file( input_file );
CHECK_ERR(rval);
// second load
- rval = mb.load_file(input_file);
+ rval = mb.load_file( input_file );
CHECK_ERR(rval);
}
@@ -44,7 +44,7 @@ void read_multiple_test()
int main(int /* argc */, char** /* argv */)
{
- int result = RUN_TEST( read_multiple_test ) ;
+ int result = RUN_TEST( read_multiple_test );
return result;
}
https://bitbucket.org/fathomteam/moab/commits/41ab91659a46/
Changeset: 41ab91659a46
Branch: None
User: pshriwise
Date: 2014-02-14 01:12:06
Summary: Formatting corrections to read_cgm_basic_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 55bbe43..69c848d 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -50,12 +50,12 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_verts_test );
- result += RUN_TEST( read_cube_curves_test );
- result += RUN_TEST( read_cube_tris_test );
- result += RUN_TEST( read_cube_surfs_test );
- result += RUN_TEST( read_cube_vols_test );
- result += RUN_TEST( read_cube_vertex_pos_test );
+ result += RUN_TEST(read_cube_verts_test);
+ result += RUN_TEST(read_cube_curves_test);
+ result += RUN_TEST(read_cube_tris_test);
+ result += RUN_TEST(read_cube_surfs_test);
+ result += RUN_TEST(read_cube_vols_test);
+ result += RUN_TEST(read_cube_vertex_pos_test);
return result;
}
@@ -80,10 +80,10 @@ void read_cube_verts_test()
read_file( mb, input_cube );
int number_of_vertices;
- rval = mb->get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_vertices );
CHECK_ERR(rval);
- CHECK_EQUAL( 8, number_of_vertices);
+ CHECK_EQUAL( 8, number_of_vertices );
}
@@ -97,11 +97,11 @@ void read_cube_tris_test()
int number_of_tris;
- rval = mb->get_number_entities_by_type(0, MBTRI , number_of_tris);
+ rval = mb->get_number_entities_by_type( 0, MBTRI , number_of_tris );
std::cout << "Number of Triangles = " << number_of_tris << std::endl;
CHECK_ERR(rval);
- CHECK_EQUAL( 12, number_of_tris);
+ CHECK_EQUAL( 12, number_of_tris );
}
@@ -127,7 +127,7 @@ void read_cube_curves_test()
val, 1, number_of_curves );
CHECK_ERR(rval);
- CHECK_EQUAL( 12, number_of_curves);
+ CHECK_EQUAL( 12, number_of_curves );
}
@@ -151,7 +151,7 @@ void read_cube_surfs_test()
int number_of_surfs;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_surfs );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 6, number_of_surfs );
@@ -170,7 +170,7 @@ void read_cube_vols_test()
Tag geom_tag;
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
Range curves;
int dim = 3;
@@ -178,7 +178,7 @@ void read_cube_vols_test()
int number_of_vols;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_vols );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 1, number_of_vols );
@@ -197,7 +197,7 @@ void read_cube_vertex_pos_test()
//First check that the correct number of vertices are present
int number_of_verts;
rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 8, number_of_verts );
@@ -211,7 +211,7 @@ void read_cube_vertex_pos_test()
double y[verts.size()];
double z[verts.size()];
rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
//Check against known locations of the vertices
@@ -268,7 +268,7 @@ void read_cube_vertex_pos_test()
{
for (unsigned int j=0; j<x_ref.size(); j++)
{
- if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j])
+ if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j] )
{
x_ref.erase( x_ref.begin()+j );
y_ref.erase( y_ref.begin()+j );
@@ -279,7 +279,7 @@ void read_cube_vertex_pos_test()
}
int leftovers = x_ref.size();
- CHECK_EQUAL(0, leftovers );
+ CHECK_EQUAL( 0, leftovers );
}
@@ -304,7 +304,7 @@ void delete_mesh_test()
void *val[] = {&dim};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, geom_sets[dim] );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
if( geom_sets[dim].size() == 0 ) std::cout << "Warning: No geom sets to begin with" << std::endl;
@@ -318,11 +318,11 @@ void delete_mesh_test()
void *val_after[] = {&dim};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val_after, 1, geom_sets_after[dim] );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
if( 0 != geom_sets_after[dim].size() ) rval = MB_FAILURE;
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
}
}
https://bitbucket.org/fathomteam/moab/commits/df8283db2936/
Changeset: df8283db2936
Branch: None
User: pshriwise
Date: 2014-02-14 01:12:06
Summary: Formatting corrections to read_cgm_senses_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 9b3f038..904477a 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -51,8 +51,8 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_curve_senses_test );
- result += RUN_TEST( read_cube_surf_senses_test );
+ result += RUN_TEST(read_cube_curve_senses_test);
+ result += RUN_TEST(read_cube_surf_senses_test);
return result;
}
@@ -64,7 +64,7 @@ void read_file( Interface* moab, const char* input_file )
GeometryQueryTool::instance()->delete_geometry();
ErrorCode rval = moab->load_file( input_file );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
}
void read_cube_curve_senses_test()
@@ -80,7 +80,7 @@ void read_cube_curve_senses_test()
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
// Check that the proper number of curves exist
@@ -89,14 +89,14 @@ void read_cube_curve_senses_test()
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 12 , number_of_curves );
// Get curve handles
Range curves;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, curves );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
// Establish GeomTopoTool instance needed to get curve data
moab::GeomTopoTool gt( mb, false );
@@ -112,7 +112,7 @@ for(unsigned int i = 0; i < curves.size() ; i++)
surfs.clear();
senses.clear();
//Get sense info for the current curve
- gt.get_senses( curves[i], surfs, senses);
+ gt.get_senses( curves[i], surfs, senses );
CHECK_ERR(rval);
//Clear reference data from previous curve
@@ -138,7 +138,7 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set )
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
return id;
}
@@ -148,20 +148,20 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
//Get ID's of the wrt entities
std::vector<int> wrt_ent_ids;
- for( unsigned int i=0 ; i<wrt_ents.size() ; i++ )
+ for(unsigned int i=0 ; i<wrt_ents.size() ; i++)
{
- wrt_ent_ids.push_back( geom_id_by_handle( moab, wrt_ents[i] ));
+ wrt_ent_ids.push_back( geom_id_by_handle( moab, wrt_ents[i] ) );
}
- for ( unsigned int i=0; i< wrt_ent_ids.size() ; i++ )
+ for(unsigned int i=0; i< wrt_ent_ids.size() ; i++)
{
- for( unsigned int j=0; j< known_wrt_ids.size(); j++ )
+ for(unsigned int j=0; j< known_wrt_ids.size(); j++)
{
if( wrt_ent_ids[i] == known_wrt_ids [j] )
{
// Make sure the senses of the matching wrt entities
// are correct
- CHECK_EQUAL( senses[i],known_senses[j] );
+ CHECK_EQUAL( senses[i], known_senses[j] );
//Once a wrt entity is matched with a known entity,
// remove it from the list
known_wrt_ids.erase( known_wrt_ids.begin()+j );
@@ -176,7 +176,8 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
}
-void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out ){
+void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+{
int curve_id = geom_id_by_handle( moab, curve );
@@ -260,7 +261,7 @@ void read_cube_surf_senses_test()
Tag geom_tag;
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
// Check that the proper number of curves exist
int dim = 2;
@@ -268,14 +269,14 @@ void read_cube_surf_senses_test()
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 6, number_of_curves );
// Get curve handles
Range surfs;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, surfs );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
// Establish GeomTopoTool instance needed to get curve data
moab::GeomTopoTool gt( mb, false );
@@ -284,14 +285,14 @@ void read_cube_surf_senses_test()
std::vector<int> known_vol_ids;
std::vector<int> known_senses;
-for( unsigned int i = 0; i < surfs.size() ; i++ )
+for(unsigned int i = 0; i < surfs.size(); i++)
{
//Clean data from previous surface
vols.clear();
senses.clear();
// Get sense information for the current
// surface from the mesh
- gt.get_senses( surfs[i], vols, senses);
+ gt.get_senses( surfs[i], vols, senses );
CHECK_ERR(rval);
//Load known curve-sense data
@@ -300,7 +301,7 @@ for( unsigned int i = 0; i < surfs.size() ; i++ )
load_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
// Check sense information from the loaded mesh against
// reference sense information
- check_sense_data( mb, vols, senses, known_vol_ids, known_senses);
+ check_sense_data( mb, vols, senses, known_vol_ids, known_senses );
}
https://bitbucket.org/fathomteam/moab/commits/219400200c1e/
Changeset: 219400200c1e
Branch: None
User: pshriwise
Date: 2014-02-14 01:12:06
Summary: Added comments to read_cgm_connectivity_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 7137666..afffbe7 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -77,7 +77,6 @@ void cube_verts_connectivity_test()
CHECK_ERR(rval);
//Check that each vertex connects to less than 4 triangles and no more than 6
-
for(Range::const_iterator i = verts.begin(); i!=verts.end(); i++)
{
std::vector<EntityHandle> adj_tris;
@@ -149,29 +148,31 @@ void cube_tri_curve_coincidence_test()
Range tri_edges;
rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges );
CHECK_ERR(rval);
-
+ //Check that we've retrieved two edges from get_adjacencies
+ //For a this file (cube), each triangle should have two curve
+ //edges
int num_of_tri_edges = tri_edges.size();
CHECK_EQUAL( 2, num_of_tri_edges );
rval = match_tri_edges_w_curve( mb, tri_edges, curves );
CHECK_ERR(rval);
-
- }
-
+ }
}
ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves )
{
-
ErrorCode rval;
int match_counter=0;
for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
{
for(Range::const_iterator j=curves.begin(); j!=curves.end(); j++)
{
+ // If the edge handle matches a curve handle, increment the number
+ // matches
if( *i == *j ) match_counter++;
}
}
-
+ //Make sure that each edge returned from triangle edges
+ //has been matched to a curve
int num_of_tri_edges = tri_edges.size();
CHECK_EQUAL( num_of_tri_edges, match_counter );
return MB_SUCCESS;
@@ -198,7 +199,7 @@ void cube_edge_adjacencies_test()
CHECK_ERR(rval);
int num_adj_tris = adj_tris.size();
- //Ensure that an edge isn't adjacent to more than two triangles
+ //Ensure that no edge is adjacent to more than two triangles
CHECK( num_adj_tris <= 2 );
}
@@ -223,7 +224,8 @@ void cube_tri_vertex_test()
Range verts;
rval = mb->get_connectivity( &(*i), 1, verts );
CHECK_ERR(rval);
-
+ //Make sure that each vertex making up
+ //the triangle is different
int number_of_verts = verts.size();
CHECK( 3 == number_of_verts );
CHECK( verts[0]!=verts[1] );
https://bitbucket.org/fathomteam/moab/commits/3504805e93ca/
Changeset: 3504805e93ca
Branch: None
User: pshriwise
Date: 2014-02-14 01:12:06
Summary: Removed white space in read_cgm_connectivity_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index afffbe7..f0e67c24 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -232,5 +232,4 @@ void cube_tri_vertex_test()
CHECK( verts[1]!=verts[2] );
CHECK( verts[2]!=verts[0] );
}
-
}
https://bitbucket.org/fathomteam/moab/commits/b4f2a9df4f9e/
Changeset: b4f2a9df4f9e
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Cleanup of read_cgm_basic_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 69c848d..3bd5dbe 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -43,7 +43,7 @@ void read_cube_tris_test();
void read_cube_surfs_test();
void read_cube_vols_test();
void read_cube_vertex_pos_test();
-void delete_mesh_test();
+//void delete_mesh_test();
int main(int /* argc */, char** /* argv */)
@@ -82,7 +82,7 @@ void read_cube_verts_test()
int number_of_vertices;
rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_vertices );
CHECK_ERR(rval);
-
+ //For a cube there should be exactly 8 vertices
CHECK_EQUAL( 8, number_of_vertices );
}
@@ -100,9 +100,8 @@ void read_cube_tris_test()
rval = mb->get_number_entities_by_type( 0, MBTRI , number_of_tris );
std::cout << "Number of Triangles = " << number_of_tris << std::endl;
CHECK_ERR(rval);
-
+ //For a cube, there should be exactly 2 triangles per face
CHECK_EQUAL( 12, number_of_tris );
-
}
void read_cube_curves_test()
@@ -112,21 +111,19 @@ void read_cube_curves_test()
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
-
+ //Get the geometry tag handle from the mesh
Tag geom_tag;
-
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
-
- Range curves;
+ //Get the curves from the mesh
int dim = 1;
void *val[] = {&dim};
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
CHECK_ERR(rval);
-
+ //For a cube, there should be exactly 12 curves loaded from the file
CHECK_EQUAL( 12, number_of_curves );
}
@@ -145,15 +142,14 @@ void read_cube_surfs_test()
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
- Range curves;
+ //Get the number of surface from the mesh geometry data
int dim = 2;
void *val[] = {&dim};
int number_of_surfs;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_surfs );
CHECK_ERR(rval);
-
-
+ //For a cube, there should be exactly 6 surfaces
CHECK_EQUAL( 6, number_of_surfs );
}
@@ -172,17 +168,14 @@ void read_cube_vols_test()
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
- Range curves;
+ //Get the number of volumes from the mesh geometry data
int dim = 3;
void *val[] = {&dim};
int number_of_vols;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_vols );
CHECK_ERR(rval);
-
-
CHECK_EQUAL( 1, number_of_vols );
-
}
void read_cube_vertex_pos_test()
@@ -220,7 +213,6 @@ void read_cube_vertex_pos_test()
std::vector<double> z_ref;
// Vertex 1
-
x_ref.push_back( 5 );
y_ref.push_back( -5 );
z_ref.push_back( 5 );
@@ -260,29 +252,34 @@ void read_cube_vertex_pos_test()
y_ref.push_back( 5 );
z_ref.push_back( -5 );
-
std::cout << verts.size() << std::endl;
std::cout << x_ref.size() << std::endl;
- for (unsigned int i=0; i<verts.size(); i++)
+ for(unsigned int i=0; i<verts.size(); i++)
{
- for (unsigned int j=0; j<x_ref.size(); j++)
+ for(unsigned int j=0; j<x_ref.size(); j++)
{
if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j] )
{
x_ref.erase( x_ref.begin()+j );
y_ref.erase( y_ref.begin()+j );
z_ref.erase( z_ref.begin()+j );
-
}
}
}
+ //After looping through each vertex loaded from the mesh
+ //there should be no entities left in the reference vector
int leftovers = x_ref.size();
CHECK_EQUAL( 0, leftovers );
}
+//Superfluous test for ReadCGM, but perhaps better
+//than the test in place for moab::delete_geometry()
+
+
+/*
void delete_mesh_test()
{
Core moab;
@@ -326,4 +323,4 @@ void delete_mesh_test()
}
}
-
+*/
https://bitbucket.org/fathomteam/moab/commits/9b1dcbd75645/
Changeset: 9b1dcbd75645
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Cleanup of read_cgm_senses_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 904477a..4f0896d 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -77,22 +77,20 @@ void read_cube_curve_senses_test()
//Get all curve handles
Tag geom_tag;
-
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
// Check that the proper number of curves exist
-
int dim = 1;
void *val[] = {&dim};
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
- val, 1, number_of_curves );
+ val, 1, number_of_curves );
CHECK_ERR(rval);
CHECK_EQUAL( 12 , number_of_curves );
- // Get curve handles
+ //Get curve handles
Range curves;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, curves );
@@ -100,6 +98,7 @@ void read_cube_curve_senses_test()
// Establish GeomTopoTool instance needed to get curve data
moab::GeomTopoTool gt( mb, false );
+ // Initialize vectors for sense checking
std::vector<EntityHandle> surfs;
std::vector<int> senses;
std::vector<int> known_surf_ids;
@@ -118,12 +117,11 @@ for(unsigned int i = 0; i < curves.size() ; i++)
//Clear reference data from previous curve
known_surf_ids.clear();
known_senses.clear();
- //Load known curve-sense data
+ //Load known curve-sense ID data
load_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
-
+ //Check that each surf and sense has a match in the references
check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
}
-
}
@@ -131,11 +129,11 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set )
{
ErrorCode rval;
-
+ //Get the id_tag handle
Tag id_tag;
rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
-
+ //Load the ID for the EntHandle given to the function
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
CHECK_ERR(rval);
@@ -176,6 +174,7 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
}
+//Loads two vectors with reference curve and curve_sense data
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
{
@@ -263,7 +262,7 @@ void read_cube_surf_senses_test()
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
- // Check that the proper number of curves exist
+ // Check that the proper number of surfaces exist
int dim = 2;
void *val[] = {&dim};
int number_of_curves;
@@ -272,13 +271,13 @@ void read_cube_surf_senses_test()
CHECK_ERR(rval);
CHECK_EQUAL( 6, number_of_curves );
- // Get curve handles
+ // Get surface handles
Range surfs;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, surfs );
CHECK_ERR(rval);
- // Establish GeomTopoTool instance needed to get curve data
+ // Establish GeomTopoTool instance needed to get surf data
moab::GeomTopoTool gt( mb, false );
std::vector<EntityHandle> vols;
std::vector<int> senses;
@@ -294,10 +293,11 @@ for(unsigned int i = 0; i < surfs.size(); i++)
// surface from the mesh
gt.get_senses( surfs[i], vols, senses );
CHECK_ERR(rval);
-
- //Load known curve-sense data
+ //Clear previous reverence data
known_vol_ids.clear();
known_senses.clear();
+ // Load known surface-volume data
+ // for this surface and check that it's correct
load_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
// Check sense information from the loaded mesh against
// reference sense information
@@ -307,10 +307,10 @@ for(unsigned int i = 0; i < surfs.size(); i++)
}
+//Loads reference surface to volume sense data into the reference vectors
void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
int surf_id = geom_id_by_handle( moab, surf );
-
switch(surf_id)
{
case 1:
@@ -341,8 +341,8 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
case 6:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+
break;
}
-
}
https://bitbucket.org/fathomteam/moab/commits/342f5f7c2914/
Changeset: 342f5f7c2914
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: New function create_entity_sets_for_dim in ReadCGM.cpp (refactor)
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index aa5d972..356b2bc 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -156,7 +156,47 @@ ErrorCode ReadCGM::set_options( const FileOptions& opts,
return MB_SUCCESS;
}
+ ErrorCode ReadCGM::create_entity_sets_for_dim( Interface* moab,
+ int dim,
+ Tag geom_tag,
+ Tag id_tag,
+ Tag category_tag,
+ DLIList<RefEntity*>& entlist,
+ std::map<RefEntity*,EntityHandle>& entitymap )
+ {
+ ErrorCode rval;
+ const char geom_categories[][CATEGORY_TAG_SIZE] =
+ {"Vertex\0", "Curve\0", "Surface\0", "Volume\0", "Group\0"};
+ const char* const names[] = { "Vertex", "Curve", "Surface", "Volume"};
+
+ entlist.clean_out();
+ GeometryQueryTool::instance()->ref_entity_list( names[dim], entlist, true );
+
+ entlist.reset();
+ for (int i = entlist.size(); i--; ) {
+ RefEntity* ent = entlist.get_and_step();
+ EntityHandle handle;
+ rval = moab->create_meshset( dim == 1 ? MESHSET_ORDERED : MESHSET_SET, handle );
+ if (MB_SUCCESS != rval)
+ return rval;
+ entitymap[ent] = handle;
+
+ rval = moab->tag_set_data( geom_tag, &handle, 1, &dim );
+ if (MB_SUCCESS != rval)
+ return rval;
+
+ int id = ent->id();
+ rval = moab->tag_set_data( id_tag, &handle, 1, &id );
+ if (MB_SUCCESS != rval)
+ return rval;
+
+ rval = moab->tag_set_data( category_tag, &handle, 1, &geom_categories[dim] );
+ if (MB_SUCCESS != rval)
+ return rval;
+ }
+
+ }
// copy geometry into mesh database
ErrorCode ReadCGM::load_file(const char *cgm_file_name,
@@ -227,33 +267,11 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
}
// create entity sets for all geometric entities
- for (int dim = 0; dim < 4; ++dim) {
- entlist.clean_out();
- GeometryQueryTool::instance()->ref_entity_list( names[dim], entlist, true );
-
- entlist.reset();
- for (int i = entlist.size(); i--; ) {
- RefEntity* ent = entlist.get_and_step();
- EntityHandle handle;
- rval = mdbImpl->create_meshset( dim == 1 ? MESHSET_ORDERED : MESHSET_SET, handle );
- if (MB_SUCCESS != rval)
- return rval;
-
- entmap[dim][ent] = handle;
-
- rval = mdbImpl->tag_set_data( geom_tag, &handle, 1, &dim );
- if (MB_SUCCESS != rval)
- return rval;
- int id = ent->id();
- rval = mdbImpl->tag_set_data( id_tag, &handle, 1, &id );
- if (MB_SUCCESS != rval)
- return rval;
-
- rval = mdbImpl->tag_set_data( category_tag, &handle, 1, &geom_categories[dim] );
- if (MB_SUCCESS != rval)
- return rval;
+ for (int dim = 0; dim < 4; ++dim)
+ {
+ rval = create_entity_sets_for_dim( mdbImpl, dim, geom_tag, id_tag, category_tag, entlist, entmap[dim] );
+ if ( rval!=MB_SUCCESS ) return rval;
}
- }
// create topology for all geometric entities
for (int dim = 1; dim < 4; ++dim) {
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 2919cce..651c2c7 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -35,6 +35,7 @@
#include <string>
#include "moab/ReaderIface.hpp"
+#include "RefEntityName.hpp"
namespace moab {
@@ -77,6 +78,13 @@ public:
bool& act_att,
bool& verbose_warnings);
+ ErrorCode create_entity_sets_for_dim( Interface* moab,
+ int dim,
+ Tag geom_tag,
+ Tag id_tag,
+ Tag category_tag,
+ DLIList<RefEntity*>& entlist,
+ std::map<RefEntity*,EntityHandle>& entitymap );
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/9e99a3077c2a/
Changeset: 9e99a3077c2a
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Cleanup of function definition for create_entity_sets_for_dim
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 356b2bc..e936b43 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -166,35 +166,36 @@ ErrorCode ReadCGM::set_options( const FileOptions& opts,
{
ErrorCode rval;
const char geom_categories[][CATEGORY_TAG_SIZE] =
- {"Vertex\0", "Curve\0", "Surface\0", "Volume\0", "Group\0"};
+ {"Vertex\0", "Curve\0", "Surface\0", "Volume\0", "Group\0"};
const char* const names[] = { "Vertex", "Curve", "Surface", "Volume"};
entlist.clean_out();
- GeometryQueryTool::instance()->ref_entity_list( names[dim], entlist, true );
+ GeometryQueryTool::instance()->ref_entity_list( names[dim], entlist, true );
- entlist.reset();
- for (int i = entlist.size(); i--; ) {
- RefEntity* ent = entlist.get_and_step();
- EntityHandle handle;
- rval = moab->create_meshset( dim == 1 ? MESHSET_ORDERED : MESHSET_SET, handle );
- if (MB_SUCCESS != rval)
- return rval;
-
- entitymap[ent] = handle;
+ entlist.reset();
+ for (int i = entlist.size(); i--; )
+ {
+ RefEntity* ent = entlist.get_and_step();
+ EntityHandle handle;
+ rval = moab->create_meshset( dim == 1 ? MESHSET_ORDERED : MESHSET_SET, handle );
+ if (MB_SUCCESS != rval)
+ return rval;
+
+ entitymap[ent] = handle;
- rval = moab->tag_set_data( geom_tag, &handle, 1, &dim );
- if (MB_SUCCESS != rval)
- return rval;
+ rval = moab->tag_set_data( geom_tag, &handle, 1, &dim );
+ if (MB_SUCCESS != rval)
+ return rval;
- int id = ent->id();
- rval = moab->tag_set_data( id_tag, &handle, 1, &id );
- if (MB_SUCCESS != rval)
- return rval;
+ int id = ent->id();
+ rval = moab->tag_set_data( id_tag, &handle, 1, &id );
+ if (MB_SUCCESS != rval)
+ return rval;
- rval = moab->tag_set_data( category_tag, &handle, 1, &geom_categories[dim] );
- if (MB_SUCCESS != rval)
- return rval;
- }
+ rval = moab->tag_set_data( category_tag, &handle, 1, &geom_categories[dim] );
+ if (MB_SUCCESS != rval)
+ return rval;
+ }
}
@@ -267,7 +268,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
}
// create entity sets for all geometric entities
- for (int dim = 0; dim < 4; ++dim)
+ for(int dim = 0; dim < 4; ++dim)
{
rval = create_entity_sets_for_dim( mdbImpl, dim, geom_tag, id_tag, category_tag, entlist, entmap[dim] );
if ( rval!=MB_SUCCESS ) return rval;
https://bitbucket.org/fathomteam/moab/commits/7ec4af8c1c97/
Changeset: 7ec4af8c1c97
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Added a function create_entity_sets to ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index e936b43..6636651 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -173,7 +173,7 @@ ErrorCode ReadCGM::set_options( const FileOptions& opts,
GeometryQueryTool::instance()->ref_entity_list( names[dim], entlist, true );
entlist.reset();
- for (int i = entlist.size(); i--; )
+ for(int i = entlist.size(); i--;)
{
RefEntity* ent = entlist.get_and_step();
EntityHandle handle;
@@ -196,9 +196,29 @@ ErrorCode ReadCGM::set_options( const FileOptions& opts,
if (MB_SUCCESS != rval)
return rval;
}
-
+ return MB_SUCCESS;
}
+ErrorCode ReadCGM::create_entity_sets( Interface* moab,
+ Tag geom_tag,
+ Tag id_tag,
+ Tag category_tag,
+ DLIList<RefEntity*>& entlist,
+ std::map<RefEntity*,EntityHandle>* entmap_ptr)
+
+{
+ ErrorCode rval;
+
+ for(int dim=0; dim<4; dim++)
+ {
+ rval = create_entity_sets_for_dim( moab, dim, geom_tag, id_tag, category_tag, entlist, *entmap_ptr );
+ if (rval!=MB_SUCCESS) return rval;
+ entmap_ptr++;
+ }
+
+ return MB_SUCCESS;
+}
+
// copy geometry into mesh database
ErrorCode ReadCGM::load_file(const char *cgm_file_name,
const EntityHandle* file_set,
@@ -214,9 +234,9 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
return MB_UNSUPPORTED_OPERATION;
}
- int norm_tol, DEFAULT_NORM = 5;
- double faceting_tol, DEFAULT_FACET_TOL = 0.001;
- double len_tol, DEFAULT_LEN_TOL = 0.0;
+ int norm_tol;
+ double faceting_tol;
+ double len_tol;
bool act_att = true;
bool verbose_warnings = false;
@@ -268,12 +288,11 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
}
// create entity sets for all geometric entities
- for(int dim = 0; dim < 4; ++dim)
- {
- rval = create_entity_sets_for_dim( mdbImpl, dim, geom_tag, id_tag, category_tag, entlist, entmap[dim] );
- if ( rval!=MB_SUCCESS ) return rval;
- }
-
+ std::map<RefEntity*,EntityHandle>* entmap_ptr;
+ entmap_ptr = entmap;
+ rval = create_entity_sets( mdbImpl, geom_tag, id_tag, category_tag, entlist, entmap_ptr );
+ if (rval!=MB_SUCCESS) return rval;
+
// create topology for all geometric entities
for (int dim = 1; dim < 4; ++dim) {
for (ci = entmap[dim].begin(); ci != entmap[dim].end(); ++ci) {
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 651c2c7..0aae3ef 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -86,6 +86,14 @@ public:
DLIList<RefEntity*>& entlist,
std::map<RefEntity*,EntityHandle>& entitymap );
+
+ ErrorCode create_entity_sets( Interface* moab,
+ Tag geom_tag,
+ Tag id_tag,
+ Tag category_tag,
+ DLIList<RefEntity*>& entlist,
+ std::map<RefEntity*,EntityHandle>* entmap_ptr);
+
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/7ffdcc8be8d3/
Changeset: 7ffdcc8be8d3
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Cleanup of ReadCGM from addition of create_entity_sets()
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 6636651..d0dcb57 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -253,12 +253,11 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
if(MB_SUCCESS != rval) return rval;
// CGM data
- std::map<RefEntity*,EntityHandle> entmap[5]; // one for each dim, and one for groups
+
std::map<RefEntity*,EntityHandle>::iterator ci;
const char geom_categories[][CATEGORY_TAG_SIZE] =
- {"Vertex\0", "Curve\0", "Surface\0", "Volume\0", "Group\0"};
- const char* const names[] = { "Vertex", "Curve", "Surface", "Volume"};
- DLIList<RefEntity*> entlist;
+ {"Vertex\0", "Curve\0", "Surface\0", "Volume\0", "Group\0"};
+
DLIList<ModelEntity*> me_list;
// Initialize CGM
@@ -288,8 +287,9 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
}
// create entity sets for all geometric entities
- std::map<RefEntity*,EntityHandle>* entmap_ptr;
- entmap_ptr = entmap;
+ DLIList<RefEntity*> entlist;
+ std::map<RefEntity*,EntityHandle> entmap[5]; // one for each dim, and one for groups
+ std::map<RefEntity*,EntityHandle>* entmap_ptr= entmap;
rval = create_entity_sets( mdbImpl, geom_tag, id_tag, category_tag, entlist, entmap_ptr );
if (rval!=MB_SUCCESS) return rval;
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 0aae3ef..a5bb127 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -92,7 +92,7 @@ public:
Tag id_tag,
Tag category_tag,
DLIList<RefEntity*>& entlist,
- std::map<RefEntity*,EntityHandle>* entmap_ptr);
+ std::map<RefEntity*,EntityHandle>* entmap_ptr );
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/271c76fbfb53/
Changeset: 271c76fbfb53
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Removed the DLI list from the function create_entity_sets_for_dim
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index d0dcb57..80b2738 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -203,17 +203,17 @@ ErrorCode ReadCGM::create_entity_sets( Interface* moab,
Tag geom_tag,
Tag id_tag,
Tag category_tag,
- DLIList<RefEntity*>& entlist,
std::map<RefEntity*,EntityHandle>* entmap_ptr)
{
ErrorCode rval;
-
+ DLIList<RefEntity*> entlist;
for(int dim=0; dim<4; dim++)
{
rval = create_entity_sets_for_dim( moab, dim, geom_tag, id_tag, category_tag, entlist, *entmap_ptr );
if (rval!=MB_SUCCESS) return rval;
entmap_ptr++;
+ entlist.clean_out();
}
return MB_SUCCESS;
@@ -290,7 +290,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
DLIList<RefEntity*> entlist;
std::map<RefEntity*,EntityHandle> entmap[5]; // one for each dim, and one for groups
std::map<RefEntity*,EntityHandle>* entmap_ptr= entmap;
- rval = create_entity_sets( mdbImpl, geom_tag, id_tag, category_tag, entlist, entmap_ptr );
+ rval = create_entity_sets( mdbImpl, geom_tag, id_tag, category_tag, entmap_ptr );
if (rval!=MB_SUCCESS) return rval;
// create topology for all geometric entities
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index a5bb127..c17f28f 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -91,7 +91,6 @@ public:
Tag geom_tag,
Tag id_tag,
Tag category_tag,
- DLIList<RefEntity*>& entlist,
std::map<RefEntity*,EntityHandle>* entmap_ptr );
//! Constructor
https://bitbucket.org/fathomteam/moab/commits/7178c16e4ffe/
Changeset: 7178c16e4ffe
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Removed entlist argument from create_entity_sets_for_dim.
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 80b2738..52a8c26 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -161,14 +161,13 @@ ErrorCode ReadCGM::set_options( const FileOptions& opts,
Tag geom_tag,
Tag id_tag,
Tag category_tag,
- DLIList<RefEntity*>& entlist,
std::map<RefEntity*,EntityHandle>& entitymap )
{
ErrorCode rval;
const char geom_categories[][CATEGORY_TAG_SIZE] =
{"Vertex\0", "Curve\0", "Surface\0", "Volume\0", "Group\0"};
const char* const names[] = { "Vertex", "Curve", "Surface", "Volume"};
-
+ DLIList<RefEntity*> entlist;
entlist.clean_out();
GeometryQueryTool::instance()->ref_entity_list( names[dim], entlist, true );
@@ -207,13 +206,11 @@ ErrorCode ReadCGM::create_entity_sets( Interface* moab,
{
ErrorCode rval;
- DLIList<RefEntity*> entlist;
for(int dim=0; dim<4; dim++)
{
- rval = create_entity_sets_for_dim( moab, dim, geom_tag, id_tag, category_tag, entlist, *entmap_ptr );
+ rval = create_entity_sets_for_dim( moab, dim, geom_tag, id_tag, category_tag, *entmap_ptr );
if (rval!=MB_SUCCESS) return rval;
entmap_ptr++;
- entlist.clean_out();
}
return MB_SUCCESS;
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index c17f28f..355549a 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -83,7 +83,6 @@ public:
Tag geom_tag,
Tag id_tag,
Tag category_tag,
- DLIList<RefEntity*>& entlist,
std::map<RefEntity*,EntityHandle>& entitymap );
https://bitbucket.org/fathomteam/moab/commits/85aee315ce58/
Changeset: 85aee315ce58
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Added function create_topology to ReadCGM.
(Not implemented in ReadCGM::load_file yet)
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 52a8c26..d4afee9 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -216,6 +216,31 @@ ErrorCode ReadCGM::create_entity_sets( Interface* moab,
return MB_SUCCESS;
}
+ErrorCode ReadCGM::create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5])
+{
+ ErrorCode rval;
+ DLIList<RefEntity*> entitylist;
+ std::map<RefEntity*,EntityHandle>::iterator ci;
+
+ for (int dim = 1; dim < 4; ++dim) {
+ for (ci = entitymap[dim].begin(); ci != entitymap[dim].end(); ++ci) {
+ entitylist.clean_out();
+ ci->first->get_child_ref_entities( entitylist );
+
+ entitylist.reset();
+ for (int i = entitylist.size(); i--; ) {
+ RefEntity* ent = entitylist.get_and_step();
+ EntityHandle h = entitymap[dim-1][ent];
+ rval = moab->add_parent_child( ci->second, h );
+ if (MB_SUCCESS != rval)
+ return rval;
+ }
+ }
+ }
+
+}
+
+
// copy geometry into mesh database
ErrorCode ReadCGM::load_file(const char *cgm_file_name,
const EntityHandle* file_set,
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 355549a..00bc020 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -92,6 +92,8 @@ public:
Tag category_tag,
std::map<RefEntity*,EntityHandle>* entmap_ptr );
+ ErrorCode create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5]);
+
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/33b0aae124d1/
Changeset: 33b0aae124d1
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Implemented the function create_topology in ReadCGM
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index d4afee9..668d6fb 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -237,7 +237,7 @@ ErrorCode ReadCGM::create_topology( Interface* moab, std::map<RefEntity*,EntityH
}
}
}
-
+ return MB_SUCCESS;
}
@@ -316,22 +316,10 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
if (rval!=MB_SUCCESS) return rval;
// create topology for all geometric entities
- for (int dim = 1; dim < 4; ++dim) {
- for (ci = entmap[dim].begin(); ci != entmap[dim].end(); ++ci) {
- entlist.clean_out();
- ci->first->get_child_ref_entities( entlist );
-
- entlist.reset();
- for (int i = entlist.size(); i--; ) {
- RefEntity* ent = entlist.get_and_step();
- EntityHandle h = entmap[dim-1][ent];
- rval = mdbImpl->add_parent_child( ci->second, h );
- if (MB_SUCCESS != rval)
- return rval;
- }
- }
- }
-
+
+ rval = create_topology( mdbImpl, entmap );
+ if (rval!=MB_SUCCESS) return rval;
+
// store CoFace senses
for (ci = entmap[2].begin(); ci != entmap[2].end(); ++ci) {
RefFace* face = (RefFace*)(ci->first);
https://bitbucket.org/fathomteam/moab/commits/4bff8985b5a5/
Changeset: 4bff8985b5a5
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:33
Summary: Small formatting change to ReadCGM
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 668d6fb..87b2f03 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -315,8 +315,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
rval = create_entity_sets( mdbImpl, geom_tag, id_tag, category_tag, entmap_ptr );
if (rval!=MB_SUCCESS) return rval;
- // create topology for all geometric entities
-
+ // create topology for all geometric entities
rval = create_topology( mdbImpl, entmap );
if (rval!=MB_SUCCESS) return rval;
https://bitbucket.org/fathomteam/moab/commits/9bba88e5df5a/
Changeset: 9bba88e5df5a
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Removed the MOAB tag arguments from create_entity_sets_for_dim and create_entity_sets in ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 87b2f03..2bd0122 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -158,9 +158,6 @@ ErrorCode ReadCGM::set_options( const FileOptions& opts,
ErrorCode ReadCGM::create_entity_sets_for_dim( Interface* moab,
int dim,
- Tag geom_tag,
- Tag id_tag,
- Tag category_tag,
std::map<RefEntity*,EntityHandle>& entitymap )
{
ErrorCode rval;
@@ -199,16 +196,13 @@ ErrorCode ReadCGM::set_options( const FileOptions& opts,
}
ErrorCode ReadCGM::create_entity_sets( Interface* moab,
- Tag geom_tag,
- Tag id_tag,
- Tag category_tag,
std::map<RefEntity*,EntityHandle>* entmap_ptr)
{
ErrorCode rval;
for(int dim=0; dim<4; dim++)
{
- rval = create_entity_sets_for_dim( moab, dim, geom_tag, id_tag, category_tag, *entmap_ptr );
+ rval = create_entity_sets_for_dim( moab, dim, *entmap_ptr );
if (rval!=MB_SUCCESS) return rval;
entmap_ptr++;
}
@@ -312,7 +306,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
DLIList<RefEntity*> entlist;
std::map<RefEntity*,EntityHandle> entmap[5]; // one for each dim, and one for groups
std::map<RefEntity*,EntityHandle>* entmap_ptr= entmap;
- rval = create_entity_sets( mdbImpl, geom_tag, id_tag, category_tag, entmap_ptr );
+ rval = create_entity_sets( mdbImpl, entmap_ptr );
if (rval!=MB_SUCCESS) return rval;
// create topology for all geometric entities
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 00bc020..f81b2a2 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -80,16 +80,10 @@ public:
ErrorCode create_entity_sets_for_dim( Interface* moab,
int dim,
- Tag geom_tag,
- Tag id_tag,
- Tag category_tag,
std::map<RefEntity*,EntityHandle>& entitymap );
ErrorCode create_entity_sets( Interface* moab,
- Tag geom_tag,
- Tag id_tag,
- Tag category_tag,
std::map<RefEntity*,EntityHandle>* entmap_ptr );
ErrorCode create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5]);
https://bitbucket.org/fathomteam/moab/commits/52ca26ac5897/
Changeset: 52ca26ac5897
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added the function store_surface_senses to ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 2bd0122..e8e9c20 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -234,6 +234,55 @@ ErrorCode ReadCGM::create_topology( Interface* moab, std::map<RefEntity*,EntityH
return MB_SUCCESS;
}
+ErrorCode ReadCGM::store_surface_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] )
+{
+ ErrorCode rval;
+ std::map<RefEntity*,EntityHandle>::iterator ci;
+
+ for (ci = entitymap[2].begin(); ci != entitymap[2].end(); ++ci) {
+ RefFace* face = (RefFace*)(ci->first);
+ BasicTopologyEntity *forward = 0, *reverse = 0;
+ for (SenseEntity* cf = face->get_first_sense_entity_ptr();
+ cf; cf = cf->next_on_bte()) {
+ BasicTopologyEntity* vol = cf->get_parent_basic_topology_entity_ptr();
+ if (cf->get_sense() == CUBIT_UNKNOWN ||
+ cf->get_sense() != face->get_surface_ptr()->bridge_sense()) {
+ if (reverse) {
+ std::cout << "Surface " << face->id() << " has reverse senes " <<
+ "with multiple volume " << reverse->id() << " and " <<
+ "volume " << vol->id() << std::endl;
+ return MB_FAILURE;
+ }
+ reverse = vol;
+ }
+ if (cf->get_sense() == CUBIT_UNKNOWN ||
+ cf->get_sense() == face->get_surface_ptr()->bridge_sense()) {
+ if (forward) {
+ std::cout << "Surface " << face->id() << " has forward senes " <<
+ "with multiple volume " << forward->id() << " and " <<
+ "volume " << vol->id() << std::endl;
+ return MB_FAILURE;
+ }
+ forward = vol;
+ }
+ }
+
+ if (forward) {
+ rval = myGeomTool->set_sense( ci->second, entitymap[3][forward], SENSE_FORWARD );
+ if (MB_SUCCESS != rval)
+ return rval;
+ }
+ if (reverse) {
+ rval = myGeomTool->set_sense( ci->second, entitymap[3][reverse], SENSE_REVERSE );
+ if (MB_SUCCESS != rval)
+ return rval;
+ }
+ }
+
+
+ return MB_SUCCESS;
+}
+
// copy geometry into mesh database
ErrorCode ReadCGM::load_file(const char *cgm_file_name,
@@ -313,46 +362,9 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
rval = create_topology( mdbImpl, entmap );
if (rval!=MB_SUCCESS) return rval;
- // store CoFace senses
- for (ci = entmap[2].begin(); ci != entmap[2].end(); ++ci) {
- RefFace* face = (RefFace*)(ci->first);
- BasicTopologyEntity *forward = 0, *reverse = 0;
- for (SenseEntity* cf = face->get_first_sense_entity_ptr();
- cf; cf = cf->next_on_bte()) {
- BasicTopologyEntity* vol = cf->get_parent_basic_topology_entity_ptr();
- if (cf->get_sense() == CUBIT_UNKNOWN ||
- cf->get_sense() != face->get_surface_ptr()->bridge_sense()) {
- if (reverse) {
- std::cout << "Surface " << face->id() << " has reverse senes " <<
- "with multiple volume " << reverse->id() << " and " <<
- "volume " << vol->id() << std::endl;
- return MB_FAILURE;
- }
- reverse = vol;
- }
- if (cf->get_sense() == CUBIT_UNKNOWN ||
- cf->get_sense() == face->get_surface_ptr()->bridge_sense()) {
- if (forward) {
- std::cout << "Surface " << face->id() << " has forward senes " <<
- "with multiple volume " << forward->id() << " and " <<
- "volume " << vol->id() << std::endl;
- return MB_FAILURE;
- }
- forward = vol;
- }
- }
-
- if (forward) {
- rval = myGeomTool->set_sense( ci->second, entmap[3][forward], SENSE_FORWARD );
- if (MB_SUCCESS != rval)
- return rval;
- }
- if (reverse) {
- rval = myGeomTool->set_sense( ci->second, entmap[3][reverse], SENSE_REVERSE );
- if (MB_SUCCESS != rval)
- return rval;
- }
- }
+ // store CoFace senses
+ rval = store_surface_senses( mdbImpl, entmap );
+ if (rval!=MB_SUCCESS) return rval;
// store CoEdge senses
std::vector<EntityHandle> ents;
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index f81b2a2..06b0187 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -88,6 +88,8 @@ public:
ErrorCode create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5]);
+ ErrorCode store_surface_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
+
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/d7d98e5a0fbc/
Changeset: d7d98e5a0fbc
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Formatting corrections to ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index e8e9c20..77329b4 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -354,7 +354,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
// create entity sets for all geometric entities
DLIList<RefEntity*> entlist;
std::map<RefEntity*,EntityHandle> entmap[5]; // one for each dim, and one for groups
- std::map<RefEntity*,EntityHandle>* entmap_ptr= entmap;
+ std::map<RefEntity*,EntityHandle>* entmap_ptr = entmap;
rval = create_entity_sets( mdbImpl, entmap_ptr );
if (rval!=MB_SUCCESS) return rval;
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 06b0187..480cc48 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -86,7 +86,7 @@ public:
ErrorCode create_entity_sets( Interface* moab,
std::map<RefEntity*,EntityHandle>* entmap_ptr );
- ErrorCode create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5]);
+ ErrorCode create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
ErrorCode store_surface_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
https://bitbucket.org/fathomteam/moab/commits/96aa485ccb28/
Changeset: 96aa485ccb28
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added comments/corrections to store_surface_senses in ReadCGM
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 77329b4..a173cff 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -245,10 +245,12 @@ ErrorCode ReadCGM::store_surface_senses( Interface* moab, std::map<RefEntity*,En
for (SenseEntity* cf = face->get_first_sense_entity_ptr();
cf; cf = cf->next_on_bte()) {
BasicTopologyEntity* vol = cf->get_parent_basic_topology_entity_ptr();
+ // allocate vol to the proper topology entity (forward or reverse)
if (cf->get_sense() == CUBIT_UNKNOWN ||
cf->get_sense() != face->get_surface_ptr()->bridge_sense()) {
+ //check that each surface has a sense for only one volume
if (reverse) {
- std::cout << "Surface " << face->id() << " has reverse senes " <<
+ std::cout << "Surface " << face->id() << " has reverse sense " <<
"with multiple volume " << reverse->id() << " and " <<
"volume " << vol->id() << std::endl;
return MB_FAILURE;
@@ -257,8 +259,9 @@ ErrorCode ReadCGM::store_surface_senses( Interface* moab, std::map<RefEntity*,En
}
if (cf->get_sense() == CUBIT_UNKNOWN ||
cf->get_sense() == face->get_surface_ptr()->bridge_sense()) {
+ //check that each surface has a sense for only one volume
if (forward) {
- std::cout << "Surface " << face->id() << " has forward senes " <<
+ std::cout << "Surface " << face->id() << " has forward sense " <<
"with multiple volume " << forward->id() << " and " <<
"volume " << vol->id() << std::endl;
return MB_FAILURE;
https://bitbucket.org/fathomteam/moab/commits/e33be4a0bb59/
Changeset: e33be4a0bb59
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Small formatting corrections to ReadCGM.cpp
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index a173cff..7654b01 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -282,7 +282,6 @@ ErrorCode ReadCGM::store_surface_senses( Interface* moab, std::map<RefEntity*,En
}
}
-
return MB_SUCCESS;
}
@@ -415,7 +414,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
#else
//true argument is optional, but for large multi-names situation, it should save
//some cpu time
- RefEntityName::instance()->get_refentity_name(grp, name_list,true);
+ RefEntityName::instance()->get_refentity_name(grp, name_list, true);
#endif
if (name_list.size() == 0)
continue;
https://bitbucket.org/fathomteam/moab/commits/d57db27ecbf3/
Changeset: d57db27ecbf3
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added a function store_curve_senses to ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 7654b01..4cca13f 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -285,6 +285,40 @@ ErrorCode ReadCGM::store_surface_senses( Interface* moab, std::map<RefEntity*,En
return MB_SUCCESS;
}
+ErrorCode ReadCGM::store_curve_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] )
+{
+
+ ErrorCode rval;
+ std::vector<EntityHandle> ents;
+ std::vector<int> senses;
+ std::map<RefEntity*,EntityHandle>::iterator ci;
+ for (ci = entitymap[1].begin(); ci != entitymap[1].end(); ++ci) {
+ RefEdge* edge = (RefEdge*)(ci->first);
+ ents.clear();
+ senses.clear();
+ for (SenseEntity* ce = edge->get_first_sense_entity_ptr();
+ ce; ce = ce->next_on_bte()) {
+ BasicTopologyEntity* fac = ce->get_parent_basic_topology_entity_ptr();
+ EntityHandle face = entitymap[2][fac];
+ if (ce->get_sense() == CUBIT_UNKNOWN ||
+ ce->get_sense() != edge->get_curve_ptr()->bridge_sense()) {
+ ents.push_back(face);
+ senses.push_back(SENSE_REVERSE);
+ }
+ if (ce->get_sense() == CUBIT_UNKNOWN ||
+ ce->get_sense() == edge->get_curve_ptr()->bridge_sense()) {
+ ents.push_back(face);
+ senses.push_back(SENSE_FORWARD);
+ }
+ }
+
+ rval = myGeomTool->set_senses( ci->second, ents, senses);
+ if (MB_SUCCESS != rval)
+ return rval;
+ }
+ return MB_SUCCESS;
+}
+
// copy geometry into mesh database
ErrorCode ReadCGM::load_file(const char *cgm_file_name,
@@ -368,33 +402,9 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
rval = store_surface_senses( mdbImpl, entmap );
if (rval!=MB_SUCCESS) return rval;
- // store CoEdge senses
- std::vector<EntityHandle> ents;
- std::vector<int> senses;
- for (ci = entmap[1].begin(); ci != entmap[1].end(); ++ci) {
- RefEdge* edge = (RefEdge*)(ci->first);
- ents.clear();
- senses.clear();
- for (SenseEntity* ce = edge->get_first_sense_entity_ptr();
- ce; ce = ce->next_on_bte()) {
- BasicTopologyEntity* fac = ce->get_parent_basic_topology_entity_ptr();
- EntityHandle face = entmap[2][fac];
- if (ce->get_sense() == CUBIT_UNKNOWN ||
- ce->get_sense() != edge->get_curve_ptr()->bridge_sense()) {
- ents.push_back(face);
- senses.push_back(SENSE_REVERSE);
- }
- if (ce->get_sense() == CUBIT_UNKNOWN ||
- ce->get_sense() == edge->get_curve_ptr()->bridge_sense()) {
- ents.push_back(face);
- senses.push_back(SENSE_FORWARD);
- }
- }
-
- rval = myGeomTool->set_senses( ci->second, ents, senses);
- if (MB_SUCCESS != rval)
- return rval;
- }
+ // store CoEdge senses
+ rval = store_curve_senses( mdbImpl, entmap);
+ if (rval!=MB_SUCCESS) return rval;
// create entity sets for all ref groups
std::vector<Tag> extra_name_tags;
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 480cc48..d9d3a29 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -90,6 +90,8 @@ public:
ErrorCode store_surface_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
+ ErrorCode store_curve_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
+
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/3511a68ccc66/
Changeset: 3511a68ccc66
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Removed MOAB interface argument from store_surface_senses function in ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 4cca13f..4cc5b2c 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -234,7 +234,7 @@ ErrorCode ReadCGM::create_topology( Interface* moab, std::map<RefEntity*,EntityH
return MB_SUCCESS;
}
-ErrorCode ReadCGM::store_surface_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] )
+ErrorCode ReadCGM::store_surface_senses( std::map<RefEntity*,EntityHandle> entitymap[5] )
{
ErrorCode rval;
std::map<RefEntity*,EntityHandle>::iterator ci;
@@ -399,7 +399,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
if (rval!=MB_SUCCESS) return rval;
// store CoFace senses
- rval = store_surface_senses( mdbImpl, entmap );
+ rval = store_surface_senses( entmap );
if (rval!=MB_SUCCESS) return rval;
// store CoEdge senses
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index d9d3a29..848b27c 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -88,7 +88,7 @@ public:
ErrorCode create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
- ErrorCode store_surface_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
+ ErrorCode store_surface_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
ErrorCode store_curve_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
https://bitbucket.org/fathomteam/moab/commits/45de710c95c0/
Changeset: 45de710c95c0
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Removed MOAB interface argument from store_curve_senses in ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 4cc5b2c..9800acb 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -285,7 +285,7 @@ ErrorCode ReadCGM::store_surface_senses( std::map<RefEntity*,EntityHandle> entit
return MB_SUCCESS;
}
-ErrorCode ReadCGM::store_curve_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] )
+ErrorCode ReadCGM::store_curve_senses( std::map<RefEntity*,EntityHandle> entitymap[5] )
{
ErrorCode rval;
@@ -403,7 +403,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
if (rval!=MB_SUCCESS) return rval;
// store CoEdge senses
- rval = store_curve_senses( mdbImpl, entmap);
+ rval = store_curve_senses( entmap );
if (rval!=MB_SUCCESS) return rval;
// create entity sets for all ref groups
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 848b27c..406cef8 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -90,7 +90,7 @@ public:
ErrorCode store_surface_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
- ErrorCode store_curve_senses( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
+ ErrorCode store_curve_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/496f817a16b2/
Changeset: 496f817a16b2
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added comments to section on group entity creation in ReadCGM
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 9800acb..d1137bf 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -414,11 +414,15 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
DLIList<CubitString*> name_list;
#endif
entlist.clean_out();
+ //get all entity groups from the CGM model
GeometryQueryTool::instance()->ref_entity_list( "group", entlist );
entlist.reset();
+ //loop over all groups
for (int i = entlist.size(); i--; ) {
+ //take the next group
RefEntity* grp = entlist.get_and_step();
name_list.clean_out();
+//get the names of all entities in this group from the solid model
#if CGM_MAJOR_VERSION>13
RefEntityName::instance()->get_refentity_name(grp, name_list);
#else
@@ -428,19 +432,19 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
#endif
if (name_list.size() == 0)
continue;
-
+ //set pointer to first name of the group and set the first name to name1
name_list.reset();
#if CGM_MAJOR_VERSION>13
CubitString name1 = name_list.get();
#else
CubitString name1 = *name_list.get();
#endif
-
+ // create entity handle for the group
EntityHandle h;
rval = mdbImpl->create_meshset( MESHSET_SET, h );
if (MB_SUCCESS != rval)
return rval;
-
+ //set tag data for the group
char namebuf[NAME_TAG_SIZE];
memset( namebuf, '\0', NAME_TAG_SIZE );
strncpy( namebuf, name1.c_str(), NAME_TAG_SIZE - 1 );
@@ -459,7 +463,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
rval = mdbImpl->tag_set_data( category_tag, &h, 1, &geom_categories[4] );
if (MB_SUCCESS != rval)
return MB_FAILURE;
-
+ //check for extra group names
if (name_list.size() > 1) {
for (int j = extra_name_tags.size(); j < name_list.size(); ++j) {
sprintf( namebuf, "EXTRA_%s%d", NAME_TAG_NAME, j );
@@ -468,7 +472,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
assert(!rval);
extra_name_tags.push_back(t);
}
-
+ //add extra group names to the group handle
for (int j = 0; j < name_list.size(); ++j) {
#if CGM_MAJOR_VERSION>13
name1 = name_list.get_and_step();
@@ -485,7 +489,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
return MB_FAILURE;
}
}
-
+ //add the group handle
entmap[4][grp] = h;
}
https://bitbucket.org/fathomteam/moab/commits/22564cd4f7c1/
Changeset: 22564cd4f7c1
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added the function create group entities to ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index d1137bf..5616365 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -319,6 +319,101 @@ ErrorCode ReadCGM::store_curve_senses( std::map<RefEntity*,EntityHandle> entitym
return MB_SUCCESS;
}
+ErrorCode ReadCGM::create_group_entities( Interface* moab, std::map<RefEntity*,EntityHandle>* entitymap )
+{
+
+ ErrorCode rval;
+ const char geom_categories[][CATEGORY_TAG_SIZE] =
+ {"Vertex\0", "Curve\0", "Surface\0", "Volume\0", "Group\0"};
+ DLIList<RefEntity*> entitylist;
+ // create entity sets for all ref groups
+ std::vector<Tag> extra_name_tags;
+#if CGM_MAJOR_VERSION>13
+ DLIList<CubitString> name_list;
+#else
+ DLIList<CubitString*> name_list;
+#endif
+ entitylist.clean_out();
+ //get all entity groups from the CGM model
+ GeometryQueryTool::instance()->ref_entity_list( "group", entitylist );
+ entitylist.reset();
+ //loop over all groups
+ for (int i = entitylist.size(); i--; ) {
+ //take the next group
+ RefEntity* grp = entitylist.get_and_step();
+ name_list.clean_out();
+//get the names of all entities in this group from the solid model
+#if CGM_MAJOR_VERSION>13
+ RefEntityName::instance()->get_refentity_name(grp, name_list);
+#else
+ //true argument is optional, but for large multi-names situation, it should save
+ //some cpu time
+ RefEntityName::instance()->get_refentity_name(grp, name_list, true);
+#endif
+ if (name_list.size() == 0)
+ continue;
+ //set pointer to first name of the group and set the first name to name1
+ name_list.reset();
+#if CGM_MAJOR_VERSION>13
+ CubitString name1 = name_list.get();
+#else
+ CubitString name1 = *name_list.get();
+#endif
+ // create entity handle for the group
+ EntityHandle h;
+ rval = moab->create_meshset( MESHSET_SET, h );
+ if (MB_SUCCESS != rval)
+ return rval;
+ //set tag data for the group
+ char namebuf[NAME_TAG_SIZE];
+ memset( namebuf, '\0', NAME_TAG_SIZE );
+ strncpy( namebuf, name1.c_str(), NAME_TAG_SIZE - 1 );
+ if (name1.length() >= (unsigned)NAME_TAG_SIZE)
+ std::cout << "WARNING: group name '" << name1.c_str()
+ << "' truncated to '" << namebuf << "'" << std::endl;
+ rval = moab->tag_set_data( name_tag, &h, 1, namebuf );
+ if (MB_SUCCESS != rval)
+ return MB_FAILURE;
+
+ int id = grp->id();
+ rval = moab->tag_set_data( id_tag, &h, 1, &id );
+ if (MB_SUCCESS != rval)
+ return MB_FAILURE;
+
+ rval = moab->tag_set_data( category_tag, &h, 1, &geom_categories[4] );
+ if (MB_SUCCESS != rval)
+ return MB_FAILURE;
+ //check for extra group names
+ if (name_list.size() > 1) {
+ for (int j = extra_name_tags.size(); j < name_list.size(); ++j) {
+ sprintf( namebuf, "EXTRA_%s%d", NAME_TAG_NAME, j );
+ Tag t;
+ rval = moab->tag_get_handle( namebuf, NAME_TAG_SIZE, MB_TYPE_OPAQUE, t, MB_TAG_SPARSE|MB_TAG_CREAT );
+ assert(!rval);
+ extra_name_tags.push_back(t);
+ }
+ //add extra group names to the group handle
+ for (int j = 0; j < name_list.size(); ++j) {
+#if CGM_MAJOR_VERSION>13
+ name1 = name_list.get_and_step();
+#else
+ name1 = *name_list.get_and_step();
+#endif
+ memset( namebuf, '\0', NAME_TAG_SIZE );
+ strncpy( namebuf, name1.c_str(), NAME_TAG_SIZE - 1 );
+ if (name1.length() >= (unsigned)NAME_TAG_SIZE)
+ std::cout << "WARNING: group name '" << name1.c_str()
+ << "' truncated to '" << namebuf << "'" << std::endl;
+ rval = moab->tag_set_data( extra_name_tags[j], &h, 1, namebuf );
+ if (MB_SUCCESS != rval)
+ return MB_FAILURE;
+ }
+ }
+ //add the group handle
+ entitymap[4][grp] = h;
+ }
+ return MB_SUCCESS;
+}
// copy geometry into mesh database
ErrorCode ReadCGM::load_file(const char *cgm_file_name,
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 406cef8..51d84ad 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -92,6 +92,9 @@ public:
ErrorCode store_curve_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
+ ErrorCode create_group_entities( Interface* moab, std::map<RefEntity*,EntityHandle>* entitymap );
+
+
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/5d29b19b02ad/
Changeset: 5d29b19b02ad
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added a new file for sense checking and re-directed the ReadCGM sense tests to that file
Affected #: 2 files
diff --git a/MeshFiles/unittest/io/cylcube.sat b/MeshFiles/unittest/io/cylcube.sat
new file mode 100644
index 0000000..0b65976
--- /dev/null
+++ b/MeshFiles/unittest/io/cylcube.sat
@@ -0,0 +1,202 @@
+1900 0 2 0
+10 Cubit 12.2 17 ACIS 19.0.2 Linux 24 Thu Feb 6 08:36:54 2014
+1 9.9999999999999995e-07 1e-10
+body $2 -1 -1 $-1 $3 $-1 $4 T 25 -5 -5 35 5 5 #
+body $5 -1 -1 $-1 $6 $-1 $-1 T -5 -5 -5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $7 $-1 $0 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+lump $8 -1 -1 $-1 $-1 $9 $0 T 25 -5 -5 35 5 5 #
+transform $-1 -1 1 0 0 0 1 0 0 0 1 0 0 0 1 no_rotate no_reflect no_shear #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $10 $-1 $1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+lump $11 -1 -1 $-1 $-1 $12 $1 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $-1 $2 $0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $13 $-1 $3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+shell $-1 -1 -1 $-1 $-1 $-1 $14 $-1 $3 T 25 -5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $5 $1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $15 $-1 $6 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+shell $-1 -1 -1 $-1 $-1 $-1 $16 $-1 $6 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $17 $8 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+face $18 -1 -1 $-1 $19 $20 $9 $-1 $21 forward single T 25 -5 5 35 5 5 F #
+simple-snl-attrib $-1 -1 $22 $11 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+face $23 -1 -1 $-1 $24 $25 $12 $-1 $26 forward single T -5 -5 -5 5 5 5 F #
+simple-snl-attrib $-1 -1 $27 $13 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 2 0 7 1 2 618932362 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $28 $-1 $14 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+face $29 -1 -1 $-1 $30 $31 $9 $-1 $32 reversed single T 25 -5 -5 35 5 -5 F #
+loop $-1 -1 -1 $-1 $-1 $33 $14 T 25 -5 5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 5 0 0 1 1 0 0 forward_v I I I I #
+simple-snl-attrib $-1 -1 $34 $15 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 3 0 7 1 3 885205176 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $35 $-1 $16 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+face $36 -1 -1 $-1 $37 $38 $12 $-1 $39 forward single T -5 -5 -5 5 5 -5 F #
+loop $-1 -1 -1 $-1 $40 $41 $16 T -5 -5 -5 5 5 -5 unknown #
+cone-surface $-1 -1 -1 $-1 0 0 0 0 0 1 5 0 0 1 I I 0 1 5 forward I I I I #
+simple-snl-attrib $-1 -1 $-1 $17 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 4 4 1 1 0 0 #
+simple-snl-attrib $-1 -1 $42 $18 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $43 $-1 $19 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+face $44 -1 -1 $-1 $45 $46 $9 $-1 $47 reversed single T 25 -5 -5 35 -5 5 F #
+loop $-1 -1 -1 $-1 $-1 $48 $19 T 25 -5 -5 35 5 -5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 -5 0 0 1 1 0 0 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $49 $50 $51 $52 forward $20 $-1 #
+simple-snl-attrib $-1 -1 $-1 $22 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 5 5 1 1 0 0 #
+simple-snl-attrib $-1 -1 $53 $23 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $54 $-1 $24 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+face $55 -1 -1 $-1 $-1 $56 $12 $-1 $57 forward single T -5 -5 5 5 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $58 $24 T -5 -5 -5 5 5 -5 unknown #
+plane-surface $-1 -1 -1 $-1 0 0 -5 0 0 -1 -1 0 0 forward_v I I I I #
+loop $-1 -1 -1 $-1 $-1 $59 $16 T -5 -5 5 5 5 5 unknown #
+coedge $-1 -1 -1 $-1 $41 $41 $58 $60 reversed $25 $-1 #
+simple-snl-attrib $-1 -1 $-1 $28 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $61 $29 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $62 $-1 $30 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+face $63 -1 -1 $-1 $64 $65 $9 $-1 $66 reversed single T 25 -5 -5 25 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $67 $30 T 25 -5 -5 35 -5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 -5 0 0 1 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $68 $69 $70 $71 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $72 $33 $73 $74 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $33 $72 $75 $76 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $77 $78 $33 $52 reversed $79 $-1 #
+edge $80 -1 -1 $-1 $81 -5 $82 5 $51 $83 forward @7 unknown T 35 -5 5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $35 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $84 $36 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $85 $-1 $37 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+loop $-1 -1 -1 $-1 $-1 $86 $37 T -5 -5 5 5 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 0 0 5 0 0 1 1 0 0 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $58 $58 $41 $60 forward $38 $-1 #
+coedge $-1 -1 -1 $-1 $59 $59 $86 $87 reversed $40 $-1 #
+edge $88 -1 -1 $-1 $89 0 $89 6.2831853071795862 $58 $90 forward @7 unknown T -5 -5 -5 5 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $43 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $91 $44 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $92 $-1 $45 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+face $93 -1 -1 $-1 $94 $95 $9 $-1 $96 reversed single T 25 5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $97 $45 T 25 -5 -5 25 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 25 0 0 1 0 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $98 $75 $99 $100 forward $46 $-1 #
+coedge $-1 -1 -1 $-1 $101 $48 $98 $102 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $48 $101 $103 $104 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $78 $77 $48 $71 reversed $79 $-1 #
+edge $105 -1 -1 $-1 $106 -5 $107 5 $70 $108 forward @7 unknown T 35 -5 -5 35 5 -5 #
+coedge $-1 -1 -1 $-1 $50 $49 $109 $110 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $111 $112 $49 $74 reversed $95 $-1 #
+edge $113 -1 -1 $-1 $82 -5 $114 5 $73 $115 forward @7 unknown T 25 5 5 35 5 5 #
+coedge $-1 -1 -1 $-1 $67 $116 $50 $76 reversed $46 $-1 #
+edge $117 -1 -1 $-1 $118 -5 $81 5 $75 $119 forward @7 unknown T 25 -5 5 35 -5 5 #
+coedge $-1 -1 -1 $-1 $70 $51 $116 $120 forward $79 $-1 #
+coedge $-1 -1 -1 $-1 $51 $70 $111 $121 reversed $79 $-1 #
+loop $-1 -1 -1 $-1 $-1 $77 $94 T 35 -5 -5 35 5 5 unknown #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $122 $-1 $52 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+vertex $123 -1 -1 $-1 $52 $124 #
+vertex $125 -1 -1 $-1 $52 $126 #
+straight-curve $-1 -1 -1 $-1 35 0 5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $54 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $127 $55 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+coedge $-1 -1 -1 $-1 $86 $86 $59 $87 forward $56 $-1 #
+edge $128 -1 -1 $-1 $129 0 $129 6.2831853071795862 $86 $130 forward @7 unknown T -5 -5 5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $131 $-1 $60 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 13 #
+vertex $132 -1 -1 $-1 $60 $133 #
+ellipse-curve $-1 -1 -1 $-1 0 0 -5 0 0 -1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $62 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $134 $63 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $135 $-1 $64 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+face $136 -1 -1 $-1 $-1 $79 $9 $-1 $137 reversed single T 35 -5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $111 $64 T 25 5 -5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 5 0 0 -1 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $138 $109 $112 $139 forward $65 $-1 #
+coedge $-1 -1 -1 $-1 $116 $67 $68 $102 reversed $46 $-1 #
+coedge $-1 -1 -1 $-1 $109 $138 $67 $100 reversed $65 $-1 #
+edge $140 -1 -1 $-1 $118 -5 $141 5 $99 $142 forward @7 unknown T 25 -5 -5 25 -5 5 #
+coedge $-1 -1 -1 $-1 $69 $68 $138 $143 forward $31 $-1 #
+edge $144 -1 -1 $-1 $107 -5 $141 5 $98 $145 forward @7 unknown T 25 -5 -5 35 -5 -5 #
+coedge $-1 -1 -1 $-1 $112 $111 $69 $104 reversed $95 $-1 #
+edge $146 -1 -1 $-1 $147 -5 $106 5 $103 $148 forward @7 unknown T 25 5 -5 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $149 $-1 $71 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+vertex $150 -1 -1 $-1 $71 $151 #
+vertex $152 -1 -1 $-1 $120 $153 #
+straight-curve $-1 -1 -1 $-1 35 0 -5 0 -1 0 I I #
+coedge $-1 -1 -1 $-1 $97 $99 $72 $110 reversed $65 $-1 #
+edge $154 -1 -1 $-1 $114 -5 $118 5 $109 $155 forward @7 unknown T 25 -5 5 25 5 5 #
+coedge $-1 -1 -1 $-1 $103 $73 $78 $121 forward $95 $-1 #
+coedge $-1 -1 -1 $-1 $73 $103 $97 $139 reversed $95 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $156 $-1 $74 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+vertex $157 -1 -1 $-1 $74 $158 #
+straight-curve $-1 -1 -1 $-1 30 5 5 -1 0 0 I I #
+coedge $-1 -1 -1 $-1 $75 $98 $77 $120 reversed $46 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $159 $-1 $76 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+vertex $160 -1 -1 $-1 $110 $161 #
+straight-curve $-1 -1 -1 $-1 30 -5 5 1 0 0 I I #
+edge $162 -1 -1 $-1 $81 -5 $107 5 $77 $163 forward @7 unknown T 35 -5 -5 35 -5 5 #
+edge $164 -1 -1 $-1 $82 -5 $106 5 $78 $165 forward @7 unknown T 35 5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $80 $52 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $166 $-1 $81 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+point $-1 -1 -1 $-1 35 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $167 $-1 $82 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+point $-1 -1 -1 $-1 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $85 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $168 $-1 $87 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 14 #
+vertex $169 -1 -1 $-1 $87 $170 #
+ellipse-curve $-1 -1 -1 $-1 0 0 5 0 0 1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $88 $60 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 13 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $171 $-1 $89 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+point $-1 -1 -1 $-1 5 0 -5 #
+simple-snl-attrib $-1 -1 $-1 $92 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $172 $93 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $173 $-1 $94 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 6 #
+plane-surface $-1 -1 -1 $-1 35 0 0 -1 0 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $99 $97 $101 $143 reversed $65 $-1 #
+edge $174 -1 -1 $-1 $114 -5 $147 5 $112 $175 forward @7 unknown T 25 5 -5 25 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $176 $-1 $100 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+vertex $177 -1 -1 $-1 $143 $178 #
+straight-curve $-1 -1 -1 $-1 25 -5 0 0 0 -1 I I #
+edge $179 -1 -1 $-1 $141 -5 $147 5 $138 $180 forward @7 unknown T 25 -5 -5 25 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $181 $-1 $102 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 6 #
+straight-curve $-1 -1 -1 $-1 30 -5 -5 -1 0 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $182 $-1 $104 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+vertex $183 -1 -1 $-1 $104 $184 #
+straight-curve $-1 -1 -1 $-1 30 5 -5 1 0 0 I I #
+simple-snl-attrib $-1 -1 $-1 $105 $71 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $185 $-1 $106 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+point $-1 -1 -1 $-1 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $186 $-1 $107 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 6 #
+point $-1 -1 -1 $-1 35 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $187 $-1 $110 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+straight-curve $-1 -1 -1 $-1 25 0 5 0 -1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $113 $74 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $188 $-1 $114 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+point $-1 -1 -1 $-1 25 5 5 #
+simple-snl-attrib $-1 -1 $-1 $117 $76 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $189 $-1 $118 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+point $-1 -1 -1 $-1 25 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $190 $-1 $120 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 10 #
+straight-curve $-1 -1 -1 $-1 35 -5 0 0 0 -1 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $191 $-1 $121 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 12 #
+straight-curve $-1 -1 -1 $-1 35 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $123 $81 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $125 $82 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $128 $87 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 14 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $192 $-1 $129 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 10 #
+point $-1 -1 -1 $-1 5 0 5 #
+simple-snl-attrib $-1 -1 $-1 $132 $89 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $135 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $193 $136 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $194 $-1 $139 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 11 #
+straight-curve $-1 -1 -1 $-1 25 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $140 $100 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $195 $-1 $141 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+point $-1 -1 -1 $-1 25 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $196 $-1 $143 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+straight-curve $-1 -1 -1 $-1 25 0 -5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $144 $102 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $146 $104 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $197 $-1 $147 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+point $-1 -1 -1 $-1 25 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $150 $106 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $152 $107 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $154 $110 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $157 $114 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $160 $118 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $162 $120 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $164 $121 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 12 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $169 $129 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $173 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $-1 $174 $139 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 11 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $177 $141 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $179 $143 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $183 $147 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+End-of-ACIS-data
\ No newline at end of file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 4f0896d..0b45b99 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -21,9 +21,9 @@ using namespace moab;
#ifdef MESHDIR
-static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
#else
-static const char input_cube[] = "/io/cube.sat";
+static const char input_cube[] = "/io/cylcube.sat";
#endif
// Function used to load the test file
https://bitbucket.org/fathomteam/moab/commits/c40f4830b8df/
Changeset: c40f4830b8df
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Updated names of test functions; made a correction to a variable name in read_cylcube_surf_senses_test()
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 0b45b99..07713a9 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -42,8 +42,8 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
int geom_id_by_handle( Interface* moab, const EntityHandle set );
// List of tests in this file
-void read_cube_curve_senses_test();
-void read_cube_surf_senses_test();
+void read_cylcube_curve_senses_test();
+void read_cylcube_surf_senses_test();
void delete_mesh_test();
@@ -51,8 +51,8 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST(read_cube_curve_senses_test);
- result += RUN_TEST(read_cube_surf_senses_test);
+ result += RUN_TEST(read_cylcube_curve_senses_test);
+ result += RUN_TEST(read_cylcube_surf_senses_test);
return result;
}
@@ -67,7 +67,7 @@ void read_file( Interface* moab, const char* input_file )
CHECK_ERR(rval);
}
-void read_cube_curve_senses_test()
+void read_cylcube_curve_senses_test()
{
ErrorCode rval;
//Open the test file
@@ -248,7 +248,7 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
}
///SURFACE SENSE CHECKING
-void read_cube_surf_senses_test()
+void read_cylcube_surf_senses_test()
{
ErrorCode rval;
//Open the test file
@@ -265,11 +265,11 @@ void read_cube_surf_senses_test()
// Check that the proper number of surfaces exist
int dim = 2;
void *val[] = {&dim};
- int number_of_curves;
+ int number_of_surfs;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
- val, 1, number_of_curves );
+ val, 1, number_of_surfs );
CHECK_ERR(rval);
- CHECK_EQUAL( 6, number_of_curves );
+ CHECK_EQUAL( 6, number_of_surfs );
// Get surface handles
Range surfs;
https://bitbucket.org/fathomteam/moab/commits/342892a9a922/
Changeset: 342892a9a922
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Updated reference information to match the new file
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 07713a9..0ec0db7 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -88,7 +88,7 @@ void read_cylcube_curve_senses_test()
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
CHECK_ERR(rval);
- CHECK_EQUAL( 12 , number_of_curves );
+ CHECK_EQUAL( 14, number_of_curves );
//Get curve handles
Range curves;
@@ -186,63 +186,72 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
case 1:
surf_ids_out.push_back(1); surf_ids_out.push_back(6);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 2:
surf_ids_out.push_back(1); surf_ids_out.push_back(5);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 3:
surf_ids_out.push_back(1); surf_ids_out.push_back(4);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 4:
surf_ids_out.push_back(1); surf_ids_out.push_back(3);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 5:
surf_ids_out.push_back(2); surf_ids_out.push_back(6);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 6:
surf_ids_out.push_back(2); surf_ids_out.push_back(3);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 7:
surf_ids_out.push_back(2); surf_ids_out.push_back(4);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 8:
surf_ids_out.push_back(2); surf_ids_out.push_back(5);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 9:
surf_ids_out.push_back(3); surf_ids_out.push_back(4);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 10:
surf_ids_out.push_back(3); surf_ids_out.push_back(6);
senses_out.push_back(-1); senses_out.push_back(1);
+ break;
- break;
case 11:
surf_ids_out.push_back(4); surf_ids_out.push_back(5);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 12:
surf_ids_out.push_back(5); surf_ids_out.push_back(6);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
+ case 13:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(-1); senses_out.push_back(1);
+ break;
+
+ case 14:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(9);
+ senses_out.push_back(-1); senses_out.push_back(1);
+ break;
}
}
@@ -269,7 +278,7 @@ void read_cylcube_surf_senses_test()
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_surfs );
CHECK_ERR(rval);
- CHECK_EQUAL( 6, number_of_surfs );
+ CHECK_EQUAL( 9, number_of_surfs );
// Get surface handles
Range surfs;
@@ -316,33 +325,47 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
case 1:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+ break;
- break;
case 2:
vol_ids_out.push_back(1);
senses_out.push_back(1);
-
- break;
+ break;
case 3:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+ break;
- break;
case 4:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+ break;
- break;
case 5:
vol_ids_out.push_back(1);
senses_out.push_back(1);
- break;
+ break;
+
case 6:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+ break;
+
+ case 7:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(1);
+ break;
+
+ case 8:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(1);
+ break;
- break;
+ case 9:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(1);
+ break;
}
}
https://bitbucket.org/fathomteam/moab/commits/5dcca0a2f916/
Changeset: 5dcca0a2f916
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Updated sense settings to use macros in case the CGM convention ever changes again.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 0ec0db7..2dcda2e 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -12,6 +12,9 @@
#include "InitCGMA.hpp"
#include "GeometryQueryTool.hpp"
+#define SENSE_FORWARD 1
+#define SENSE_REVERSE -1
+#define SENSE_UNKNOWN 0
using namespace moab;
#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
@@ -185,72 +188,72 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
{
case 1:
surf_ids_out.push_back(1); surf_ids_out.push_back(6);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 2:
surf_ids_out.push_back(1); surf_ids_out.push_back(5);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 3:
surf_ids_out.push_back(1); surf_ids_out.push_back(4);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 4:
surf_ids_out.push_back(1); surf_ids_out.push_back(3);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 5:
surf_ids_out.push_back(2); surf_ids_out.push_back(6);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 6:
surf_ids_out.push_back(2); surf_ids_out.push_back(3);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 7:
surf_ids_out.push_back(2); surf_ids_out.push_back(4);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 8:
surf_ids_out.push_back(2); surf_ids_out.push_back(5);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 9:
surf_ids_out.push_back(3); surf_ids_out.push_back(4);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 10:
surf_ids_out.push_back(3); surf_ids_out.push_back(6);
- senses_out.push_back(-1); senses_out.push_back(1);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
break;
case 11:
surf_ids_out.push_back(4); surf_ids_out.push_back(5);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 12:
surf_ids_out.push_back(5); surf_ids_out.push_back(6);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 13:
surf_ids_out.push_back(7); surf_ids_out.push_back(8);
- senses_out.push_back(-1); senses_out.push_back(1);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
break;
case 14:
surf_ids_out.push_back(7); surf_ids_out.push_back(9);
- senses_out.push_back(-1); senses_out.push_back(1);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
break;
}
@@ -324,47 +327,47 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
{
case 1:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 2:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 3:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 4:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 5:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 6:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 7:
vol_ids_out.push_back(2);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 8:
vol_ids_out.push_back(2);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 9:
vol_ids_out.push_back(2);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
}
}
https://bitbucket.org/fathomteam/moab/commits/3a9b96952fcd/
Changeset: 3a9b96952fcd
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added new ReadCGM test file read_cgm_group_test.cpp. Included this in the /test/io Makefile.am
Affected #: 2 files
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index e9a73b3..61f932a 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -25,7 +25,8 @@ else
endif
if HAVE_CGM
- CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test read_cgm_connectivity_test
+ CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test read_cgm_connectivity_test \
+ read_cgm_group_test
else
CGM_TEST =
endif
@@ -78,6 +79,8 @@ read_cgm_senses_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_senses_test.cp
read_cgm_senses_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
read_cgm_connectivity_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_connectivity_test.cpp
read_cgm_connectivity_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_group_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_group_test.cpp
+read_cgm_group_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
readutil_test_SOURCES = $(srcdir)/../TestUtil.hpp readutil_test.cpp
cgns_test_SOURCES=$(srcdir)/../TestUtil.hpp cgns_test.cpp
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
new file mode 100644
index 0000000..5596880
--- /dev/null
+++ b/test/io/read_cgm_group_test.cpp
@@ -0,0 +1,51 @@
+
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+#include "MBTagConventions.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+
+using namespace moab;
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+ std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+ << __LINE__ << std::endl; \
+ return A; } } while(false)
+
+
+#ifdef MESHDIR
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+#else
+static const char input_cube[] = "/io/cube.sat";
+#endif
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
https://bitbucket.org/fathomteam/moab/commits/84411bd3ca21/
Changeset: 84411bd3ca21
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added testing of groups and group names to read_cgm_group_test
Affected #: 1 file
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
index 5596880..04d4787 100644
--- a/test/io/read_cgm_group_test.cpp
+++ b/test/io/read_cgm_group_test.cpp
@@ -20,21 +20,32 @@ using namespace moab;
#ifdef MESHDIR
-static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
#else
-static const char input_cube[] = "/io/cube.sat";
+static const char input_cylcube[] = "/io/cylcube.sat";
#endif
// Function used to load the test file
void read_file( Interface* moab, const char* input_file );
-// List of tests in this file
+//Function for getting entity ids
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+//Function for checking retrieved group data
+void check_group_data( std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids );
+//Function for loading all reference data
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids);
+
+// List of tests in this file
+void read_cylcube_groups_test();
int main(int /* argc */, char** /* argv */)
{
int result = 0;
+
+ result+=RUN_TEST(read_cylcube_groups_test);
return result;
}
@@ -49,3 +60,126 @@ void read_file( Interface* moab, const char* input_file )
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
}
+
+void read_cylcube_groups_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube);
+
+ //Get (or create) the name and category tags
+ Tag name_tag, category_tag;
+
+ rval = mb->tag_get_handle( NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
+ name_tag, moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ rval = mb->tag_get_handle( CATEGORY_TAG_NAME, CATEGORY_TAG_SIZE,
+ MB_TYPE_OPAQUE, category_tag,
+ moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the group entity handles
+ Range group_sets;
+ char query[] = "Group\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+ //Has to be this way because of the way tags are created
+ void* val[] = {&query};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &category_tag, val, 1, group_sets);
+ CHECK_ERR(rval);
+
+ std::vector<int> g_ids;
+ std::vector<std::string> g_names;
+ std::vector<int> g_ent_ids;
+ int j = 0;
+ for(Range::iterator i=group_sets.begin(); i!=group_sets.end(); i++)
+ {
+ int group_id = geom_id_by_handle( mb, *i );
+ g_ids.push_back(group_id);
+ //Get the group name
+ char group_name[NAME_TAG_SIZE+1];
+ rval = mb->tag_get_data( name_tag, &(*i), 1, &group_name);
+ CHECK_ERR(rval);
+ //Store group name
+ std::string temp(group_name);
+ g_names.push_back(temp);
+ //Ensure the group is named correctly
+ CHECK( strcmp( group_name, "Group 2") || strcmp(group_name, "Group 3"));
+ //Get all entities in the group
+ Range group_ents;
+ rval = mb->get_entities_by_type( *i, MBENTITYSET, group_ents, false);
+ CHECK_ERR(rval);
+ if( group_ents.size() != 1) CHECK(false);
+ int grp_ent_id = geom_id_by_handle( mb, group_ents[0] );
+ g_ent_ids.push_back(grp_ent_id);
+
+ }
+ check_group_data(g_ids, g_names, g_ent_ids);
+}
+
+
+void check_group_data(std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids )
+{
+
+ //Initialize reference data
+ std::vector<int> group_ref_ids;
+ std::vector<std::string> group_ref_names;
+ std::vector<int> group_ref_ent_ids;
+ load_group_references( group_ref_ids, group_ref_names, group_ref_ent_ids );
+
+ // check that the correct number of entities were found
+ CHECK_EQUAL ( group_ref_ids.size(), group_ids.size() );
+ // CHECK_EQUAL ( group_ref_names.size(), group_names.size() );
+ CHECK_EQUAL ( group_ref_ent_ids.size(), group_ent_ids.size() );
+
+ //now make sure that each group has a matching group
+ for(unsigned int i=0 ; i<group_ids.size(); i++)
+ {
+ for(unsigned int j=0; j<group_ref_ids.size(); j++)
+ {
+ if( group_ids[i]==group_ref_ids[j]
+ && group_names[i] == group_ref_names[j]
+ && group_ent_ids[i]==group_ref_ent_ids[j])
+ {
+ group_ref_ids.erase(group_ref_ids.begin()+j);
+ group_ref_names.erase(group_ref_names.begin()+j);
+ group_ref_ent_ids.erase(group_ref_ent_ids.begin()+j);
+ continue;
+ }
+ }
+ }
+
+ // Check sizes of reference vectors after matching
+ // (all should be zero)
+ int leftovers = group_ref_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_names.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_ent_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+}
+
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids )
+{
+ //First set of group info
+ names.push_back("Group 3"); ids.push_back(3); ent_ids.push_back(2);
+
+ //Second set of group info
+ names.push_back("Group 2"); ids.push_back(2); ent_ids.push_back(1);
+}
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
+ ErrorCode rval;
+ //Get the id_tag handle
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+ //Load the ID for the EntHandle given to the function
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ CHECK_ERR(rval);
+ return id;
+ }
https://bitbucket.org/fathomteam/moab/commits/2f045f63d3a8/
Changeset: 2f045f63d3a8
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Implemented the create_group_entities function in ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 5616365..002b212 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -319,7 +319,7 @@ ErrorCode ReadCGM::store_curve_senses( std::map<RefEntity*,EntityHandle> entitym
return MB_SUCCESS;
}
-ErrorCode ReadCGM::create_group_entities( Interface* moab, std::map<RefEntity*,EntityHandle>* entitymap )
+ErrorCode ReadCGM::create_group_entities( Interface* moab, std::map<RefEntity*,EntityHandle>& entitymap )
{
ErrorCode rval;
@@ -410,7 +410,7 @@ ErrorCode ReadCGM::create_group_entities( Interface* moab, std::map<RefEntity*,E
}
}
//add the group handle
- entitymap[4][grp] = h;
+ entitymap[grp] = h;
}
return MB_SUCCESS;
}
@@ -501,93 +501,10 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
rval = store_curve_senses( entmap );
if (rval!=MB_SUCCESS) return rval;
- // create entity sets for all ref groups
- std::vector<Tag> extra_name_tags;
-#if CGM_MAJOR_VERSION>13
- DLIList<CubitString> name_list;
-#else
- DLIList<CubitString*> name_list;
-#endif
- entlist.clean_out();
- //get all entity groups from the CGM model
- GeometryQueryTool::instance()->ref_entity_list( "group", entlist );
- entlist.reset();
- //loop over all groups
- for (int i = entlist.size(); i--; ) {
- //take the next group
- RefEntity* grp = entlist.get_and_step();
- name_list.clean_out();
-//get the names of all entities in this group from the solid model
-#if CGM_MAJOR_VERSION>13
- RefEntityName::instance()->get_refentity_name(grp, name_list);
-#else
- //true argument is optional, but for large multi-names situation, it should save
- //some cpu time
- RefEntityName::instance()->get_refentity_name(grp, name_list, true);
-#endif
- if (name_list.size() == 0)
- continue;
- //set pointer to first name of the group and set the first name to name1
- name_list.reset();
-#if CGM_MAJOR_VERSION>13
- CubitString name1 = name_list.get();
-#else
- CubitString name1 = *name_list.get();
-#endif
- // create entity handle for the group
- EntityHandle h;
- rval = mdbImpl->create_meshset( MESHSET_SET, h );
- if (MB_SUCCESS != rval)
- return rval;
- //set tag data for the group
- char namebuf[NAME_TAG_SIZE];
- memset( namebuf, '\0', NAME_TAG_SIZE );
- strncpy( namebuf, name1.c_str(), NAME_TAG_SIZE - 1 );
- if (name1.length() >= (unsigned)NAME_TAG_SIZE)
- std::cout << "WARNING: group name '" << name1.c_str()
- << "' truncated to '" << namebuf << "'" << std::endl;
- rval = mdbImpl->tag_set_data( name_tag, &h, 1, namebuf );
- if (MB_SUCCESS != rval)
- return MB_FAILURE;
-
- int id = grp->id();
- rval = mdbImpl->tag_set_data( id_tag, &h, 1, &id );
- if (MB_SUCCESS != rval)
- return MB_FAILURE;
-
- rval = mdbImpl->tag_set_data( category_tag, &h, 1, &geom_categories[4] );
- if (MB_SUCCESS != rval)
- return MB_FAILURE;
- //check for extra group names
- if (name_list.size() > 1) {
- for (int j = extra_name_tags.size(); j < name_list.size(); ++j) {
- sprintf( namebuf, "EXTRA_%s%d", NAME_TAG_NAME, j );
- Tag t;
- rval = mdbImpl->tag_get_handle( namebuf, NAME_TAG_SIZE, MB_TYPE_OPAQUE, t, MB_TAG_SPARSE|MB_TAG_CREAT );
- assert(!rval);
- extra_name_tags.push_back(t);
- }
- //add extra group names to the group handle
- for (int j = 0; j < name_list.size(); ++j) {
-#if CGM_MAJOR_VERSION>13
- name1 = name_list.get_and_step();
-#else
- name1 = *name_list.get_and_step();
-#endif
- memset( namebuf, '\0', NAME_TAG_SIZE );
- strncpy( namebuf, name1.c_str(), NAME_TAG_SIZE - 1 );
- if (name1.length() >= (unsigned)NAME_TAG_SIZE)
- std::cout << "WARNING: group name '" << name1.c_str()
- << "' truncated to '" << namebuf << "'" << std::endl;
- rval = mdbImpl->tag_set_data( extra_name_tags[j], &h, 1, namebuf );
- if (MB_SUCCESS != rval)
- return MB_FAILURE;
- }
- }
- //add the group handle
- entmap[4][grp] = h;
- }
-
+ // create eneity setes for all ref groups
+ rval = create_group_entities( mdbImpl, entmap[4] );
+ if(rval!=MB_SUCCESS) return rval;
+
// store contents for each group
entlist.reset();
for (ci = entmap[4].begin(); ci != entmap[4].end(); ++ci) {
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 51d84ad..af26b73 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -92,7 +92,7 @@ public:
ErrorCode store_curve_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
- ErrorCode create_group_entities( Interface* moab, std::map<RefEntity*,EntityHandle>* entitymap );
+ ErrorCode create_group_entities( Interface* moab, std::map<RefEntity*,EntityHandle>& entitymap );
//! Constructor
https://bitbucket.org/fathomteam/moab/commits/a045acebe303/
Changeset: a045acebe303
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Cleanup of ReadCGM.hpp
Affected #: 1 file
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index af26b73..72bb1d0 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -86,14 +86,15 @@ public:
ErrorCode create_entity_sets( Interface* moab,
std::map<RefEntity*,EntityHandle>* entmap_ptr );
- ErrorCode create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] );
+ ErrorCode create_topology( Interface* moab,
+ std::map<RefEntity*,EntityHandle> entitymap[5] );
ErrorCode store_surface_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
ErrorCode store_curve_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
- ErrorCode create_group_entities( Interface* moab, std::map<RefEntity*,EntityHandle>& entitymap );
-
+ ErrorCode create_group_entities( Interface* moab,
+ std::map<RefEntity*,EntityHandle>& entitymap );
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/c9e846c31cc3/
Changeset: c9e846c31cc3
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Cleanup of read_cgm_group_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
index 04d4787..1357fb3 100644
--- a/test/io/read_cgm_group_test.cpp
+++ b/test/io/read_cgm_group_test.cpp
@@ -89,7 +89,7 @@ void read_cylcube_groups_test()
void* val[] = {&query};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &category_tag, val, 1, group_sets);
CHECK_ERR(rval);
-
+ //Get group names and IDs
std::vector<int> g_ids;
std::vector<std::string> g_names;
std::vector<int> g_ent_ids;
@@ -105,18 +105,16 @@ void read_cylcube_groups_test()
//Store group name
std::string temp(group_name);
g_names.push_back(temp);
- //Ensure the group is named correctly
- CHECK( strcmp( group_name, "Group 2") || strcmp(group_name, "Group 3"));
//Get all entities in the group
Range group_ents;
- rval = mb->get_entities_by_type( *i, MBENTITYSET, group_ents, false);
+ rval = mb->get_entities_by_type( *i, MBENTITYSET, group_ents, false );
CHECK_ERR(rval);
if( group_ents.size() != 1) CHECK(false);
int grp_ent_id = geom_id_by_handle( mb, group_ents[0] );
g_ent_ids.push_back(grp_ent_id);
}
- check_group_data(g_ids, g_names, g_ent_ids);
+ check_group_data( g_ids, g_names, g_ent_ids );
}
@@ -131,7 +129,7 @@ void check_group_data(std::vector<int> group_ids, std::vector<std::string> group
// check that the correct number of entities were found
CHECK_EQUAL ( group_ref_ids.size(), group_ids.size() );
- // CHECK_EQUAL ( group_ref_names.size(), group_names.size() );
+ CHECK_EQUAL ( group_ref_names.size(), group_names.size() );
CHECK_EQUAL ( group_ref_ent_ids.size(), group_ent_ids.size() );
//now make sure that each group has a matching group
https://bitbucket.org/fathomteam/moab/commits/ebf2d270ca19/
Changeset: ebf2d270ca19
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Small changes to ReadCGM.cpp
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 002b212..6a8b8d6 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -195,9 +195,7 @@ ErrorCode ReadCGM::set_options( const FileOptions& opts,
return MB_SUCCESS;
}
-ErrorCode ReadCGM::create_entity_sets( Interface* moab,
- std::map<RefEntity*,EntityHandle>* entmap_ptr)
-
+ErrorCode ReadCGM::create_entity_sets( Interface* moab, std::map<RefEntity*,EntityHandle>* entmap_ptr )
{
ErrorCode rval;
for(int dim=0; dim<4; dim++)
@@ -210,7 +208,7 @@ ErrorCode ReadCGM::create_entity_sets( Interface* moab,
return MB_SUCCESS;
}
-ErrorCode ReadCGM::create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5])
+ErrorCode ReadCGM::create_topology( Interface* moab, std::map<RefEntity*,EntityHandle> entitymap[5] )
{
ErrorCode rval;
DLIList<RefEntity*> entitylist;
https://bitbucket.org/fathomteam/moab/commits/3ebbc12732bf/
Changeset: 3ebbc12732bf
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added a new functions store_group_contents() to ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 6a8b8d6..53b6578 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -413,6 +413,67 @@ ErrorCode ReadCGM::create_group_entities( Interface* moab, std::map<RefEntity*,E
return MB_SUCCESS;
}
+ErrorCode ReadCGM::store_group_content( Interface* moab, std::map<RefEntity*,EntityHandle>* entitymap )
+{
+
+ ErrorCode rval;
+ DLIList<RefEntity*> entlist;
+ std::map<RefEntity*,EntityHandle>::iterator ci;
+ // store contents for each group
+ entlist.reset();
+ for (ci = entitymap[4].begin(); ci != entitymap[4].end(); ++ci) {
+ RefGroup* grp = (RefGroup*)(ci->first);
+ entlist.clean_out();
+ grp->get_child_ref_entities( entlist );
+
+ Range entities;
+ while (entlist.size()) {
+ RefEntity* ent = entlist.pop();
+ int dim = ent->dimension();
+
+ if (dim < 0) {
+
+ Body* body;
+ if (entitymap[4].find(ent) != entitymap[4].end()){
+ // child is another group; examine its contents
+ entities.insert( entitymap[4][ent] );
+ }
+ else if( (body = dynamic_cast<Body*>(ent)) != NULL ){
+ // Child is a CGM Body, which presumably comprises some volumes--
+ // extract volumes as if they belonged to group.
+ DLIList<RefVolume*> vols;
+ body->ref_volumes( vols );
+ for( int vi = vols.size(); vi--; ){
+ RefVolume* vol = vols.get_and_step();
+ if( entitymap[3].find(vol) != entitymap[3].end() ){
+ entities.insert( entitymap[3][vol] );
+ }
+ else{
+ std::cerr << "Warning: CGM Body has orphan RefVolume" << std::endl;
+ }
+ }
+ }
+ else{
+ // otherwise, warn user.
+ std::cerr << "Warning: A dim<0 entity is being ignored by ReadCGM." << std::endl;
+ }
+
+ }
+ else if (dim < 4) {
+ if (entitymap[dim].find(ent) != entitymap[dim].end())
+ entities.insert( entitymap[dim][ent] );
+ }
+ }
+
+ if (!entities.empty()) {
+ rval = mdbImpl->add_entities( ci->second, entities );
+ if (MB_SUCCESS != rval)
+ return MB_FAILURE;
+ }
+ }
+
+
+}
// copy geometry into mesh database
ErrorCode ReadCGM::load_file(const char *cgm_file_name,
const EntityHandle* file_set,
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 72bb1d0..54948a1 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -96,6 +96,8 @@ public:
ErrorCode create_group_entities( Interface* moab,
std::map<RefEntity*,EntityHandle>& entitymap );
+ ErrorCode store_group_content( Interface* moab, std::map<RefEntity*,EntityHandle>* entitymap );
+
//! Constructor
ReadCGM(Interface* impl = NULL);
https://bitbucket.org/fathomteam/moab/commits/8f322d693cc1/
Changeset: 8f322d693cc1
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Implemented the store_group_content() function in ReadCGM.
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 53b6578..5dccad0 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -432,7 +432,6 @@ ErrorCode ReadCGM::store_group_content( Interface* moab, std::map<RefEntity*,Ent
int dim = ent->dimension();
if (dim < 0) {
-
Body* body;
if (entitymap[4].find(ent) != entitymap[4].end()){
// child is another group; examine its contents
@@ -471,9 +470,9 @@ ErrorCode ReadCGM::store_group_content( Interface* moab, std::map<RefEntity*,Ent
return MB_FAILURE;
}
}
-
-
+ return MB_SUCCESS;
}
+
// copy geometry into mesh database
ErrorCode ReadCGM::load_file(const char *cgm_file_name,
const EntityHandle* file_set,
@@ -564,65 +563,15 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
rval = create_group_entities( mdbImpl, entmap[4] );
if(rval!=MB_SUCCESS) return rval;
- // store contents for each group
- entlist.reset();
- for (ci = entmap[4].begin(); ci != entmap[4].end(); ++ci) {
- RefGroup* grp = (RefGroup*)(ci->first);
- entlist.clean_out();
- grp->get_child_ref_entities( entlist );
-
- Range entities;
- while (entlist.size()) {
- RefEntity* ent = entlist.pop();
- int dim = ent->dimension();
-
- if (dim < 0) {
-
- Body* body;
- if (entmap[4].find(ent) != entmap[4].end()){
- // child is another group; examine its contents
- entities.insert( entmap[4][ent] );
- }
- else if( (body = dynamic_cast<Body*>(ent)) != NULL ){
- // Child is a CGM Body, which presumably comprises some volumes--
- // extract volumes as if they belonged to group.
- DLIList<RefVolume*> vols;
- body->ref_volumes( vols );
- for( int vi = vols.size(); vi--; ){
- RefVolume* vol = vols.get_and_step();
- if( entmap[3].find(vol) != entmap[3].end() ){
- entities.insert( entmap[3][vol] );
- }
- else{
- std::cerr << "Warning: CGM Body has orphan RefVolume" << std::endl;
- }
- }
- }
- else{
- // otherwise, warn user.
- std::cerr << "Warning: A dim<0 entity is being ignored by ReadCGM." << std::endl;
- }
-
- }
- else if (dim < 4) {
- if (entmap[dim].find(ent) != entmap[dim].end())
- entities.insert( entmap[dim][ent] );
- }
- }
-
- if (!entities.empty()) {
- rval = mdbImpl->add_entities( ci->second, entities );
- if (MB_SUCCESS != rval)
- return MB_FAILURE;
- }
- }
-
- // done with volumes and groups
+ rval = store_group_content( mdbImpl, entmap );
+ if(rval!=MB_SUCCESS) return rval;
+
+ // done with volumes and groups
entmap[3].clear();
entmap[4].clear();
- // create geometry for all vertices and replace
- // vertex set handles with vertex handles in map
+ // create geometry for all vertices and replace
+ // vertex set handles with vertex handles in map
for (ci = entmap[0].begin(); ci != entmap[0].end(); ++ci) {
CubitVector pos = dynamic_cast<RefVertex*>(ci->first)->coordinates();
double coords[3] = {pos.x(), pos.y(), pos.z()};
https://bitbucket.org/fathomteam/moab/commits/04c05d1ef169/
Changeset: 04c05d1ef169
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added function store_geom_senses() to ReadCGM
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index 5dccad0..49cdf0a 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -232,6 +232,21 @@ ErrorCode ReadCGM::create_topology( Interface* moab, std::map<RefEntity*,EntityH
return MB_SUCCESS;
}
+ErrorCode ReadCGM::store_geom_senses( std::map<RefEntity*,EntityHandle> entitymap[5] )
+{
+ ErrorCode rval;
+ // store CoFace senses
+ rval = store_surface_senses( entitymap );
+ if (rval!=MB_SUCCESS) return rval;
+
+ // store CoEdge senses
+ rval = store_curve_senses( entitymap );
+ if (rval!=MB_SUCCESS) return rval;
+
+ return MB_SUCCESS;
+
+}
+
ErrorCode ReadCGM::store_surface_senses( std::map<RefEntity*,EntityHandle> entitymap[5] )
{
ErrorCode rval;
@@ -549,7 +564,7 @@ ErrorCode ReadCGM::load_file(const char *cgm_file_name,
// create topology for all geometric entities
rval = create_topology( mdbImpl, entmap );
- if (rval!=MB_SUCCESS) return rval;
+ if(rval!=MB_SUCCESS) return rval;
// store CoFace senses
rval = store_surface_senses( entmap );
diff --git a/src/io/ReadCGM.hpp b/src/io/ReadCGM.hpp
index 54948a1..17cf14a 100644
--- a/src/io/ReadCGM.hpp
+++ b/src/io/ReadCGM.hpp
@@ -89,6 +89,8 @@ public:
ErrorCode create_topology( Interface* moab,
std::map<RefEntity*,EntityHandle> entitymap[5] );
+ ErrorCode store_geom_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
+
ErrorCode store_surface_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
ErrorCode store_curve_senses( std::map<RefEntity*,EntityHandle> entitymap[5] );
https://bitbucket.org/fathomteam/moab/commits/0261cf1ef4f0/
Changeset: 0261cf1ef4f0
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Implemented function store_geom_senses in ReadCGM
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/08429aad2211/
Changeset: 08429aad2211
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added/corrected comments in ReadCGM.cpp
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/829fac1bfeab/
Changeset: 829fac1bfeab
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:34
Summary: Added a function store_groups to ReadCGM
Affected #: 2 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/ad9f0b5bbcdd/
Changeset: ad9f0b5bbcdd
Branch: None
User: pshriwise
Date: 2014-02-14 01:13:35
Summary: Implemented the function store_groups in ReadCGM::load_file()
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/78de3ee4e514/
Changeset: 78de3ee4e514
Branch: None
User: pshriwise
Date: 2014-02-28 20:16:20
Summary: Merge branch 'master' into ReadCGM_refactor
Conflicts:
test/io/read_cgm_basic_test.cpp
test/io/read_cgm_connectivity_test.cpp
test/io/read_cgm_group_test.cpp
test/io/read_cgm_senses_test.cpp
Affected #: 23 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/746c4bcd5251/
Changeset: 746c4bcd5251
Branch: None
User: pshriwise
Date: 2014-02-28 20:35:04
Summary: Uncommented cgm_version.h. Building with CGM 13.1 now.
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/6fa3c2a7e2be/
Changeset: 6fa3c2a7e2be
Branch: None
User: pshriwise
Date: 2014-03-28 19:09:54
Summary: Merge branch 'ReadCGM_refactor'
Affected #: 2 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/0cf64556cacb/
Changeset: 0cf64556cacb
Branch: None
User: pshriwise
Date: 2014-03-29 04:31:27
Summary: Added cube and cylcube file to the distcheck path.
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/33f4b79721d8/
Changeset: 33f4b79721d8
Branch: None
User: pshriwise
Date: 2014-04-07 21:03:58
Summary: Embedded the create_ent_sets_for_dim inside of create_entity_sets.
Affected #: 2 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/e52c4be9883e/
Changeset: e52c4be9883e
Branch: None
User: pshriwise
Date: 2014-04-07 21:34:25
Summary: Removed store_coFace_senses and store_CoEdge_senses from store_geom_senses and placed them in ReadCGM load_file.
Affected #: 2 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/037441b40a8c/
Changeset: 037441b40a8c
Branch: None
User: pshriwise
Date: 2014-04-07 21:52:21
Summary: Changed the name store_group_entities to store_group_entsets.
Affected #: 2 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/e8eecad0bac4/
Changeset: e8eecad0bac4
Branch: None
User: pshriwise
Date: 2014-04-07 22:37:38
Summary: Updated the create_ent_sets function to take a reference to a std::map rather than a pointer.
Affected #: 2 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/9a9f3bbc7615/
Changeset: 9a9f3bbc7615
Branch: None
User: pshriwise
Date: 2014-04-07 23:02:45
Summary: Removed a deprecated line from create_entity_sets.
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/86c1afab1597/
Changeset: 86c1afab1597
Branch: None
User: pshriwise
Date: 2014-04-11 20:41:36
Summary: Created a new function for handling cgm instance settings in ReadCGM.
Affected #: 2 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/ecae1e928b0c/
Changeset: ecae1e928b0c
Branch: None
User: pshriwise
Date: 2014-04-28 16:55:01
Summary: Merge branch 'master' of https://bitbucket.org/fathomteam/moab
Affected #: 7 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/7d0cf24a70f3/
Changeset: 7d0cf24a70f3
Branch: None
User: pshriwise
Date: 2014-05-05 19:37:31
Summary: Merge branch 'master' of https://bitbucket.org/fathomteam/moab
Affected #: 23 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/a790e30983c6/
Changeset: a790e30983c6
Branch: None
User: pshriwise
Date: 2014-05-19 16:31:10
Summary: Merge branch 'master' of https://bitbucket.org/fathomteam/moab
Conflicts:
MeshFiles/unittest/io/Makefile.am
Affected #: 44 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/69618c4580ed/
Changeset: 69618c4580ed
Branch: master
User: gonuke
Date: 2014-05-20 07:32:23
Summary: Merge remote-tracking branch 'pshriwise/master' to begin refactor of ReadCGM
Affected #: 3 files
Diff not available.
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list