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

Method SetNodeValue

Common/DataModel/vtkPiecewiseFunction.cxx:341–371  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

339
340//------------------------------------------------------------------------------
341int vtkPiecewiseFunction::SetNodeValue(int index, double val[4])
342{
343 int size = static_cast<int>(this->Internal->Nodes.size());
344
345 if (index < 0 || index >= size)
346 {
347 vtkErrorMacro("Index out of range!");
348 return -1;
349 }
350
351 double oldX = this->Internal->Nodes[index]->X;
352 this->Internal->Nodes[index]->X = val[0];
353 this->Internal->Nodes[index]->Y = val[1];
354 this->Internal->Nodes[index]->Midpoint = val[2];
355 this->Internal->Nodes[index]->Sharpness = val[3];
356
357 if (oldX != val[0])
358 {
359 // The point has been moved, the order of points or the range might have
360 // been modified.
361 this->SortAndUpdateRange();
362 // No need to call Modified() here because SortAndUpdateRange() has done it
363 // already.
364 }
365 else
366 {
367 this->Modified();
368 }
369
370 return 1;
371}
372
373//------------------------------------------------------------------------------
374int vtkPiecewiseFunction::AddPoint(double x, double y)

Callers 7

SetControlPointMethod · 0.45
EditPointMethod · 0.45
MouseMoveEventMethod · 0.45
SetControlPointMethod · 0.45
EditPointMethod · 0.45
SetControlPointMethod · 0.45
EditPointMethod · 0.45

Calls 3

SortAndUpdateRangeMethod · 0.95
sizeMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected