Isis 3.0 Developer's Reference (API) |
Home |
This is the GUI communication mechanism for cubes. More...
#include <CubeDisplayProperties.h>
Inherits QObject.
Public Types | |
enum | Property { Color, Selected, ShowDNs, ShowFill, ShowLabel, ShowOutline, Zooming, ZOrdering } |
This is a list of properties and actions that are possible. More... | |
Public Slots | |
void | setColor (QColor newColor) |
Change the color associated with this cube. | |
void | setShowDNs (bool) |
Change the visibility of DNs associated with this cube. | |
void | setShowFill (bool) |
Change the visibility of the fill area associated with this cube. | |
void | setShowLabel (bool) |
Change the visibility of the display name associated with this cube. | |
void | setShowOutline (bool) |
Change the visibility of the outline associated with this cube. | |
void | setSelected (bool) |
Change the selected state associated with this cube. | |
Signals | |
void | propertyChanged (CubeDisplayProperties *) |
void | supportAdded (Property) |
void | moveUpOne () |
Z Order up one. | |
void | moveToTop () |
Z Order to top. | |
void | moveDownOne () |
Z Order down one. | |
void | moveToBottom () |
Z Order to bottom. | |
void | zoomFit () |
Fit in window. | |
Public Member Functions | |
CubeDisplayProperties (QString filename, QMutex *cameraMutex, QObject *parent=NULL) | |
CubeDisplayProperties constructor. | |
virtual | ~CubeDisplayProperties () |
This deletes the Cube * and frees other allocated memory. | |
void | fromPvl (const PvlObject &pvl) |
void | addSupport (Property prop) |
Call this with every property you support, otherwise they will not communicate properly between widgets. | |
bool | supports (Property prop) |
Support may come later, please make sure you are connected to the supportAdded signal. | |
QVariant | getValue (Property prop) const |
Get a property's associated data. | |
Cube * | cube () |
Get the Cube * associated with this display property. | |
UniversalGroundMap * | groundMap () |
Get the UniversalGroundMap * associated with this display property. | |
QString | displayName () const |
Returns the display name. | |
QString | fileName () const |
void | closeCube () |
Cleans up the Cube *. | |
double | incidenceAngle () const |
double | emissionAngle () const |
double | resolution () const |
geos::geom::MultiPolygon * | footprint (QMutex *lock=NULL) |
Cleans up the Cube *. | |
PvlObject | toPvl () const |
Convert to Pvl for project files. | |
Static Public Member Functions | |
static bool | allSupport (Property prop, QList< CubeDisplayProperties * >) |
Returns true if all of the given displays support the property. | |
static QList< QAction * > | getSupportedDisplayActions (QList< CubeDisplayProperties * > cubeDisplays) |
Gets a list of pre-connected actions that have to do with display, such as color, alpha, outline, fill, etc. | |
static QList< QAction * > | getSupportedZoomActions (QList< CubeDisplayProperties * > cubeDisplays) |
Gets a list of pre-connected actions that have to do with zooming, i.e. | |
static QList< QAction * > | getSupportedZOrderActions (QList< CubeDisplayProperties * > cubeDisplays) |
Gets a list of pre-connected actions that have to do with Z-Ordering, such as Bring to Front, Send to Back, etc. | |
static QColor | randomColor () |
Creates and returns a random color for the intial color of the footprint polygon. |
This is the GUI communication mechanism for cubes.
This class is the connector between various GUI interfaces for cubes. 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 | | | ------CubeDisplayProperties -------
When a user selects a cube in widgetA, widgetB and widgetC now have a chance to also select the same cube. This applies to all shared properties. Some of the properties are actions - such as zoomFit. This also allows a widget with no zooming (such as a list) to have an option to zoom (if any of the widgets support it*) and have that option work. There is no state associated with zoomFit - it's an action connected to a signal.
The proper way to detect a cube 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::CubeDisplayProperties::CubeDisplayProperties | ( | QString | filename, | |
QMutex * | cameraMutex, | |||
QObject * | parent = NULL | |||
) |
CubeDisplayProperties constructor.
This sets default values and constructs the Cube *. You cannot have much more than 1K of these without calling closeCube().
cubeFilename | The filename (fully expanded) of the cube file. | |
parent | Qt parent object (this is destroyed when parent is destroyed) |
References _FILEINFO_, Isis::iException::Clear(), Color, cube(), footprint(), Isis::iException::Io, Isis::iException::Message(), Isis::Null, randomColor(), Isis::iException::Report(), setSelected(), setShowDNs(), setShowFill(), setShowLabel(), setShowOutline(), and table.
Isis::CubeDisplayProperties::~CubeDisplayProperties | ( | ) | [virtual] |
This deletes the Cube * and frees other allocated memory.
The destroyed() signal will be called from here.
References closeCube().
void Isis::CubeDisplayProperties::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().
Referenced by Isis::MosaicSceneItem::MosaicSceneItem(), and Isis::MosaicTreeWidgetItem::MosaicTreeWidgetItem().
bool Isis::CubeDisplayProperties::allSupport | ( | Property | prop, | |
QList< CubeDisplayProperties * > | displays | |||
) | [static] |
Returns true if all of the given displays support the property.
prop | The property we're testing for support for | |
displays | The displays we're doing the test on |
References supports().
Referenced by getSupportedDisplayActions(), getSupportedZoomActions(), and getSupportedZOrderActions().
void Isis::CubeDisplayProperties::closeCube | ( | ) |
Cleans up the Cube *.
You want to call this once you're sure you are done with the Cube because the OS will limit how many of these we have open.
Referenced by ~CubeDisplayProperties().
Cube * Isis::CubeDisplayProperties::cube | ( | ) |
Get the Cube * associated with this display property.
This will allocate the Cube * if one is not already present.
References Isis::Cube::open().
Referenced by CubeDisplayProperties(), and footprint().
QString Isis::CubeDisplayProperties::displayName | ( | ) | const |
Returns the display name.
References fileName().
Referenced by Isis::MosaicSceneItem::contextMenuEvent(), footprint(), Isis::MosaicSceneItem::MosaicSceneItem(), Isis::MosaicTreeWidgetItem::MosaicTreeWidgetItem(), and Isis::MosaicSceneItem::reproject().
double Isis::CubeDisplayProperties::emissionAngle | ( | ) | const [inline] |
Referenced by Isis::MosaicTreeWidgetItem::MosaicTreeWidgetItem().
QString Isis::CubeDisplayProperties::fileName | ( | ) | const [inline] |
geos::geom::MultiPolygon * Isis::CubeDisplayProperties::footprint | ( | QMutex * | lock = NULL |
) |
Cleans up the Cube *.
You want to call this once you're sure you are done with the Cube because the OS will limit how many of these we have open.
References _FILEINFO_, Isis::iException::Clear(), cube(), displayName(), Isis::iException::Io, Isis::iException::Message(), poly(), Isis::ImagePolygon::Polys(), and Isis::Cube::read().
Referenced by CubeDisplayProperties().
void Isis::CubeDisplayProperties::fromPvl | ( | const PvlObject & | pvl | ) |
QList< QAction * > Isis::CubeDisplayProperties::getSupportedDisplayActions | ( | QList< CubeDisplayProperties * > | cubeDisplays | ) | [static] |
Gets a list of pre-connected actions that have to do with display, such as color, alpha, outline, fill, etc.
References allSupport(), Color, getValue(), ShowDNs, ShowFill, ShowLabel, and ShowOutline.
Referenced by Isis::MosaicSceneItem::contextMenuEvent(), and Isis::MosaicTreeWidget::contextMenuEvent().
QList< QAction * > Isis::CubeDisplayProperties::getSupportedZoomActions | ( | QList< CubeDisplayProperties * > | cubeDisplays | ) | [static] |
Gets a list of pre-connected actions that have to do with zooming, i.e.
Zoom Fit.
References allSupport(), zoomFit(), and Zooming.
Referenced by Isis::MosaicSceneItem::contextMenuEvent(), and Isis::MosaicTreeWidget::contextMenuEvent().
QList< QAction * > Isis::CubeDisplayProperties::getSupportedZOrderActions | ( | QList< CubeDisplayProperties * > | cubeDisplays | ) | [static] |
Gets a list of pre-connected actions that have to do with Z-Ordering, such as Bring to Front, Send to Back, etc.
References allSupport(), moveDownOne(), moveToBottom(), moveToTop(), moveUpOne(), and ZOrdering.
Referenced by Isis::MosaicSceneItem::contextMenuEvent(), and Isis::MosaicTreeWidget::contextMenuEvent().
QVariant Isis::CubeDisplayProperties::getValue | ( | Property | prop | ) | const |
Get a property's associated data.
prop | The property |
Referenced by Isis::MosaicSceneItem::color(), getSupportedDisplayActions(), Isis::MosaicSceneItem::paint(), Isis::MosaicTreeWidgetItem::update(), and Isis::MosaicSceneItem::updateSelection().
UniversalGroundMap * Isis::CubeDisplayProperties::groundMap | ( | ) |
Get the UniversalGroundMap * associated with this display property.
This will allocate the pointer if one is not already present.
double Isis::CubeDisplayProperties::incidenceAngle | ( | ) | const [inline] |
Referenced by Isis::MosaicTreeWidgetItem::MosaicTreeWidgetItem().
void Isis::CubeDisplayProperties::moveDownOne | ( | ) | [signal] |
Z Order down one.
Referenced by getSupportedZOrderActions().
void Isis::CubeDisplayProperties::moveToBottom | ( | ) | [signal] |
Z Order to bottom.
Referenced by getSupportedZOrderActions().
void Isis::CubeDisplayProperties::moveToTop | ( | ) | [signal] |
Z Order to top.
Referenced by getSupportedZOrderActions().
void Isis::CubeDisplayProperties::moveUpOne | ( | ) | [signal] |
Z Order up one.
Referenced by getSupportedZOrderActions().
void Isis::CubeDisplayProperties::propertyChanged | ( | CubeDisplayProperties * | _t1 | ) | [signal] |
QColor Isis::CubeDisplayProperties::randomColor | ( | ) | [static] |
Creates and returns a random color for the intial color of the footprint polygon.
Referenced by CubeDisplayProperties().
double Isis::CubeDisplayProperties::resolution | ( | ) | const [inline] |
Referenced by Isis::MosaicTreeWidgetItem::MosaicTreeWidgetItem().
void Isis::CubeDisplayProperties::setColor | ( | QColor | newColor | ) | [slot] |
Change the color associated with this cube.
References Color.
void Isis::CubeDisplayProperties::setSelected | ( | bool | newValue | ) | [slot] |
Change the selected state associated with this cube.
References Selected.
Referenced by CubeDisplayProperties(), Isis::MosaicTreeWidgetItem::update(), and Isis::MosaicSceneItem::updateSelection().
void Isis::CubeDisplayProperties::setShowDNs | ( | bool | newValue | ) | [slot] |
Change the visibility of DNs associated with this cube.
References ShowDNs.
Referenced by CubeDisplayProperties(), and Isis::MosaicTreeWidgetItem::update().
void Isis::CubeDisplayProperties::setShowFill | ( | bool | newValue | ) | [slot] |
Change the visibility of the fill area associated with this cube.
References ShowFill.
Referenced by CubeDisplayProperties(), and Isis::MosaicTreeWidgetItem::update().
void Isis::CubeDisplayProperties::setShowLabel | ( | bool | newValue | ) | [slot] |
Change the visibility of the display name associated with this cube.
References ShowLabel.
Referenced by CubeDisplayProperties(), and Isis::MosaicTreeWidgetItem::update().
void Isis::CubeDisplayProperties::setShowOutline | ( | bool | newValue | ) | [slot] |
Change the visibility of the outline associated with this cube.
References ShowOutline.
Referenced by CubeDisplayProperties(), and Isis::MosaicTreeWidgetItem::update().
void Isis::CubeDisplayProperties::supportAdded | ( | Property | _t1 | ) | [signal] |
Referenced by addSupport().
bool Isis::CubeDisplayProperties::supports | ( | Property | prop | ) |
Support may come later, please make sure you are connected to the supportAdded signal.
Referenced by allSupport().
PvlObject Isis::CubeDisplayProperties::toPvl | ( | ) | const |
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::ReadWrite.
Referenced by Isis::MosaicController::saveProject().
void Isis::CubeDisplayProperties::zoomFit | ( | ) | [signal] |
Fit in window.
Referenced by getSupportedZoomActions().