----------------------------------------------------------------------------
| 55 | |
| 56 | //---------------------------------------------------------------------------- |
| 57 | inline vtkSMProperty* GetControlPointsProperty(vtkSMProxy* self) |
| 58 | { |
| 59 | vtkSMProperty* controlPointsProperty = self->GetProperty("RGBPoints"); |
| 60 | if (!controlPointsProperty) |
| 61 | { |
| 62 | controlPointsProperty = self->GetProperty("Points"); |
| 63 | } |
| 64 | |
| 65 | if (!controlPointsProperty) |
| 66 | { |
| 67 | vtkGenericWarningMacro("'RGBPoints' or 'Points' property is required."); |
| 68 | return nullptr; |
| 69 | } |
| 70 | |
| 71 | vtkSMPropertyHelper cntrlPoints(controlPointsProperty); |
| 72 | unsigned int num_elements = cntrlPoints.GetNumberOfElements(); |
| 73 | if (num_elements % 4 != 0) |
| 74 | { |
| 75 | vtkGenericWarningMacro("Property must have 4-tuples. Resizing."); |
| 76 | cntrlPoints.SetNumberOfElements((num_elements / 4) * 4); |
| 77 | } |
| 78 | |
| 79 | return controlPointsProperty; |
| 80 | } |
| 81 | |
| 82 | //---------------------------------------------------------------------------- |
| 83 | // Normalize cntrlPoints so that the range goes from (0, 1). The cntrlPoints |
no test coverage detected