Salome HOME
Fix of lost presentation in debian squeeze in release mode
authorsbh <sergey.belash@opencascade.com>
Fri, 23 Jan 2015 17:36:47 +0000 (20:36 +0300)
committersbh <sergey.belash@opencascade.com>
Fri, 23 Jan 2015 17:36:47 +0000 (20:36 +0300)
src/ModelAPI/CMakeLists.txt
src/ModelAPI/ModelAPI_CompositeFeature.cpp [new file with mode: 0644]
src/ModelAPI/ModelAPI_CompositeFeature.h
src/ModuleBase/ModuleBase_IModule.cpp
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_Operation.h

index 05fe6e971253aef473e35fa150300f207906c7f4..fc00bafd6dee6a738b2f166edf9f547c39d09310 100644 (file)
@@ -49,6 +49,7 @@ SET(PROJECT_SOURCES
     ModelAPI_Result.cpp
     ModelAPI_ResultPart.cpp
     ModelAPI_ResultConstruction.cpp
+    ModelAPI_CompositeFeature.cpp
 )
 
 SET(PROJECT_LIBRARIES
diff --git a/src/ModelAPI/ModelAPI_CompositeFeature.cpp b/src/ModelAPI/ModelAPI_CompositeFeature.cpp
new file mode 100644 (file)
index 0000000..ba5d1cd
--- /dev/null
@@ -0,0 +1,13 @@
+// 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()
+{
+
+}
+
index 3498b8fb1c0d714c2cde47218c9bcf12e915ca0e..df78236d98e2a124d40c7ad632fb35e559821329 100644 (file)
@@ -1,23 +1,26 @@
 // 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 tadd 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;
 
index 0e2ce8d7f6bc7545a1c204fd6d6f2e670bdd8bcb..e44ee809d41445db6e624d3b3c6f8ab862377cb4 100644 (file)
@@ -74,9 +74,11 @@ ModuleBase_Operation* ModuleBase_IModule::createOperation(const std::string& the
   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];
@@ -127,4 +129,4 @@ void ModuleBase_IModule::editFeature(FeaturePtr theFeature)
   ModuleBase_Operation* anOperation = createOperation(aFeatureId);
   anOperation->setFeature(theFeature);
   sendOperation(anOperation);
-}
\ No newline at end of file
+}
index e9cfa075f67bad5cf5122ded5504dd727fd3da76..96060b463837050075cb47244ca5f19fe8fabb13 100644 (file)
@@ -90,7 +90,7 @@ void ModuleBase_Operation::flushCreated()
 
 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();
@@ -246,6 +246,16 @@ void ModuleBase_Operation::activateByPreselection()
 
 }
 
+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)
 {
index 596b51d1df007630685e2665e252ed849a451a64..77c8d3fe34e2b622d36476da8ff7b9b51660c06e 100644 (file)
@@ -120,10 +120,10 @@ Q_OBJECT
   /// 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