VR-Forces 4.3 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::DtRangeEditorWidget Class Reference

A widget class for editing ranges. More...

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

Public Slots

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

Public Member Functions

 DtRangeEditorWidget (DtDe &de, QWidget *parent=0, Qt::WindowFlags flags=0)
 CTOR.
virtual ~DtRangeEditorWidget ()
 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 setValueUnits (const QString &units)
 Set the units for the altitude label.
virtual void setValueDecimals (int decimals)
 Set the decimals for the altitude label.
virtual void setRangeBackgroundColor (const QColor &color)
 Set the background color to display outside of ranges.
virtual QColor rangeBackgroundColor () const
 Get the background color for the ranges.
virtual void getRange (int index, float &rangeStart, float &rangeEnd, QColor &color) const
 Get information about the given range.
virtual int numRanges () const
 Get the number of ranges.
virtual void addControlPoint (double rangeStart, double rangeEnd, double red, double green, double blue, double alpha=1.0)
 Add a single control point to the currently-set gradient.
virtual void addControlPoint (DtRangeEditorInterface::ControlPoint cp)
 Add a single control point to the currently-set gradient.
virtual void setGradient (DtRangeEditorInterface::Gradient grad)
 Replace the currently-set gradient with gradient specified.
virtual
DtRangeEditorInterface::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::DtRangeEditorInterface
virtual ~DtRangeEditorInterface ()
 Virtual DTOR.

Static Public Attributes

static const int theRangeStartColumn = 0
static const int theRangeEndColumn = 1
static const int theColorColumn = 2

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 rangeStart, double rangeEnd, 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 rangeStart, double rangeEnd, std::string color)
 Creates the items for each column in a new row.
virtual void changeEvent (QEvent *event)
 Listens for enable/disable events and updates gradient.

Protected Attributes

QString myRangeEndLabel
QString myRangeStartLabel
QColor myBackgroundColor
QAbstractItemDelegate * myColorDelegate
QAbstractItemDelegate * myValueDelegate
QStandardItemModel * myControlPointModel
QGraphicsScene * myGradientScene
QTreeViewmyControlPointView
QGraphicsView * myGradientView
QPushButtonmyAddControlPointButton
QPushButtonmyRemoveControlPointButton
makVrv::DtDemyDe

Additional Inherited Members

- Public Types inherited from makVrv::DtRangeEditorInterface
typedef std::vector< double > ControlPoint
 Vector type for the double values that make up a control point.
typedef std::vector
< DtRangeEditorInterface::ControlPoint
Gradient
 Vector type for storing ControlPoints.
- Public Attributes inherited from makVrv::DtRangeEditorInterface
boost::signal< void(const
DtRangeEditorInterface::Gradient &)> 
signal_gradientChanged
 Signal emitted when the user changes the gradient.

Detailed Description

A widget class for editing ranges.

Constructor & Destructor Documentation

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

CTOR.

virtual makVrv::DtRangeEditorWidget::~DtRangeEditorWidget ( )
virtual

DTOR.

Member Function Documentation

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

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

virtual void makVrv::DtRangeEditorWidget::clearGradient ( )
virtual

Blank the currently-set gradient.

Implements makVrv::DtRangeEditorInterface.

virtual void makVrv::DtRangeEditorWidget::setValueUnits ( const QString &  units)
virtual

Set the units for the altitude label.

virtual void makVrv::DtRangeEditorWidget::setValueDecimals ( int  decimals)
virtual

Set the decimals for the altitude label.

virtual void makVrv::DtRangeEditorWidget::setRangeBackgroundColor ( const QColor &  color)
virtual

Set the background color to display outside of ranges.

virtual QColor makVrv::DtRangeEditorWidget::rangeBackgroundColor ( ) const
virtual

Get the background color for the ranges.

virtual void makVrv::DtRangeEditorWidget::getRange ( int  index,
float &  rangeStart,
float &  rangeEnd,
QColor &  color 
) const
virtual

Get information about the given range.

virtual int makVrv::DtRangeEditorWidget::numRanges ( ) const
virtual

Get the number of ranges.

virtual void makVrv::DtRangeEditorWidget::addControlPoint ( double  rangeStart,
double  rangeEnd,
double  red,
double  green,
double  blue,
double  alpha = 1.0 
)
virtual

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

Implements makVrv::DtRangeEditorInterface.

virtual void makVrv::DtRangeEditorWidget::addControlPoint ( DtRangeEditorInterface::ControlPoint  cp)
virtual

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

Exceptions
DtCorruptedStateif cp is anything but (start,end,r,g,b,a(optional)).

Implements makVrv::DtRangeEditorInterface.

virtual void makVrv::DtRangeEditorWidget::setGradient ( DtRangeEditorInterface::Gradient  grad)
virtual

Replace the currently-set gradient with gradient specified.

Implements makVrv::DtRangeEditorInterface.

virtual DtRangeEditorInterface::Gradient makVrv::DtRangeEditorWidget::gradient ( ) const
virtual

Return the currently-set gradient.

Implements makVrv::DtRangeEditorInterface.

virtual void makVrv::DtRangeEditorWidget::removeControlPoint ( int  index)
virtual

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

virtual void makVrv::DtRangeEditorWidget::decorate ( )
virtualslot

Line up everything properly when first shown.

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

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

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

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

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

Redraw the gradient preview and point window.

void makVrv::DtRangeEditorWidget::setupGui ( )
protected

Lays out the widget.

Non-virtual (Called from CTOR).

void makVrv::DtRangeEditorWidget::connectToSignals ( )
protected

Connects to signals from widgets.

Non-virtual (Called from CTOR).

virtual void makVrv::DtRangeEditorWidget::insertNewControlPoint ( double  rangeStart,
double  rangeEnd,
const QColor &  color 
)
protectedvirtual

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

std::string makVrv::DtRangeEditorWidget::colorStringFromColor ( const QColor &  color)
protected

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

QList<QStandardItem*> makVrv::DtRangeEditorWidget::modelRowFromAltitudeColor ( double  rangeStart,
double  rangeEnd,
std::string  color 
)
protected

Creates the items for each column in a new row.

virtual void makVrv::DtRangeEditorWidget::changeEvent ( QEvent *  event)
protectedvirtual

Listens for enable/disable events and updates gradient.

Member Data Documentation

const int makVrv::DtRangeEditorWidget::theRangeStartColumn = 0
static
const int makVrv::DtRangeEditorWidget::theRangeEndColumn = 1
static
const int makVrv::DtRangeEditorWidget::theColorColumn = 2
static
QString makVrv::DtRangeEditorWidget::myRangeEndLabel
protected
QString makVrv::DtRangeEditorWidget::myRangeStartLabel
protected
QColor makVrv::DtRangeEditorWidget::myBackgroundColor
protected
QAbstractItemDelegate* makVrv::DtRangeEditorWidget::myColorDelegate
protected
QAbstractItemDelegate* makVrv::DtRangeEditorWidget::myValueDelegate
protected
QStandardItemModel* makVrv::DtRangeEditorWidget::myControlPointModel
protected
QGraphicsScene* makVrv::DtRangeEditorWidget::myGradientScene
protected
QTreeView* makVrv::DtRangeEditorWidget::myControlPointView
protected
QGraphicsView* makVrv::DtRangeEditorWidget::myGradientView
protected
QPushButton* makVrv::DtRangeEditorWidget::myAddControlPointButton
protected
QPushButton* makVrv::DtRangeEditorWidget::myRemoveControlPointButton
protected
makVrv::DtDe& makVrv::DtRangeEditorWidget::myDe
protected

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

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)