1 // This is gel/octree/VoxmapPoints.h
2 #ifndef VoxmapPoints_h_
3 #define VoxmapPoints_h_
4 //:
5 // \file
6 // \author
7 //     Geoffrey Cross, Oxford RRG, 17 May 99
8 //
9 //-----------------------------------------------------------------------------
10 
11 #include <iostream>
12 #include <vector>
13 #include <vbl/vbl_sparse_array_3d.h>
14 #include <vnl/vnl_double_3.h>
15 #ifdef _MSC_VER
16 #  include <vcl_msvc_warnings.h>
17 #endif
18 
19 class VoxmapPoints
20 {
21  public:
22   // Constructors/Destructors--------------------------------------------------
23 
24   VoxmapPoints( int, vnl_double_3, double);
25 
26   // Data Access---------------------------------------------------------------
27 
GetVoxmapCentre()28   vnl_double_3 GetVoxmapCentre() const { return centre; }
GetVoxmapSize()29   double  GetVoxmapSize() const { return size; }
30 
SetVoxmapCentre(vnl_double_3 c)31   void SetVoxmapCentre( vnl_double_3 c) { centre= c; }
SetVoxmapSize(double s)32   void SetVoxmapSize( double s) { size= s; }
33 
34   // Data Control--------------------------------------------------------------
35 
36   vnl_double_3 GetCentre( int x, int y, int z, int d) const;
37   vnl_double_3 GetCorner( int x, int y, int z, int dx, int dy, int dz, int d) const;
38   int GetCornerIndex( int x, int y, int z, int dx, int dy, int dz, int d) const;
39 
40  protected:
41   // Data Members--------------------------------------------------------------
42 
43   int depth;
44   int nocorners;
45   int nocentres;
46 
47   vnl_double_3 centre;
48   double  size;
49 
50  private:
51 
52   mutable std::vector<vnl_double_3> cornerpoints;
53   mutable vbl_sparse_array_3d<int> corners;
54   mutable vbl_sparse_array_3d<vnl_double_3> centres;
55 };
56 
57 #endif // VoxmapPoints_h_
58