#include <ExchangePlugin_ExportFeature.h>
#include <GeomAlgoAPI_BREPExport.h>
-//#include <GeomAlgoAPI_STEPExport.h>
+#include <GeomAlgoAPI_STEPExport.h>
#include <GeomAlgoAPI_IGESExport.h>
#include <Config_Common.h>
if (aFormatName == "BREP") {
aResult = BREPExport::Export(aFileName, aFormatName, aShape, anError, anUnknownLabel);
} else if (aFormatName == "STEP" || aFormatName == "STP") {
-// aShape = STEPExport::Export(aFileName, aFormatName, anError, anUnknownLabel);
+ aResult = STEPExport::Export(aFileName, aFormatName, aShape, anError, anUnknownLabel);
} else if (aFormatName == "IGES") {
aResult = IGESExport::Export(aFileName, aFormatName, aShape, anError, anUnknownLabel);
}
GeomAlgoAPI_STEPImport.h
GeomAlgoAPI_IGESImport.h
GeomAlgoAPI_BREPExport.h
+ GeomAlgoAPI_STEPExport.h
GeomAlgoAPI_IGESExport.h
)
GeomAlgoAPI_STEPImport.cpp
GeomAlgoAPI_IGESImport.cpp
GeomAlgoAPI_BREPExport.cpp
+ GeomAlgoAPI_STEPExport.cpp
GeomAlgoAPI_IGESExport.cpp
)
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#include <GeomAlgoAPI_STEPExport.h>
+
+// OOCT includes
+#include <IFSelect_ReturnStatus.hxx>
+#include <STEPControl_Writer.hxx>
+#include <Interface_Static.hxx>
+
+namespace STEPExport {
+
+bool Export (const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TopoDS_Shape& theShape,
+ TCollection_AsciiString& theError,
+ const TDF_Label& theShapeLabel)
+{
+ #ifdef _DEBUG
+ std::cout << "Export STEP into file " << theFileName.ToCString() << std::endl;
+ #endif
+
+ try
+ {
+// // Set "C" numeric locale to save numbers correctly
+// Kernel_Utils::Localizer loc;
+
+ IFSelect_ReturnStatus status ;
+ //VRV: OCC 4.0 migration
+ STEPControl_Writer aWriter;
+ Interface_Static::SetCVal("xstep.cascade.unit","M");
+ Interface_Static::SetCVal("write.step.unit", "M");
+ Interface_Static::SetIVal("write.step.nonmanifold", 1);
+ status = aWriter.Transfer( theShape, STEPControl_AsIs );
+ //VRV: OCC 4.0 migration
+ if( status == IFSelect_RetDone )
+ status = aWriter.Write( theFileName.ToCString() );
+
+ // Return previous locale
+ if( status == IFSelect_RetDone )
+ return true;
+ }
+ catch (Standard_Failure)
+ {
+ theError = "Exception catched in STEPExport";
+ }
+ return false;
+}
+
+} // namespace STEPExport
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+/*
+ * GEOMALGOAPI_STEPExport.h
+ *
+ * Created on: May 14, 2015
+ * Author: spo
+ */
+
+#ifndef GEOMALGOAPI_STEPEXPORT_H_
+#define GEOMALGOAPI_STEPEXPORT_H_
+
+#include <GeomAlgoAPI.h>
+
+#include <TCollection_AsciiString.hxx>
+#include <TCollection_HAsciiString.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TDF_Label.hxx>
+
+namespace STEPExport {
+
+/// Implementation of the export parameter from the STEP file
+GEOMALGOAPI_EXPORT
+Handle(TCollection_HAsciiString) GetValue(const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theParameterName,
+ TCollection_AsciiString& theError);
+
+/// Implementation of the export STEP files algorithms
+GEOMALGOAPI_EXPORT
+bool Export(const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TopoDS_Shape& theShape,
+ TCollection_AsciiString& theError,
+ const TDF_Label& theShapeLabel);
+}
+
+#endif /* GEOMALGOAPI_STEPEXPORT_H_ */
* Author: sbh
*/
+#ifndef GEOMALGOAPI_STEPIMPORT_H_
+#define GEOMALGOAPI_STEPIMPORT_H_
+
#include <GeomAlgoAPI.h>
#include <TCollection_AsciiString.hxx>
const TCollection_AsciiString& theFormatName, TCollection_AsciiString& theError,
const TDF_Label& theShapeLabel);
}
+
+#endif /* GEOMALGOAPI_STEPIMPORT_H_ */