Isis 3 Developer Reference
|
This is the GUI communication mechanism for shape objects. More...
#include <ShapeDisplayProperties.h>
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 shape. More... | |
void | setShowLabel (bool) |
Change the visibility of the display name associated with this shape. More... | |
void | setSelected (bool) |
Change the selected state associated with this shape. More... | |
Signals | |
void | propertyChanged (ShapeDisplayProperties *) |
void | supportAdded (Property) |
void | propertyChanged (DisplayProperties *) |
void | supportAdded (int) |
Public Member Functions | |
ShapeDisplayProperties (QString displayName, QObject *parent=NULL) | |
ShapeDisplayProperties constructor. More... | |
ShapeDisplayProperties (XmlStackedHandlerReader *xmlReader, QObject *parent=NULL) | |
ShapeDisplayProperties constructor. More... | |
virtual | ~ShapeDisplayProperties () |
The destructor. More... | |
void | addSupport (Property prop) |
Call this with every property you support, otherwise they will not communicate properly between widgets. 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... | |
This is the GUI communication mechanism for shape objects.
This class is the connector between various GUI interfaces for shape 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 shape in widgetA, widgetB and widgetC now have a chance to also select the same shape. 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 shape 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.
This is a list of properties and actions that are possible.
Isis::ShapeDisplayProperties::ShapeDisplayProperties | ( | QString | displayName, |
QObject * | parent = NULL |
||
) |
ShapeDisplayProperties 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) |
References None, randomColor(), setSelected(), and setShowLabel().
Isis::ShapeDisplayProperties::ShapeDisplayProperties | ( | XmlStackedHandlerReader * | xmlReader, |
QObject * | parent = NULL |
||
) |
ShapeDisplayProperties 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). |
References None, and Isis::XmlStackedHandlerReader::pushContentHandler().
|
virtual |
The destructor.
|
inherited |
Call this with every property you support, otherwise they will not communicate properly between widgets.
prop | The property you are adding support for |
References Isis::DisplayProperties::supportAdded(), and Isis::DisplayProperties::supports().
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem(), and Isis::MosaicSceneItem::MosaicSceneItem().
void Isis::ShapeDisplayProperties::addSupport | ( | Property | prop | ) |
Call this with every property you support, otherwise they will not communicate properly between widgets.
prop | The property you are adding support for |
References supportAdded(), and supports().
|
inherited |
Returns the display name.
Referenced by Isis::Directory::addCnetEditorView(), Isis::MosaicSceneItem::contextMenuEvent(), Isis::DisplayProperties::DisplayProperties(), Isis::ImageTreeWidgetItem::ImageTreeWidgetItem(), Isis::Shape::initFootprint(), Isis::Image::initFootprint(), Isis::MosaicSceneItem::MosaicSceneItem(), Isis::GuiCamera::operator==(), Isis::MosaicSceneItem::reproject(), Isis::DisplayProperties::save(), Isis::ControlDisplayProperties::save(), save(), Isis::GuiCameraDisplayProperties::save(), Isis::TargetBodyDisplayProperties::save(), Isis::SensorInfoWidget::SensorInfoWidget(), Isis::DisplayProperties::setDisplayName(), Isis::ExportControlNetWorkOrder::setupExecution(), Isis::TargetInfoWidget::TargetInfoWidget(), and Isis::DisplayProperties::toPvl().
|
inherited |
References Isis::DisplayProperties::setDisplayName().
Referenced by Isis::Shape::fromPvl(), and Isis::Image::fromPvl().
|
inherited |
Get a property's associated data.
prop | The property |
Referenced by Isis::MosaicSceneItem::color(), Isis::MosaicSceneItem::cubeDisplayChanged(), Isis::MosaicSceneItem::paint(), Isis::ImageListActionWorkOrder::qualifyString(), Isis::MosaicSceneItem::reproject(), Isis::ImageTreeWidgetItem::update(), and Isis::MosaicSceneItem::updateSelection().
QVariant Isis::ShapeDisplayProperties::getValue | ( | Property | prop | ) | const |
Get a property's associated data.
prop | The property |
|
signalinherited |
Referenced by Isis::DisplayProperties::setValue().
|
signal |
|
static |
Creates and returns a random color for the initial color of the footprint polygon.
Referenced by ShapeDisplayProperties().
void Isis::ShapeDisplayProperties::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). |
References Isis::DisplayProperties::displayName(), and Isis::ReadWrite.
Referenced by Isis::Shape::save().
|
slot |
Change the color associated with this shape.
newColor | The new color associated with this shape. |
|
inherited |
Sets display name.
displayName | Display name of the object. |
References Isis::DisplayProperties::displayName().
Referenced by Isis::DisplayProperties::fromPvl().
|
slot |
Change the selected state associated with this shape.
The | new state associated with this shape. |
References Selected.
Referenced by ShapeDisplayProperties().
|
slot |
Change the visibility of the display name associated with this shape.
newValue | The visibiliy of the display name for this shape. |
References ShowLabel.
Referenced by ShapeDisplayProperties().
|
protectedinherited |
This is the generic mutator for properties.
Given a value, this will change it and emit propertyChanged if its different and supported.
References Isis::DisplayProperties::propertyChanged(), 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().
|
signalinherited |
Referenced by Isis::DisplayProperties::addSupport().
|
signal |
Referenced by addSupport().
|
inherited |
Support may come later, please make sure you are connected to the supportAdded signal.
Referenced by Isis::DisplayProperties::addSupport(), Isis::ImageList::allSupport(), Isis::DisplayProperties::setValue(), and Isis::ImageTreeWidgetItem::update().
bool Isis::ShapeDisplayProperties::supports | ( | Property | prop | ) |
Support for this may come later.
Please make sure you are connected to the supportAdded signal.
Referenced by addSupport().
|
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.
References Isis::DisplayProperties::displayName(), and Isis::ReadWrite.
Referenced by Isis::Shape::toPvl(), and Isis::Image::toPvl().