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

vtkBSPCuts.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkBSPCuts.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 =========================================================================*/
00015 /*----------------------------------------------------------------------------
00016  Copyright (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00019 
00035 #ifndef __vtkBSPCuts_h
00036 #define __vtkBSPCuts_h
00037 
00038 #include "vtkObject.h"
00039 
00040 class vtkKdNode;
00041 
00042 class VTK_GRAPHICS_EXPORT vtkBSPCuts : public vtkObject
00043 {
00044 public:
00045   vtkTypeRevisionMacro(vtkBSPCuts, vtkObject);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00048   static vtkBSPCuts *New();
00049 
00062   void CreateCuts(double *bounds,
00063                   int ncuts, int *dim, double *coord, 
00064                   int *lower, int *upper,
00065                   double *lowerDataCoord, double *upperDataCoord,
00066                   int *npoints);
00067 
00070   void CreateCuts(vtkKdNode *kd);
00071 
00075   vtkKdNode *GetKdNodeTree(){return this->Top;}
00076 
00080   vtkGetMacro(NumberOfCuts, int);
00081 
00084   int GetArrays(int len, int *dim, double *coord, int *lower, int *upper,
00085                 double *lowerDataCoord, double *upperDataCoord, int *npoints);
00086 
00087   void PrintTree();
00088   void PrintArrays();
00089 
00090 protected:
00091 
00092   vtkBSPCuts();
00093   ~vtkBSPCuts();
00094 
00095 private:
00096 
00097   static void DeleteAllDescendants(vtkKdNode *kd);
00098 
00099   static int CountNodes(vtkKdNode *kd);
00100   static void SetMinMaxId(vtkKdNode *kd);
00101   static void _PrintTree(vtkKdNode *kd, int depth);
00102 
00103   void BuildTree(vtkKdNode *kd, int idx);
00104   int WriteArray(vtkKdNode *kd, int loc);
00105 
00106   void ResetArrays();
00107   void AllocateArrays(int size);
00108 
00109   vtkKdNode *Top;
00110 
00111   // required cut information
00112 
00113   int NumberOfCuts;// number of cuts, also length of each array
00114   int *Dim;        // dimension (x/y/z - 0/1/2) where cut occurs
00115   double *Coord;   // location of cut along axis
00116   int *Lower;               // location in arrays of left (lower) child info
00117   int *Upper;               // location in arrays of right (lower) child info
00118 
00119   // optional cut information 
00120 
00121   double *LowerDataCoord;   // coordinate of uppermost data in lower half
00122   double *UpperDataCoord;   // coordinate of lowermost data in upper half
00123   int *Npoints;             // number of data values in partition
00124 
00125   double Bounds[6];    
00126 
00127   vtkBSPCuts(const vtkBSPCuts&); // Not implemented
00128   void operator=(const vtkBSPCuts&); // Not implemented
00129 };
00130 
00131 #endif

Generated on Mon Jan 21 23:07:24 2008 for VTK by  doxygen 1.4.3-20050530