------------------------------------------------------------------------------
| 339 | |
| 340 | //------------------------------------------------------------------------------ |
| 341 | int 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 | //------------------------------------------------------------------------------ |
| 374 | int vtkPiecewiseFunction::AddPoint(double x, double y) |
no test coverage detected