37 QString msg =
"Invalid label attachment type [" + QString::number(labelType) +
"]";
51 QString temp = labelType.toUpper();
57 QString msg =
"Invalid label attachment type string [" + labelType +
"]";
102 m_attributeTypeTesters = testers;
119 m_attributeTypeTesters = testers;
140 if (!m_attributes.isEmpty())
141 result =
"+" + m_attributes.join(
"+");
158 QString upcaseAtt = attribute.toUpper();
160 if (attribute.contains(
"+")) {
162 "Individual attributes (for example, BSQ) cannot contain the '+' "
163 "character because that is used to denote the separation of individual "
170 bool (ChildClass::*tester)(QString)
const;
171 foreach (tester, m_attributeTypeTesters) {
172 if ( (
static_cast<const ChildClass *
>(
this)->*tester)(upcaseAtt) ) {
175 QObject::tr(
"Attribute [%1] is ambiguous").arg(attribute),
185 QObject::tr(
"Attribute [%1] is not recognized").arg(attribute),
189 m_attributes.append(attribute);
244 m_attributes.clear();
245 foreach (QString attribute, attributes)
262 foreach (QString attribute, m_attributes) {
263 QString upcaseAtt = attribute.toUpper();
264 if ( (
static_cast<const ChildClass *
>(
this)->*tester)(upcaseAtt) ) {
265 relevantAttributes.append(upcaseAtt);
269 return relevantAttributes;
284 void setAttribute(QString newValue,
bool (ChildClass::*tester)(QString)
const) {
285 QMutableListIterator<QString> it(m_attributes);
288 while (it.hasNext()) {
289 QString &attribute = it.next();
291 QString upcaseAtt = attribute.toUpper();
292 if ( (
static_cast<const ChildClass *
>(
this)->*tester)(upcaseAtt) ) {
293 if (found || newValue ==
"") {
299 attribute = newValue;
307 if (!found && newValue !=
"") {
308 m_attributes.append(newValue);
284 void setAttribute(QString newValue,
bool (ChildClass::*tester)(QString)
const) {
…}
327 QList< bool (ChildClass::*)(QString)
const > m_attributeTypeTesters;
385 std::vector<QString>
bands()
const;
406 bool isBandRange(QString attribute)
const;
412 std::vector<QString> m_bands;
532 bool isByteOrder(QString attribute)
const;
533 bool isFileFormat(QString attribute)
const;
534 bool isLabelAttachment(QString attribute)
const;
535 bool isPixelType(QString attribute)
const;
536 bool isRange(QString attribute)
const;
#define _FILEINFO_
Macro for the filename and line number.
Definition IException.h:24
CubeAttribute(QList< bool(ChildClass::*)(QString) const > testers, const FileName &fileName)
Constructs a CubeAttribute using the argument.
Definition CubeAttribute.h:117
void addAttributes(const FileName &fileNameWithAtts)
Append the attributes found in the filename to these cube attributes.
Definition CubeAttribute.h:201
void addAttribute(QString attribute)
Add a single attribute to these attributes.
Definition CubeAttribute.h:157
QString toString() const
Return a string-representation of this cube attributes.
Definition CubeAttribute.h:137
virtual ~CubeAttribute()
Destroys the object.
Definition CubeAttribute.h:125
void addAttributes(const QString &attributesString)
Append the attributes in the string to these cube attributes.
Definition CubeAttribute.h:227
QStringList attributeList(bool(ChildClass::*tester)(QString) const) const
Get a list of attributes that the tester returns true on.
Definition CubeAttribute.h:259
void setAttributes(const FileName &fileName)
Replaces the current attributes with the attributes in the given file name.
Definition CubeAttribute.h:241
void setAttribute(QString newValue, bool(ChildClass::*tester)(QString) const)
Set the attribute(s) for which tester returns true to newValue.
Definition CubeAttribute.h:284
CubeAttribute(QList< bool(ChildClass::*)(QString) const > testers)
Constructs an empty CubeAttribute.
Definition CubeAttribute.h:101
void addAttributes(const char *attributesString)
Append the attributes in the string to these cube attributes.
Definition CubeAttribute.h:214
double minimum() const
Return the output cube attribute minimum.
Definition CubeAttribute.cpp:320
ByteOrder byteOrder() const
Return the byte order as an Isis::ByteOrder.
Definition CubeAttribute.cpp:492
double maximum() const
Return the output cube attribute maximum.
Definition CubeAttribute.cpp:335
void setByteOrder(ByteOrder order)
Set the order according to the parameter order.
Definition CubeAttribute.cpp:511
bool propagateFileFormat() const
Return true if the file format is to be propagated from an input cube.
Definition CubeAttribute.cpp:182
bool propagateMinimumMaximum() const
Return true if the min/max are to be propagated from an input cube.
Definition CubeAttribute.cpp:177
bool propagatePixelType() const
Return true if the pixel type is to be propagated from an input cube.
Definition CubeAttribute.cpp:165
Cube::Format fileFormat() const
Return the file format an Cube::Format.
Definition CubeAttribute.cpp:279
QString fileFormatString() const
Return the file format as a string.
Definition CubeAttribute.cpp:298
void setLabelAttachment(Cube::LabelAttachment attachment)
Set the label attachment type to the parameter value.
Definition CubeAttribute.cpp:421
QString byteOrderString() const
Return the byte order as a string.
Definition CubeAttribute.cpp:506
CubeAttributeOutput()
Constructs an empty CubeAttributeOutput.
Definition CubeAttribute.cpp:152
PixelType pixelType() const
Return the pixel type as an Isis::PixelType.
Definition CubeAttribute.cpp:386
void setMinimum(double min)
Set the output cube attribute minimum.
Definition CubeAttribute.cpp:350
void setMaximum(double max)
Set the output cube attribute maximum.
Definition CubeAttribute.cpp:368
Cube::LabelAttachment labelAttachment() const
Definition CubeAttribute.cpp:426
~CubeAttributeOutput()
Destroys the object.
Definition CubeAttribute.cpp:161
void setPixelType(PixelType type)
Set the pixel type to that given by the parameter.
Definition CubeAttribute.cpp:416
void setFileFormat(Cube::Format fmt)
Set the format to the fmt parameter.
Definition CubeAttribute.cpp:303
LabelAttachment
Input cube label type tracker.
Definition Cube.h:245
@ ExternalLabel
The label is pointing to an external DN file - the label is also external to the data.
Definition Cube.h:254
@ GdalLabel
Definition Cube.h:255
@ AttachedLabel
The input label is embedded in the image file.
Definition Cube.h:246
@ DetachedLabel
The input label is in a separate data file from the image.
Definition Cube.h:247
Format
These are the possible storage formats of ISIS cubes.
Definition Cube.h:179
File name manipulation and expansion.
Definition FileName.h:100
QString attributes() const
Returns a QString of the attributes in a filename, attributes are expected to be of type CubeAttribut...
Definition FileName.cpp:121
Isis exception class.
Definition IException.h:91
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition IException.h:118
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
ByteOrder
Tests the current architecture for byte order.
Definition Endian.h:42
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString LabelAttachmentName(Cube::LabelAttachment labelType)
Return the string representation of the contents of a variable of type LabelAttachment.
Definition CubeAttribute.h:31
PixelType
Enumerations for Isis Pixel Types.
Definition PixelType.h:29
Cube::LabelAttachment LabelAttachmentEnumeration(const QString &labelType)
Return the appropriate LabelType depending on which of the valid values the argument spells.
Definition CubeAttribute.h:50