[MOAB-dev] r5079 - in MOAB/trunk: src/io tools/dagmc

sjackson at cae.wisc.edu sjackson at cae.wisc.edu
Wed Aug 3 11:58:41 CDT 2011


Author: sjackson
Date: 2011-08-03 11:58:41 -0500 (Wed, 03 Aug 2011)
New Revision: 5079

Modified:
   MOAB/trunk/src/io/ReadCGM.cpp
   MOAB/trunk/tools/dagmc/dagmc_preproc.cpp
Log:
Silence "ERROR: Attribute type -1 not recognized" messages from ReadCGM

* Generalize ReadCGM parameter VERBOSE_CGM_CURVE_WARNINGS to
  VERBOSE_CGM_WARNINGS.
* Silence CGM's attribute manager unless verbose warnings are
  requested.
* Update dagmc_preproc (the only client of the VERBOSE_CGM*_WARNINGS
  option that I know of) to reflect the change.

Although I would prefer to have a complete understanding of why these
error messages are occuring before disabling them, I think the benefit
to users outweighs my discomfort.  Users loading large CAD files have
been annoyed by these messages for years, and the errors don't seem to
affect our ability to use the loaded data as we expect.

Modified: MOAB/trunk/src/io/ReadCGM.cpp
===================================================================
--- MOAB/trunk/src/io/ReadCGM.cpp	2011-08-03 16:30:19 UTC (rev 5078)
+++ MOAB/trunk/src/io/ReadCGM.cpp	2011-08-03 16:58:41 UTC (rev 5079)
@@ -144,14 +144,14 @@
   if (MB_SUCCESS != opts.get_real_option("MAX_FACET_EDGE_LENGTH", len_tol))
     len_tol = DEFAULT_LEN_TOL;
 
-  bool verbose_curve_warnings = false;
-  if (MB_SUCCESS == opts.get_null_option("VERBOSE_CGM_CURVE_WARNINGS"))
-    verbose_curve_warnings = true;
+  bool verbose_warnings = false;
+  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 == opts.match_option(name,value)) 
+  if(MB_SUCCESS == rval) 
     act_att = false; 
 
   // always tag with the faceting_tol and geometry absolute resolution
@@ -180,6 +180,10 @@
     CGMApp::instance()->attrib_manager()->set_all_auto_actuate_flags( act_att );
   }
 
+  if( !verbose_warnings ){
+    CGMApp::instance()->attrib_manager()->silent_flag( true );
+  }
+
   CubitStatus s;
 
   // Get CGM file type
@@ -505,9 +509,9 @@
      || (  end_vtx->coordinates() - points.back() ).length() > GEOMETRY_RESABS ) {
 
       curve_warnings--;
-      if( curve_warnings >= 0 || verbose_curve_warnings ){ 
+      if( curve_warnings >= 0 || verbose_warnings ){ 
 	std::cerr << "Warning: vertices not at ends of curve " << edge->id() << std::endl;
-	if( curve_warnings == 0 && !verbose_curve_warnings ){
+	if( curve_warnings == 0 && !verbose_warnings ){
 	  std::cerr << "         further instances of this warning will be suppressed..." << std::endl;
 	}
       }
@@ -548,10 +552,10 @@
       return MB_FAILURE;
   }
 
-  if( !verbose_curve_warnings && curve_warnings < 0 ){


More information about the moab-dev mailing list