浏览代码

Shortcut ctkVTKVolumePropertyWidget::setVolumeProperty

when the new volume property is the same as the old one.
It is computationally faster.
Julien Finet 13 年之前
父节点
当前提交
3f884f5c3d
共有 1 个文件被更改,包括 4 次插入0 次删除
  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;