|
Isis Developer Reference
|
Go to the documentation of this file. 1 #ifndef CubeAttribute_h
2 #define CubeAttribute_h
13 #include <QStringList>
57 QString msg =
"Invalid label attachment type [" + QString::number(labelType) +
"]";
71 QString temp = labelType.toUpper();
76 QString msg =
"Invalid label attachment type string [" + labelType +
"]";
123 m_attributeTypeTesters = testers;
140 m_attributeTypeTesters = testers;
161 if (!m_attributes.isEmpty())
162 result =
"+" + m_attributes.join(
"+");
179 QString upcaseAtt = attribute.toUpper();
181 if (attribute.contains(
"+")) {
183 "Individual attributes (for example, BSQ) cannot contain the '+' "
184 "character because that is used to denote the separation of individual "
191 bool (ChildClass::*tester)(QString)
const;
192 foreach (tester, m_attributeTypeTesters) {
193 if ( (
static_cast<const ChildClass *
>(
this)->*tester)(upcaseAtt) ) {
196 QObject::tr(
"Attribute [%1] is ambiguous").arg(attribute),
206 QObject::tr(
"Attribute [%1] is not recognized").arg(attribute),
210 m_attributes.append(attribute);
265 m_attributes.clear();
266 foreach (QString attribute, attributes)
283 foreach (QString attribute, m_attributes) {
284 QString upcaseAtt = attribute.toUpper();
285 if ( (
static_cast<const ChildClass *
>(
this)->*tester)(upcaseAtt) ) {
286 relevantAttributes.append(upcaseAtt);
290 return relevantAttributes;
305 void setAttribute(QString newValue,
bool (ChildClass::*tester)(QString)
const) {
306 QMutableListIterator<QString> it(m_attributes);
309 while (it.hasNext()) {
310 QString &attribute = it.next();
312 QString upcaseAtt = attribute.toUpper();
313 if ( (
static_cast<const ChildClass *
>(
this)->*tester)(upcaseAtt) ) {
314 if (found || newValue ==
"") {
320 attribute = newValue;
328 if (!found && newValue !=
"") {
329 m_attributes.append(newValue);
348 QList< bool (ChildClass::*)(QString)
const > m_attributeTypeTesters;
406 std::vector<QString>
bands()
const;
427 bool isBandRange(QString attribute)
const;
433 std::vector<QString> m_bands;
550 bool isByteOrder(QString attribute)
const;
551 bool isFileFormat(QString attribute)
const;
552 bool isLabelAttachment(QString attribute)
const;
553 bool isPixelType(QString attribute)
const;
554 bool isRange(QString attribute)
const;
Format
These are the possible storage formats of ISIS cubes.
Definition: Cube.h:178
void setMaximum(double max)
Set the output cube attribute maximum.
Definition: CubeAttribute.cpp:342
@ DetachedLabel
The input label is in a separate data file from the image.
Definition: CubeAttribute.h:33
void setPixelType(PixelType type)
Set the pixel type to that given by the parameter.
Definition: CubeAttribute.cpp:390
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
CubeAttribute(QList< bool(ChildClass::*)(QString) const > testers, const FileName &fileName)
Constructs a CubeAttribute using the argument.
Definition: CubeAttribute.h:138
QString LabelAttachmentName(LabelAttachment labelType)
Return the string representation of the contents of a variable of type LabelAttachment.
Definition: CubeAttribute.h:52
QStringList attributeList(bool(ChildClass::*tester)(QString) const) const
Get a list of attributes that the tester returns true on.
Definition: CubeAttribute.h:280
bool IsLsb()
Return true if this host is an LSB first machine and false if it is not.
Definition: Endian.h:67
File name manipulation and expansion.
Definition: FileName.h:100
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
void setAttribute(QString newValue, bool(ChildClass::*tester)(QString) const)
Set the attribute(s) for which tester returns true to newValue.
Definition: CubeAttribute.h:305
virtual ~CubeAttribute()
Destroys the object.
Definition: CubeAttribute.h:146
void addAttributes(const QString &attributesString)
Append the attributes in the string to these cube attributes.
Definition: CubeAttribute.h:248
@ UnsignedWord
Definition: PixelType.h:31
Manipulate and parse attributes of output cube filenames.
Definition: CubeAttribute.h:473
@ SignedWord
Definition: PixelType.h:32
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
void setFileFormat(Cube::Format fmt)
Set the format to the fmt parameter.
Definition: CubeAttribute.cpp:288
void addAttributes(const char *attributesString)
Append the attributes in the string to these cube attributes.
Definition: CubeAttribute.h:235
ByteOrder
Tests the current architecture for byte order.
Definition: Endian.h:42
LabelAttachment LabelAttachmentEnumeration(const QString &labelType)
Return the appropriate LabelType depending on which of the valid values the argument spells.
Definition: CubeAttribute.h:70
void addAttributes(const FileName &fileNameWithAtts)
Append the attributes found in the filename to these cube attributes.
Definition: CubeAttribute.h:222
void setAttributes(const FileName &fileName)
Replaces the current attributes with the attributes in the given file name.
Definition: CubeAttribute.h:262
@ AttachedLabel
The input label is embedded in the image file.
Definition: CubeAttribute.h:32
void setByteOrder(ByteOrder order)
Set the order according to the parameter order.
Definition: CubeAttribute.cpp:474
LabelAttachment
Input cube label type tracker.
Definition: CubeAttribute.h:31
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
@ Tile
Cubes are stored in tile format, that is the order of the pixels in the file (on disk) is BSQ within ...
Definition: Cube.h:232
PixelType pixelType() const
Return the pixel type as an Isis::PixelType.
Definition: CubeAttribute.cpp:360
bool propagateMinimumMaximum() const
Return true if the min/max are to be propagated from an input cube.
Definition: CubeAttribute.cpp:177
@ Msb
Definition: Endian.h:45
Isis exception class.
Definition: IException.h:91
QString byteOrderString() const
Return the byte order as a string.
Definition: CubeAttribute.cpp:469
QString fileFormatString() const
Return the file format as a string.
Definition: CubeAttribute.cpp:283
CubeAttributeOutput()
Constructs an empty CubeAttributeOutput.
Definition: CubeAttribute.cpp:152
~CubeAttributeOutput()
Destroys the object.
Definition: CubeAttribute.cpp:161
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
@ Bsq
Cubes are stored in band-sequential format, that is the order of the pixels in the file (on disk) is:
Definition: Cube.h:199
LabelAttachment labelAttachment() const
Definition: CubeAttribute.cpp:400
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:27
@ UnsignedInteger
Definition: PixelType.h:33
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Namespace for the standard library.
ByteOrder byteOrder() const
Return the byte order as an Isis::ByteOrder.
Definition: CubeAttribute.cpp:455
void setLabelAttachment(LabelAttachment attachment)
Set the label attachment type to the parameter value.
Definition: CubeAttribute.cpp:395
QString PixelTypeName(Isis::PixelType pixelType)
Returns string name of PixelType enumeration entered as input parameter.
Definition: PixelType.h:66
@ SignedInteger
Definition: PixelType.h:34
double maximum() const
Return the output cube attribute maximum.
Definition: CubeAttribute.cpp:309
double minimum() const
Return the output cube attribute minimum.
Definition: CubeAttribute.cpp:294
QString ByteOrderName(Isis::ByteOrder byteOrder)
Definition: Endian.h:48
CubeAttribute(QList< bool(ChildClass::*)(QString) const > testers)
Constructs an empty CubeAttribute.
Definition: CubeAttribute.h:122
@ Lsb
Definition: Endian.h:44
Cube::Format fileFormat() const
Return the file format an Cube::Format.
Definition: CubeAttribute.cpp:267
Parent class for CubeAttributeInput and CubeAttributeOutput.
Definition: CubeAttribute.h:118
@ UnsignedByte
Definition: PixelType.h:29
bool propagatePixelType() const
Return true if the pixel type is to be propagated from an input cube.
Definition: CubeAttribute.cpp:165
@ ExternalLabel
The label is pointing to an external DN file - the label is also external to the data.
Definition: CubeAttribute.h:40
void addAttribute(QString attribute)
Add a single attribute to these attributes.
Definition: CubeAttribute.h:178
void setMinimum(double min)
Set the output cube attribute minimum.
Definition: CubeAttribute.cpp:324
QString attributes() const
Returns a QString of the attributes in a filename, attributes are expected to be of type CubeAttribut...
Definition: FileName.cpp:121
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
QString toString() const
Return a string-representation of this cube attributes.
Definition: CubeAttribute.h:158
@ Real
Definition: PixelType.h:35
@ None
Definition: PixelType.h:28