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

Method UpdateRange

Common/DataModel/vtkPiecewiseFunction.cxx:458–483  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

456
457//------------------------------------------------------------------------------
458bool vtkPiecewiseFunction::UpdateRange()
459{
460 double oldRange[2];
461 oldRange[0] = this->Range[0];
462 oldRange[1] = this->Range[1];
463
464 int size = static_cast<int>(this->Internal->Nodes.size());
465 if (size)
466 {
467 this->Range[0] = this->Internal->Nodes[0]->X;
468 this->Range[1] = this->Internal->Nodes[size - 1]->X;
469 }
470 else
471 {
472 this->Range[0] = 0;
473 this->Range[1] = 0;
474 }
475 // If the rage is the same, then no need to call Modified()
476 if (oldRange[0] == this->Range[0] && oldRange[1] == this->Range[1])
477 {
478 return false;
479 }
480
481 this->Modified();
482 return true;
483}
484
485//------------------------------------------------------------------------------
486int vtkPiecewiseFunction::RemovePoint(double x)

Callers 2

SortAndUpdateRangeMethod · 0.95
RemovePointByIndexMethod · 0.95

Calls 2

sizeMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected