Isis 3 Programmer Reference
ProcessBySample.cpp
Go to the documentation of this file.
1 
23 #include "ProcessBySample.h"
24 
25 #include "Buffer.h"
26 #include "Cube.h"
27 #include "IException.h"
28 #include "Process.h"
29 #include "ProcessByBrick.h"
30 
31 using namespace std;
32 namespace Isis {
53  Isis::Cube *ProcessBySample::SetInputCube(const QString &parameter,
54  int requirements) {
55  int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
56  allRequirements |= requirements;
57  return Process::SetInputCube(parameter, allRequirements);
58  }
59 
60 
73  Isis::Cube *ProcessBySample::SetInputCube(const QString &file,
75  int requirements) {
76  int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
77  allRequirements |= requirements;
78  return Process::SetInputCube(file, att, allRequirements);
79  }
80 
81 
93  void ProcessBySample::StartProcess(void funct(Isis::Buffer &inout)) {
94  VerifyCubes(InPlace);
95  SetBricks(InPlace);
96  ProcessByBrick::StartProcess(funct);
97  }
98 
99 
110  void ProcessBySample::StartProcess(void funct(Isis::Buffer &in,
111  Isis::Buffer &out)) {
112  VerifyCubes(InputOutput);
113  SetBricks(InputOutput);
114  ProcessByBrick::StartProcess(funct);
115  }
116 
117 
127  void ProcessBySample::StartProcess(void funct(std::vector<Isis::Buffer *> &in,
128  std::vector<Isis::Buffer *> &out)) {
129  VerifyCubes(InputOutputList) ;
130  SetBricks(InputOutputList);
131  ProcessByBrick::StartProcess(funct);
132  }
133 
134 
135  void ProcessBySample::SetBricks(IOCubes cn){
136  switch(cn){
137  case InPlace:
138  if (InputCubes.size() == 1) {
139  SetBrickSize(1, InputCubes[0]->lineCount(), 1);
140  }
141  else {
142  SetBrickSize(1, OutputCubes[0]->lineCount(), 1);
143  }
144  break;
145 
146  case InputOutput:
147  SetInputBrickSize(1, InputCubes[0]->lineCount(), 1);
148  SetOutputBrickSize(1, OutputCubes[0]->lineCount(), 1);
149  break;
150 
151  case InputOutputList:
152  for(unsigned int i = 0; i < InputCubes.size(); i++) {
153  SetInputBrickSize(1, InputCubes[i]->lineCount(), 1, i + 1);
154  }
155  for(unsigned int i = 0; i < OutputCubes.size(); i++) {
156  SetOutputBrickSize(1, OutputCubes[i]->lineCount(), 1, i + 1);
157  }
158  break;
159  }
160  }
161 }
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