VTK
dox/Filters/HyperTree/vtkHyperOctreeSampleFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkHyperOctreeSampleFunction.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00031 #ifndef __vtkHyperOctreeSampleFunction_h
00032 #define __vtkHyperOctreeSampleFunction_h
00033 
00034 #include "vtkFiltersHyperTreeModule.h" // For export macro
00035 #include "vtkHyperOctreeAlgorithm.h"
00036 
00037 class vtkImplicitFunction;
00038 
00039 class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeSampleFunction : public vtkHyperOctreeAlgorithm
00040 {
00041 public:
00042   vtkTypeMacro(vtkHyperOctreeSampleFunction,vtkHyperOctreeAlgorithm);
00043   void PrintSelf(ostream& os, vtkIndent indent);
00044 
00045   static vtkHyperOctreeSampleFunction *New();
00046 
00049   int GetLevels();
00050 
00055   void SetLevels(int levels);
00056 
00059   int GetMinLevels();
00060 
00064   void SetMinLevels(int minLevels);
00065 
00068   double GetThreshold();
00069 
00073   void SetThreshold(double threshold);
00074 
00078   int GetDimension();
00079 
00080    // Set the dimension of the tree with `dim'. See GetDimension() for details.
00081   // \pre valid_dim: dim>=1 && dim<=3
00082   // \post dimension_is_set: GetDimension()==dim
00083   void SetDimension(int dim);
00084 
00086 
00087   vtkSetVector3Macro(Size,double);
00089 
00091 
00092   vtkGetVector3Macro(Size,double);
00094 
00096 
00097   vtkSetVector3Macro(Origin,double);
00098   // Return the origin (position of corner (0,0,0) ) of the root.
00099   vtkGetVector3Macro(Origin,double);
00101 
00103   double GetWidth();
00104 
00107   void SetWidth(double width);
00108 
00111   double GetHeight();
00112 
00116   void SetHeight(double height);
00117 
00120   double GetDepth();
00121 
00125   void SetDepth(double depth);
00126 
00128 
00129   virtual void SetImplicitFunction(vtkImplicitFunction*);
00130   vtkGetObjectMacro(ImplicitFunction,vtkImplicitFunction);
00132 
00134 
00135   vtkSetMacro(OutputScalarType,int);
00136   vtkGetMacro(OutputScalarType,int);
00137   void SetOutputScalarTypeToDouble()
00138     {this->SetOutputScalarType(VTK_DOUBLE);}
00139   void SetOutputScalarTypeToFloat()
00140     {this->SetOutputScalarType(VTK_FLOAT);}
00141   void SetOutputScalarTypeToLong()
00142     {this->SetOutputScalarType(VTK_LONG);}
00143   void SetOutputScalarTypeToUnsignedLong()
00144     {this->SetOutputScalarType(VTK_UNSIGNED_LONG);};
00145   void SetOutputScalarTypeToInt()
00146     {this->SetOutputScalarType(VTK_INT);}
00147   void SetOutputScalarTypeToUnsignedInt()
00148     {this->SetOutputScalarType(VTK_UNSIGNED_INT);}
00149   void SetOutputScalarTypeToShort()
00150     {this->SetOutputScalarType(VTK_SHORT);}
00151   void SetOutputScalarTypeToUnsignedShort()
00152     {this->SetOutputScalarType(VTK_UNSIGNED_SHORT);}
00153   void SetOutputScalarTypeToChar()
00154     {this->SetOutputScalarType(VTK_CHAR);}
00155   void SetOutputScalarTypeToUnsignedChar()
00156     {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}
00158 
00160   unsigned long GetMTime();
00161 
00162 protected:
00164 
00167   vtkHyperOctreeSampleFunction();
00168   ~vtkHyperOctreeSampleFunction();
00170 
00171 
00172   int RequestInformation (vtkInformation * vtkNotUsed(request),
00173                           vtkInformationVector ** vtkNotUsed( inputVector ),
00174                           vtkInformationVector *outputVector);
00175 
00176   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00177 
00178   void Subdivide(vtkHyperOctreeCursor *cursor,
00179                  int level,
00180                  vtkHyperOctree *output);
00181 
00182   int Dimension;
00183   double Size[3]; // size on each axis
00184   double Origin[3]; // position of corner (0,0,0) of the root.
00185   int Levels;
00186   int MinLevels;
00187 
00188   int OutputScalarType;
00189   vtkImplicitFunction *ImplicitFunction;
00190   double Threshold;
00191 
00192 private:
00193   vtkHyperOctreeSampleFunction(const vtkHyperOctreeSampleFunction&);  // Not implemented.
00194   void operator=(const vtkHyperOctreeSampleFunction&);  // Not implemented.
00195 };
00196 
00197 #endif