VTK
dox/Filtering/vtkOctreePointLocatorNode.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkOctreePointLocatorNode.h
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 
00036 #ifndef __vtkOctreePointLocatorNode_h
00037 #define __vtkOctreePointLocatorNode_h
00038 
00039 #include "vtkObject.h"
00040 
00041 class vtkCell;
00042 class vtkPlanesIntersection;
00043 
00044 class VTK_FILTERING_EXPORT vtkOctreePointLocatorNode : public vtkObject
00045 {
00046 public:
00047   vtkTypeMacro(vtkOctreePointLocatorNode, vtkObject);
00048   void PrintSelf(ostream& os, vtkIndent indent);
00049 
00050   static vtkOctreePointLocatorNode *New();
00051 
00053 
00054   void SetNumberOfPoints(int numberOfPoints)
00055   {
00056     this->NumberOfPoints = numberOfPoints;
00057   }
00058   vtkGetMacro(NumberOfPoints, int);
00060 
00062 
00064   void SetBounds(double xMin, double xMax, double yMin,
00065                  double yMax, double zMin, double zMax);
00066   void SetBounds(double b[6])
00067     {
00068     this->SetBounds(b[0], b[1], b[2], b[3], b[4], b[5]);
00069     }
00070   void GetBounds(double *b) const;
00072 
00074 
00077   void SetDataBounds(double xMin, double xMax, double yMin,
00078                      double yMax, double zMin, double zMax);
00079   void GetDataBounds(double *b) const;
00081 
00083 
00085   vtkGetMacro(MinBounds, double*);
00086   vtkGetMacro(MaxBounds, double*);
00088 //ETX
00089 
00091 
00092   void SetMinBounds(double minBounds[3])
00093   {
00094     this->MinBounds[0] = minBounds[0];
00095     this->MinBounds[1] = minBounds[1];
00096     this->MinBounds[2] = minBounds[2];
00097   }
00099 
00101 
00102   void SetMaxBounds(double maxBounds[3])
00103   {
00104     this->MaxBounds[0] = maxBounds[0];
00105     this->MaxBounds[1] = maxBounds[1];
00106     this->MaxBounds[2] = maxBounds[2];
00107   }
00109 
00111 
00113   vtkGetMacro(MinDataBounds, double*);
00114   vtkGetMacro(MaxDataBounds, double*);
00116 //ETX
00117 
00119 
00121   void SetMinDataBounds(double minDataBounds[3])
00122   {
00123     this->MinDataBounds[0] = minDataBounds[0];
00124     this->MinDataBounds[1] = minDataBounds[1];
00125     this->MinDataBounds[2] = minDataBounds[2];
00126   }
00128 
00130 
00132   void SetMaxDataBounds(double maxDataBounds[3])
00133   {
00134     this->MaxDataBounds[0] = maxDataBounds[0];
00135     this->MaxDataBounds[1] = maxDataBounds[1];
00136     this->MaxDataBounds[2] = maxDataBounds[2];
00137   }
00139 
00141 
00143   vtkGetMacro(ID, int);
00145 
00147 
00151   vtkGetMacro(MinID, int);
00153 
00155   void CreateChildNodes();
00156 
00158   void DeleteChildNodes();
00159 
00161   vtkOctreePointLocatorNode* GetChild(int i);
00162 
00169   int IntersectsRegion(vtkPlanesIntersection *pi, int useDataBounds);
00170 
00174   int ContainsPoint(double x, double y, double z, int useDataBounds);
00175 
00177 
00180   double GetDistance2ToBoundary(double x, double y, double z, 
00181                                 vtkOctreePointLocatorNode* top, int useDataBounds);
00183 
00185 
00189   double GetDistance2ToBoundary(double x, double y, double z, 
00190                                 double *boundaryPt, vtkOctreePointLocatorNode* top,
00191                                 int useDataBounds);
00193 
00195 
00199   double GetDistance2ToInnerBoundary(double x, double y, double z,
00200                                      vtkOctreePointLocatorNode* top);
00202 
00208   int GetSubOctantIndex(double* point, int CheckContainment);
00209 
00211 
00214   void ComputeOctreeNodeInformation(vtkOctreePointLocatorNode* Parent, 
00215                                     int& NextLeafId, int & NextMinId,
00216                                     float* coordinates);
00218 
00219 protected:
00220   vtkOctreePointLocatorNode();
00221   ~vtkOctreePointLocatorNode();
00222 
00223 private:
00224 
00225   double _GetDistance2ToBoundary(
00226     double x, double y, double z, double *boundaryPt,
00227     int innerBoundaryOnly, vtkOctreePointLocatorNode* top,
00228     int useDataBounds);
00229 
00231   double MinBounds[3];
00232 
00234   double MaxBounds[3];
00235 
00238   double MinDataBounds[3];   
00239 
00242   double MaxDataBounds[3];
00243 
00247   int NumberOfPoints;
00248   
00250   vtkOctreePointLocatorNode** Children;
00251 
00253   int ID;
00254 
00258   int MinID;
00259 
00260   vtkOctreePointLocatorNode(const vtkOctreePointLocatorNode&); // Not implemented
00261   void operator=(const vtkOctreePointLocatorNode&); // Not implemented
00262 };
00263 
00264 #endif