TopoDS_Shape aShape(theShape->impl<TopoDS_Shape>());
bool aResult = false;
if (aFormatName == "BREP") {
- aResult = BREPExport::Export(theFileName, aFormatName, aShape, anError);
+ aResult = BREPExport(theFileName, aFormatName, aShape, anError);
} else if (aFormatName == "STEP") {
- aResult = STEPExport::Export(theFileName, aFormatName, aShape, anError);
+ aResult = STEPExport(theFileName, aFormatName, aShape, anError);
} else if (aFormatName.substr(0, 4) == "IGES") {
- aResult = IGESExport::Export(theFileName, aFormatName, aShape, anError);
+ aResult = IGESExport(theFileName, aFormatName, aShape, anError);
} else {
anError = "Unsupported format " + aFormatName;
}
TopoDS_Shape aShape;
if (anExtension == "BREP" || anExtension == "BRP") {
- aShape = BREPImport::Import(theFileName, anExtension, anError);
+ aShape = BREPImport(theFileName, anExtension, anError);
} else if (anExtension == "STEP" || anExtension == "STP") {
- aShape = STEPImport::Import(theFileName, anExtension, anError);
+ aShape = STEPImport(theFileName, anExtension, anError);
} else if (anExtension == "IGES" || anExtension == "IGS") {
- aShape = IGESImport::Import(theFileName, anExtension, anError);
+ aShape = IGESImport(theFileName, anExtension, anError);
}
// Check if shape is valid
if ( aShape.IsNull() ) {
#include "GeomAlgoAPI_Rotation.h"
#include "GeomAlgoAPI_ShapeProps.h"
#include "GeomAlgoAPI_SketchBuilder.h"
+ #include "GeomAlgoAPI_BREPExport.h"
+ #include "GeomAlgoAPI_IGESExport.h"
+ #include "GeomAlgoAPI_STEPExport.h"
+ #include "GeomAlgoAPI_BREPImport.h"
+ #include "GeomAlgoAPI_IGESImport.h"
+ #include "GeomAlgoAPI_STEPImport.h"
#include "GeomAlgoAPI_Tools.h"
#include <memory>
%include "GeomAlgoAPI_Rotation.h"
%include "GeomAlgoAPI_ShapeProps.h"
%include "GeomAlgoAPI_SketchBuilder.h"
+%include "GeomAlgoAPI_BREPExport.h"
+%include "GeomAlgoAPI_IGESExport.h"
+%include "GeomAlgoAPI_STEPExport.h"
+%include "GeomAlgoAPI_BREPImport.h"
+%include "GeomAlgoAPI_IGESImport.h"
+%include "GeomAlgoAPI_STEPImport.h"
%include "GeomAlgoAPI_Tools.h"
%typemap(out) std::list< std::shared_ptr< GeomAPI_Shape > >::value_type & {
*
*/
//=============================================================================
-namespace BREPExport {
-
-bool Export(const std::string& theFileName,
- const std::string&,
- const TopoDS_Shape& theShape,
- std::string& theError)
+bool BREPExport(const std::string& theFileName,
+ const std::string&,
+ const TopoDS_Shape& theShape,
+ std::string& theError)
{
#ifdef _DEBUG
std::cout << "Export BREP into file " << theFileName << std::endl;
}
return true;
}
-
-} // namespace BREPExport
#include <TopoDS_Shape.hxx>
-namespace BREPExport {
-
/// Implementation of the export BREP files algorithms
GEOMALGOAPI_EXPORT
-bool Export(const std::string& theFileName,
- const std::string& theFormatName,
- const TopoDS_Shape& theShape,
- std::string& theError);
-
-} // namespace BREPExport
+bool BREPExport(const std::string& theFileName,
+ const std::string& theFormatName,
+ const TopoDS_Shape& theShape,
+ std::string& theError);
#endif /* GEOMALGOAPI_BREPEXPORT_H_ */
*
*/
//=============================================================================
-namespace BREPImport {
-
-TopoDS_Shape Import(const std::string& theFileName,
- const std::string&,
- std::string& theError)
+TopoDS_Shape BREPImport(const std::string& theFileName,
+ const std::string&,
+ std::string& theError)
{
#ifdef _DEBUG
std::cout << "Import BREP from file " << theFileName << std::endl;
}
return aShape;
}
-
-} // namespace BREPImport
#include <TopoDS_Shape.hxx>
-namespace BREPImport {
-
/// Implementation of the import BREP files algorithms
GEOMALGOAPI_EXPORT
-TopoDS_Shape Import(const std::string& theFileName,
- const std::string& theFormatName,
- std::string& theError);
-
-} // namespace BREPImport
+TopoDS_Shape BREPImport(const std::string& theFileName,
+ const std::string& theFormatName,
+ std::string& theError);
#endif /* GEOMALGOAPI_BREPIMPORT_H_ */
}
//=============================================================================
-//extern "C" {
-
-namespace IGESExport {
-
-bool Export(const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName,
- const TopoDS_Shape& theShape,
- TCollection_AsciiString& theError)
+bool IGESExport(const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TopoDS_Shape& theShape,
+ TCollection_AsciiString& theError)
{
// theFormatName expected "IGES-5.1", "IGES-5.3"...
TCollection_AsciiString aVersion = theFormatName.Token("-", 2);
}
return false;
}
-
-}
-
-//}
#include <TopoDS_Shape.hxx>
-namespace IGESExport {
-
/// Implementation of the export IGES files algorithms
GEOMALGOAPI_EXPORT
-bool Export(const std::string& theFileName,
- const std::string& theFormatName,
- const TopoDS_Shape& theShape,
- std::string& theError);
-
-} // namespace IGESExport
+bool IGESExport(const std::string& theFileName,
+ const std::string& theFormatName,
+ const TopoDS_Shape& theShape,
+ std::string& theError);
#endif /* GEOMALGOAPI_IGESEXPORT_H_ */
*
*/
//=============================================================================
-namespace IGESImport {
-
-TopoDS_Shape Import(const std::string& theFileName,
- const std::string&,
- std::string& theError)
+TopoDS_Shape IGESImport(const std::string& theFileName,
+ const std::string&,
+ std::string& theError)
{
#ifdef _DEBUG
std::cout << "Import IGES from file " << theFileName << std::endl;
return aResShape;
}
-
-} // namespace IGESImport
#include <TopoDS_Shape.hxx>
-namespace IGESImport {
-
/// Implementation of the import IGES files algorithms
GEOMALGOAPI_EXPORT
-TopoDS_Shape Import(const std::string& theFileName,
- const std::string& theFormatName,
- std::string& theError);
-
-} // namespace IGESImport
+TopoDS_Shape IGESImport(const std::string& theFileName,
+ const std::string& theFormatName,
+ std::string& theError);
#endif /* GEOMALGOAPI_IGESIMPORT_H_ */
#include <STEPControl_Writer.hxx>
#include <Interface_Static.hxx>
-namespace STEPExport {
-
-bool Export(const std::string& theFileName,
- const std::string& theFormatName,
- const TopoDS_Shape& theShape,
- std::string& theError)
+bool STEPExport(const std::string& theFileName,
+ const std::string& theFormatName,
+ const TopoDS_Shape& theShape,
+ std::string& theError)
{
#ifdef _DEBUG
std::cout << "Export STEP into file " << theFileName << std::endl;
}
return false;
}
-
-} // namespace STEPExport
#include <TopoDS_Shape.hxx>
-namespace STEPExport {
-
/// Implementation of the export STEP files algorithms
GEOMALGOAPI_EXPORT
-bool Export(const std::string& theFileName,
- const std::string& theFormatName,
- const TopoDS_Shape& theShape,
- std::string& theError);
-
-} // namespace STEPExport
+bool STEPExport(const std::string& theFileName,
+ const std::string& theFormatName,
+ const TopoDS_Shape& theShape,
+ std::string& theError);
#endif /* GEOMALGOAPI_STEPEXPORT_H_ */
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-namespace STEPImport {
//=============================================================================
/*!
* GetShape()
return aValue;
}
-TopoDS_Shape Import (const std::string& theFileName,
- const std::string& theFormatName,
- std::string& theError)
+TopoDS_Shape STEPImport(const std::string& theFileName,
+ const std::string& theFormatName,
+ std::string& theError)
{
TopoDS_Shape aResShape;
// Return previous locale
return aResShape;
}
-
-} // namespace STEPImport
#include <TopoDS_Shape.hxx>
-namespace STEPImport {
-
/// Implementation of the import STEP files algorithms
GEOMALGOAPI_EXPORT
-TopoDS_Shape Import(const std::string& theFileName,
- const std::string& theFormatName,
- std::string& theError);
-
-} // namespace STEPImport
+TopoDS_Shape STEPImport(const std::string& theFileName,
+ const std::string& theFormatName,
+ std::string& theError);
#endif /* GEOMALGOAPI_STEPIMPORT_H_ */
/**
* Returns an extension of theFileName
*/
- static std::string extension(const std::string& theFileName);
+ GEOMALGOAPI_EXPORT static std::string extension(const std::string& theFileName);
/**
* Returns a name of theFileName
*/
- static std::string name(const std::string& theFileName);
+ GEOMALGOAPI_EXPORT static std::string name(const std::string& theFileName);
};
} // GeomAlgoAPI_Tools