ADD_SUBDIRECTORY (src/PythonAPI)
# High Level C++/Python API
ADD_SUBDIRECTORY (src/ModelHighAPI)
+ADD_SUBDIRECTORY (src/ConnectorAPI)
ADD_SUBDIRECTORY (src/ConstructionAPI)
ADD_SUBDIRECTORY (src/ExchangeAPI)
ADD_SUBDIRECTORY (src/FeaturesAPI)
--- /dev/null
+## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+INCLUDE(Common)
+
+SET(PROJECT_HEADERS
+ ConnectorAPI.h
+ ConnectorAPI_Connector.h
+)
+
+SET(PROJECT_SOURCES
+ ConnectorAPI_Connector.cpp
+)
+
+SET(PROJECT_LIBRARIES
+ ModelAPI
+ ModelHighAPI
+)
+
+INCLUDE_DIRECTORIES(
+ ${PROJECT_SOURCE_DIR}/src/Events
+ ${PROJECT_SOURCE_DIR}/src/ModelAPI
+ ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
+)
+
+# Plugin headers dependency
+INCLUDE_DIRECTORIES(
+ # TODO(spo): modify ConnectorPlugin headers to remove dependency on GeomAPI headers
+ ${PROJECT_SOURCE_DIR}/src/GeomAPI
+ # TODO(spo): it is for *_swig.h files. Can we eliminate it?
+ ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
+ ${PROJECT_SOURCE_DIR}/src/ConnectorPlugin
+)
+
+#TODO(spo): is ${CAS_DEFINITIONS} necessary?
+ADD_DEFINITIONS(-DCONSTRUCTIONAPI_EXPORTS ${CAS_DEFINITIONS})
+ADD_LIBRARY(ConnectorAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+TARGET_LINK_LIBRARIES(ConnectorAPI ${PROJECT_LIBRARIES})
+
+# SWIG wrapper
+
+INCLUDE(PythonAPI)
+
+SET_SOURCE_FILES_PROPERTIES(ConnectorAPI.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(ConnectorAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+
+#TODO(spo): is ModelAPI necessary or it could be received by INTERFACE_ (may require modern CMake)?
+SET(SWIG_LINK_LIBRARIES
+ ConnectorAPI
+ ModelHighAPI
+ ModelAPI
+ ${PYTHON_LIBRARIES}
+)
+
+SET(SWIG_MODULE_ConnectorAPI_EXTRA_DEPS ${SWIG_MODULE_ConnectorAPI_EXTRA_DEPS}
+ ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
+ doxyhelp.i
+ ${PROJECT_HEADERS}
+)
+
+SWIG_ADD_MODULE(ConnectorAPI python ConnectorAPI.i ${PROJECT_HEADERS})
+SWIG_LINK_LIBRARIES(ConnectorAPI ${SWIG_LINK_LIBRARIES})
+
+IF(WIN32)
+ SET_TARGET_PROPERTIES(_ConnectorAPI PROPERTIES DEBUG_OUTPUT_NAME _ConnectorAPI_d)
+ENDIF(WIN32)
+
+INSTALL(TARGETS _ConnectorAPI DESTINATION ${SHAPER_INSTALL_SWIG})
+INSTALL(TARGETS ConnectorAPI DESTINATION ${SHAPER_INSTALL_BIN})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ConnectorAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#ifndef CONNECTORAPI_H
+#define CONNECTORAPI_H
+
+#if defined CONNECTORAPI_EXPORTS
+#if defined WIN32
+#define CONNECTORAPI_EXPORT __declspec( dllexport )
+#else
+#define CONNECTORAPI_EXPORT
+#endif
+#else
+#if defined WIN32
+#define CONNECTORAPI_EXPORT __declspec( dllimport )
+#else
+#define CONNECTORAPI_EXPORT
+#endif
+#endif
+
+#endif
--- /dev/null
+/* ConnectorAPI.i */
+
+%module ConnectorAPI
+
+%{
+ #include "ConnectorAPI_swig.h"
+%}
+
+%include "doxyhelp.i"
+
+// import other modules
+%import "ModelHighAPI.i"
+
+// to avoid error on this
+#define CONNECTORAPI_EXPORT
+
+// standard definitions
+%include "typemaps.i"
+%include "std_shared_ptr.i"
+
+// all supported interfaces
+%include "ConnectorAPI_Connector.h"
--- /dev/null
+// Name : ConnectorAPI_Connector.cpp
+// Purpose:
+//
+// History:
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
+
+//--------------------------------------------------------------------------------------
+#include "ConnectorAPI_Connector.h"
+//--------------------------------------------------------------------------------------
+#include <ModelAPI_Document.h>
+#include <ModelAPI_Feature.h>
+//--------------------------------------------------------------------------------------
+void exportToGEOM(const std::shared_ptr<ModelAPI_Document> & thePart)
+{
+ // TODO(spo): check that theConnector is not empty
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature("ExportToGEOM");
+ aFeature->execute();
+}
--- /dev/null
+// Name : ConnectorAPI_Connector.h
+// Purpose:
+//
+// History:
+// 16/06/16 - Sergey POKHODENKO - Creation of the file
+
+#ifndef SRC_CONNECTORAPI_CONNECTORAPI_PART_H_
+#define SRC_CONNECTORAPI_CONNECTORAPI_PART_H_
+
+//--------------------------------------------------------------------------------------
+#include "ConnectorAPI.h"
+//--------------------------------------------------------------------------------------
+#include <memory>
+//--------------------------------------------------------------------------------------
+class ModelAPI_Document;
+//--------------------------------------------------------------------------------------
+/**\ingroup CPPHighAPI
+ * \brief Export to GEOM
+ */
+CONNECTORAPI_EXPORT
+void exportToGEOM(const std::shared_ptr<ModelAPI_Document> & thePart);
+
+//--------------------------------------------------------------------------------------
+//--------------------------------------------------------------------------------------
+#endif /* SRC_CONNECTORAPI_CONNECTORAPI_PART_H_ */
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: ConnectorAPI_swig.h
+// Created: 16/06/16
+// Author: Sergey POKHODENKO
+
+#ifndef SRC_CONNECTORAPI_CONNECTORAPI_SWIG_H_
+#define SRC_CONNECTORAPI_CONNECTORAPI_SWIG_H_
+
+ #include <ModelHighAPI_swig.h>
+
+ #include "ConnectorAPI_Connector.h"
+
+#endif /* SRC_CONNECTORAPI_CONNECTORAPI_SWIG_H_ */
"""Package for Connection plugin for the Parametric Geometry API of the Modeler.
"""
-from connection import exportToGEOM
\ No newline at end of file
+from ConnectorAPI import exportToGEOM
\ No newline at end of file