48 CubeTileHandler::CubeTileHandler(QFile * dataFile,
49 const QList<int> *virtualBandList,
const Pvl &labels,
bool alreadyOnDisk)
50 :
CubeIoHandler(dataFile, virtualBandList, labels, alreadyOnDisk) {
85 PvlContainer::Replace);
87 PvlContainer::Replace);
89 PvlContainer::Replace);
99 if(dataFile->seek(startByte)) {
100 QByteArray binaryData = dataFile->read(chunkToFill.
getByteCount());
109 IString msg =
"Reading from the file [" + dataFile->fileName() +
"] " 110 "failed with reading [" +
112 "] bytes at position [" + QString::number(startByte) +
"]";
120 bool success =
false;
123 if(dataFile->seek(startByte)) {
132 IString msg =
"Writing to the file [" + dataFile->fileName() +
"] " 133 "failed with writing [" +
135 "] bytes at position [" + QString::number(startByte) +
"]";
154 if(dimensionSize <= maxSize) {
155 ideal = dimensionSize;
158 int greatestDividend = maxSize;
160 while(greatestDividend > ideal) {
161 if(dimensionSize % greatestDividend == 0) {
162 ideal = greatestDividend;
long long int BigInt
Big int.
void clearCache(bool blockForWriteCache=true) const
Free all cube chunks (cached cube data) from memory and write them to disk.
int getChunkIndex(const RawCubeChunk &) const
Given a chunk, what's its index in the file.
void setRawData(QByteArray rawData)
Sets the chunk's raw data.
void setChunkSizes(int numSamples, int numLines, int numBands)
This should be called once from the child constructor.
int getSampleCountInChunk() const
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
int SizeOf(Isis::PixelType pixelType)
Returns the number of bytes of the specified PixelType.
Namespace for the standard library.
int findGoodSize(int maxSize, int dimensionSize) const
This is a helper method that tries to compute a good tile size for one of the cube's dimensions (samp...
BigInt getDataStartByte() const
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
A type of error that occurred when performing an actual I/O operation.
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
Handles converting buffers to and from disk.
~CubeTileHandler()
Writes all data from memory to disk.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
#define _FILEINFO_
Macro for the filename and line number.
A single keyword-value pair.
A section of raw data on the disk.
virtual void writeRaw(const RawCubeChunk &chunkToWrite)
This needs to write the chunkToWrite directly to disk with no modifications to the data itself...
BigInt getBytesPerChunk() const
Container for cube-like labels.
BigInt getTileStartByte(const RawCubeChunk &chunk) const
This is a helper method that goes from chunk to file position.
void updateLabels(Pvl &label)
Update the cube labels so that this cube indicates what tile size it used.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
virtual void readRaw(RawCubeChunk &chunkToFill)
This needs to populate the chunkToFill with unswapped raw bytes from the disk.
Contains Pvl Groups and Pvl Objects.
QByteArray & getRawData() const
int getLineCountInChunk() const
PixelType pixelType() const