[cgma-dev] r2797 - in cgm/trunk: . itaps
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Thu Apr 2 16:22:26 CDT 2009
Author: tautges
Date: 2009-04-02 16:22:26 -0500 (Thu, 02 Apr 2009)
New Revision: 2797
Modified:
cgm/trunk/cgm.make.in
cgm/trunk/itaps/iGeom-Defs.inc.in
cgm/trunk/itaps/iGeom_CGMA.cc
Log:
- add a crude but effective file type extraction from file name; this
should really be a capability in each engine
- add a -DHAVE_ACIS and/or -DHAVE_OCC to IGEOM_DEFINES so applications
can branch on which engine to decide file extensions
Modified: cgm/trunk/cgm.make.in
===================================================================
--- cgm/trunk/cgm.make.in 2009-04-02 20:42:34 UTC (rev 2796)
+++ cgm/trunk/cgm.make.in 2009-04-02 21:22:26 UTC (rev 2797)
@@ -29,7 +29,7 @@
-I at abs_top_srcdir@/geom/Cholla
# Pre-processor flags
-CGM_DEFINES = @CANT_USE_STD@ @CANT_USE_STD_IO@ @TEMPLATE_DEFS_INCLUDED@
+CGM_DEFINES = @CANT_USE_STD@ @CANT_USE_STD_IO@ @TEMPLATE_DEFS_INCLUDED@ @HAVE_ACIS_DEF@ @HAVE_OCC_DEF@
CGM_INCLUDES = @CGM_EXT_INCLUDE@ $(CGM_INT_INCLUDE)
CGM_CPPFLAGS = $(CGM_DEFINES) $(CGM_INCLUDES)
Modified: cgm/trunk/itaps/iGeom-Defs.inc.in
===================================================================
--- cgm/trunk/itaps/iGeom-Defs.inc.in 2009-04-02 20:42:34 UTC (rev 2796)
+++ cgm/trunk/itaps/iGeom-Defs.inc.in 2009-04-02 21:22:26 UTC (rev 2797)
@@ -4,7 +4,7 @@
# These should never be required for the iGeom interface
IGEOM_INCLUDES = -I at abs_srcdir@ -I at abs_builddir@
-IGEOM_DEFINES =
+IGEOM_DEFINES = @HAVE_ACIS_DEF@ @HAVE_OCC_DEF@
IGEOM_CPPFLAGS = $(IGEOM_DEFINES) $(IGEOM_INCLUDES)
# The useful flags we are providing
Modified: cgm/trunk/itaps/iGeom_CGMA.cc
===================================================================
--- cgm/trunk/itaps/iGeom_CGMA.cc 2009-04-02 20:42:34 UTC (rev 2796)
+++ cgm/trunk/itaps/iGeom_CGMA.cc 2009-04-02 21:22:26 UTC (rev 2797)
@@ -394,7 +394,7 @@
name = name_buf.c_str();
// parse options
- std::string file_type = "ACIS_SAT";
+ std::string file_type;
std::vector<std::string> opts;
tokenize( std::string(options, options_len), opts );
for (std::vector<std::string>::iterator i = opts.begin(); i != opts.end(); ++i)
@@ -403,6 +403,31 @@
ERROR( iBase_INVALID_ARGUMENT, i->c_str() );
}
+ // if no type, check file type for known extensions
+ if (file_type.empty()) {
+ size_t name_len = name_buf.length();
+ if (name_buf.find(".igs") < name_len ||
+ name_buf.find(".IGS") < name_len ||
+ name_buf.find(".iges") < name_len ||
+ name_buf.find(".IGES") < name_len)
+ file_type = "IGES";
+ else if (name_buf.find(".stp") < name_len ||
+ name_buf.find(".STP") < name_len ||
+ name_buf.find(".step") < name_len ||
+ name_buf.find(".STEP") < name_len)
+ file_type = "STEP";
+ else if (name_buf.find(".sat") < name_len ||
+ name_buf.find(".SAT") < name_len)
+ file_type = "ACIS_SAT";
+ else if (name_buf.find(".occ") < name_len ||
+ name_buf.find(".brep") < name_len ||
+ name_buf.find(".OCC") < name_len ||
+ name_buf.find(".BREP") < name_len)
+ file_type = "OCC";
+ else
+ ERROR(iBase_FAILURE, "Unknown geometry file extension and no file type.");
+ }
+
// process options (none right now...)
DLIList<RefEntity*> bodies;
int num_ents_exported;
More information about the cgma-dev
mailing list