File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
 |
Isis 3 Programmer Reference
|
1 #ifndef CubeAttribute_h
2 #define CubeAttribute_h
13 #include <QStringList>
18 #include "IException.h"
19 #include "PixelType.h"
57 QString msg =
"Invalid label attachment type [" + QString::number(labelType) +
"]";
71 QString temp = labelType.toUpper();
76 QString msg =
"Invalid label attachment type string [" + labelType +
"]";
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;
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),
266 foreach (QString attribute, 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) {
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 !=
"") {
406 std::vector<QString>
bands()
const;
427 bool isBandRange(QString attribute)
const;
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.
RangeType
Output cube range tracker.
void setMaximum(double max)
Set the output cube attribute maximum.
@ DetachedLabel
The input label is in a separate data file from the image.
@ RangeSet
The range has been set.
void setPixelType(PixelType type)
Set the pixel type to that given by the parameter.
This is free and unencumbered software released into the public domain.
CubeAttribute(QList< bool(ChildClass::*)(QString) const > testers, const FileName &fileName)
Constructs a CubeAttribute using the argument.
QString LabelAttachmentName(LabelAttachment labelType)
Return the string representation of the contents of a variable of type LabelAttachment.
QStringList attributeList(bool(ChildClass::*tester)(QString) const) const
Get a list of attributes that the tester returns true on.
File name manipulation and expansion.
QList< bool(ChildClass::*)(QString) const > m_attributeTypeTesters
These testers determine if an attribute looks like a particular option.
@ Unknown
A type of error that cannot be classified as any of the other error types.
void setAttribute(QString newValue, bool(ChildClass::*tester)(QString) const)
Set the attribute(s) for which tester returns true to newValue.
@ PropagateRange
Propagate the range from an input cube.
virtual ~CubeAttribute()
Destroys the object.
void addAttributes(const QString &attributesString)
Append the attributes in the string to these cube attributes.
Manipulate and parse attributes of output cube filenames.
void setFileFormat(Cube::Format fmt)
Set the format to the fmt parameter.
void addAttributes(const char *attributesString)
Append the attributes in the string to these cube attributes.
ByteOrder
Tests the current architecture for byte order.
LabelAttachment LabelAttachmentEnumeration(const QString &labelType)
Return the appropriate LabelType depending on which of the valid values the argument spells.
void addAttributes(const FileName &fileNameWithAtts)
Append the attributes found in the filename to these cube attributes.
void setAttributes(const FileName &fileName)
Replaces the current attributes with the attributes in the given file name.
@ AttachedLabel
The input label is embedded in the image file.
void setByteOrder(ByteOrder order)
Set the order according to the parameter order.
LabelAttachment
Input cube label type tracker.
QStringList m_attributes
These are the attributes that this cube attribute stores.
PixelType pixelType() const
Return the pixel type as an Isis::PixelType.
bool propagateMinimumMaximum() const
Return true if the min/max are to be propagated from an input cube.
QString byteOrderString() const
Return the byte order as a string.
QString fileFormatString() const
Return the file format as a string.
CubeAttributeOutput()
Constructs an empty CubeAttributeOutput.
~CubeAttributeOutput()
Destroys the object.
PixelType
Enumerations for Isis Pixel Types.
@ Programmer
This error is for when a programmer made an API call that was illegal.
ByteOrder byteOrder() const
Return the byte order as an Isis::ByteOrder.
void setLabelAttachment(LabelAttachment attachment)
Set the label attachment type to the parameter value.
double maximum() const
Return the output cube attribute maximum.
double minimum() const
Return the output cube attribute minimum.
CubeAttribute(QList< bool(ChildClass::*)(QString) const > testers)
Constructs an empty CubeAttribute.
Cube::Format fileFormat() const
Return the file format an Cube::Format.
Parent class for CubeAttributeInput and CubeAttributeOutput.
bool propagatePixelType() const
Return true if the pixel type is to be propagated from an input cube.
@ ExternalLabel
The label is pointing to an external DN file - the label is also external to the data.
void addAttribute(QString attribute)
Add a single attribute to these attributes.
void setMinimum(double min)
Set the output cube attribute minimum.
QString attributes() const
Returns a QString of the attributes in a filename, attributes are expected to be of type CubeAttribut...
This is free and unencumbered software released into the public domain.
QString toString() const
Return a string-representation of this cube attributes.