14 #include <vtkPiecewiseFunction.h>
15 #include <vtkColorTransferFunction.h>
16 #include <vtkVolumeProperty.h>
25 VolumeProperty::VolumeProperty() : QObject(),
31 mOpacityTransferFunction->AddPoint(0.0, 0.0);
32 mOpacityTransferFunction->AddPoint(maxVal, 1.0);
34 mColorTransferFunction->SetColorSpaceToRGB();
35 mColorTransferFunction->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
36 mColorTransferFunction->AddRGBPoint(maxVal, 1.0, 1.0, 1.0);
38 mVolumeProperty->SetColor(mColorTransferFunction);
39 mVolumeProperty->SetScalarOpacity(mOpacityTransferFunction);
40 mVolumeProperty->SetInterpolationTypeToLinear();
43 mVolumeProperty->ShadeOff();
44 mVolumeProperty->SetAmbient ( 0.2 );
45 mVolumeProperty->SetDiffuse ( 0.9 );
46 mVolumeProperty->SetSpecular ( 0.3 );
47 mVolumeProperty->SetSpecularPower ( 15.0 );
48 mVolumeProperty->SetScalarOpacityUnitDistance(0.8919);
53 return mVolumeProperty;
65 disconnect(mImage.get(), SIGNAL(vtkImageDataChanged()),
this, SLOT(transferFunctionsChangedSlot()));
66 disconnect(mImage.get(), SIGNAL(transferFunctionsChanged()),
this, SLOT(transferFunctionsChangedSlot()));
73 connect(mImage.get(), SIGNAL(vtkImageDataChanged()),
this, SLOT(transferFunctionsChangedSlot()));
74 connect(mImage.get(), SIGNAL(transferFunctionsChanged()),
this, SLOT(transferFunctionsChangedSlot()));
77 this->transferFunctionsChangedSlot();
80 void VolumeProperty::transferFunctionsChangedSlot()
85 mVolumeProperty->SetColor(mImage->getTransferFunctions3D()->getColorTF());
86 mVolumeProperty->SetScalarOpacity(mImage->getTransferFunctions3D()->getOpacityTF());
87 mVolumeProperty->SetShade(mImage->getShadingOn());
89 mVolumeProperty->SetAmbient(mImage->getShadingAmbient());
90 mVolumeProperty->SetDiffuse(mImage->getShadingDiffuse());
91 mVolumeProperty->SetSpecular(mImage->getShadingSpecular());
92 mVolumeProperty->SetSpecularPower(mImage->getShadingSpecularPower());
94 mVolumeProperty->SetInterpolationType(mImage->getInterpolationType());