changeset 321:56b2e47d3c0c am-2

added undo-crop button
author am@osimis.io
date Fri, 12 Oct 2018 14:53:38 +0200
parents 10d188d6e5cc
children a902a07769d4
files Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.cpp Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.h Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.ui Applications/Samples/SimpleViewer/SimpleViewerApplication.cpp Applications/Samples/SimpleViewer/SimpleViewerApplication.h Framework/Widgets/IWorldSceneMouseTracker.h
diffstat 6 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.cpp	Fri Oct 12 14:38:48 2018 +0200
+++ b/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.cpp	Fri Oct 12 14:53:38 2018 +0200
@@ -40,6 +40,7 @@
 
 #if QT_VERSION >= 0x050000
     connect(ui_->toolButtonCrop, &QToolButton::clicked, this, &SimpleViewerMainWindow::cropClicked);
+    connect(ui_->pushButtonUndoCrop, &QToolButton::clicked, this, &SimpleViewerMainWindow::undoCropClicked);
     connect(ui_->toolButtonLine, &QToolButton::clicked, this, &SimpleViewerMainWindow::lineClicked);
     connect(ui_->toolButtonCircle, &QToolButton::clicked, this, &SimpleViewerMainWindow::circleClicked);
     connect(ui_->toolButtonWindowing, &QToolButton::clicked, this, &SimpleViewerMainWindow::windowingClicked);
@@ -50,6 +51,7 @@
     connect(ui_->toolButtonLine, SIGNAL(clicked()), this, SLOT(lineClicked()));
     connect(ui_->toolButtonCircle, SIGNAL(clicked()), this, SLOT(circleClicked()));
     connect(ui_->toolButtonWindowing, SIGNAL(clicked()), this, SLOT(windowingClicked()));
+    connect(ui_->pushButtonUndoCrop, SIGNAL(clicked()), this, SLOT(undoCropClicked()));
     connect(ui_->pushButtonRotate, SIGNAL(clicked()), this, SLOT(rotateClicked()));
     connect(ui_->pushButtonInvert, SIGNAL(clicked()), this, SLOT(invertClicked()));
 #endif
@@ -66,6 +68,12 @@
     stoneApplication_.ExecuteCommand(command);
   }
 
+  void SimpleViewerMainWindow::undoCropClicked()
+  {
+    GenericNoArgCommand command("action:undo-crop");
+    stoneApplication_.ExecuteCommand(command);
+  }
+
   void SimpleViewerMainWindow::lineClicked()
   {
     GenericNoArgCommand command("selectTool:line-measure");
--- a/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.h	Fri Oct 12 14:38:48 2018 +0200
+++ b/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.h	Fri Oct 12 14:53:38 2018 +0200
@@ -47,6 +47,7 @@
 
   private slots:
     void cropClicked();
+    void undoCropClicked();
     void rotateClicked();
     void windowingClicked();
     void lineClicked();
--- a/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.ui	Fri Oct 12 14:38:48 2018 +0200
+++ b/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.ui	Fri Oct 12 14:53:38 2018 +0200
@@ -82,6 +82,13 @@
         </widget>
        </item>
        <item>
+        <widget class="QPushButton" name="pushButtonUndoCrop">
+         <property name="text">
+          <string>undo crop</string>
+         </property>
+        </widget>
+       </item>
+       <item>
         <widget class="QToolButton" name="toolButtonLine">
          <property name="text">
           <string>line</string>
--- a/Applications/Samples/SimpleViewer/SimpleViewerApplication.cpp	Fri Oct 12 14:38:48 2018 +0200
+++ b/Applications/Samples/SimpleViewer/SimpleViewerApplication.cpp	Fri Oct 12 14:53:38 2018 +0200
@@ -199,6 +199,10 @@
     {
       ExecuteAction(Actions_Rotate);
     }
+    else if (command.GetName() == "action:undo-crop")
+    {
+      ExecuteAction(Actions_UndoCrop);
+    }
     else if (command.GetName() == "action:invert")
     {
       ExecuteAction(Actions_Invert);
--- a/Applications/Samples/SimpleViewer/SimpleViewerApplication.h	Fri Oct 12 14:38:48 2018 +0200
+++ b/Applications/Samples/SimpleViewer/SimpleViewerApplication.h	Fri Oct 12 14:53:38 2018 +0200
@@ -82,7 +82,8 @@
 
     enum Actions {
       Actions_Rotate,
-      Actions_Invert
+      Actions_Invert,
+      Actions_UndoCrop
     };
 
   private:
--- a/Framework/Widgets/IWorldSceneMouseTracker.h	Fri Oct 12 14:38:48 2018 +0200
+++ b/Framework/Widgets/IWorldSceneMouseTracker.h	Fri Oct 12 14:53:38 2018 +0200
@@ -32,8 +32,7 @@
   class IWorldSceneMouseTracker : public boost::noncopyable
   {
   public:
-    virtual ~IWorldSceneMouseTracker()
-    {
+    virtual ~IWorldSceneMouseTracker() {
     }
 
     virtual void Render(CairoContext& context,