[cgma-dev] r5332 - cgm/trunk/geom/OCC
jiangtao_ma at yahoo.com
jiangtao_ma at yahoo.com
Fri Jan 20 14:44:01 CST 2012
Author: janehu
Date: 2012-01-20 14:44:00 -0600 (Fri, 20 Jan 2012)
New Revision: 5332
Modified:
cgm/trunk/geom/OCC/OCCQueryEngine.cpp
cgm/trunk/geom/OCC/OCCQueryEngine.hpp
Log:
Added unit parameter for import/export functions for iges files in OCC engine cgm. Passed cgm/test make check.
Modified: cgm/trunk/geom/OCC/OCCQueryEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.cpp 2012-01-20 20:42:57 UTC (rev 5331)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.cpp 2012-01-20 20:44:00 UTC (rev 5332)
@@ -32,6 +32,7 @@
#include "gp_Ax2.hxx"
#include "Geom_Surface.hxx"
#include "Geom_Curve.hxx"
+#include "Interface_Static.hxx"
#include "BRepBuilderAPI.hxx"
#include "BRepBuilderAPI_Transform.hxx"
#include "BRepBuilderAPI_GTransform.hxx"
@@ -849,6 +850,7 @@
const char* file_name,
const char* file_type,
const CubitString &,
+ const char* unit,
const char*)
{
if( strcmp( file_type, "OCC" ) != 0 &&
@@ -859,6 +861,14 @@
return CUBIT_FAILURE;
}
+ char* name = "write.iges.unit";
+ Standard_CString orig_unit;
+ if(strcmp( file_type, "IGES") == 0 && unit != NULL)
+ {
+ orig_unit = Interface_Static::CVal(name);
+ Interface_Static::SetCVal (name, unit);
+ }
+
DLIList<OCCBody*> OCC_bodies;
DLIList<OCCSurface*> OCC_surfaces;
DLIList<OCCCurve*> OCC_curves;
@@ -921,6 +931,10 @@
status = write_topology( file_name, file_type,
OCC_bodies, OCC_surfaces,
OCC_curves, OCC_points );
+ //set the unit back.
+ if(strcmp( file_type, "IGES") == 0 && unit != NULL)
+ Interface_Static::SetCVal (name,orig_unit);
+
if( status == CUBIT_FAILURE ) return CUBIT_FAILURE;
if( free_body_count || free_surface_count ||
@@ -1463,7 +1477,8 @@
CubitBoolean import_surfaces,
CubitBoolean import_curves,
CubitBoolean import_vertices,
- CubitBoolean free_surfaces)
More information about the cgma-dev
mailing list