ADD_SUBDIRECTORY (src/PythonAPI)
# High Level C++/Python API
ADD_SUBDIRECTORY (src/ModelHighAPI)
+ADD_SUBDIRECTORY (src/BuildAPI)
ADD_SUBDIRECTORY (src/ConnectorAPI)
ADD_SUBDIRECTORY (src/ConstructionAPI)
ADD_SUBDIRECTORY (src/ExchangeAPI)
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+#ifndef BUILDAPI_H
+#define BUILDAPI_H
+
+#if defined BUILDAPI_EXPORTS
+#if defined WIN32
+#define BUILDAPI_EXPORT __declspec( dllexport )
+#else
+#define BUILDAPI_EXPORT
+#endif
+#else
+#if defined WIN32
+#define BUILDAPI_EXPORT __declspec( dllimport )
+#else
+#define BUILDAPI_EXPORT
+#endif
+#endif
+
+#endif
--- /dev/null
+/* FeaturesAPI.i */
+
+%module BuildAPI
+
+%{
+ #include "BuildAPI_swig.h"
+%}
+
+%include "doxyhelp.i"
+
+// import other modules
+%import "ModelHighAPI.i"
+
+// to avoid error on this
+#define BUILDAPI_EXPORT
+
+// standard definitions
+%include "typemaps.i"
+%include "std_shared_ptr.i"
+
+// shared pointers
+%shared_ptr(BuildAPI_Vertex)
+
+// all supported interfaces
+%include "BuildAPI_Vertex.h"
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: BuildAPI_Vertex.cpp
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#include "BuildAPI_Vertex.h"
+
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+BuildAPI_Vertex::BuildAPI_Vertex(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+ initialize();
+}
+
+//==================================================================================================
+BuildAPI_Vertex::BuildAPI_Vertex(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects)
+: ModelHighAPI_Interface(theFeature)
+{
+ if(initialize()) {
+ setBase(theBaseObjects);
+ }
+}
+
+//==================================================================================================
+BuildAPI_Vertex::~BuildAPI_Vertex()
+{
+
+}
+
+//==================================================================================================
+void BuildAPI_Vertex::setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects)
+{
+ fillAttribute(theBaseObjects, mybaseObjects);
+
+ execute();
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+VertexPtr addVertex(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(BuildAPI_Vertex::ID());
+ return VertexPtr(new BuildAPI_Vertex(aFeature, theBaseObjects));
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: BuildAPI_Vertex.h
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#ifndef BuildAPI_Vertex_H_
+#define BuildAPI_Vertex_H_
+
+#include "BuildAPI.h"
+
+#include <BuildPlugin_Vertex.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Selection;
+
+/// \class BuildAPI_Vertex
+/// \ingroup CPPHighAPI
+/// \brief Interface for Vertex feature.
+class BuildAPI_Vertex: public ModelHighAPI_Interface
+{
+public:
+ /// Constructor without values.
+ BUILDAPI_EXPORT
+ explicit BuildAPI_Vertex(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+ /// Constructor with values.
+ BUILDAPI_EXPORT
+ explicit BuildAPI_Vertex(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects);
+
+ /// Destructor.
+ BUILDAPI_EXPORT
+ virtual ~BuildAPI_Vertex();
+
+ INTERFACE_1(BuildPlugin_Vertex::ID(),
+ baseObjects, BuildPlugin_Vertex::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */)
+
+ /// Modify base attribute of the feature.
+ BUILDAPI_EXPORT
+ void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
+};
+
+/// Pointer on Vertex object.
+typedef std::shared_ptr<BuildAPI_Vertex> VertexPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Vertex feature.
+BUILDAPI_EXPORT
+VertexPtr addVertex(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects);
+
+#endif // BuildAPI_Vertex_H_
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: FeaturesAPI_swig.h
+// Created: 07 June 2016
+// Author: Dmitry Bobylev
+
+#ifndef FeaturesAPI_swig_H_
+#define FeaturesAPI_swig_H_
+
+ #include <ModelHighAPI_swig.h>
+
+ #include "BuildAPI_Vertex.h"
+
+#endif // FeaturesAPI_swig_H_
--- /dev/null
+## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+INCLUDE(Common)
+
+SET(PROJECT_HEADERS
+ BuildAPI.h
+ BuildAPI_Vertex.h
+)
+
+SET(PROJECT_SOURCES
+ BuildAPI_Vertex.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(
+ ${PROJECT_SOURCE_DIR}/src/GeomAPI
+ ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
+ ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
+ ${PROJECT_SOURCE_DIR}/src/BuildPlugin
+)
+
+#TODO(spo): is ${CAS_DEFINITIONS} necessary?
+ADD_DEFINITIONS(-DBUILDAPI_EXPORTS ${CAS_DEFINITIONS})
+ADD_LIBRARY(BuildAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+TARGET_LINK_LIBRARIES(BuildAPI ${PROJECT_LIBRARIES})
+
+# SWIG wrapper
+
+INCLUDE(PythonAPI)
+
+SET_SOURCE_FILES_PROPERTIES(BuildAPI.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(BuildAPI.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
+ BuildAPI
+ ModelHighAPI
+ ModelAPI
+ ${PYTHON_LIBRARIES}
+)
+
+SET(SWIG_MODULE_BuildAPI_EXTRA_DEPS ${SWIG_MODULE_BuildAPI_EXTRA_DEPS}
+ ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/ModelHighAPI.i
+ doxyhelp.i
+ ${PROJECT_HEADERS}
+)
+
+SWIG_ADD_MODULE(BuildAPI python BuildAPI.i ${PROJECT_HEADERS})
+SWIG_LINK_LIBRARIES(BuildAPI ${SWIG_LINK_LIBRARIES})
+
+IF(WIN32)
+ SET_TARGET_PROPERTIES(_BuildAPI PROPERTIES DEBUG_OUTPUT_NAME _BuildAPI_d)
+ENDIF(WIN32)
+
+INSTALL(TARGETS _BuildAPI DESTINATION ${SHAPER_INSTALL_SWIG})
+INSTALL(TARGETS BuildAPI DESTINATION ${SHAPER_INSTALL_BIN})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/BuildAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
+
+# Tests
+INCLUDE(UnitTest)
+
+ADD_UNIT_TESTS(
+)
+
+# ADD_SUBDIRECTORY (Test)