Isis Developer Reference
Isis::ImageDisplayProperties Class Reference

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

#include <ImageDisplayProperties.h>

Inheritance diagram for Isis::ImageDisplayProperties:
Inheritance graph
Collaboration diagram for Isis::ImageDisplayProperties:
Collaboration graph

Public Types

enum  Property {
  None = 0 , Color = 1 , Selected = 2 , ShowDNs = 4 ,
  ShowFill = 8 , ShowLabel = 16 , ShowOutline = 32 , Zooming = 64 ,
  ZOrdering = 128 , FootprintViewProperties
}
 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 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.
 
void propertyChanged (DisplayProperties *)
 
void supportAdded (int)
 

Public Member Functions

 ImageDisplayProperties (QString displayName, QObject *parent=NULL)
 ImageDisplayProperties constructor.
 
 ImageDisplayProperties (XmlStackedHandlerReader *xmlReader, QObject *parent=NULL)
 
virtual ~ImageDisplayProperties ()
 
void fromPvl (const PvlObject &pvl)
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 Output format:
 
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.
 

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
2011-05-05 Steven Lambright

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 cube, default randomized (QColor)

Selected 

The selection state of this cube (bool)

ShowDNs 

True if the cube should show DN values if possible (bool)

ShowFill 

True if the cube should show a fill area if possible (bool)

ShowLabel 

True if the cube should show its display name (bool)

ShowOutline 

True if the cube should be outlined (bool)

Zooming 

Data ignored. Tells if the cube supports the zoomFit action.

ZOrdering 

Data ignored. Tells if the cube supports the "move*" actions.

FootprintViewProperties 

Every display property for footprint views, provided for convenience.

Constructor & Destructor Documentation

◆ ImageDisplayProperties() [1/2]

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

ImageDisplayProperties constructor.

This sets default values and constructs the Cube *. You cannot have much more than 1K of these without calling closeCube().

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

References randomColor(), setShowDNs(), setShowFill(), setShowOutline(), and Isis::DisplayProperties::setValue().

◆ ImageDisplayProperties() [2/2]

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

◆ ~ImageDisplayProperties()

Isis::ImageDisplayProperties::~ImageDisplayProperties ( )
virtual

Member Function Documentation

◆ addSupport()

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().

◆ displayName()

◆ fromPvl()

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

◆ getValue()

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

◆ moveDownOne

void Isis::ImageDisplayProperties::moveDownOne ( )
signal

Z Order down one.

◆ moveToBottom

void Isis::ImageDisplayProperties::moveToBottom ( )
signal

Z Order to bottom.

◆ moveToTop

void Isis::ImageDisplayProperties::moveToTop ( )
signal

Z Order to top.

◆ moveUpOne

void Isis::ImageDisplayProperties::moveUpOne ( )
signal

Z Order up one.

◆ propertyChanged

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

◆ randomColor()

QColor Isis::ImageDisplayProperties::randomColor ( )
static

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

Referenced by ImageDisplayProperties().

◆ save()

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

Output format:

<displayProperties displayName="..."> Hex-encoded data </displayProperties>

References Isis::DisplayProperties::displayName().

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

◆ setColor

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

Change the color associated with this cube.

References Isis::DisplayProperties::setValue().

◆ 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::ImageDisplayProperties::setSelected ( bool newValue)
slot

Change the selected state associated with this cube.

References Selected, and Isis::DisplayProperties::setValue().

Referenced by Isis::ProjectItemModel::onSelectionChanged(), and Isis::MosaicSceneItem::updateSelection().

◆ setShowDNs

void Isis::ImageDisplayProperties::setShowDNs ( bool newValue)
slot

Change the visibility of DNs associated with this cube.

References Isis::DisplayProperties::setValue(), and ShowDNs.

Referenced by ImageDisplayProperties().

◆ setShowFill

void Isis::ImageDisplayProperties::setShowFill ( bool newValue)
slot

Change the visibility of the fill area associated with this cube.

References Isis::DisplayProperties::setValue(), and ShowFill.

Referenced by ImageDisplayProperties(), and Isis::ImageTreeWidgetItem::update().

◆ setShowLabel

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

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

References Isis::DisplayProperties::setValue(), and ShowLabel.

◆ setShowOutline

void Isis::ImageDisplayProperties::setShowOutline ( bool newValue)
slot

Change the visibility of the outline associated with this cube.

References Isis::DisplayProperties::setValue(), and ShowOutline.

Referenced by ImageDisplayProperties().

◆ setValue()

void Isis::DisplayProperties::setValue ( int property,
QVariant value )
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 ImageDisplayProperties(), setColor(), setSelected(), setShowDNs(), setShowFill(), setShowLabel(), and setShowOutline().

◆ supportAdded

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

◆ supports()

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().

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

◆ zoomFit

void Isis::ImageDisplayProperties::zoomFit ( )
signal

Fit in window.


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