Isis 3 Programmer Reference
TileManager.cpp
Go to the documentation of this file.
1 
23 #include "TileManager.h"
24 
25 #include "IException.h"
26 
27 using namespace std;
28 namespace Isis {
29 
41  TileManager::TileManager(const Isis::Cube &cube,
42  const int &bufNumSamples, const int &bufNumLines) :
43  Isis::BufferManager(cube.sampleCount(), cube.lineCount(), cube.bandCount(),
44  bufNumSamples, bufNumLines, 1,
45  cube.pixelType()) {
46 
47  p_numSampTiles = (cube.sampleCount() - 1) / bufNumSamples + 1;
48  p_numLineTiles = (cube.lineCount() - 1) / bufNumLines + 1;
49  }
50 
66  bool TileManager::SetTile(const int tile, const int band) {
67  if(tile < 1) {
68  string message = "Invalid value for argument [tile]";
70  }
71 
72  if(band < 1) {
73  string message = "Invalid value for argument [band]";
75  }
76 
77  int map = (band - 1) * (p_numSampTiles * p_numLineTiles) + tile - 1;
78 
79  return setpos(map);
80  }
81 } // end namespace isis
82 
int sampleCount() const
Definition: Cube.cpp:1452
Namespace for the standard library.
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:162
int p_numLineTiles
Stores the number of tiles in the line direction.
Definition: TileManager.h:59
Manages a Buffer over a cube.
Definition: BufferManager.h:68
bool SetTile(const int Tile, const int band=1)
Sets the current tile as requested.
Definition: TileManager.cpp:66
#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.
int lineCount() const
Definition: Cube.cpp:1379
Isis exception class.
Definition: IException.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
int p_numSampTiles
Stores the number of tiles in the sample direction.
Definition: TileManager.h:58
IO Handler for Isis Cubes.
Definition: Cube.h:170