Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound 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 =========================================================================*/
00048 #ifndef __vtkSimpleScalarTree_h
00049 #define __vtkSimpleScalarTree_h
00050 
00051 #include "vtkScalarTree.h"
00052 
00053 //BTX
00054 class vtkFloatArray;
00055 class vtkScalarNode;
00056 //ETX
00057 
00058 class VTK_FILTERING_EXPORT vtkSimpleScalarTree : public vtkScalarTree
00059 {
00060 public:
00063   static vtkSimpleScalarTree *New();
00064 
00066 
00067   vtkTypeRevisionMacro(vtkSimpleScalarTree,vtkScalarTree);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00072 
00076   vtkSetClampMacro(BranchingFactor,int,2,VTK_LARGE_INTEGER);
00077   vtkGetMacro(BranchingFactor,int);
00079 
00081 
00083   vtkGetMacro(Level,int);
00085 
00087 
00088   vtkSetClampMacro(MaxLevel,int,1,VTK_LARGE_INTEGER);
00089   vtkGetMacro(MaxLevel,int);
00091 
00095   virtual void BuildTree();
00096   
00098   virtual void Initialize();
00099 
00102   virtual void InitTraversal(float scalarValue);
00103 
00105 
00109   virtual vtkCell *GetNextCell(vtkIdType &cellId, vtkIdList* &ptIds,
00110                                vtkDataArray *cellScalars);
00112 
00113 protected:
00114   vtkSimpleScalarTree();
00115   ~vtkSimpleScalarTree();
00116 
00117   vtkDataArray *Scalars;
00118   int MaxLevel;
00119   int Level;
00120   int BranchingFactor; //number of children per node
00121   vtkScalarNode *Tree; //pointerless scalar range tree
00122   int TreeSize; //allocated size of tree
00123 
00124 private:
00125   vtkIdType TreeIndex; //traversal location within tree
00126   vtkIdType LeafOffset; //offset to leaf nodes of tree
00127   int       ChildNumber; //current child in traversal
00128   vtkIdType CellId; //current cell id being examined
00129   int       FindStartLeaf(vtkIdType index, int level);
00130   int       FindNextLeaf(vtkIdType index,int level);
00131 
00132 private:
00133   vtkSimpleScalarTree(const vtkSimpleScalarTree&);  // Not implemented.
00134   void operator=(const vtkSimpleScalarTree&);  // Not implemented.
00135 };
00136 
00137 #endif
00138 
00139