35 #include <vtkPiecewiseFunction.h>
36 #include <vtkColorTransferFunction.h>
37 #include <vtkVolumeProperty.h>
46 VolumeProperty::VolumeProperty() : QObject(),
52 mOpacityTransferFunction->AddPoint(0.0, 0.0);
53 mOpacityTransferFunction->AddPoint(maxVal, 1.0);
55 mColorTransferFunction->SetColorSpaceToRGB();
56 mColorTransferFunction->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
57 mColorTransferFunction->AddRGBPoint(maxVal, 1.0, 1.0, 1.0);
59 mVolumeProperty->SetColor(mColorTransferFunction);
60 mVolumeProperty->SetScalarOpacity(mOpacityTransferFunction);
61 mVolumeProperty->SetInterpolationTypeToLinear();
64 mVolumeProperty->ShadeOff();
65 mVolumeProperty->SetAmbient ( 0.2 );
66 mVolumeProperty->SetDiffuse ( 0.9 );
67 mVolumeProperty->SetSpecular ( 0.3 );
68 mVolumeProperty->SetSpecularPower ( 15.0 );
69 mVolumeProperty->SetScalarOpacityUnitDistance(0.8919);
74 return mVolumeProperty;
86 disconnect(mImage.get(), SIGNAL(vtkImageDataChanged()),
this, SLOT(transferFunctionsChangedSlot()));
87 disconnect(mImage.get(), SIGNAL(transferFunctionsChanged()),
this, SLOT(transferFunctionsChangedSlot()));
94 connect(mImage.get(), SIGNAL(vtkImageDataChanged()),
this, SLOT(transferFunctionsChangedSlot()));
95 connect(mImage.get(), SIGNAL(transferFunctionsChanged()),
this, SLOT(transferFunctionsChangedSlot()));
98 this->transferFunctionsChangedSlot();
101 void VolumeProperty::transferFunctionsChangedSlot()
106 mVolumeProperty->SetColor(mImage->getTransferFunctions3D()->getColorTF());
107 mVolumeProperty->SetScalarOpacity(mImage->getTransferFunctions3D()->getOpacityTF());
108 mVolumeProperty->SetShade(mImage->getShadingOn());
110 mVolumeProperty->SetAmbient(mImage->getShadingAmbient());
111 mVolumeProperty->SetDiffuse(mImage->getShadingDiffuse());
112 mVolumeProperty->SetSpecular(mImage->getShadingSpecular());
113 mVolumeProperty->SetSpecularPower(mImage->getShadingSpecularPower());
115 mVolumeProperty->SetInterpolationType(mImage->getInterpolationType());
vtkSmartPointer< class vtkVolumeProperty > vtkVolumePropertyPtr
boost::shared_ptr< class Image > ImagePtr
vtkSmartPointer< class vtkPiecewiseFunction > vtkPiecewiseFunctionPtr
vtkSmartPointer< class vtkColorTransferFunction > vtkColorTransferFunctionPtr
vtkVolumePropertyPtr getVolumeProperty()
void setImage(ImagePtr image)