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 =========================================================================*/
00049 #ifndef __vtkSimpleScalarTree_h
00050 #define __vtkSimpleScalarTree_h
00051 
00052 #include "vtkScalarTree.h"
00053 
00054 //BTX
00055 class vtkFloatArray;
00056 class vtkScalarNode;
00057 //ETX
00058 
00059 class VTK_FILTERING_EXPORT vtkSimpleScalarTree : public vtkScalarTree
00060 {
00061 public:
00064   static vtkSimpleScalarTree *New();
00065 
00067 
00068   vtkTypeRevisionMacro(vtkSimpleScalarTree,vtkScalarTree);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00073 
00077   vtkSetClampMacro(BranchingFactor,int,2,VTK_LARGE_INTEGER);
00078   vtkGetMacro(BranchingFactor,int);
00080 
00082 
00084   vtkGetMacro(Level,int);
00086 
00088 
00089   vtkSetClampMacro(MaxLevel,int,1,VTK_LARGE_INTEGER);
00090   vtkGetMacro(MaxLevel,int);
00092 
00096   virtual void BuildTree();
00097   
00099   virtual void Initialize();
00100 
00103   virtual void InitTraversal(float scalarValue);
00104 
00106 
00110   virtual vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds,
00111                                vtkDataArray *cellScalars);
00113 
00114 protected:
00115   vtkSimpleScalarTree();
00116   ~vtkSimpleScalarTree();
00117 
00118   vtkDataArray *Scalars;
00119   int MaxLevel;
00120   int Level;
00121   int BranchingFactor; //number of children per node
00122   vtkScalarNode *Tree; //pointerless scalar range tree
00123   int TreeSize; //allocated size of tree
00124 
00125 private:
00126   vtkIdType TreeIndex; //traversal location within tree
00127   vtkIdType LeafOffset; //offset to leaf nodes of tree
00128   int       ChildNumber; //current child in traversal
00129   vtkIdType CellId; //current cell id being examined
00130   int       FindStartLeaf(vtkIdType index, int level);
00131   int       FindNextLeaf(vtkIdType index,int level);
00132 
00133 private:
00134   vtkSimpleScalarTree(const vtkSimpleScalarTree&);  // Not implemented.
00135   void operator=(const vtkSimpleScalarTree&);  // Not implemented.
00136 };
00137 
00138 #endif
00139 
00140