Browse Source

Shortcut ctkVTKVolumePropertyWidget::setVolumeProperty

when the new volume property is the same as the old one.
It is computationally faster.
Julien Finet 13 years ago
parent
commit
3f884f5c3d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Libs/Visualization/VTK/Widgets/ctkVTKVolumePropertyWidget.cpp

+ 4 - 0
Libs/Visualization/VTK/Widgets/ctkVTKVolumePropertyWidget.cpp

@@ -193,6 +193,10 @@ void ctkVTKVolumePropertyWidget
 ::setVolumeProperty(vtkVolumeProperty* newVolumeProperty)
 {
   Q_D(ctkVTKVolumePropertyWidget);
+  if (d->VolumeProperty == newVolumeProperty)
+    {
+    return;
+    }
   this->qvtkReconnect(d->VolumeProperty, newVolumeProperty, vtkCommand::ModifiedEvent,
                       this, SLOT(updateFromVolumeProperty()));
   d->VolumeProperty = newVolumeProperty;