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

Filtering/vtkSimpleScalarTree.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSimpleScalarTree.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00038 #ifndef __vtkSimpleScalarTree_h
00039 #define __vtkSimpleScalarTree_h
00040 
00041 #include "vtkScalarTree.h"
00042 
00043 //BTX
00044 class vtkFloatArray;
00045 class vtkScalarNode;
00046 //ETX
00047 
00048 class VTK_FILTERING_EXPORT vtkSimpleScalarTree : public vtkScalarTree
00049 {
00050 public:
00053   static vtkSimpleScalarTree *New();
00054 
00056 
00057   vtkTypeRevisionMacro(vtkSimpleScalarTree,vtkScalarTree);
00058   void PrintSelf(ostream& os, vtkIndent indent);
00060 
00062 
00066   vtkSetClampMacro(BranchingFactor,int,2,VTK_LARGE_INTEGER);
00067   vtkGetMacro(BranchingFactor,int);
00069 
00071 
00073   vtkGetMacro(Level,int);
00075 
00077 
00078   vtkSetClampMacro(MaxLevel,int,1,VTK_LARGE_INTEGER);
00079   vtkGetMacro(MaxLevel,int);
00081 
00085   virtual void BuildTree();
00086   
00088   virtual void Initialize();
00089 
00092   virtual void InitTraversal(float scalarValue);
00093 
00095 
00099   virtual vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds,
00100                                vtkDataArray *cellScalars);
00102 
00103 protected:
00104   vtkSimpleScalarTree();
00105   ~vtkSimpleScalarTree();
00106 
00107   vtkDataArray *Scalars;
00108   int MaxLevel;
00109   int Level;
00110   int BranchingFactor; //number of children per node
00111   vtkScalarNode *Tree; //pointerless scalar range tree
00112   int TreeSize; //allocated size of tree
00113 
00114 private:
00115   vtkIdType TreeIndex; //traversal location within tree
00116   vtkIdType LeafOffset; //offset to leaf nodes of tree
00117   int       ChildNumber; //current child in traversal
00118   vtkIdType CellId; //current cell id being examined
00119   int       FindStartLeaf(vtkIdType index, int level);
00120   int       FindNextLeaf(vtkIdType index,int level);
00121 
00122 private:
00123   vtkSimpleScalarTree(const vtkSimpleScalarTree&);  // Not implemented.
00124   void operator=(const vtkSimpleScalarTree&);  // Not implemented.
00125 };
00126 
00127 #endif
00128 
00129