Isis 3.0 Programmer Reference
Back | Home
Blobber.h
Go to the documentation of this file.
1 #ifndef Blobber_h
2 #define Blobber_h
3 
26 #include <QString>
27 
28 #include <tnt/tnt_array2d.h>
29 
30 namespace Isis {
31  class Cube;
32  class Table;
33 
111  class Blobber {
112  public:
113  Blobber();
114  Blobber(const QString &blobname, const QString &fieldname,
115  const QString &name = "Blob");
116  Blobber(Cube &cube, const QString &blobname,
117  const QString &fieldname, const QString &name = "Blob");
119  virtual ~Blobber() { }
120 
121  Blobber deepcopy() const;
122 
132  void setName(const QString &name) {
133  _name = name;
134  }
135 
145  void setBlobName(const QString &bname) {
146  _blobname = bname;
147  }
148 
157  void setFieldName(const QString &fname) {
158  _fieldname = fname;
159  }
160 
165  inline int size() const {
166  return (Lines() * Samples());
167  }
168 
173  inline int Lines() const {
174  return (_buf.dim1());
175  }
180  inline int Samples() const {
181  return (_buf.dim2());
182  }
183 
188  QString getName() const {
189  return (_name);
190  }
191 
196  QString getBlobName() const {
197  return (_blobname);
198  }
199 
204  QString getFieldName() const {
205  return (_fieldname);
206  }
207 
219  inline double *operator[](int i) {
220  return (_buf[i]);
221  }
234  inline double const *operator[](int i) const {
235  return (_buf[i]);
236  }
237 
238 // Load options for reading the BLOB from ISIS files
239  void load(const QString &filename);
240  void load(Cube &cube);
241 
242 
243  protected:
244  typedef TNT::Array2D<double> BlobBuf;
245 
251  inline const BlobBuf &ref() const {
252  return (_buf);
253  }
254 
255  private:
256  QString _blobname;
257  QString _fieldname;
258  QString _name;
260 
261 // Low/level I/O and conversion methods
262  void loadDouble(Table &tbl);
263  void loadInteger(Table &tbl);
264  double int2ToDouble(int value) const;
265  };
266 };
267 
268 #endif
269 
TNT::Array2D< double > BlobBuf
Internal buffer uses TNT.
Definition: Blobber.h:244
QString _fieldname
Name of field in BLOB to read.
Definition: Blobber.h:257
double int2ToDouble(int value) const
Converts integer data to double precision.
Definition: Blobber.cpp:232
Base class for accessing ISIS blobs.
Definition: Blobber.h:111
double const * operator[](int i) const
Returns the ith row/line in the BLOB that can be further referenced into samples. ...
Definition: Blobber.h:234
void load(const QString &filename)
Loads the contents of a BLOB from a cube file.
Definition: Blobber.cpp:136
int Lines() const
Number of rows or lines in the BLOB.
Definition: Blobber.h:173
void loadInteger(Table &tbl)
Provides direct reading in of the field data from the BLOB.
Definition: Blobber.cpp:210
int Samples() const
Number of columns or samples in the BLOB.
Definition: Blobber.h:180
void loadDouble(Table &tbl)
Provides direct reading in of the field data from the BLOB.
Definition: Blobber.cpp:184
QString getFieldName() const
Retreive the name of the field in the Tabel object BLOB.
Definition: Blobber.h:204
QString _blobname
Name of BLOB to read.
Definition: Blobber.h:256
QString _name
Name of this data set.
Definition: Blobber.h:258
QString getBlobName() const
Retrieves the name of the Table object.
Definition: Blobber.h:196
BlobBuf _buf
Buffer holding data.
Definition: Blobber.h:259
Blobber deepcopy() const
Create a unique copy of this blob.
Definition: Blobber.cpp:123
void setName(const QString &name)
Specifies the name of this class instantiation.
Definition: Blobber.h:132
QString getName() const
Returns the name of the BLOB given to refer to this instantiation.
Definition: Blobber.h:188
virtual ~Blobber()
Destructor of this object.
Definition: Blobber.h:119
Class for storing Table blobs information.
Definition: Table.h:74
double * operator[](int i)
Returns the ith row/line in the BLOB that can be further referenced into samples. ...
Definition: Blobber.h:219
Blobber()
Default basic constructor that is mostly not useful.
Definition: Blobber.cpp:43
void setFieldName(const QString &fname)
Sets field name in the ISIS BLOB object that contains data.
Definition: Blobber.h:157
int size() const
Returns the total number of elements (rows * columns) in blob.
Definition: Blobber.h:165
void setBlobName(const QString &bname)
Sets the name of the ISIS BLOB object that contains the data.
Definition: Blobber.h:145
const BlobBuf & ref() const
Returns a const reference to the internal buffer for ease of use to derived objects.
Definition: Blobber.h:251
IO Handler for Isis Cubes.
Definition: Cube.h:158

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:14:48