From: spo Date: Tue, 15 Dec 2015 11:04:24 +0000 (+0300) Subject: Improve SWIG compilation: eliminate types duplication. X-Git-Tag: V_2.1.0~162^2~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4027dc62fa3c8a05356903aabf3f474a4ff89631;p=modules%2Fshaper.git Improve SWIG compilation: eliminate types duplication. --- diff --git a/src/GeomAPI/GeomAPI.i b/src/GeomAPI/GeomAPI.i index 41f79de25..b367e4333 100644 --- a/src/GeomAPI/GeomAPI.i +++ b/src/GeomAPI/GeomAPI.i @@ -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 - #include + #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 index 000000000..0dd57e6cd --- /dev/null +++ b/src/GeomAPI/GeomAPI_swig.h @@ -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 + #include + +#endif /* SRC_GEOMAPI_GEOMAPI_SWIG_H_ */ diff --git a/src/GeomAlgoAPI/GeomAlgoAPI.i b/src/GeomAlgoAPI/GeomAlgoAPI.i index 856e34e79..86addb6d2 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI.i +++ b/src/GeomAlgoAPI/GeomAlgoAPI.i @@ -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 - #include - #include + #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 index 000000000..164f8ec61 --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_swig.h @@ -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 + #include + #include + +#endif /* SRC_GEOMALGOAPI_GEOMALGOAPI_SWIG_H_ */ diff --git a/src/GeomDataAPI/CMakeLists.txt b/src/GeomDataAPI/CMakeLists.txt index 8747e7eab..bef8c896d 100644 --- a/src/GeomDataAPI/CMakeLists.txt +++ b/src/GeomDataAPI/CMakeLists.txt @@ -22,7 +22,8 @@ SET(PROJECT_LIBRARIES ModelAPI ) -INCLUDE_DIRECTORIES( +INCLUDE_DIRECTORIES( + ../GeomAPI # only for SWIG ../ModelAPI ) diff --git a/src/GeomDataAPI/GeomDataAPI.i b/src/GeomDataAPI/GeomDataAPI.i index 24da73652..df40992c9 100644 --- a/src/GeomDataAPI/GeomDataAPI.i +++ b/src/GeomDataAPI/GeomDataAPI.i @@ -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 - #include - #include - - template std::shared_ptr castTo(std::shared_ptr theObject) - { - return std::dynamic_pointer_cast(theObject); - } + #include "GeomDataAPI_swig.h" %} +// import other modules +%import "ModelAPI.i" + // to avoid error on this #define GEOMDATAAPI_EXPORT #define MODELAPI_EXPORT @@ -27,13 +17,11 @@ %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 index 000000000..c24d49360 --- /dev/null +++ b/src/GeomDataAPI/GeomDataAPI_swig.h @@ -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 + #include + #include + + template std::shared_ptr castTo(std::shared_ptr theObject) + { + return std::dynamic_pointer_cast(theObject); + } + +#endif /* SRC_GEOMDATAAPI_GEOMDATAAPI_SWIG_H_ */ diff --git a/src/ModelAPI/ModelAPI.i b/src/ModelAPI/ModelAPI.i index 8da7ce250..dc68d70f5 100644 --- a/src/ModelAPI/ModelAPI.i +++ b/src/ModelAPI/ModelAPI.i @@ -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 - #include - - template - std::shared_ptr shared_ptr_cast(std::shared_ptr theObject) - { - return std::dynamic_pointer_cast(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 index 000000000..8d27f4188 --- /dev/null +++ b/src/ModelAPI/ModelAPI_swig.h @@ -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 + #include + + template + std::shared_ptr shared_ptr_cast(std::shared_ptr theObject) + { + return std::dynamic_pointer_cast(theObject); + } + +#endif /* SRC_MODELAPI_MODELAPI_SWIG_H_ */