USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::ControlDisplayProperties Class Reference

This is the GUI communication mechanism for cubes. More...

#include <ControlDisplayProperties.h>

Inheritance diagram for Isis::ControlDisplayProperties:
Inheritance graph
Collaboration diagram for Isis::ControlDisplayProperties:
Collaboration graph

Classes

class  XmlHandler
 

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 cube.
 
void setShowLabel (bool)
 Change the visibility of the display name associated with this cube.
 
void setSelected (bool)
 Change the selected state associated with this cube.
 

Signals

void propertyChanged (ControlDisplayProperties *)
 
void supportAdded (Property)
 
void propertyChanged (DisplayProperties *)
 
void supportAdded (int)
 

Public Member Functions

 ControlDisplayProperties (QString displayName, QObject *parent=NULL)
 ControlDisplayProperties constructor.
 
 ControlDisplayProperties (XmlStackedHandlerReader *xmlReader, QObject *parent=NULL)
 
virtual ~ControlDisplayProperties ()
 destructor
 
void addSupport (Property prop)
 Convert to Pvl for project files.
 
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.
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 
void fromPvl (const PvlObject &pvl)
 
PvlObject toPvl () const
 Convert to Pvl for project files.
 
void addSupport (int property)
 Call this with every property you support, otherwise they will not communicate properly between widgets.
 
bool supports (int property)
 Support may come later, please make sure you are connected to the supportAdded signal.
 
QVariant getValue (int property) const
 Get a property's associated data.
 
void setDisplayName (QString displayName)
 Sets display name.
 
QString displayName () const
 Returns the display name.
 

Static Public Member Functions

static QColor randomColor ()
 Creates and returns a random color for the intial color of the footprint polygon.
 

Protected Member Functions

void setValue (int prop, QVariant value)
 This is the generic mutator for properties.
 

Private Slots

void toggleShowLabel ()
 Change the visibility of the display name.
 

Private Member Functions

 ControlDisplayProperties (const ControlDisplayProperties &)
 
ControlDisplayPropertiesoperator= (const ControlDisplayProperties &)
 
void setValue (Property prop, QVariant value)
 This is the generic mutator for properties.
 

Static Private Member Functions

static QList
< ControlDisplayProperties * > 
senderToData (QObject *sender)
 This is for the slots that have a list of display properties as associated data.
 

Private Attributes

Property m_propertiesUsed
 This indicated whether any widgets with this DisplayProperties is using a particular property.
 
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.
 

Detailed Description

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 | | | ---—DisplayProperties ----—

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.

Author
2012-06-12 Ken Edmundson
History:
2012-06-12 Ken Edmundson - Creation.

Definition at line 73 of file ControlDisplayProperties.h.

Member Enumeration Documentation

This is a list of properties and actions that are possible.

Enumerator
None 

Null display property for bit-flag purposes.

Color 

The color of the control net, default randomized (QColor)

Selected 

The selection state of this control net (bool)

ShowLabel 

True if the control net should show its display name (bool)

Definition at line 79 of file ControlDisplayProperties.h.

Constructor & Destructor Documentation

Isis::ControlDisplayProperties::ControlDisplayProperties ( QString  displayName,
QObject parent = NULL 
)

ControlDisplayProperties constructor.

This sets default values and constructs the object *.

Parameters
displayNameThe filename (fully expanded) of the object.
parentQt parent object (this is destroyed when parent is destroyed)

Definition at line 26 of file ControlDisplayProperties.cpp.

References m_propertiesUsed, m_propertyValues, None, randomColor(), setSelected(), setShowLabel(), and setValue().

Isis::ControlDisplayProperties::~ControlDisplayProperties ( )
virtual

destructor

Definition at line 53 of file ControlDisplayProperties.cpp.

Member Function Documentation

void Isis::DisplayProperties::addSupport ( int  property)
inherited

Call this with every property you support, otherwise they will not communicate properly between widgets.

Parameters
propThe property you are adding support for

Definition at line 99 of file DisplayProperties.cpp.

References Isis::DisplayProperties::m_propertiesUsed, and Isis::DisplayProperties::supports().

Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem(), and Isis::MosaicSceneItem::MosaicSceneItem().

