------------------------------------------------------------------------------ Get the currently set RGB transfer function. Create one if none set.
| 361 | //------------------------------------------------------------------------------ |
| 362 | // Get the currently set RGB transfer function. Create one if none set. |
| 363 | vtkColorTransferFunction* vtkVolumeProperty::GetRGBTransferFunction(int index) |
| 364 | { |
| 365 | if (this->RGBTransferFunction[index] == nullptr) |
| 366 | { |
| 367 | this->RGBTransferFunction[index] = vtkColorTransferFunction::New(); |
| 368 | this->RGBTransferFunction[index]->Register(this); |
| 369 | this->RGBTransferFunction[index]->Delete(); |
| 370 | this->RGBTransferFunction[index]->AddRGBPoint(0, 0.0, 0.0, 0.0); |
| 371 | this->RGBTransferFunction[index]->AddRGBPoint(1024, 1.0, 1.0, 1.0); |
| 372 | if (this->ColorChannels[index] != 3) |
| 373 | { |
| 374 | this->ColorChannels[index] = 3; |
| 375 | } |
| 376 | this->Modified(); |
| 377 | } |
| 378 | |
| 379 | return this->RGBTransferFunction[index]; |
| 380 | } |
| 381 | |
| 382 | //------------------------------------------------------------------------------ |
| 383 | // Set the scalar opacity of a volume to a transfer function |