Isis Developer Reference
Isis::ShapeDisplayProperties Class Reference

This is the GUI communication mechanism for shape objects. More...

#include <ShapeDisplayProperties.h>

Inheritance diagram for Isis::ShapeDisplayProperties:
Inheritance graph
Collaboration diagram for Isis::ShapeDisplayProperties:
Collaboration graph

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

Signals

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

Public Member Functions

 ShapeDisplayProperties (QString displayName, QObject *parent=NULL)
 ShapeDisplayProperties constructor.
 
 ShapeDisplayProperties (XmlStackedHandlerReader *xmlReader, QObject *parent=NULL)
 ShapeDisplayProperties constructor.
 
virtual ~ShapeDisplayProperties ()
 The 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 for this may come later.
 
QVariant getValue (Property prop) const
 Get a property's associated data.
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 Saves this object 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 initial color of the footprint polygon.
 

Protected Member Functions

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

Detailed Description

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.

Author
2016-07-25 Tracie Sucharski

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)

Constructor & Destructor Documentation

◆ ShapeDisplayProperties() [1/2]

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

ShapeDisplayProperties 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)

References None, randomColor(), setSelected(), and setShowLabel().

◆ ShapeDisplayProperties() [2/2]

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

ShapeDisplayProperties constructor.

Parameters
xmlReaderThe XML reader parsing the XML file containing the display properties.
parentThe Qt parent object (this is destroyed when the parent is destroyed).

References None.

◆ ~ShapeDisplayProperties()

Isis::ShapeDisplayProperties::~ShapeDisplayProperties ( )
virtual

The destructor.

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

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

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

◆ addSupport() [2/2]

void Isis::ShapeDisplayProperties::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

References supportAdded(), and supports().

◆ displayName()

◆ fromPvl()

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

◆ getValue() [1/2]

QVariant Isis::DisplayProperties::getValue ( int property) const
inherited

◆ getValue() [2/2]

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

Get a property's associated data.

Parameters
propThe property
Returns
QVariant The data associated with the property.

◆ propertyChanged [1/2]

void Isis::DisplayProperties::propertyChanged ( DisplayProperties * )
signalinherited

◆ propertyChanged [2/2]

void Isis::ShapeDisplayProperties::propertyChanged ( ShapeDisplayProperties * )
signal

◆ randomColor()

QColor Isis::ShapeDisplayProperties::randomColor ( )
static

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

Returns
QColor The color for the initial footprint polygon.

Referenced by ShapeDisplayProperties().

◆ save()

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

Saves this object to an XML file.

Parameters
streamThe XML stream writer write to.
projectThe project this object is attached to (not used).
newProjectRootFileName of the project? (not used).

References Isis::DisplayProperties::displayName().

Referenced by Isis::Shape::save().

◆ setColor

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

Change the color associated with this shape.

Parameters
newColorThe new color associated with this shape.

◆ setDisplayName()

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

Sets display name.

Parameters
displayNameDisplay name of the object.

References Isis::DisplayProperties::displayName().

Referenced by Isis::DisplayProperties::fromPvl().

◆ setSelected

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

Change the selected state associated with this shape.

Parameters
Thenew state associated with this shape.

References Selected.

Referenced by ShapeDisplayProperties().

◆ setShowLabel

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

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

Parameters
newValueThe visibiliy of the display name for this shape.

References ShowLabel.

Referenced by ShapeDisplayProperties().

◆ setValue()

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

◆ supportAdded [1/2]

void Isis::DisplayProperties::supportAdded ( int )
signalinherited

◆ supportAdded [2/2]

void Isis::ShapeDisplayProperties::supportAdded ( Property )
signal

Referenced by addSupport().

◆ 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

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

◆ supports() [2/2]

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

Support for this may come later.

Please make sure you are connected to the supportAdded signal.

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

Referenced by addSupport().

◆ 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.

References Isis::DisplayProperties::displayName().

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


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