00001 /*========================================================================= 00002 00003 Module: $RCSfile: vtkKWParameterValueFunctionInterface.h,v $ 00004 00005 Copyright (c) Kitware, Inc. 00006 All rights reserved. 00007 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00053 #ifndef __vtkKWParameterValueFunctionInterface_h 00054 #define __vtkKWParameterValueFunctionInterface_h 00055 00056 #include "vtkKWWidgetWithLabel.h" 00057 00058 class KWWidgets_EXPORT vtkKWParameterValueFunctionInterface : public vtkKWWidgetWithLabel 00059 { 00060 // @cond section_public 00061 public: 00062 vtkTypeRevisionMacro(vtkKWParameterValueFunctionInterface,vtkKWWidgetWithLabel); 00063 void PrintSelf(ostream& os, vtkIndent indent); 00064 00068 virtual int HasFunction() = 0; 00069 00071 virtual int GetFunctionSize() = 0; 00072 00074 00079 enum 00080 { 00081 MaxFunctionPointDimensionality = 20 00082 }; 00083 //ETX 00085 00086 // ******************************************************************* 00087 // The following methods are fast low-level manipulators: do *not* check if 00088 // points can added/removed or are locked, it is up to the higer-level 00089 // methods to do it (see vtkKWParameterValueFunctionEditor for example, 00090 // AddFunctionPointAtParameter() will use the low-level 00091 // FunctionPointCanBeRemoved() and RemoveFunctionPoint() below). 00092 // Points are usually accessed by 'id', which is pretty much its rank 00093 // in the function (i.e., the 0-th point is the first point and has id = 0, 00094 // the next point has id = 1, etc., up to GetFunctionSize() - 1) 00095 // ******************************************************************* 00096 00099 virtual unsigned long GetFunctionMTime() = 0; 00100 00103 virtual int GetFunctionPointParameter(int id, double *parameter) = 0; 00104 00107 virtual int GetFunctionPointDimensionality() = 0; 00108 00109 // @endcond 00110 // @cond section_protected 00111 protected: 00120 virtual int InterpolateFunctionPointValues(double parameter,double *values)=0; 00124 virtual int GetFunctionPointValues(int id, double *values) = 0; 00125 00129 virtual int SetFunctionPointValues(int id, const double *values) = 0; 00130 00131 // Add a 'n-tuple' value at a given 'parameter' over the parameter range 00132 // (where 'n' is the dimensionality of the point), and return the 00133 // corresponding point 'id' (the rank of the newly added point in the 00134 // function). 00135 // Return 1 on success, 0 otherwise 00136 virtual int AddFunctionPoint(double parameter,const double *values,int *id)=0; 00147 virtual int SetFunctionPoint(int id, double parameter, const double *values)=0; 00148 00153 virtual int RemoveFunctionPoint(int id) = 0; 00154 00155 // ******************************************************************* 00156 // The following low-level methods can be reimplemented, but a default 00157 // implementation is provided either by this class or by 00158 // vtkKWParameterValueFunctionEditor and is working just fine. 00159 // If you have to reimplement them (for efficiency reasons for example), 00160 // make sure to call the corresponding superclass method too 00161 // (or have a good reason not to :). 00162 // Those methods are used by high-level methods, and should 00163 // not be called from the other low-level methods described above 00164 // (see vtkKWParameterValueFunctionEditor for example, the high-level 00165 // AddFunctionPointAtParameter() method will use the low-level 00166 // below FunctionPointCanBeRemoved() and above RemoveFunctionPoint()). 00167 // ******************************************************************* 00168 00169 // @endcond 00170 // @cond section_public 00171 public: 00177 virtual int GetFunctionPointId(double parameter, int *id); 00178 00182 virtual int FunctionPointCanBeAdded() = 0; 00183 00186 virtual int FunctionPointCanBeRemoved(int id) = 0; 00187 00190 virtual int FunctionPointParameterIsLocked(int id) = 0; 00191 00199 virtual int FunctionPointValueIsLocked(int id) = 0; 00200 00206 virtual int FunctionPointCanBeMovedToParameter(int id, double parameter) = 0; 00207 00208 // @endcond 00209 // @cond section_protected 00210 protected: 00211 vtkKWParameterValueFunctionInterface() {}; 00212 ~vtkKWParameterValueFunctionInterface() {}; 00213 00215 virtual void CreateWidget(); 00216 00226 virtual int FunctionLineIsSampledBetweenPoints(int id1, int id2); 00227 00228 // @endcond 00229 // @cond section_private 00230 private: 00231 vtkKWParameterValueFunctionInterface(const vtkKWParameterValueFunctionInterface&); // Not implemented 00232 void operator=(const vtkKWParameterValueFunctionInterface&); // Not implemented 00233 }; 00234 00235 #endif 00236 // @endcond
1.6.1