Isis 3 Programmer Reference
SampleManager.cpp
Go to the documentation of this file.
1 
24 #include "SampleManager.h"
25 
26 #include "IException.h"
27 #include "IString.h"
28 
29 using namespace std;
30 namespace Isis {
31 
44  SampleManager::SampleManager(const Isis::Cube &cube, const bool reverse) :
45  Isis::BufferManager(cube.sampleCount(), cube.lineCount(),
46  cube.bandCount(), 1, cube.lineCount(), 1,
47  cube.pixelType(), reverse) {
48  }
49 
60  bool SampleManager::SetSample(const int sample, const int band) {
61  if(sample < 1) {
62  string message = "Invalid value for argument [sample]";
64  }
65 
66  if(band < 1) {
67  string message = "Invalid value for argument [band]";
69  }
70 
71  int map = (band - 1) * MaxSamples() + sample - 1;
72  return setpos(map);
73  }
74 
75 } // end namespace isis
int MaxSamples() const
Returns the number of samples in the cube.
Namespace for the standard library.
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:162
Manages a Buffer over a cube.
Definition: BufferManager.h:68
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
bool setpos(BigInt map)
Sets the position of the shape in the cube.
Isis exception class.
Definition: IException.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
IO Handler for Isis Cubes.
Definition: Cube.h:170
bool SetSample(const int sample, const int band=1)
Positions the buffer at the requested line and returns a status indicator if the set was succesful or...