VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | 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]

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.
- Public Member Functions inherited from makVrv::DtGradientEditorInterface
virtual ~DtGradientEditorInterface ()
 Virtual DTOR.

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
QTreeViewmyControlPointView
QGraphicsView * myGradientView
QPushButtonmyAddControlPointButton
QPushButtonmyRemoveControlPointButton
makVrv::DtDemyDe

Additional Inherited Members

- Public Types inherited from makVrv::DtGradientEditorInterface
typedef std::vector< double > ControlPoint
typedef std::vector
< DtGradientEditorInterface::ControlPoint
Gradient
- Public Attributes inherited from makVrv::DtGradientEditorInterface
boost::signal< void(const
DtGradientEditorInterface::Gradient &)> 
signal_gradientChanged
 Signal emitted when the user changes the gradient.

Detailed Description

A widget class for editing gradients.

Constructor & Destructor Documentation

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

CTOR.

virtual makVrv::DtGradientEditorWidget::~DtGradientEditorWidget ( )
virtual

DTOR.

Member Function Documentation

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

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

virtual void makVrv::DtGradientEditorWidget::clearGradient ( )
virtual

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.

virtual void makVrv::DtGradientEditorWidget::addControlPoint ( DtGradientEditorInterface::ControlPoint  cp)
virtual

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

Implements makVrv::DtGradientEditorInterface.

virtual void makVrv::DtGradientEditorWidget::setGradient ( DtGradientEditorInterface::Gradient  grad)
virtual

Replace the currently-set gradient with gradient specified.

Implements makVrv::DtGradientEditorInterface.

virtual const DtGradientEditorInterface::Gradient makVrv::DtGradientEditorWidget::gradient ( ) const
virtual

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

Line up everything properly when first shown.

virtual void makVrv::DtGradientEditorWidget::insertNewControlPoint ( )
protectedvirtualslot

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

virtual void makVrv::DtGradientEditorWidget::removeSelectedControlPoint ( )
protectedvirtualslot

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

virtual void makVrv::DtGradientEditorWidget::updateGradient ( )
protectedvirtualslot

Redraw the gradient preview and point window.

void makVrv::DtGradientEditorWidget::setupGui ( )
protected

Lays out the widget.

Non-virtual (Called from CTOR).

void makVrv::DtGradientEditorWidget::connectToSignals ( )
protected

Connects to signals from widgets.

Non-virtual (Called from CTOR).

virtual void makVrv::DtGradientEditorWidget::insertNewControlPoint ( double  height,
const QColor &  color 
)
protectedvirtual

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

const int makVrv::DtGradientEditorWidget::theAltitudeColumn = 0
static
const int makVrv::DtGradientEditorWidget::theDisplayColorColumn = 1
static
QString makVrv::DtGradientEditorWidget::myAltitudeUnitsLabel
protected
QAbstractItemDelegate* makVrv::DtGradientEditorWidget::myColorDelegate
protected
QAbstractItemDelegate* makVrv::DtGradientEditorWidget::myAltitudeDelegate
protected
QStandardItemModel* makVrv::DtGradientEditorWidget::myControlPointModel
protected
QGraphicsScene* makVrv::DtGradientEditorWidget::myGradientScene
protected
QTreeView* makVrv::DtGradientEditorWidget::myControlPointView
protected
QGraphicsView* makVrv::DtGradientEditorWidget::myGradientView
protected
QPushButton* makVrv::DtGradientEditorWidget::myAddControlPointButton
protected
QPushButton* makVrv::DtGradientEditorWidget::myRemoveControlPointButton
protected
makVrv::DtDe& makVrv::DtGradientEditorWidget::myDe
protected

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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)