Salome HOME
Issue #608: Usage of OCCT in interface -- Wrap classes by SWIG
authorspo <sergey.pokhodenko@opencascade.com>
Mon, 29 Jun 2015 11:02:41 +0000 (14:02 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Mon, 29 Jun 2015 11:03:19 +0000 (14:03 +0300)
16 files changed:
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp
src/GeomAlgoAPI/GeomAlgoAPI.i
src/GeomAlgoAPI/GeomAlgoAPI_BREPExport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_BREPExport.h
src/GeomAlgoAPI/GeomAlgoAPI_BREPImport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_BREPImport.h
src/GeomAlgoAPI/GeomAlgoAPI_IGESExport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_IGESExport.h
src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_IGESImport.h
src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.h
src/GeomAlgoAPI/GeomAlgoAPI_STEPImport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_STEPImport.h
src/GeomAlgoAPI/GeomAlgoAPI_Tools.h

index 1cf82bb0b9e974efa70b184d76aff35858c5c128..f4e87b76ef0c6378491cc4d1b31e9a68162190c2 100644 (file)
@@ -120,11 +120,11 @@ bool ExchangePlugin_ExportFeature::exportFile(const std::string& theFileName,
   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;
   }
index 1716adb37e54150fb7e59e74c704f895024d5fe1..adc678657a778b0a92b77a9510d30607aab369f1 100644 (file)
@@ -81,11 +81,11 @@ bool ExchangePlugin_ImportFeature::importFile(const std::string& theFileName)
 
   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() ) {
index 806c443c9f1d932f3cd8dfa21ace4853d495d665..6a49f1fae2e2ea3e0dd73931f3a0f74706631cea 100644 (file)
   #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 & {
index 8a6c36f11e74ed19c1be303fe7a3cc9967912342..d85ae6b4f74de282aad96e9a93839936f1872a80 100644 (file)
  *
  */
 //=============================================================================
-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;
@@ -36,5 +34,3 @@ bool Export(const std::string& theFileName,
   }
   return true;
 }
-
-} // namespace BREPExport
index 2b51e43f7522ae7c61da8e9751f29d42b469297c..de545479e6ba8af584f728a8c8d74ccd2d57b64b 100644 (file)
 
 #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_ */
index 9cb93117d5ad0257f466f52546b217db38cd8f8b..62d63ac24b4d063b5935f0574ae1218610851160 100644 (file)
  *
  */
 //=============================================================================
-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;
@@ -27,5 +25,3 @@ TopoDS_Shape Import(const std::string& theFileName,
   }
   return aShape;
 }
-
-} // namespace BREPImport
index 93fce71fd4d4ff9b85d04dfeabf6d13d901e509e..a06f1db1b43159c37a6c8ba57137f18bd86ba1bd 100644 (file)
 
 #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_ */
index 0f7182a8f28b52077e14277aa379eba3f66469b7..93fb05b025dc428c319d64a5869d15143dad8bbc 100644 (file)
@@ -78,14 +78,10 @@ int KindOfBRep (const TopoDS_Shape& theShape)
 }
 
 //=============================================================================
-//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);
@@ -136,7 +132,3 @@ bool Export(const TCollection_AsciiString& theFileName,
   }
   return false;
 }
-
-}
-
-//}
index a583ae804b8acf481e2fe696ddd4627f86df4d69..f701723428a3c28606b29460711c8ad4cce340fb 100644 (file)
 
 #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_ */
index b15b0d19e63504d4b020190d94298d1531b657b7..872d8b3f5a7339521e3e044ff8332c30934a9d2d 100644 (file)
  *
  */
 //=============================================================================
-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;
@@ -66,5 +64,3 @@ TopoDS_Shape Import(const std::string& theFileName,
 
   return aResShape;
 }
-
-} // namespace IGESImport
index f2a3e2dc7324a25b202a23231dd1d6dfc41bae85..57fc754d18810317b771425d1af58ec76217dda9 100644 (file)
 
 #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_ */
index 6ec05e477e284da9903293730fdf84a2bf3b97c1..fbf7f718b07c97704454c54c6998fd57674f5893 100644 (file)
 #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;
@@ -50,5 +48,3 @@ bool Export(const std::string& theFileName,
   }
   return false;
 }
-
-} // namespace STEPExport
index 09fa129e1922199dd29fde9e2b3ed37d6da63363..2011617af76b05b67995d6a047abf1fce0a339c2 100644 (file)
 
 #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_ */
index bb304eea928e9b7f379b39d732c6be64978d0fdf..7ff22b0f015a3500fb3fe675816a4670b61278ef 100644 (file)
@@ -43,7 +43,6 @@
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
-namespace STEPImport {
 //=============================================================================
 /*!
  *  GetShape()
@@ -364,9 +363,9 @@ Handle(TCollection_HAsciiString) GetValue (const TCollection_AsciiString& theFil
   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;
 
@@ -494,5 +493,3 @@ TopoDS_Shape Import (const std::string& theFileName,
   // Return previous locale
   return aResShape;
 }
-
-} // namespace STEPImport
index 6f3506248dd1d8a84753f8cc9e35a1dd5ea5b66d..adf7c2f184bec5f1f9fad19dc74a746180d5b74f 100644 (file)
 
 #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_ */
index 3524e188e933547ac7db8acb7e060287c1a23702..f53385c816d84c4653a99b93ba55cd227063a701 100644 (file)
@@ -27,11 +27,11 @@ public:
   /**
    * 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