소스 검색

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 14 년 전
부모
커밋
871862a42f
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 0
      Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsWidget.h
  2. 3 3
      Libs/Visualization/VTK/Widgets/ctkVTKVolumePropertyWidget.cpp

+ 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);