${PROJECT_SOURCE_DIR}/src/GeomAPI
${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
${CAS_INCLUDE_DIRS}
-)
+)
SET(PROJECT_HEADERS
ExchangePlugin.h
ExchangePlugin_ExportFeature.h
ExchangePlugin_Validators.h
)
-
+
SET(PROJECT_SOURCES
ExchangePlugin_Plugin.cpp
ExchangePlugin_ImportFeature.cpp
/*
* ExchangePlugin_ExportFeature.cpp
*
- * Created on: Aug 28, 2014
- * Author: sbh
+ * Created on: May 14, 2015
+ * Author: spo
*/
#include <ExchangePlugin_ExportFeature.h>
-//#include <GeomAlgoAPI_BREPExport.h>
+#include <GeomAlgoAPI_BREPExport.h>
//#include <GeomAlgoAPI_STEPExport.h>
#include <GeomAlgoAPI_IGESExport.h>
TopoDS_Shape aShape(theShape->impl<TopoDS_Shape>());
bool aResult = true;
if (aFormatName == "BREP") {
-// aShape = BREPExport::Export(aFileName, aFormatName, anError, anUnknownLabel);
+ aResult = BREPExport::Export(aFileName, aFormatName, aShape, anError, anUnknownLabel);
} else if (aFormatName == "STEP" || aFormatName == "STP") {
// aShape = STEPExport::Export(aFileName, aFormatName, anError, anUnknownLabel);
} else if (aFormatName == "IGES") {
GeomAlgoAPI_BREPImport.h
GeomAlgoAPI_STEPImport.h
GeomAlgoAPI_IGESImport.h
+ GeomAlgoAPI_BREPExport.h
GeomAlgoAPI_IGESExport.h
)
GeomAlgoAPI_BREPImport.cpp
GeomAlgoAPI_STEPImport.cpp
GeomAlgoAPI_IGESImport.cpp
+ GeomAlgoAPI_BREPExport.cpp
GeomAlgoAPI_IGESExport.cpp
)
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#include <GeomAlgoAPI_BREPExport.h>
+
+#include <BRepTools.hxx>
+#include <BRep_Builder.hxx>
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+//extern "C" {
+namespace BREPExport {
+bool Export(const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString&,
+ const TopoDS_Shape& theShape,
+ TCollection_AsciiString& theError, const TDF_Label&)
+{
+ #ifdef _DEBUG
+ std::cout << "Export BREP into file " << theFileName << std::endl;
+ #endif
+ if ( !BRepTools::Write( theShape, theFileName.ToCString() ) ) {
+ theError = "BREP Export failed";
+ return false;
+ }
+ return true;
+}
+
+}
+//}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+/*
+ * GEOMALGOAPI_BREPExport.h
+ *
+ * Created on: May 14, 2015
+ * Author: spo
+ */
+
+#ifndef GEOMALGOAPI_BREPEXPORT_H_
+#define GEOMALGOAPI_BREPEXPORT_H_
+
+#include <GeomAlgoAPI.h>
+
+#include <TCollection_AsciiString.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TDF_Label.hxx>
+
+namespace BREPExport {
+
+/// Implementation of the export BREP files algorithms
+GEOMALGOAPI_EXPORT
+bool Export(const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TopoDS_Shape& theShape,
+ TCollection_AsciiString& theError, const TDF_Label&);
+
+}
+
+#endif /* GEOMALGOAPI_BREPEXPORT_H_ */
namespace IGESExport {
-/// Implementation of the import IGES files algorithms
+/// Implementation of the export IGES files algorithms
GEOMALGOAPI_EXPORT
bool Export(const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName,