------------------------------------------------------------------------------
| 977 | |
| 978 | //------------------------------------------------------------------------------ |
| 979 | void vtkPiecewiseFunction::BuildFunctionFromTable( |
| 980 | double xStart, double xEnd, int size, double* table, int stride) |
| 981 | { |
| 982 | double inc = 0.0; |
| 983 | double* tptr = table; |
| 984 | |
| 985 | this->RemoveAllPoints(); |
| 986 | |
| 987 | if (size > 1) |
| 988 | { |
| 989 | inc = (xEnd - xStart) / static_cast<double>(size - 1); |
| 990 | } |
| 991 | |
| 992 | int i; |
| 993 | for (i = 0; i < size; i++) |
| 994 | { |
| 995 | vtkPiecewiseFunctionNode* node = new vtkPiecewiseFunctionNode; |
| 996 | node->X = xStart + inc * i; |
| 997 | node->Y = *tptr; |
| 998 | node->Sharpness = 0.0; |
| 999 | node->Midpoint = 0.5; |
| 1000 | |
| 1001 | this->Internal->Nodes.push_back(node); |
| 1002 | tptr += stride; |
| 1003 | } |
| 1004 | |
| 1005 | this->SortAndUpdateRange(); |
| 1006 | } |
| 1007 | |
| 1008 | //------------------------------------------------------------------------------ |
| 1009 | void vtkPiecewiseFunction::FillFromDataPointer(int nb, double* ptr) |