]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refs #30 - Sketch base GUI: create, draw lines
authornds <natalia.donis@opencascade.com>
Wed, 30 Apr 2014 05:50:50 +0000 (09:50 +0400)
committernds <natalia.donis@opencascade.com>
Wed, 30 Apr 2014 05:50:50 +0000 (09:50 +0400)
Renames method to work through local context

src/PartSet/PartSet_Module.cpp
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Displayer.h

index 0724e6de1fa8e9e92ea5b87cfd001b222135c4a7..167d9f0ea1fc5f3902acc7958beb601377f7ce70 100644 (file)
@@ -224,9 +224,7 @@ void PartSet_Module::onPlaneSelected(double theX, double theY, double theZ)
     PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
     if (aPreviewOp) {
       aPreviewOp->setEditMode(true);
-      // the preview should be shown in another local context
       visualizePreview(false);
-      visualizePreview(true);
     }
   }
 
@@ -247,12 +245,12 @@ void PartSet_Module::visualizePreview(bool isDisplay)
   if (isDisplay) {
     boost::shared_ptr<GeomAPI_Shape> aPreview = aPreviewOp->preview();
     if (aPreview) {
-      aDisplayer->LocalSelection(anOperation->feature(),
-                                   aPreview->impl<TopoDS_Shape>(), aPreviewOp->getSelectionMode());
+      aDisplayer->DisplayInLocalContext(anOperation->feature(), aPreview->impl<TopoDS_Shape>(),
+                                        aPreviewOp->getSelectionMode());
     }
   }
   else {
-    aDisplayer->GlobalSelection(false);
+    aDisplayer->CloseLocalContexts(false);
     aDisplayer->Erase(anOperation->feature());
   }
 }
index 41c912f1a4e29248576cb291a820f10dc38f6dc5..4803c578df03b201ae433d3f94fa75ded37c0f18 100644 (file)
@@ -73,9 +73,9 @@ void XGUI_Displayer::Erase(boost::shared_ptr<ModelAPI_Feature> theFeature,
     aContext->UpdateCurrentViewer();
 }
 
-void XGUI_Displayer::LocalSelection(boost::shared_ptr<ModelAPI_Feature> theFeature,
-                                    const TopoDS_Shape& theShape,
-                                    const int theMode, const bool isUpdateViewer)
+void XGUI_Displayer::DisplayInLocalContext(boost::shared_ptr<ModelAPI_Feature> theFeature,
+                                           const TopoDS_Shape& theShape,
+                                           const int theMode, const bool isUpdateViewer)
 {
   Handle(AIS_InteractiveContext) aContext = AISContext();
   
@@ -94,16 +94,16 @@ void XGUI_Displayer::LocalSelection(boost::shared_ptr<ModelAPI_Feature> theFeatu
 
   AIS_ListOfInteractive anAISList;
   anAISList.Append(anAIS);
-  setLocalSelection(anAISList, theMode, true);
+  activateInLocalContext(anAISList, theMode, true);
 }
 
-void XGUI_Displayer::GlobalSelection(const bool isUpdateViewer)
+void XGUI_Displayer::CloseLocalContexts(const bool isUpdateViewer)
 {
-  setGlobalSelection(true);
+  closeAllContexts(true);
 }
 
-void XGUI_Displayer::setLocalSelection(const AIS_ListOfInteractive& theAISObjects, const int theMode,
-                                    const bool isUpdateViewer)
+void XGUI_Displayer::activateInLocalContext(const AIS_ListOfInteractive& theAISObjects, const int theMode,
+                                            const bool isUpdateViewer)
 {
   Handle(AIS_InteractiveContext) ic = AISContext();
 
@@ -133,7 +133,7 @@ void XGUI_Displayer::setLocalSelection(const AIS_ListOfInteractive& theAISObject
     ic->UpdateCurrentViewer();
 }
 
-void XGUI_Displayer::setGlobalSelection(const bool isUpdateViewer)
+void XGUI_Displayer::closeAllContexts(const bool isUpdateViewer)
 {
   Handle(AIS_InteractiveContext) ic = AISContext();
   if (!ic.IsNull()) {
index b6967a2ab5d3366b60117d7ec6f775b63eb12ba6..3b1b54f608003fac118f6906c3cb346be8e4b876 100644 (file)
@@ -59,8 +59,9 @@ public:
   /// \param theShape a shape
   /// \param theMode a local selection mode
   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
-  void LocalSelection(boost::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape,
-                      const int theMode, const bool isUpdateViewer = true);
+  void DisplayInLocalContext(boost::shared_ptr<ModelAPI_Feature> theFeature,
+                             const TopoDS_Shape& theShape,
+                             const int theMode, const bool isUpdateViewer = true);
 
   /// Erase the feature and a shape.
   /// \param theFeature a feature instance
@@ -69,17 +70,18 @@ public:
 
   /// Deactivates selection of sub-shapes
   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
-  void GlobalSelection(const bool isUpdateViewer = true);
+  void CloseLocalContexts(const bool isUpdateViewer = true);
 
+protected:
   /// Activate local selection
   /// \param theAIS the list of objects
   /// \param theMode the selection mode
   /// \param isUpdateViewer the state wether the viewer should be updated immediatelly
-  void setLocalSelection(const AIS_ListOfInteractive& theAISObjects, const int theMode,
-                         const bool isUpdateViewer);
+  void activateInLocalContext(const AIS_ListOfInteractive& theAISObjects, const int theMode,
+                              const bool isUpdateViewer);
   /// Deactivate local selection
   /// \param isUpdateViewer the state wether the viewer should be updated immediatelly
-  void setGlobalSelection(const bool isUpdateViewer);
+  void closeAllContexts(const bool isUpdateViewer);
 
   /// Returns currently installed AIS_InteractiveContext
   Handle(AIS_InteractiveContext) AISContext() const { return myAISContext; }