Isis 3 Programmer Reference
BufferManager.h
Go to the documentation of this file.
1 #ifndef BufferManager_h
2 #define BufferManager_h
3 
26 #include "Constants.h"
27 #include "PixelType.h"
28 #include "Buffer.h"
29 
30 namespace Isis {
68  class BufferManager : public Isis::Buffer {
69 
70  public:
71  // Constructors and Destructors
72  BufferManager();
73  BufferManager(int maxsamps, int maxlines, int maxbands,
74  int bufsamps, int buflines, int bufbands,
75  Isis::PixelType type, bool reverse = false);
76  BufferManager(const BufferManager &other);
77 
80 
81  // Traversal Methods
82 
89  bool operator++(int) {
90  return (next());
91  }
92 
93 
103  setpos(p_currentMap + i);
104  return *this;
105  }
106 
112  bool begin() {
113  return (setpos(0));
114  }
115 
122  bool next() {
123  return (setpos(p_currentMap + 1));
124  }
125 
131  bool end() const {
132  return (p_currentMap >= p_nmaps);
133  }
134 
135  bool setpos(BigInt map);
136 
137  void swap(BufferManager &other);
138 
140 
141  protected:
142 
143  // Methods visable to deriving classes
144 
150  int MaxSamples() const {
151  return (p_maxSamps);
152  }
153 
159  int MaxLines() const {
160  return (p_maxLines);
161  }
162 
168  int MaxBands() const {
169  return (p_maxBands);
170  }
171 
178  BigInt MaxMaps() const {
179  return (p_nmaps);
180  }
181 
182  void SetIncrements(const int sinc, const int linc, const int binc);
183  void SetOffsets(const int soff, const int loff, const int boff);
184 
185  private:
189 
190  int p_sinc;
191  int p_linc;
192  int p_binc;
193 
194  int p_soff;
195  int p_loff;
196  int p_boff;
197 
201 
204 
210  bool p_reverse;
211  };
212 };
213 
214 #endif
215 
Buffer for reading and writing cube data.
Definition: Buffer.h:69
BigInt MaxMaps() const
Returns the maximum number of positions the shape buffer needs to cover the entire image (see setpos ...
long long int BigInt
Big int.
Definition: Constants.h:65
void SetOffsets(const int soff, const int loff, const int boff)
Sets the offset of the buffer.
bool p_reverse
If true the axies are processed in Band, Line, Sample order (e.g., BIL).
int p_loff
Line offset.
int p_sinc
Sample increment.
BufferManager & operator+=(int i)
Moves the shape buffer by a certain amount.
int p_maxLines
Maximum lines to map.
int MaxSamples() const
Returns the number of samples in the cube.
int MaxBands() const
Returns the number of bands in the cube.
int p_boff
Band offset.
~BufferManager()
Destroys the BufferManager object.
Definition: BufferManager.h:79
int MaxLines() const
Returns the number of lines in the cube.
int p_binc
Band increment.
int p_maxSamps
Maximum samples to map.
int p_soff
Sample offset.
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:43
void swap(BufferManager &other)
Swaps the values of this BufferManager with that of another.
bool begin()
Moves the shape buffer to the first position.
int p_currentSample
Current sample.
Manages a Buffer over a cube.
Definition: BufferManager.h:68
bool next()
Moves the shape buffer to the next position.
bool end() const
Returns true if the shape buffer has accessed the end of the cube.
BufferManager & operator=(const BufferManager &rhs)
Creates a new BufferManager with the same values as another.
bool setpos(BigInt map)
Sets the position of the shape in the cube.
int p_linc
Line increment.
BigInt p_currentMap
Current buffer map position.
bool operator++(int)
Moves the shape buffer to the next position.
Definition: BufferManager.h:89
int p_currentBand
Current band.
void SetIncrements(const int sinc, const int linc, const int binc)
Sets how the shape is incremented through the cube.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
int p_maxBands
Maximum bands to map.
int p_currentLine
Current line.
BigInt p_nmaps
Total number of objects to map.