1 #ifndef CubeAttribute_h 2 #define CubeAttribute_h 29 #include <QStringList> 73 QString msg =
"Invalid label attachment type [" + QString::number(labelType) +
"]";
87 QString temp = labelType.toUpper();
92 QString msg =
"Invalid label attachment type string [" + labelType +
"]";
195 QString upcaseAtt = attribute.toUpper();
197 if (attribute.contains(
"+")) {
199 "Individual attributes (for example, BSQ) cannot contain the '+' " 200 "character because that is used to denote the separation of individual " 207 bool (ChildClass::*tester)(QString)
const;
209 if ( (static_cast<const ChildClass *>(
this)->*tester)(upcaseAtt) ) {
212 QObject::tr(
"Attribute [%1] is ambiguous").arg(attribute),
222 QObject::tr(
"Attribute [%1] is not recognized").arg(attribute),
282 foreach (QString attribute, attributes)
300 QString upcaseAtt = attribute.toUpper();
301 if ( (static_cast<const ChildClass *>(
this)->*tester)(upcaseAtt) ) {
302 relevantAttributes.append(upcaseAtt);
306 return relevantAttributes;
321 void setAttribute(QString newValue,
bool (ChildClass::*tester)(QString)
const) {
325 while (it.hasNext()) {
326 QString &attribute = it.next();
328 QString upcaseAtt = attribute.toUpper();
329 if ( (static_cast<const ChildClass *>(
this)->*tester)(upcaseAtt) ) {
330 if (found || newValue ==
"") {
336 attribute = newValue;
344 if (!found && newValue !=
"") {
422 std::vector<QString>
bands()
const;
443 bool isBandRange(QString attribute)
const;
566 bool isByteOrder(QString attribute)
const;
567 bool isFileFormat(QString attribute)
const;
568 bool isLabelAttachment(QString attribute)
const;
569 bool isPixelType(QString attribute)
const;
570 bool isRange(QString attribute)
const;
virtual ~CubeAttribute()
Destroys the object.
The label is pointing to an external DN file - the label is also external to the data.
PixelType pixelType() const
Return the pixel type as an Isis::PixelType.
LabelAttachment LabelAttachmentEnumeration(const QString &labelType)
Return the appropriate LabelType depending on which of the valid values the argument spells...
ByteOrder byteOrder() const
Return the byte order as an Isis::ByteOrder.
File name manipulation and expansion.
void addAttribute(QString attribute)
Add a single attribute to these attributes.
void addAttributes(const char *attributesString)
Append the attributes in the string to these cube attributes.
ByteOrder
Tests the current architecture for byte order.
bool propagatePixelType() const
Return true if the pixel type is to be propagated from an input cube.
void setAttributes(const FileName &fileName)
Replaces the current attributes with the attributes in the given file name.
bool propagateMinimumMaximum() const
Return true if the min/max are to be propagated from an input cube.
void setLabelAttachment(LabelAttachment attachment)
Set the label attachment type to the parameter value.
void setFileFormat(Cube::Format fmt)
Set the format to the fmt parameter.
QString byteOrderString() const
Return the byte order as a string.
This error is for when a programmer made an API call that was illegal.
QList< bool(ChildClass::*)(QString) const > m_attributeTypeTesters
These testers determine if an attribute looks like a particular option.
PixelType
Enumerations for Isis Pixel Types.
CubeAttributeOutput()
Constructs an empty CubeAttributeOutput.
The input label is in a separate data file from the image.
void setAttribute(QString newValue, bool(ChildClass::*tester)(QString) const)
Set the attribute(s) for which tester returns true to newValue.
QStringList m_attributes
These are the attributes that this cube attribute stores.
#define _FILEINFO_
Macro for the filename and line number.
Manipulate and parse attributes of output cube filenames.
A type of error that cannot be classified as any of the other error types.
QString LabelAttachmentName(LabelAttachment labelType)
Return the string representation of the contents of a variable of type LabelAttachment.
double maximum() const
Return the output cube attribute maximum.
void addAttributes(const QString &attributesString)
Append the attributes in the string to these cube attributes.
The input label is embedded in the image file.
Cube::Format fileFormat() const
Return the file format an Cube::Format.
void setPixelType(PixelType type)
Set the pixel type to that given by the parameter.
QString fileFormatString() const
Return the file format as a string.
void setMinimum(double min)
Set the output cube attribute minimum.
void addAttributes(const FileName &fileNameWithAtts)
Append the attributes found in the filename to these cube attributes.
RangeType
Output cube range tracker.
~CubeAttributeOutput()
Destroys the object.
Namespace for ISIS/Bullet specific routines.
Propagate the range from an input cube.
CubeAttribute(QList< bool(ChildClass::*)(QString) const > testers)
Constructs an empty CubeAttribute.
Parent class for CubeAttributeInput and CubeAttributeOutput.
QString attributes() const
Returns a QString of the attributes in a filename, attributes are expected to be of type CubeAttribut...
double minimum() const
Return the output cube attribute minimum.
LabelAttachment
Input cube label type tracker.
Format
These are the possible storage formats of Isis3 cubes.
QString toString() const
Return a string-representation of this cube attributes.
void setByteOrder(ByteOrder order)
Set the order according to the parameter order.
void setMaximum(double max)
Set the output cube attribute maximum.
CubeAttribute(QList< bool(ChildClass::*)(QString) const > testers, const FileName &fileName)
Constructs a CubeAttribute using the argument.
QStringList attributeList(bool(ChildClass::*tester)(QString) const) const
Get a list of attributes that the tester returns true on.