------------------------------------------------------------------------------ Returns the RGB color evaluated at the specified location
| 725 | //------------------------------------------------------------------------------ |
| 726 | // Returns the RGB color evaluated at the specified location |
| 727 | void vtkColorTransferFunction::GetColor(double x, double rgb[3]) |
| 728 | { |
| 729 | if (this->IndexedLookup) |
| 730 | { |
| 731 | int numNodes = this->GetSize(); |
| 732 | vtkVariant xv(x); |
| 733 | vtkIdType idx = this->GetAnnotatedValueIndexInternal(xv); |
| 734 | if (idx < 0 || numNodes == 0) |
| 735 | { |
| 736 | this->GetNanColor(rgb); |
| 737 | } |
| 738 | else |
| 739 | { |
| 740 | double nodeVal[6]; |
| 741 | this->GetNodeValue(idx % numNodes, nodeVal); |
| 742 | for (int i = 0; i < 3; ++i) |
| 743 | rgb[i] = nodeVal[i + 1]; |
| 744 | } |
| 745 | return; |
| 746 | } |
| 747 | this->GetTable(x, x, 1, rgb); |
| 748 | } |
| 749 | |
| 750 | //------------------------------------------------------------------------------ |
| 751 | // Returns the red color evaluated at the specified location |
no test coverage detected