| 111 | } |
| 112 | |
| 113 | void vtkArrayRenderer::PrepareColormap(vtkScalarsToColors* cmap) |
| 114 | { |
| 115 | if (!cmap && this->ColorTextureMap) |
| 116 | { |
| 117 | // We have a previous colormap. Use it. |
| 118 | return; |
| 119 | } |
| 120 | vtkNew<vtkColorTransferFunction> ctf; |
| 121 | if (!cmap) |
| 122 | { |
| 123 | // Create a cool-to-warm (blue to red) diverging colormap by default: |
| 124 | ctf->SetVectorModeToMagnitude(); |
| 125 | ctf->SetColorSpaceToDiverging(); |
| 126 | ctf->AddRGBPoint(0.0, 59. / 255., 76. / 255., 192. / 255.); |
| 127 | ctf->AddRGBPoint(0.5, 221. / 255., 221. / 255., 221. / 255.); |
| 128 | ctf->AddRGBPoint(1.0, 180. / 255., 4. / 255., 38. / 255.); |
| 129 | ctf->Build(); |
| 130 | cmap = ctf; |
| 131 | } |
| 132 | // Now, if there is no colormap texture, make one from the colormap |
| 133 | if (!this->LookupTable || this->LookupTable->GetMTime() < cmap->GetMTime()) |
| 134 | { |
| 135 | this->SetLookupTable(cmap); |
| 136 | } |
| 137 | if (!this->ColorTextureMap || this->ColorTextureMap->GetMTime() < this->LookupTable->GetMTime()) |
| 138 | { |
| 139 | this->CreateColormapTexture(); // populate this->ColorTexture from this->LookupTable |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | double* vtkArrayRenderer::GetBounds() |
| 144 | { |
no test coverage detected