Isis 3 Programmer Reference
|
This is the GUI communication mechanism for target body objects. More...
#include <TargetBodyDisplayProperties.h>
Classes | |
class | XmlHandler |
Process an XML file containing information about a WorkOrder. More... | |
Public Types | |
enum | Property { None = 0, Color = 1, Selected = 2, ShowLabel = 16 } |
This is a list of properties and actions that are possible. More... | |
Public Slots | |
void | setColor (QColor newColor) |
Change the color associated with this target. More... | |
void | setShowLabel (bool) |
Change the visibility of the display name associated with this target. More... | |
void | setSelected (bool) |
Change the selected state associated with this target. More... | |
Signals | |
void | propertyChanged (TargetBodyDisplayProperties *) |
void | supportAdded (Property) |
void | propertyChanged (DisplayProperties *) |
void | supportAdded (int) |
Public Member Functions | |
TargetBodyDisplayProperties (QString displayName, QObject *parent=NULL) | |
TargetBodyDisplayProperties constructor. More... | |
TargetBodyDisplayProperties (XmlStackedHandlerReader *xmlReader, QObject *parent=NULL) | |
TargetBodyDisplayProperties constructor. More... | |
virtual | ~TargetBodyDisplayProperties () |
The destructor. More... | |
void | addSupport (Property prop) |
Convert to Pvl for project files. More... | |
bool | supports (Property prop) |
Support for this may come later. More... | |
QVariant | getValue (Property prop) const |
Get a property's associated data. More... | |
void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
Saves this object to an XML file. More... | |
void | fromPvl (const PvlObject &pvl) |
PvlObject | toPvl () const |
Convert to Pvl for project files. More... | |
void | addSupport (int property) |
Call this with every property you support, otherwise they will not communicate properly between widgets. More... | |
bool | supports (int property) |
Support may come later, please make sure you are connected to the supportAdded signal. More... | |
QVariant | getValue (int property) const |
Get a property's associated data. More... | |
void | setDisplayName (QString displayName) |
Sets display name. More... | |
QString | displayName () const |
Returns the display name. More... | |
Static Public Member Functions | |
static QColor | randomColor () |
Creates and returns a random color for the initial color of the footprint polygon. More... | |
Protected Member Functions | |
void | setValue (int prop, QVariant value) |
This is the generic mutator for properties. More... | |
Private Slots | |
void | toggleShowLabel () |
Change the visibility of the display name. More... | |
Private Member Functions | |
TargetBodyDisplayProperties (const TargetBodyDisplayProperties &) | |
TargetBodyDisplayProperties & | operator= (const TargetBodyDisplayProperties &) |
void | setValue (Property prop, QVariant value) |
This is the generic mutator for properties. More... | |
Static Private Member Functions | |
static QList< TargetBodyDisplayProperties * > | senderToData (QObject *sender) |
Return display properties associated with a slot. More... | |
Private Attributes | |
Property | m_propertiesUsed |
This indicated whether any widgets with this DisplayProperties is using a particular property. More... | |
QMap< int, QVariant > * | m_propertyValues |
This is a map from Property to value – the reason I use an int is so Qt knows how to serialize this QMap into binary data. More... | |
This is the GUI communication mechanism for target body objects.
This class is the connector between various GUI interfaces for target body objects. We use this to communicate shared properties that various widgets need to know/should react to in a generic way.
This is how this class is supposed to "connect" widgets:
widgetA widgetB widgetC | | | ---—DisplayProperties ----—
When a user selects a target in widgetA, widgetB and widgetC now have a chance to also select the same target. This applies to all shared properties. Some of the properties are actions - such as ?????. This also allows a widget with no ??? (such as a list) to have an option to ???? (if any of the widgets support it*) and have that option work. There is no state associated with ????? - it's an action connected to a signal.
The proper way to detect a target going away is to connect to the destroyed signal (from the parent QObject). Once that is emitted you cannot call any methods on this object.
Definition at line 77 of file TargetBodyDisplayProperties.h.
This is a list of properties and actions that are possible.
Definition at line 83 of file TargetBodyDisplayProperties.h.
Isis::TargetBodyDisplayProperties::TargetBodyDisplayProperties | ( | QString | displayName, |
QObject * | parent = NULL |
||
) |
TargetBodyDisplayProperties constructor.
This sets default values and constructs the object *.
displayName | The filename (fully expanded) of the object. |
parent | Qt parent object (this is destroyed when parent is destroyed) |
Definition at line 24 of file TargetBodyDisplayProperties.cpp.
References m_propertiesUsed, m_propertyValues, None, randomColor(), setSelected(), setShowLabel(), and setValue().
Isis::TargetBodyDisplayProperties::TargetBodyDisplayProperties | ( | XmlStackedHandlerReader * | xmlReader, |
QObject * | parent = NULL |
||
) |
TargetBodyDisplayProperties constructor.
xmlReader | The XML reader parsing the XML file containing the display properties. |
parent | The Qt parent object (this is destroyed when the parent is destroyed). |
Definition at line 43 of file TargetBodyDisplayProperties.cpp.
References m_propertiesUsed, m_propertyValues, None, and Isis::XmlStackedHandlerReader::pushContentHandler().
|
virtual |
The destructor.
Definition at line 55 of file TargetBodyDisplayProperties.cpp.
|
inherited |
Call this with every property you support, otherwise they will not communicate properly between widgets.
prop | The property you are adding support for |
Definition at line 100 of file DisplayProperties.cpp.
References Isis::DisplayProperties::m_propertiesUsed, and Isis::DisplayProperties::supports().
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem(), and Isis::MosaicSceneItem::MosaicSceneItem().
void Isis::TargetBodyDisplayProperties::addSupport | ( | Property | prop | ) |
Convert to Pvl for project files.
This stores all of the data associated with all of the properties (but not what is supported). This also s tores the target filename. Call this with every property you support, otherwise they will not communicate properly between widgets.
prop | The property you are adding support for |
Definition at line 95 of file TargetBodyDisplayProperties.cpp.
References m_propertiesUsed, and supports().
|
inherited |
Returns the display name.
Definition at line 80 of file DisplayProperties.cpp.
References Isis::DisplayProperties::m_displayName.
Referenced by Isis::Directory::addCnetEditorView(), Isis::MosaicSceneItem::contextMenuEvent(), Isis::DisplayProperties::DisplayProperties(), Isis::TargetInfoWidget::errorMsg(), Isis::ImageTreeWidgetItem::ImageTreeWidgetItem(), Isis::Shape::initFootprint(), Isis::Image::initFootprint(), Isis::MosaicSceneItem::MosaicSceneItem(), Isis::ImageList::CopyImageDataFunctor::operator()(), Isis::GuiCamera::operator==(), Isis::MosaicSceneItem::reproject(), Isis::MosaicSceneWidget::reprojectItems(), Isis::DisplayProperties::save(), Isis::ShapeDisplayProperties::save(), Isis::GuiCameraDisplayProperties::save(), save(), Isis::SensorInfoWidget::SensorInfoWidget(), Isis::DisplayProperties::setDisplayName(), Isis::ExportControlNetWorkOrder::setupExecution(), Isis::ShapeDisplayProperties::XmlHandler::startElement(), Isis::TargetBodyDisplayProperties::XmlHandler::startElement(), Isis::GuiCameraDisplayProperties::XmlHandler::startElement(), Isis::TargetInfoWidget::TargetInfoWidget(), and Isis::DisplayProperties::toPvl().
|
inherited |
Get a property's associated data.
prop | The property |
Definition at line 139 of file DisplayProperties.cpp.
References Isis::DisplayProperties::m_propertyValues.
Referenced by Isis::ImageList::applyAlphas(), Isis::ImageList::askAlpha(), Isis::ImageList::askNewColor(), Isis::MosaicSceneItem::cubeDisplayChanged(), Isis::MosaicControlNetTool::displayConnectivity(), Isis::ImageReader::VariantToImageFunctor::operator()(), Isis::MosaicSceneItem::paint(), Isis::ImageListActionWorkOrder::qualifyString(), Isis::MosaicSceneItem::reproject(), Isis::ImageList::saveAndApplyAlpha(), Isis::ImageList::saveAndApplyColor(), Isis::ImageList::saveAndApplyRandomColor(), Isis::ImageList::saveAndToggleShowDNs(), Isis::ImageList::saveAndToggleShowFill(), Isis::ImageList::saveAndToggleShowLabel(), Isis::ImageList::saveAndToggleShowOutline(), Isis::MosaicSceneItem::updateChildren(), and Isis::MosaicSceneItem::updateSelection().
QVariant Isis::TargetBodyDisplayProperties::getValue | ( | Property | prop | ) | const |
Get a property's associated data.
prop | The property |
Definition at line 119 of file TargetBodyDisplayProperties.cpp.
References m_propertyValues.
Referenced by toggleShowLabel().
|
static |
Creates and returns a random color for the initial color of the footprint polygon.
Definition at line 129 of file TargetBodyDisplayProperties.cpp.
Referenced by TargetBodyDisplayProperties().
void Isis::TargetBodyDisplayProperties::save | ( | QXmlStreamWriter & | stream, |
const Project * | project, | ||
FileName | newProjectRoot | ||
) | const |
Saves this object to an XML file.
stream | The XML stream writer write to. |
project | The project this object is attached to (not used). |
newProjectRoot | FileName of the project? (not used). |
Definition at line 152 of file TargetBodyDisplayProperties.cpp.
References Isis::DisplayProperties::displayName().
|
staticprivate |
Return display properties associated with a slot.
This is for the slots that have a list of display properties as associated data. This gets that list out of the data.
The | object requesting the data. |
Definition at line 329 of file TargetBodyDisplayProperties.cpp.
Referenced by toggleShowLabel().
|
slot |
Change the color associated with this target.
newColor | The new color associated with this target. |
Definition at line 176 of file TargetBodyDisplayProperties.cpp.
References setValue().
|
inherited |
Sets display name.
displayName | Display name of the object. |
Definition at line 89 of file DisplayProperties.cpp.
References Isis::DisplayProperties::displayName(), and Isis::DisplayProperties::m_displayName.
|
slot |
Change the selected state associated with this target.
The | new state associated with this target. |
Definition at line 186 of file TargetBodyDisplayProperties.cpp.
References Selected, and setValue().
Referenced by TargetBodyDisplayProperties().
|
slot |
Change the visibility of the display name associated with this target.
newValue | The visibiliy of the display name for this target. |
Definition at line 196 of file TargetBodyDisplayProperties.cpp.
References setValue(), and ShowLabel.
Referenced by TargetBodyDisplayProperties(), and toggleShowLabel().
|
protectedinherited |
This is the generic mutator for properties.
Given a value, this will change it and emit propertyChanged if its different and supported.
Definition at line 123 of file DisplayProperties.cpp.
References Isis::DisplayProperties::m_propertyValues, and Isis::DisplayProperties::supports().
Referenced by Isis::ImageDisplayProperties::ImageDisplayProperties(), Isis::ImageDisplayProperties::setColor(), Isis::ImageDisplayProperties::setSelected(), Isis::ImageDisplayProperties::setShowDNs(), Isis::ImageDisplayProperties::setShowFill(), Isis::ImageDisplayProperties::setShowLabel(), and Isis::ImageDisplayProperties::setShowOutline().
|
private |
This is the generic mutator for properties.
Given a value, this will change it and emit propertyChanged if its different and supported.
prop | The key into the m_propertyValues QMap <int, QVariant> |
value | The value we want to change to. |
Definition at line 309 of file TargetBodyDisplayProperties.cpp.
References m_propertyValues, and supports().
Referenced by setColor(), setSelected(), setShowLabel(), and TargetBodyDisplayProperties().
|
inherited |
Support may come later, please make sure you are connected to the supportAdded signal.
Definition at line 114 of file DisplayProperties.cpp.
References Isis::DisplayProperties::m_propertiesUsed.
Referenced by Isis::DisplayProperties::addSupport(), Isis::ImageList::allSupport(), and Isis::DisplayProperties::setValue().
bool Isis::TargetBodyDisplayProperties::supports | ( | Property | prop | ) |
Support for this may come later.
Please make sure you are connected to the supportAdded signal.
Definition at line 108 of file TargetBodyDisplayProperties.cpp.
References m_propertiesUsed.
Referenced by addSupport(), and setValue().
|
privateslot |
Change the visibility of the display name.
This should only be connected to an action with a list of displays as its data. This synchronizes all of the values where at least one is guaranteed to be toggled.
Definition at line 208 of file TargetBodyDisplayProperties.cpp.
References getValue(), senderToData(), setShowLabel(), and ShowLabel.
|
inherited |
Convert to Pvl for project files.
This stores all of the data associated with all of the properties (but not what is supported). This also stores the cube filename.
Definition at line 60 of file DisplayProperties.cpp.
References Isis::DisplayProperties::displayName().
|
private |
This indicated whether any widgets with this DisplayProperties is using a particular property.
This helps others who can set but not display know whether they should give the option to set.
Definition at line 162 of file TargetBodyDisplayProperties.h.
Referenced by addSupport(), supports(), and TargetBodyDisplayProperties().
|
private |
This is a map from Property to value – the reason I use an int is so Qt knows how to serialize this QMap into binary data.
Definition at line 168 of file TargetBodyDisplayProperties.h.
Referenced by getValue(), setValue(), and TargetBodyDisplayProperties().