Isis 3 Programmer Reference
Isis::GuiCameraDisplayProperties Class Reference

The GUI communication mechanism for target body objects. More...

#include <GuiCameraDisplayProperties.h>

Inheritance diagram for Isis::GuiCameraDisplayProperties:
Inheritance graph
Collaboration diagram for Isis::GuiCameraDisplayProperties:
Collaboration graph

Classes

class  XmlHandler
 Process a GuiCameraDisplayProperties in a stack-oriented way. 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.
 
void setShowLabel (bool)
 Change the visibility of the display name associated with this target.
 
void setSelected (bool)
 Change the selected state associated with this target.
 

Signals

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

Public Member Functions

 GuiCameraDisplayProperties (QString displayName, QObject *parent=NULL)
 GuiCameraDisplayProperties constructor.
 
 GuiCameraDisplayProperties (XmlStackedHandlerReader *xmlReader, QObject *parent=NULL)
 GuiCameraDisplayProperties constructor.
 
virtual ~GuiCameraDisplayProperties ()
 destructor
 
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.
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 Write the Gui Camera Display Properties out to an XML file.
 
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

 GuiCameraDisplayProperties (const GuiCameraDisplayProperties &)
 
GuiCameraDisplayPropertiesoperator= (const GuiCameraDisplayProperties &)
 
void setValue (Property prop, QVariant value)
 This is the generic mutator for properties.
 
 Q_DISABLE_COPY (DisplayProperties)
 

Static Private Member Functions

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

Private Attributes

Property m_propertiesUsed
 This indicates 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.
 
QString m_displayName
 This is the display name.
 

Detailed Description

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.

Author
2015-05-27 Ken Edmundson
History

2015-05-27 Ken Edmundson - Creation.

2016-06-08 Tyler Wilson - Added documentation to many of the member functions, and cleaned up the formatting. Fixes #3997.

Definition at line 76 of file GuiCameraDisplayProperties.h.

Member Enumeration Documentation

◆ Property

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 82 of file GuiCameraDisplayProperties.h.

Constructor & Destructor Documentation

◆ GuiCameraDisplayProperties() [1/2]

Isis::GuiCameraDisplayProperties::GuiCameraDisplayProperties ( QString displayName,
QObject * parent = NULL )

GuiCameraDisplayProperties constructor.

This sets default values and constructs the object pointer.

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

Definition at line 24 of file GuiCameraDisplayProperties.cpp.

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

◆ GuiCameraDisplayProperties() [2/2]

Isis::GuiCameraDisplayProperties::GuiCameraDisplayProperties ( XmlStackedHandlerReader * xmlReader,
QObject * parent = NULL )

GuiCameraDisplayProperties constructor.

Parameters
xmlReaderXML reader class for loading the Gui Camera Display Properties
parent

Definition at line 45 of file GuiCameraDisplayProperties.cpp.

References m_propertiesUsed, m_propertyValues, and None.

◆ ~GuiCameraDisplayProperties()

Isis::GuiCameraDisplayProperties::~GuiCameraDisplayProperties ( )
virtual

destructor

Definition at line 57 of file GuiCameraDisplayProperties.cpp.

Member Function Documentation

◆ addSupport() [1/2]

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 108 of file DisplayProperties.cpp.

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

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

◆ addSupport() [2/2]

void Isis::GuiCameraDisplayProperties::addSupport ( Property prop)

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 98 of file GuiCameraDisplayProperties.cpp.

References m_propertiesUsed, and supports().

◆ displayName()

◆ fromPvl()

void Isis::DisplayProperties::fromPvl ( const PvlObject & pvl)
inherited

Definition at line 54 of file DisplayProperties.cpp.

◆ getValue() [1/2]

◆ getValue() [2/2]

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

Get a property's associated data.

Parameters
propThe property
Returns
QVariant Returns the value of the property.

Definition at line 122 of file GuiCameraDisplayProperties.cpp.

References m_propertyValues.

Referenced by toggleShowLabel().

◆ randomColor()

QColor Isis::GuiCameraDisplayProperties::randomColor ( )
static

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

Returns
QColor Returns a random color.

Definition at line 132 of file GuiCameraDisplayProperties.cpp.

Referenced by GuiCameraDisplayProperties().

◆ save()

void Isis::GuiCameraDisplayProperties::save ( QXmlStreamWriter & stream,
const Project * project,
FileName newProjectRoot ) const

Write the Gui Camera Display Properties out to an XML file.

Parameters
streamThe output data stream.
projectNot used in this function.
newProjectRootNot used in this function.

Definition at line 155 of file GuiCameraDisplayProperties.cpp.

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

◆ senderToData()

QList< GuiCameraDisplayProperties * > Isis::GuiCameraDisplayProperties::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.

Parameters
senderObjThe caller object containing a list of the display properties.

Definition at line 323 of file GuiCameraDisplayProperties.cpp.

Referenced by toggleShowLabel().

◆ setColor

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

Change the color associated with this target.

Parameters
newColoris the color to associate with this target.

Definition at line 178 of file GuiCameraDisplayProperties.cpp.

References setValue().

◆ setDisplayName()

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

Sets display name.

Parameters
displayNameDisplay name of the object.

Definition at line 97 of file DisplayProperties.cpp.

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

◆ setSelected

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

Change the selected state associated with this target.

Parameters
newValueis the new state associated with this target.

Definition at line 187 of file GuiCameraDisplayProperties.cpp.

References Selected, and setValue().

Referenced by GuiCameraDisplayProperties().

◆ setShowLabel

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

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

Parameters
newValueShows/hides the display name of the associated target.

Definition at line 196 of file GuiCameraDisplayProperties.cpp.

References setValue(), and ShowLabel.

Referenced by GuiCameraDisplayProperties(), and toggleShowLabel().

◆ setValue() [1/2]

void Isis::DisplayProperties::setValue ( int property,
QVariant value )
protectedinherited

◆ setValue() [2/2]

void Isis::GuiCameraDisplayProperties::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.

Parameters
propThe key into the m_propertyValues QMap <int, QVariant>
valueThe value we want to change to.

Definition at line 307 of file GuiCameraDisplayProperties.cpp.

References m_propertyValues, and supports().

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

◆ supports() [1/2]

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 122 of file DisplayProperties.cpp.

References Isis::DisplayProperties::m_propertiesUsed.

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

◆ supports() [2/2]

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

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

Returns
bool Returns true if the property has support, false otherwise.

Definition at line 112 of file GuiCameraDisplayProperties.cpp.

References m_propertiesUsed.

Referenced by addSupport(), and setValue().

◆ toggleShowLabel

void Isis::GuiCameraDisplayProperties::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 206 of file GuiCameraDisplayProperties.cpp.

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

◆ toPvl()

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 68 of file DisplayProperties.cpp.

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

Referenced by Isis::Image::toPvl(), and Isis::Shape::toPvl().

Member Data Documentation

◆ m_displayName

QString Isis::DisplayProperties::m_displayName
privateinherited

◆ m_propertiesUsed

Property Isis::GuiCameraDisplayProperties::m_propertiesUsed
private

This indicates 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 179 of file GuiCameraDisplayProperties.h.

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

◆ m_propertyValues

QMap<int, QVariant>* Isis::GuiCameraDisplayProperties::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 185 of file GuiCameraDisplayProperties.h.

Referenced by getValue(), GuiCameraDisplayProperties(), GuiCameraDisplayProperties(), save(), and setValue().


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