Isis 3 Programmer Reference
ProcessByLine.cpp
Go to the documentation of this file.
1 
24 #include "ProcessByLine.h"
25 
26 #include "Buffer.h"
27 #include "Cube.h"
28 #include "IException.h"
29 #include "Process.h"
30 #include "ProcessByBrick.h"
31 
32 
33 using namespace std;
34 namespace Isis {
57  Isis::Cube *ProcessByLine::SetInputCube(const QString &parameter,
58  const int requirements) {
59  int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
60  allRequirements |= requirements;
61  return Process::SetInputCube(parameter, allRequirements);
62  }
63 
64 
80  Isis::Cube *ProcessByLine::SetInputCube(const QString &file,
82  const int requirements) {
83  int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
84  allRequirements |= requirements;
85  return Process::SetInputCube(file, att, allRequirements);
86  }
87 
88 
97  void ProcessByLine::SetInputCube(Isis::Cube *inCube) {
98  Process::SetInputCube(inCube);
99  }
100 
101 
102  void ProcessByLine::SetBricks(IOCubes cn) {
103 
104  switch(cn){
105 
106  case InPlace:
107 
108  if (InputCubes.size() == 1) {
109  SetBrickSize(InputCubes[0]->sampleCount(), 1, 1);
110  }
111 
112  else {
113  SetBrickSize(OutputCubes[0]->sampleCount(), 1, 1);
114  }
115 
116  break;
117 
118  case InputOutput:
119 
120  SetInputBrickSize(InputCubes[0]->sampleCount(), 1, 1);
121  SetOutputBrickSize(OutputCubes[0]->sampleCount(), 1, 1);
122 
123  break;
124 
125  case InputOutputList:
126 
127  for (unsigned int i = 0; i < InputCubes.size(); i++) {
128  SetInputBrickSize(InputCubes[i]->sampleCount(), 1, 1, i + 1);
129  }
130  for (unsigned int i = 0; i < OutputCubes.size(); i++) {
131  SetOutputBrickSize(OutputCubes[i]->sampleCount(), 1, 1, i + 1);
132  }
133 
134  break;
135  }
136  }
137 
138 
139 
159  void ProcessByLine::StartProcess(void funct(Isis::Buffer &inout)) {
160  VerifyCubes(InPlace);
161  SetBricks(InPlace);
162  ProcessByBrick::StartProcess(funct);
163  }
164 
165 
185  void ProcessByLine::StartProcess(std::function<void(Isis::Buffer &in)> funct ) {
186  VerifyCubes(InPlace);
187  SetBricks(InPlace);
188  ProcessByBrick::StartProcess(funct);
189  }
190 
191 
204  void ProcessByLine::StartProcess(void funct(Isis::Buffer &in, Isis::Buffer &out)) {
205  VerifyCubes(InputOutput);
206  SetBricks(InputOutput);
207  ProcessByBrick::StartProcess(funct);
208  }
209 
210 
222  void ProcessByLine::StartProcess(void funct(std::vector<Isis::Buffer *> &in,
223  std::vector<Isis::Buffer *> &out)) {
224  VerifyCubes(InputOutputList);
225  SetBricks(InputOutputList);
226  ProcessByBrick::StartProcess(funct);
227  }
228 }
Buffer for reading and writing cube data.
Definition: Buffer.h:69
Manipulate and parse attributes of input cube filenames.
Namespace for the standard library.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
IO Handler for Isis Cubes.
Definition: Cube.h:170