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

vtkSimpleScalarTree.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSimpleScalarTree.h,v $
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 =========================================================================*/
00045 #ifndef __vtkSimpleScalarTree_h
00046 #define __vtkSimpleScalarTree_h
00047 
00048 #include "vtkScalarTree.h"
00049 
00050 //BTX
00051 class vtkScalarNode;
00052 //ETX
00053 
00054 class VTK_FILTERING_EXPORT vtkSimpleScalarTree : public vtkScalarTree
00055 {
00056 public:
00059   static vtkSimpleScalarTree *New();
00060 
00062 
00063   vtkTypeRevisionMacro(vtkSimpleScalarTree,vtkScalarTree);
00064   void PrintSelf(ostream& os, vtkIndent indent);
00066 
00068 
00072   vtkSetClampMacro(BranchingFactor,int,2,VTK_LARGE_INTEGER);
00073   vtkGetMacro(BranchingFactor,int);
00075 
00077 
00079   vtkGetMacro(Level,int);
00081 
00083 
00084   vtkSetClampMacro(MaxLevel,int,1,VTK_LARGE_INTEGER);
00085   vtkGetMacro(MaxLevel,int);
00087 
00091   virtual void BuildTree();
00092   
00094   virtual void Initialize();
00095 
00098   virtual void InitTraversal(double scalarValue);
00099 
00101 
00105   virtual vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds,
00106                                vtkDataArray *cellScalars);
00108 
00109 protected:
00110   vtkSimpleScalarTree();
00111   ~vtkSimpleScalarTree();
00112 
00113   vtkDataArray *Scalars;
00114   int MaxLevel;
00115   int Level;
00116   int BranchingFactor; //number of children per node
00117   vtkScalarNode *Tree; //pointerless scalar range tree
00118   int TreeSize; //allocated size of tree
00119 
00120 private:
00121   vtkIdType TreeIndex; //traversal location within tree
00122   vtkIdType LeafOffset; //offset to leaf nodes of tree
00123   int       ChildNumber; //current child in traversal
00124   vtkIdType CellId; //current cell id being examined
00125   int       FindStartLeaf(vtkIdType index, int level);
00126   int       FindNextLeaf(vtkIdType index,int level);
00127 
00128 private:
00129   vtkSimpleScalarTree(const vtkSimpleScalarTree&);  // Not implemented.
00130   void operator=(const vtkSimpleScalarTree&);  // Not implemented.
00131 };
00132 
00133 #endif
00134 
00135