Salome HOME
Improve SWIG compilation: eliminate types duplication.
authorspo <sergey.pokhodenko@opencascade.com>
Tue, 15 Dec 2015 11:04:24 +0000 (14:04 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Thu, 17 Dec 2015 11:53:05 +0000 (14:53 +0300)
src/GeomAPI/GeomAPI.i
src/GeomAPI/GeomAPI_swig.h [new file with mode: 0644]
src/GeomAlgoAPI/GeomAlgoAPI.i
src/GeomAlgoAPI/GeomAlgoAPI_swig.h [new file with mode: 0644]
src/GeomDataAPI/CMakeLists.txt
src/GeomDataAPI/GeomDataAPI.i
src/GeomDataAPI/GeomDataAPI_swig.h [new file with mode: 0644]
src/ModelAPI/ModelAPI.i
src/ModelAPI/ModelAPI_swig.h [new file with mode: 0644]

index 41f79de25f0ec12ea8328195655105abbcda61d9..b367e4333d258c2969672548e737c84816791ed7 100644 (file)
@@ -1,38 +1,7 @@
 /* GeomAPI.i */
 %module GeomAPI
 %{
-  #include "GeomAPI.h"
-  #include "GeomAPI_AISObject.h"
-  #include "GeomAPI_Ax1.h"
-  #include "GeomAPI_Ax2.h"
-  #include "GeomAPI_Ax3.h"
-  #include "GeomAPI_Circ.h"
-  #include "GeomAPI_Circ2d.h"
-  #include "GeomAPI_Curve.h"
-  #include "GeomAPI_DataMapOfShapeMapOfShapes.h"
-  #include "GeomAPI_DataMapOfShapeShape.h"
-  #include "GeomAPI_Dir.h"
-  #include "GeomAPI_Dir2d.h"
-  #include "GeomAPI_Edge.h"
-  #include "GeomAPI_Face.h"
-  #include "GeomAPI_ICustomPrs.h"
-  #include "GeomAPI_Interface.h"
-  #include "GeomAPI_IPresentable.h"
-  #include "GeomAPI_Lin.h"
-  #include "GeomAPI_Lin2d.h"
-  #include "GeomAPI_PlanarEdges.h"
-  #include "GeomAPI_Pln.h"
-  #include "GeomAPI_Pnt.h"
-  #include "GeomAPI_Pnt2d.h"
-  #include "GeomAPI_Shape.h"
-  #include "GeomAPI_ShapeExplorer.h"
-  #include "GeomAPI_Vertex.h"
-  #include "GeomAPI_XY.h"
-  #include "GeomAPI_XYZ.h"
-  #include "GeomAPI_Trsf.h"
-
-  #include <memory>
-  #include <string>
+  #include "GeomAPI_swig.h"
 %}
 
 // to avoid error on this
diff --git a/src/GeomAPI/GeomAPI_swig.h b/src/GeomAPI/GeomAPI_swig.h
new file mode 100644 (file)
index 0000000..0dd57e6
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:    GeomAPI_swig.h
+// Created: Dec 15, 2015
+// Author:  Sergey POKHODENKO
+
+#ifndef SRC_GEOMAPI_GEOMAPI_SWIG_H_
+#define SRC_GEOMAPI_GEOMAPI_SWIG_H_
+
+  #include "GeomAPI.h"
+  #include "GeomAPI_AISObject.h"
+  #include "GeomAPI_Ax1.h"
+  #include "GeomAPI_Ax2.h"
+  #include "GeomAPI_Ax3.h"
+  #include "GeomAPI_Circ.h"
+  #include "GeomAPI_Circ2d.h"
+  #include "GeomAPI_Curve.h"
+  #include "GeomAPI_DataMapOfShapeMapOfShapes.h"
+  #include "GeomAPI_DataMapOfShapeShape.h"
+  #include "GeomAPI_Dir.h"
+  #include "GeomAPI_Dir2d.h"
+  #include "GeomAPI_Edge.h"
+  #include "GeomAPI_Face.h"
+  #include "GeomAPI_ICustomPrs.h"
+  #include "GeomAPI_Interface.h"
+  #include "GeomAPI_IPresentable.h"
+  #include "GeomAPI_Lin.h"
+  #include "GeomAPI_Lin2d.h"
+  #include "GeomAPI_PlanarEdges.h"
+  #include "GeomAPI_Pln.h"
+  #include "GeomAPI_Pnt.h"
+  #include "GeomAPI_Pnt2d.h"
+  #include "GeomAPI_Shape.h"
+  #include "GeomAPI_ShapeExplorer.h"
+  #include "GeomAPI_Vertex.h"
+  #include "GeomAPI_XY.h"
+  #include "GeomAPI_XYZ.h"
+  #include "GeomAPI_Trsf.h"
+
+  #include <memory>
+  #include <string>
+
+#endif /* SRC_GEOMAPI_GEOMAPI_SWIG_H_ */
index 856e34e79664affc9f305d59eea65b438d88abdd..86addb6d2af1f326c52ddfe8b62f2872cb07303a 100644 (file)
@@ -1,37 +1,7 @@
 /* GeomAPI.i */
 %module GeomAlgoAPI
 %{
-  #include "GeomAlgoAPI.h"
-  #include "GeomAlgoAPI_Boolean.h"
-  #include "GeomAlgoAPI_CompoundBuilder.h"
-  #include "GeomAlgoAPI_DFLoader.h"
-  #include "GeomAlgoAPI_EdgeBuilder.h"
-  #include "GeomAlgoAPI_FaceBuilder.h"
-  #include "GeomAlgoAPI_MakeShape.h"
-  #include "GeomAlgoAPI_MakeShapeCustom.h"
-  #include "GeomAlgoAPI_MakeShapeList.h"
-  #include "GeomAlgoAPI_MakeSweep.h"
-  #include "GeomAlgoAPI_Translation.h"
-  #include "GeomAlgoAPI_Placement.h"
-  #include "GeomAlgoAPI_PointBuilder.h"
-  #include "GeomAlgoAPI_Prism.h"
-  #include "GeomAlgoAPI_Revolution.h"
-  #include "GeomAlgoAPI_Rotation.h"
-  #include "GeomAlgoAPI_ShapeTools.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 "GeomAlgoAPI_Transform.h"
-  #include "GeomAlgoAPI_PaveFiller.h"
-
-  #include <memory>
-  #include <string>
-  #include <list>
+  #include "GeomAlgoAPI_swig.h"
 %}
 
 // to avoid error on this
diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_swig.h b/src/GeomAlgoAPI/GeomAlgoAPI_swig.h
new file mode 100644 (file)
index 0000000..164f8ec
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:               GeomAlgoAPI_swig.h
+// Created: Dec 15, 2015
+// Author:  Sergey POKHODENKO
+
+#ifndef SRC_GEOMALGOAPI_GEOMALGOAPI_SWIG_H_
+#define SRC_GEOMALGOAPI_GEOMALGOAPI_SWIG_H_
+
+  #include "GeomAlgoAPI.h"
+  #include "GeomAlgoAPI_Boolean.h"
+  #include "GeomAlgoAPI_CompoundBuilder.h"
+  #include "GeomAlgoAPI_DFLoader.h"
+  #include "GeomAlgoAPI_EdgeBuilder.h"
+  #include "GeomAlgoAPI_FaceBuilder.h"
+  #include "GeomAlgoAPI_MakeShape.h"
+  #include "GeomAlgoAPI_MakeShapeCustom.h"
+  #include "GeomAlgoAPI_MakeShapeList.h"
+  #include "GeomAlgoAPI_MakeSweep.h"
+  #include "GeomAlgoAPI_Translation.h"
+  #include "GeomAlgoAPI_Placement.h"
+  #include "GeomAlgoAPI_PointBuilder.h"
+  #include "GeomAlgoAPI_Prism.h"
+  #include "GeomAlgoAPI_Revolution.h"
+  #include "GeomAlgoAPI_Rotation.h"
+  #include "GeomAlgoAPI_ShapeTools.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 "GeomAlgoAPI_Transform.h"
+  #include "GeomAlgoAPI_PaveFiller.h"
+
+  #include <memory>
+  #include <string>
+  #include <list>
+
+#endif /* SRC_GEOMALGOAPI_GEOMALGOAPI_SWIG_H_ */
index 8747e7eab30f15d1ab82f308b7a28f1468728ee2..bef8c896d64b2acd5a537ee9545b555937b59cdb 100644 (file)
@@ -22,7 +22,8 @@ SET(PROJECT_LIBRARIES
     ModelAPI
 )
 
-INCLUDE_DIRECTORIES( 
+INCLUDE_DIRECTORIES(
+  ../GeomAPI        # only for SWIG
   ../ModelAPI
 )
 
index 24da73652b8bbf0ddb185b9a499c39802f8940c1..df40992c95607145582756d26e216421605faf1b 100644 (file)
@@ -1,22 +1,12 @@
 /* GeomDataAPI.i */
 %module GeomDataAPI
 %{
-  #include "ModelAPI_Attribute.h"
-  #include "GeomDataAPI.h"
-  #include "GeomDataAPI_Point.h"
-  #include "GeomDataAPI_Dir.h"
-  #include "GeomDataAPI_Point2D.h"
-
-  #include <memory>
-  #include <string>
-  #include <list>
-  
-  template<class T> std::shared_ptr<T> castTo(std::shared_ptr<ModelAPI_Attribute> theObject) 
-  { 
-    return std::dynamic_pointer_cast<T>(theObject); 
-  } 
+  #include "GeomDataAPI_swig.h"
 %}
 
+// import other modules
+%import "ModelAPI.i"
+
 // to avoid error on this
 #define GEOMDATAAPI_EXPORT
 #define MODELAPI_EXPORT
 %include "std_list.i"
 %include "std_shared_ptr.i"
 
-%shared_ptr(ModelAPI_Attribute)
 %shared_ptr(GeomDataAPI_Point)
 %shared_ptr(GeomDataAPI_Dir)
 %shared_ptr(GeomDataAPI_Point2D)
 
 // all supported interfaces
-%include "ModelAPI_Attribute.h"
 %include "GeomDataAPI_Point.h"
 %include "GeomDataAPI_Dir.h"
 %include "GeomDataAPI_Point2D.h"
diff --git a/src/GeomDataAPI/GeomDataAPI_swig.h b/src/GeomDataAPI/GeomDataAPI_swig.h
new file mode 100644 (file)
index 0000000..c24d493
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:               GeomDataAPI_swig.h
+// Created: Dec 15, 2015
+// Author:  Sergey POKHODENKO
+
+#ifndef SRC_GEOMDATAAPI_GEOMDATAAPI_SWIG_H_
+#define SRC_GEOMDATAAPI_GEOMDATAAPI_SWIG_H_
+
+  #include "ModelAPI_swig.h"
+
+  #include "GeomDataAPI.h"
+  #include "GeomDataAPI_Point.h"
+  #include "GeomDataAPI_Dir.h"
+  #include "GeomDataAPI_Point2D.h"
+
+  #include <memory>
+  #include <string>
+  #include <list>
+
+  template<class T> std::shared_ptr<T> castTo(std::shared_ptr<ModelAPI_Attribute> theObject)
+  {
+    return std::dynamic_pointer_cast<T>(theObject);
+  }
+
+#endif /* SRC_GEOMDATAAPI_GEOMDATAAPI_SWIG_H_ */
index 8da7ce250a1cf8dc59f3137f4df441fd48551590..dc68d70f583bea112dfb5514dd7fc4c64f8aec05 100644 (file)
@@ -9,55 +9,16 @@
 }
 
 %{
-  #include "ModelAPI.h"
-  #include "ModelAPI_Entity.h"
-  #include "ModelAPI_Document.h"
-  #include "ModelAPI_Session.h"
-  #include "ModelAPI_Object.h"
-  #include "ModelAPI_Feature.h"
-  #include "ModelAPI_Plugin.h"
-  #include "ModelAPI_CompositeFeature.h"
-  #include "ModelAPI_Data.h"
-  #include "ModelAPI_Attribute.h"
-  #include "ModelAPI_AttributeDocRef.h"
-  #include "ModelAPI_AttributeDouble.h"
-  #include "ModelAPI_AttributeInteger.h"
-  #include "ModelAPI_AttributeIntArray.h"
-  #include "ModelAPI_AttributeString.h"
-  #include "ModelAPI_AttributeReference.h"
-  #include "ModelAPI_AttributeRefAttr.h"
-  #include "ModelAPI_AttributeSelection.h"
-  #include "ModelAPI_AttributeSelectionList.h"
-  #include "ModelAPI_AttributeValidator.h"
-  #include "ModelAPI_Validator.h"
-  #include "ModelAPI_FeatureValidator.h"
-  #include "ModelAPI_AttributeRefList.h"
-  #include "ModelAPI_AttributeBoolean.h"
-  #include "ModelAPI_Result.h"
-  #include "ModelAPI_ResultConstruction.h"
-  #include "ModelAPI_ResultBody.h"
-  #include "ModelAPI_ResultPart.h"
-  #include "ModelAPI_ResultParameter.h"
-  #include "ModelAPI_ResultGroup.h"
-  #include "ModelAPI_Tools.h"
-  #include "ModelAPI_ResultCompSolid.h"
-  
-  #include <memory>
-  #include <string>
-  
-  template<class T1, class T2> 
-  std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject)
-  { 
-    return std::dynamic_pointer_cast<T1>(theObject); 
-  }
-
+  #include "ModelAPI_swig.h"
 %}
 
