]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refs #30 - Sketch base GUI: create, draw lines
authornds <natalia.donis@opencascade.com>
Thu, 24 Apr 2014 07:16:39 +0000 (11:16 +0400)
committernds <natalia.donis@opencascade.com>
Thu, 24 Apr 2014 07:16:39 +0000 (11:16 +0400)
Add comments for some code

src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h

index 452b546e29b315658e59516ad507e21756df4fab..12cf4971a067b8bdd8c873a306a6d87df27f2e17 100644 (file)
@@ -92,26 +92,6 @@ void PartSet_Module::onFeatureTriggered()
   Event_Loop::loop()->send(aMessage);
 }
 
-/**
- * Slot that is called by the operation requiring of preview display or erase
- * \param isDisplay the display or erase state
-*/
-void PartSet_Module::visualizePreview(bool isDisplay)
-{
-  ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
-  if (!anOperation)
-    return;
-
-  PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
-  if (!aPreviewOp)
-    return;
-
-  if (isDisplay)
-    myWorkshop->displayer()->Display(anOperation->feature(), aPreviewOp->preview());
-  else
-    myWorkshop->displayer()->Erase(anOperation->feature(), aPreviewOp->preview());
-}
-
 void PartSet_Module::onOperationStarted()
 {
   ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
@@ -137,3 +117,19 @@ void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
     visualizePreview(false);
   }
 }
+
+void PartSet_Module::visualizePreview(bool isDisplay)
+{
+  ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
+  if (!anOperation)
+    return;
+
+  PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
+  if (!aPreviewOp)
+    return;
+
+  if (isDisplay)
+    myWorkshop->displayer()->Display(anOperation->feature(), aPreviewOp->preview());
+  else
+    myWorkshop->displayer()->Erase(anOperation->feature(), aPreviewOp->preview());
+}
index 64f03d59c082c136abacc51be272d6a9644a9c96..60f78835cc6251f8be2cb3f07c7d6c1d8fbcfcd7 100644 (file)
@@ -22,10 +22,16 @@ public:
 
 public slots:
   void onFeatureTriggered();
+  /// SLOT, that is called after the operation is started. Perform some specific for module
+  /// actions, e.g. connect the sketch feature to the viewer selection and show the sketch preview.
   void onOperationStarted();
+  /// SLOT, that is called after the operation is stopped. Disconnect the sketch feature
+  /// from the viewer selection and show the sketch preview.
   void onOperationStopped(ModuleBase_Operation* theOperation);
 
 private:
+  /// Displays or erase the current operation preview, if it has it.
+  /// \param isDisplay the state whether the presentation should be displayed or erased
   void visualizePreview(bool isDisplay);
 
 private: