MCPcopy Create free account
hub / github.com/Kitware/ParaView / GetControlPointsProperty

Function GetControlPointsProperty

Remoting/Views/vtkSMTransferFunctionProxy.cxx:57–80  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

55
56//----------------------------------------------------------------------------
57inline 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

Callers 6

GetRangeMethod · 0.85
SaveColorMapMethod · 0.85

Calls 3

GetPropertyMethod · 0.45
GetNumberOfElementsMethod · 0.45
SetNumberOfElementsMethod · 0.45

Tested by

no test coverage detected