USGS

Isis 3.0 Object Programmers' Reference

Home

Process.h
Go to the documentation of this file.
00001 #ifndef Process_h
00002 #define Process_h
00003 
00025 #include "Preference.h"
00026 
00027 #include "Cube.h"
00028 #include "Progress.h"
00029 #include "CubeAttribute.h"
00030 #include "Statistics.h"
00031 
00032 template <typename T> class QSet;
00033 template <typename T> class QList;
00034 
00035 namespace Isis {
00036   const int SizeMatch = 1;
00037   const int SpatialMatch = 2;
00038   const int OneBand = 16;
00039   const int BandMatchOrOne = 32;
00040   const int ReadWrite = 64;
00041   const int AllMatchOrOne = 128;
00042 };
00043 
00044 namespace Isis {
00045   class UserInterface;
00046 
00147   class Process {
00148     protected:
00149       Isis::Progress *p_progress;  
00150 
00153       bool p_propagateLabels;
00157       bool p_propagateTables;
00161       bool p_propagatePolygons;
00165       bool p_propagateHistory;
00169       bool p_propagateOriginalLabel;
00170 
00176       std::vector< std::vector< Isis::Statistics * > > p_bandStats;
00177 
00183       std::vector< Isis::Statistics * > p_cubeStats;
00184 
00189       std::vector<Isis::Cube *> InputCubes;
00190 
00195       std::vector<Isis::Cube *> OutputCubes;
00196 
00203       QSet<Isis::Cube *> *m_ownedCubes;
00204 
00205     public:
00206       Process();
00207       virtual ~Process();
00208 
00217       void StartProcess(void funct()) {
00218         funct();
00219       };
00220       virtual void EndProcess();
00221       virtual void Finalize();
00222 
00223       Isis::Cube *SetInputCube(const QString &parameter,
00224                                const int requirements = 0);
00225       Isis::Cube *SetInputCube(const QString &fname,
00226                                const Isis::CubeAttributeInput &att,
00227                                int requirements = 0);
00228       void SetInputCube(Isis::Cube *inCube);
00229 
00230 
00231       Isis::Cube *SetOutputCube(const QString &parameter);
00232       Isis::Cube *SetOutputCube(const QString &parameter, const int nsamps,
00233                                 const int nlines, const int nbands = 1);
00234       Isis::Cube *SetOutputCube(const QString &fname,
00235                                 const Isis::CubeAttributeOutput &att,
00236                                 const int nsamps, const int nlines,
00237                                 const int nbands = 1);
00238 
00239       void AddInputCube(Cube *cube, bool owned = true);
00240       void AddOutputCube(Cube *cube, bool owned = true);
00241 
00242       void ClearCubes();
00243       void ClearInputCubes();
00244       void ClearOutputCubes();
00245  
00246       void PropagateLabels(const bool prop);
00247       void PropagateLabels(const QString &cube);
00248       void PropagateTables(const bool prop);
00249       void PropagateTables(const QString &fromName);
00250       void PropagatePolygons(const bool prop);
00251       void PropagateHistory(const bool prop);
00252       void PropagateOriginalLabel(const bool prop);
00253 
00259       Isis::Progress *Progress() {
00260         return p_progress;
00261       };
00262 
00263       QString MissionData(const QString &mission, const QString &file,
00264                               bool highestVersion = false);
00265 
00266       void WriteHistory(Cube &cube);
00267 
00268       void CalculateStatistics();
00269 
00279       inline std::vector<Isis::Statistics *> BandStatistics(
00280         const unsigned index) {
00281         return p_bandStats[index];
00282       }
00283 
00293       inline Isis::Statistics *CubeStatistics(
00294         const unsigned index) {
00295         return p_cubeStats[index];
00296       }
00297   };
00298 }
00299 
00300 #endif