MCPcopy Create free account
hub / github.com/Kitware/VTK / ShallowCopy

Method ShallowCopy

Common/DataModel/vtkPiecewiseFunction.cxx:134–156  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

132
133//------------------------------------------------------------------------------
134void vtkPiecewiseFunction::ShallowCopy(vtkDataObject* o)
135{
136 vtkPiecewiseFunction* f = vtkPiecewiseFunction::SafeDownCast(o);
137
138 if (f != nullptr)
139 {
140 this->Clamping = f->Clamping;
141 int i;
142 this->RemoveAllPoints();
143 for (i = 0; i < f->GetSize(); i++)
144 {
145 double val[4];
146 int isInRange = f->GetNodeValue(i, val);
147 assert(isInRange == 1);
148 (void)isInRange;
149 this->AddPoint(val[0], val[1], val[2], val[3]);
150 }
151 this->Modified();
152 }
153
154 // Do the superclass
155 this->vtkDataObject::ShallowCopy(o);
156}
157
158//------------------------------------------------------------------------------
159void vtkPiecewiseFunction::Initialize()

Callers

nothing calls this directly

Calls 6

RemoveAllPointsMethod · 0.95
AddPointMethod · 0.95
assertFunction · 0.50
GetSizeMethod · 0.45
GetNodeValueMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected