Isis 3 Programmer Reference
ProcessByTile.cpp
Go to the documentation of this file.
1 
23 #include "ProcessByTile.h"
24 #include "TileManager.h"
25 
26 using namespace std;
27 namespace Isis {
28 
36  void ProcessByTile::SetTileSize(const int ns, const int nl) {
37  p_tileSamples = ns;
38  p_tileLines = nl;
39  p_tileSizeSet = true;
40  }
41 
56  void ProcessByTile::StartProcess(void
57  funct(Buffer &in, Buffer &out)) {
58 
59  //SetBrickSizesForProcessCube();
60  VerifyCubes(InputOutput);
61  SetBricks(InputOutput);
62  ProcessByBrick::StartProcess(funct);
63  }
64 
65 
79  void ProcessByTile::StartProcess(void funct(Buffer &in)) {
80 
81  VerifyCubes(InPlace);
82  SetBricks(InPlace);
83  //SetBrickSizesForProcessCubeInPlace();
84  ProcessByBrick::StartProcess(funct);
85  }
86 
87 
102  void ProcessByTile::StartProcess(void funct(std::vector<Buffer *> &in,
103  std::vector<Buffer *> &out)) {
104  //SetBrickSizesForProcessCubes();
105  VerifyCubes(InputOutputList);
106  SetBricks(InputOutputList);
107  ProcessByBrick::StartProcess(funct);
108  }
109 
110 
117  void ProcessByTile::EndProcess() {
118  p_tileSizeSet = false;
119  ProcessByBrick::EndProcess();
120  }
121 
122 
126  void ProcessByTile::Finalize() {
127  p_tileSizeSet = false;
128  ProcessByBrick::Finalize();
129  }
130 
131 
132  void ProcessByTile::SetBricks(IOCubes cn){
133 
134  switch(cn) {
135 
136  case InPlace:
137 
138  // Make sure the tile size has been set
139  if(!p_tileSizeSet) {
140  string m = "Use the SetTileSize method to set the tile size";
141  throw IException(IException::Programmer, m, _FILEINFO_);
142  }
143 
144  ProcessByBrick::SetBrickSize(p_tileSamples, p_tileLines, 1);
145 
146  break;
147 
148 
149  case InputOutput:
150  if(!p_tileSizeSet) {
151  string m = "Use the SetTileSize method to set the tile size";
152  throw IException(IException::Programmer, m, _FILEINFO_);
153  }
154 
155  ProcessByBrick::SetBrickSize(p_tileSamples, p_tileLines, 1);
156 
157  break;
158 
159  case InputOutputList:
160 
161  if(!p_tileSizeSet) {
162  string m = "Use the SetTileSize method to set the tile size";
163  throw IException(IException::Programmer, m, _FILEINFO_);
164  }
165 
166  ProcessByBrick::SetBrickSize(p_tileSamples, p_tileLines, 1);
167 
168  break;
169 
170 
171  }
172 
173 
174  }
175 
176 
177 
178 } // end namespace isis
179 
Buffer for reading and writing cube data.
Definition: Buffer.h:69
Namespace for the standard library.
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
Isis exception class.
Definition: IException.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31