Selaa lähdekoodia

Merge branch 'ctkVTKSliceView'

* ctkVTKSliceView:
  ENH: Changed signal resized(QResizeEvent*) into resized(const QSize& size, const QSize& oldSize)
  ENH: Change ctkVTKSliceView API - setImageData, setCornerAnnotationText, setBackgroundColor, setRenderEnabled are not slots
Jean-Christophe Fillion-Robin 15 vuotta sitten
vanhempi
commit
e5071c3420

+ 2 - 1
Libs/Visualization/VTK/Widgets/ctkVTKSliceView.cpp

@@ -22,6 +22,7 @@
 #include <QTimer>
 #include <QVBoxLayout>
 #include <QDebug>
+#include <QResizeEvent>
 
 // CTK includes
 #include "ctkVTKSliceView.h"
@@ -580,6 +581,6 @@ void ctkVTKSliceView::setImageData(vtkImageData* newImageData)
 void ctkVTKSliceView::resizeEvent(QResizeEvent * event)
 {
   this->QWidget::resizeEvent(event);
-  emit this->resized(event);
+  emit this->resized(event->size(), event->oldSize());
 }
 

+ 15 - 11
Libs/Visualization/VTK/Widgets/ctkVTKSliceView.h

@@ -66,6 +66,18 @@ public slots:
   /// Reset cameras associated with all renderWindowItem
   void resetCamera();
 
+  /// Set image data
+  void setImageData(vtkImageData* newImageData);
+
+  /// Set corner annotation \a text
+  void setCornerAnnotationText(const QString& text);
+
+  /// Set background color
+  void setBackgroundColor(const QColor& newBackgroundColor);
+
+  /// Enable/Disable rendering
+  void setRenderEnabled(bool value);
+
 public:
 
   /// Get underlying RenderWindow
@@ -78,12 +90,10 @@ public:
   /// Get current interactor style
   vtkInteractorObserver* interactorStyle();
   
-  /// Set/Get corner annotation \a text
-  void setCornerAnnotationText(const QString& text);
+  /// Get corner annotation text
   QString cornerAnnotationText() const;
 
-  /// Set/Get background color
-  void setBackgroundColor(const QColor& newBackgroundColor);
+  /// Get background color
   QColor backgroundColor() const;
 
   /// Get active camera
@@ -134,21 +144,15 @@ public:
   /// Return if rendering is enabled
   bool renderEnabled() const;
 
-  /// Enable/Disable rendering
-  void setRenderEnabled(bool value);
-
   /// Get current color window
   double colorWindow() const;
 
   /// Get current color level
   double colorLevel() const;
-
-  /// Set image data
-  void setImageData(vtkImageData* newImageData);
   
 
 signals:
-  void resized(QResizeEvent*);
+  void resized(const QSize& size, const QSize& oldSize);
 
 protected:
   virtual void resizeEvent(QResizeEvent * event);