Parcourir la source

Shortcut ctkVTKVolumePropertyWidget::setVolumeProperty

when the new volume property is the same as the old one.
It is computationally faster.
Julien Finet il y a 13 ans
Parent
commit
3f884f5c3d
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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)
 ::setVolumeProperty(vtkVolumeProperty* newVolumeProperty)
 {
 {
   Q_D(ctkVTKVolumePropertyWidget);
   Q_D(ctkVTKVolumePropertyWidget);
+  if (d->VolumeProperty == newVolumeProperty)
+    {
+    return;
+    }
   this->qvtkReconnect(d->VolumeProperty, newVolumeProperty, vtkCommand::ModifiedEvent,
   this->qvtkReconnect(d->VolumeProperty, newVolumeProperty, vtkCommand::ModifiedEvent,
                       this, SLOT(updateFromVolumeProperty()));
                       this, SLOT(updateFromVolumeProperty()));
   d->VolumeProperty = newVolumeProperty;
   d->VolumeProperty = newVolumeProperty;