Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

GUI/Widgets/vtkKWParameterValueFunctionInterface.h

Go to the documentation of this file.
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 public:
00061   vtkTypeRevisionMacro(vtkKWParameterValueFunctionInterface,vtkKWWidgetWithLabel);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063 
00065   virtual void Create(vtkKWApplication *app);
00066 
00070   virtual int HasFunction() = 0;
00071 
00073   virtual int GetFunctionSize() = 0;
00074 
00076 
00081   enum 
00082   {
00083     MaxFunctionPointDimensionality = 20
00084   };
00085   //ETX
00087 
00088   // *******************************************************************
00089   // The following methods are fast low-level manipulators: do *not* check if
00090   // points can added/removed or are locked, it is up to the higer-level
00091   // methods to do it (see vtkKWParameterValueFunctionEditor for example,
00092   // AddFunctionPointAtParameter() will use the low-level
00093   // FunctionPointCanBeRemoved() and RemoveFunctionPoint() below).
00094   // Points are usually accessed by 'id', which is pretty much its rank
00095   // in the function (i.e., the 0-th point is the first point and has id = 0,
00096   // the next point has id = 1, etc., up to GetFunctionSize() - 1)
00097   // *******************************************************************
00098 
00101   virtual unsigned long GetFunctionMTime() = 0;
00102 
00105   virtual int GetFunctionPointParameter(int id, double *parameter) = 0;
00106 
00109   virtual int GetFunctionPointDimensionality() = 0;
00110 
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 public:
00175   virtual int GetFunctionPointId(double parameter, int *id);
00176 
00180   virtual int FunctionPointCanBeAdded() = 0;
00181 
00184   virtual int FunctionPointCanBeRemoved(int id) = 0;
00185 
00188   virtual int FunctionPointParameterIsLocked(int id) = 0;
00189 
00197   virtual int FunctionPointValueIsLocked(int id) = 0;
00198 
00204   virtual int FunctionPointCanBeMovedToParameter(int id, double parameter) = 0;
00205 
00206 protected:
00216   virtual int FunctionLineIsSampledBetweenPoints(int id1, int id2);
00217 
00218   vtkKWParameterValueFunctionInterface() {};
00219   ~vtkKWParameterValueFunctionInterface() {};
00220 
00221 private:
00222   vtkKWParameterValueFunctionInterface(const vtkKWParameterValueFunctionInterface&); // Not implemented
00223   void operator=(const vtkKWParameterValueFunctionInterface&); // Not implemented
00224 };
00225 
00226 #endif

Generated on Tue May 30 12:31:43 2006 for ParaView by doxygen 1.3.5