FeaturesAPI_Extrusion.h
FeaturesAPI_ExtrusionBoolean.h
FeaturesAPI_Group.h
+ FeaturesAPI_Intersection.h
FeaturesAPI_Partition.h
FeaturesAPI_Pipe.h
FeaturesAPI_Placement.h
FeaturesAPI_Extrusion.cpp
FeaturesAPI_ExtrusionBoolean.cpp
FeaturesAPI_Group.cpp
+ FeaturesAPI_Intersection.cpp
FeaturesAPI_Partition.cpp
FeaturesAPI_Pipe.cpp
FeaturesAPI_Placement.cpp
%shared_ptr(FeaturesAPI_ExtrusionCut)
%shared_ptr(FeaturesAPI_ExtrusionFuse)
%shared_ptr(FeaturesAPI_Group)
+%shared_ptr(FeaturesAPI_Intersection)
%shared_ptr(FeaturesAPI_Partition)
%shared_ptr(FeaturesAPI_Pipe)
%shared_ptr(FeaturesAPI_Placement)
%include "FeaturesAPI_Extrusion.h"
%include "FeaturesAPI_ExtrusionBoolean.h"
%include "FeaturesAPI_Group.h"
+%include "FeaturesAPI_Intersection.h"
%include "FeaturesAPI_Partition.h"
%include "FeaturesAPI_Pipe.h"
%include "FeaturesAPI_Placement.h"
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: FeaturesAPI_Intersection.cpp
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#include "FeaturesAPI_Intersection.h"
+
+#include <ModelHighAPI_Tools.h>
+
+//==================================================================================================
+FeaturesAPI_Intersection::FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+: ModelHighAPI_Interface(theFeature)
+{
+ initialize();
+}
+
+//==================================================================================================
+FeaturesAPI_Intersection::FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theObjects,
+ const std::list<ModelHighAPI_Selection>& theTools)
+: ModelHighAPI_Interface(theFeature)
+{
+ if(initialize()) {
+ fillAttribute(theObjects, myobjects);
+ fillAttribute(theTools, mytools);
+
+ execute();
+ }
+}
+
+//==================================================================================================
+FeaturesAPI_Intersection::~FeaturesAPI_Intersection()
+{
+
+}
+
+//==================================================================================================
+void FeaturesAPI_Intersection::setObjects(const std::list<ModelHighAPI_Selection>& theObjects)
+{
+ fillAttribute(theObjects, myobjects);
+
+ execute();
+}
+
+//==================================================================================================
+void FeaturesAPI_Intersection::setTools(const std::list<ModelHighAPI_Selection>& theTools)
+{
+ fillAttribute(theTools, mytools);
+
+ execute();
+}
+
+// TODO(spo): make add* as static functions of the class
+//==================================================================================================
+IntersectionPtr addIntersection(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const std::list<ModelHighAPI_Selection>& theObjects,
+ const std::list<ModelHighAPI_Selection>& theTools)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Intersection::ID());
+ return IntersectionPtr(new FeaturesAPI_Intersection(aFeature, theObjects, theTools));
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
+// File: FeaturesAPI_Intersection.h
+// Created: 09 June 2016
+// Author: Dmitry Bobylev
+
+#ifndef FeaturesAPI_Intersection_H_
+#define FeaturesAPI_Intersection_H_
+
+#include "FeaturesAPI.h"
+
+#include <FeaturesPlugin_Intersection.h>
+
+#include <ModelHighAPI_Interface.h>
+#include <ModelHighAPI_Macro.h>
+
+class ModelHighAPI_Selection;
+
+/// \class FeaturesAPI_Intersection
+/// \ingroup CPPHighAPI
+/// \brief Interface for Intersection feature.
+class FeaturesAPI_Intersection: public ModelHighAPI_Interface
+{
+public:
+ /// Constructor without values.
+ FEATURESAPI_EXPORT
+ explicit FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+ /// Constructor with values.
+ FEATURESAPI_EXPORT
+ explicit FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theObjects,
+ const std::list<ModelHighAPI_Selection>& theTools);
+
+ /// Destructor.
+ FEATURESAPI_EXPORT
+ virtual ~FeaturesAPI_Intersection();
+
+ INTERFACE_2(FeaturesPlugin_Intersection::ID(),
+ objects, FeaturesPlugin_Intersection::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList, /** Objects */,
+ tools, FeaturesPlugin_Intersection::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList, /** Tools */)
+
+ /// Modify objects attribute of the feature.
+ FEATURESAPI_EXPORT
+ void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
+
+ /// Modify tools attribute of the feature.
+ FEATURESAPI_EXPORT
+ void setTools(const std::list<ModelHighAPI_Selection>& theTools);
+};
+
+/// Pointer on Intersection object.
+typedef std::shared_ptr<FeaturesAPI_Intersection> IntersectionPtr;
+
+/// \ingroup CPPHighAPI
+/// \brief Create Intersection feature.
+FEATURESAPI_EXPORT
+IntersectionPtr addIntersection(const std::shared_ptr<ModelAPI_Document>& thePart,
+ const std::list<ModelHighAPI_Selection>& theObjects,
+ const std::list<ModelHighAPI_Selection>& theTools);
+
+#endif // FeaturesAPI_Intersection_H_
#include "FeaturesAPI_Extrusion.h"
#include "FeaturesAPI_ExtrusionBoolean.h"
#include "FeaturesAPI_Group.h"
+ #include "FeaturesAPI_Intersection.h"
#include "FeaturesAPI_Partition.h"
#include "FeaturesAPI_Pipe.h"
#include "FeaturesAPI_Placement.h"