ModelAPI_Result.cpp
ModelAPI_ResultPart.cpp
ModelAPI_ResultConstruction.cpp
+ ModelAPI_CompositeFeature.cpp
)
SET(PROJECT_LIBRARIES
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: ModelAPI_CompositeFeature.h
+// Created: 20 Oct 2014
+// Author: Mikhail PONIKAROV
+
+#include <ModelAPI_CompositeFeature.h>
+
+ModelAPI_CompositeFeature::~ModelAPI_CompositeFeature()
+{
+
+}
+
// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-// File: ModelAPI_CompositeFeature.hxx
+// File: ModelAPI_CompositeFeature.h
// Created: 20 Oct 2014
// Author: Mikhail PONIKAROV
-#ifndef ModelAPI_CompositeFeature_H_
-#define ModelAPI_CompositeFeature_H_
+#ifndef MODELAPI_COMPOSITEFEATURE_H_
+#define MODELAPI_COMPOSITEFEATURE_H_
+#include "ModelAPI.h"
#include "ModelAPI_Feature.h"
/**\class ModelAPI_CompositeFeature
* \ingroup DataModel
* \brief Feature that consists of other features: like sketcher
- * with edges inside. It just allows t oadd a feature to this feature only
+ * with edges inside. It just allows to add a feature to this feature only
* instead of adding in both document and this feature.
*/
class ModelAPI_CompositeFeature : public ModelAPI_Feature
{
public:
+ MODELAPI_EXPORT virtual ~ModelAPI_CompositeFeature();
+
/// Adds feature to the sketch and to its document
virtual std::shared_ptr<ModelAPI_Feature> addFeature(std::string theID) = 0;
ModuleBase_Operation* aCurOperation = myWorkshop->currentOperation();
if (aCurOperation) {
FeaturePtr aFeature = aCurOperation->feature();
- CompositeFeaturePtr aCompFea = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
- if (aCompFea)
- anOperation->setParentFeature(aCompFea);
+ CompositeFeaturePtr aCompFeature =
+ std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
+ if (aCompFeature) {
+ anOperation->setParentFeature(aCompFeature);
+ }
}
std::string aPluginFileName = myFeaturesInFiles[theFeatureId];
ModuleBase_Operation* anOperation = createOperation(aFeatureId);
anOperation->setFeature(theFeature);
sendOperation(anOperation);
-}
\ No newline at end of file
+}
FeaturePtr ModuleBase_Operation::createFeature(const bool theFlushMessage)
{
- if (myParentFeature) {
+ if (myParentFeature.get()) {
myFeature = myParentFeature->addFeature(getDescription()->operationId().toStdString());
} else {
std::shared_ptr<ModelAPI_Document> aDoc = document();
}
+void ModuleBase_Operation::setParentFeature(CompositeFeaturePtr theParent)
+{
+ myParentFeature = theParent;
+}
+
+CompositeFeaturePtr ModuleBase_Operation::parentFeature() const
+{
+ return myParentFeature;
+}
+
void ModuleBase_Operation::initSelection(ModuleBase_ISelection* theSelection,
ModuleBase_IViewer* theViewer)
{
/// If the operation works with feature which is sub-feature of another one
/// then this variable has to be initialised by parent feature
/// before operation feature creating
- void setParentFeature(CompositeFeaturePtr theParent) { myParentFeature = theParent; }
+ void setParentFeature(CompositeFeaturePtr theParent);
/// \return Installed parent feature (can be NULL)
- CompositeFeaturePtr parentFeature() const { return myParentFeature; }
+ CompositeFeaturePtr parentFeature() const;
signals:
/// The operation is started