VR-Forces 4.0.4 Class Documentation
Public Slots | Public Member Functions | Static Public Attributes | Protected Slots | Protected Member Functions | Protected Attributes
makVrv::DtGradientEditorWidget Class Reference

A widget class for editing gradients. More...

Inheritance diagram for makVrv::DtGradientEditorWidget:
Inheritance graph
[legend]

List of all members.

Public Slots

virtual void decorate ()
 Line up everything properly when first shown.

Public Member Functions

 DtGradientEditorWidget (DtDe &de, QWidget *parent=0, Qt::WindowFlags flags=0)
 CTOR.
virtual ~DtGradientEditorWidget ()
 DTOR.
virtual void resizeEvent (QResizeEvent *event)
 Reimplementation of QWidget::resizeEvent() to redraw the gradient preview.
virtual void clearGradient ()
 Blank the currently-set gradient.
virtual void setAltitudeUnits (const QString &units)
 Set the units for the altitude label.
virtual void setAltitudeDecimals (int decimals)
 Set the decimals for the altitude label.
virtual void addControlPoint (double location, double red, double green, double blue, double alpha=1.0)
 Add a single control point to the currently-set gradient.
virtual void addControlPoint (DtGradientEditorInterface::ControlPoint cp)
 Add a single control point to the currently-set gradient.
virtual void setGradient (DtGradientEditorInterface::Gradient grad)
 Replace the currently-set gradient with gradient specified.
virtual const
DtGradientEditorInterface::Gradient 
gradient () const
 Return the currently-set gradient.
virtual void removeControlPoint (int index)
 Remove a single control point from the currently-set gradient.

Static Public Attributes

static const int theAltitudeColumn = 0
static const int theDisplayColorColumn = 1

Protected Slots

virtual void insertNewControlPoint ()
 Insert a new control point at the selection Called when "add point" is pressed.
virtual void removeSelectedControlPoint ()
 Remove control point at the selection Called when "delete point" is pressed.
virtual void updateGradient ()
 Redraw the gradient preview and point window.

Protected Member Functions

void setupGui ()
 Lays out the widget.
void connectToSignals ()
 Connects to signals from widgets.
virtual void insertNewControlPoint (double height, const QColor &color)
 Creates a new item in the model with the given parameters.
std::string colorStringFromColor (const QColor &color)
 Returns the color as a hex string ( "RRGGBB" ).
QList< QStandardItem * > modelRowFromAltitudeColor (double altitude, std::string color)
 Creates the items for each column in a new row.

Protected Attributes

QString myAltitudeUnitsLabel
QAbstractItemDelegate * myColorDelegate
QAbstractItemDelegate * myAltitudeDelegate
QStandardItemModel * myControlPointModel
QGraphicsScene * myGradientScene
QTreeView * myControlPointView
QGraphicsView * myGradientView
QPushButtonmyAddControlPointButton
QPushButtonmyRemoveControlPointButton
makVrv::DtDemyDe

Detailed Description

A widget class for editing gradients.


Constructor & Destructor Documentation

makVrv::DtGradientEditorWidget::DtGradientEditorWidget ( DtDe de,
QWidget parent = 0,
Qt::WindowFlags  flags = 0 
)

CTOR.

DTOR.


Member Function Documentation

virtual void makVrv::DtGradientEditorWidget::resizeEvent ( QResizeEvent *  event) [virtual]

Reimplementation of QWidget::resizeEvent() to redraw the gradient preview.

Blank the currently-set gradient.

Implements makVrv::DtGradientEditorInterface.

virtual void makVrv::DtGradientEditorWidget::setAltitudeUnits ( const QString &  units) [virtual]

Set the units for the altitude label.

virtual void makVrv::DtGradientEditorWidget::setAltitudeDecimals ( int  decimals) [virtual]

Set the decimals for the altitude label.

virtual void makVrv::DtGradientEditorWidget::addControlPoint ( double  location,
double  red,
double  green,
double  blue,
double  alpha = 1.0 
) [virtual]

Add a single control point to the currently-set gradient.

Implements makVrv::DtGradientEditorInterface.

Add a single control point to the currently-set gradient.

Implements makVrv::DtGradientEditorInterface.

Replace the currently-set gradient with gradient specified.

Implements makVrv::DtGradientEditorInterface.

Return the currently-set gradient.

Implements makVrv::DtGradientEditorInterface.

virtual void makVrv::DtGradientEditorWidget::removeControlPoint ( int  index) [virtual]

Remove a single control point from the currently-set gradient.

virtual void makVrv::DtGradientEditorWidget::decorate ( ) [virtual, slot]

Line up everything properly when first shown.

virtual void makVrv::DtGradientEditorWidget::insertNewControlPoint ( ) [protected, virtual, slot]

Insert a new control point at the selection Called when "add point" is pressed.

virtual void makVrv::DtGradientEditorWidget::removeSelectedControlPoint ( ) [protected, virtual, slot]

Remove control point at the selection Called when "delete point" is pressed.

virtual void makVrv::DtGradientEditorWidget::updateGradient ( ) [protected, virtual, slot]

Redraw the gradient preview and point window.

Lays out the widget.

Non-virtual (Called from CTOR).

Connects to signals from widgets.

Non-virtual (Called from CTOR).

virtual void makVrv::DtGradientEditorWidget::insertNewControlPoint ( double  height,
const QColor &  color 
) [protected, virtual]

Creates a new item in the model with the given parameters.

std::string makVrv::DtGradientEditorWidget::colorStringFromColor ( const QColor &  color) [protected]

Returns the color as a hex string ( "RRGGBB" ).

QList<QStandardItem*> makVrv::DtGradientEditorWidget::modelRowFromAltitudeColor ( double  altitude,
std::string  color 
) [protected]

Creates the items for each column in a new row.


Member Data Documentation

QAbstractItemDelegate* makVrv::DtGradientEditorWidget::myColorDelegate [protected]
QAbstractItemDelegate* makVrv::DtGradientEditorWidget::myAltitudeDelegate [protected]
QStandardItemModel* makVrv::DtGradientEditorWidget::myControlPointModel [protected]

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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)