+// import other modules
+%import "GeomAPI.i"
+
 // to avoid error on this
 #define MODELAPI_EXPORT
 
 // standard definitions
-%include "GeomAPI.i"
 %include "typemaps.i"
 %include "std_string.i"
 %include "std_list.i"
diff --git a/src/ModelAPI/ModelAPI_swig.h b/src/ModelAPI/ModelAPI_swig.h
new file mode 100644 (file)
index 0000000..8d27f41
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:    ModelAPI_swig.h
+// Created: Dec 15, 2015
+// Author:  Sergey POKHODENKO
+
+#ifndef SRC_MODELAPI_MODELAPI_SWIG_H_
+#define SRC_MODELAPI_MODELAPI_SWIG_H_
+
+  #include "GeomAPI_swig.h"
+
+  #include "ModelAPI.h"
+  #include "ModelAPI_Entity.h"
+  #include "ModelAPI_Document.h"
+  #include "ModelAPI_Session.h"
+  #include "ModelAPI_Object.h"
+  #include "ModelAPI_Feature.h"
+  #include "ModelAPI_Plugin.h"
+  #include "ModelAPI_CompositeFeature.h"
+  #include "ModelAPI_Data.h"
+  #include "ModelAPI_Attribute.h"
+  #include "ModelAPI_AttributeDocRef.h"
+  #include "ModelAPI_AttributeDouble.h"
+  #include "ModelAPI_AttributeInteger.h"
+  #include "ModelAPI_AttributeIntArray.h"
+  #include "ModelAPI_AttributeString.h"
+  #include "ModelAPI_AttributeReference.h"
+  #include "ModelAPI_AttributeRefAttr.h"
+  #include "ModelAPI_AttributeSelection.h"
+  #include "ModelAPI_AttributeSelectionList.h"
+  #include "ModelAPI_AttributeValidator.h"
+  #include "ModelAPI_Validator.h"
+  #include "ModelAPI_FeatureValidator.h"
+  #include "ModelAPI_AttributeRefList.h"
+  #include "ModelAPI_AttributeBoolean.h"
+  #include "ModelAPI_Result.h"
+  #include "ModelAPI_ResultConstruction.h"
+  #include "ModelAPI_ResultBody.h"
+  #include "ModelAPI_ResultPart.h"
+  #include "ModelAPI_ResultParameter.h"
+  #include "ModelAPI_ResultGroup.h"
+  #include "ModelAPI_Tools.h"
+  #include "ModelAPI_ResultCompSolid.h"
+
+  #include <memory>
+  #include <string>
+
+  template<class T1, class T2>
+  std::shared_ptr<T1> shared_ptr_cast(std::shared_ptr<T2> theObject)
+  {
+    return std::dynamic_pointer_cast<T1>(theObject);
+  }
+
+#endif /* SRC_MODELAPI_MODELAPI_SWIG_H_ */