Procházet zdrojové kódy

Don't synchronize the axes in real time

Right now the axes are modified inside the Render
function. Setting the new axes to the other view would
then generate some OpenGL context switch.
Julien Finet před 13 roky
rodič
revize
871862a42f

+ 2 - 0
Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsWidget.h

@@ -67,6 +67,8 @@ public slots:
   void setYRange(double min, double max);
 
 signals:
+  /// Be carefull, axesModified() can be fired inside the Render() function
+  /// of the view. You might want to connect the slot using Qt::QueuedConnection
   void axesModified();
 
 protected slots:

+ 3 - 3
Libs/Visualization/VTK/Widgets/ctkVTKVolumePropertyWidget.cpp

@@ -93,11 +93,11 @@ void ctkVTKVolumePropertyWidgetPrivate::setupUi(QWidget* widget)
   this->ScalarOpacityThresholdWidget->setVisible(false);
 
   QObject::connect(this->ScalarOpacityWidget, SIGNAL(axesModified()),
-                   q, SLOT(onAxesModified()));//, Qt::QueuedConnection);
+                   q, SLOT(onAxesModified()), Qt::QueuedConnection);
   QObject::connect(this->ScalarColorWidget, SIGNAL(axesModified()),
-                   q, SLOT(onAxesModified()));//, Qt::QueuedConnection);
+                   q, SLOT(onAxesModified()), Qt::QueuedConnection);
   QObject::connect(this->GradientWidget, SIGNAL(axesModified()),
-                   q, SLOT(onAxesModified()));//, Qt::QueuedConnection);
+                   q, SLOT(onAxesModified()), Qt::QueuedConnection);
 
   this->GradientGroupBox->setCollapsed(true);
   this->AdvancedGroupBox->setCollapsed(true);