void Isis::ControlDisplayProperties::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 cube filename. Call this with every property you support, otherwise they will not communicate properly between widgets.

Parameters
propThe property you are adding support for

Definition at line 94 of file ControlDisplayProperties.cpp.

References m_propertiesUsed, and supports().

QVariant Isis::ControlDisplayProperties::getValue ( Property  prop) const

Get a property's associated data.

Parameters
propThe property

Definition at line 118 of file ControlDisplayProperties.cpp.

References m_propertyValues.

Referenced by toggleShowLabel().

QColor Isis::ControlDisplayProperties::randomColor ( )
static

Creates and returns a random color for the intial color of the footprint polygon.

Definition at line 127 of file ControlDisplayProperties.cpp.

Referenced by ControlDisplayProperties().

QList< ControlDisplayProperties * > Isis::ControlDisplayProperties::senderToData ( QObject senderObj)
staticprivate

This is for the slots that have a list of display properties as associated data.

This gets that list out of the data.

Definition at line 264 of file ControlDisplayProperties.cpp.

Referenced by toggleShowLabel().

void Isis::ControlDisplayProperties::setColor ( QColor  newColor)
slot

Change the color associated with this cube.

Definition at line 166 of file ControlDisplayProperties.cpp.

References setValue().

void Isis::DisplayProperties::setDisplayName ( QString  displayName)
inherited

Sets display name.

Parameters
displayNameDisplay name of the object.

Definition at line 88 of file DisplayProperties.cpp.

References Isis::DisplayProperties::displayName(), and Isis::DisplayProperties::m_displayName.

void Isis::ControlDisplayProperties::setSelected ( bool  newValue)
slot

Change the selected state associated with this cube.

Definition at line 174 of file ControlDisplayProperties.cpp.

References Selected, and setValue().

Referenced by ControlDisplayProperties().

void Isis::ControlDisplayProperties::setShowLabel ( bool  newValue)
slot

Change the visibility of the display name associated with this cube.

Definition at line 182 of file ControlDisplayProperties.cpp.

References setValue(), and ShowLabel.

Referenced by ControlDisplayProperties(), and toggleShowLabel().

void Isis::DisplayProperties::setValue ( int  property,
QVariant  value 
)
protectedinherited
void Isis::ControlDisplayProperties::setValue ( Property  prop,
QVariant  value 
)
private

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 249 of file ControlDisplayProperties.cpp.

References supports().

Referenced by ControlDisplayProperties(), setColor(), setSelected(), and setShowLabel().

bool Isis::DisplayProperties::supports ( int  property)
inherited

Support may come later, please make sure you are connected to the supportAdded signal.

Returns
True if the property has support, false otherwise

Definition at line 113 of file DisplayProperties.cpp.

References Isis::DisplayProperties::m_propertiesUsed.

Referenced by Isis::DisplayProperties::addSupport(), Isis::ImageList::allSupport(), and Isis::DisplayProperties::setValue().

bool Isis::ControlDisplayProperties::supports ( Property  prop)

Support may come later, please make sure you are connected to the supportAdded signal.

Returns
True if the property has support, false otherwise

Definition at line 108 of file ControlDisplayProperties.cpp.

References m_propertiesUsed.

Referenced by addSupport(), and setValue().

void Isis::ControlDisplayProperties::toggleShowLabel ( )
privateslot

Change the visibility of the display name.

This should only be connected to by 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 192 of file ControlDisplayProperties.cpp.

References getValue(), senderToData(), setShowLabel(), and ShowLabel.

PvlObject Isis::DisplayProperties::toPvl ( ) const
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 59 of file DisplayProperties.cpp.

References Isis::DisplayProperties::displayName(), and Isis::DisplayProperties::m_propertyValues.

Referenced by Isis::Image::toPvl().

Member Data Documentation

Property Isis::ControlDisplayProperties::m_propertiesUsed
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 156 of file ControlDisplayProperties.h.

Referenced by addSupport(), ControlDisplayProperties(), and supports().

QMap<int, QVariant>* Isis::ControlDisplayProperties::m_propertyValues
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 162 of file ControlDisplayProperties.h.

Referenced by ControlDisplayProperties(), and getValue().


The documentation for this class was generated from the following files: