VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtWindDirectionDialWidget Class Reference

A compass rose with a wind-direction arrow. More...

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

Public Types

enum  BackGroundType { TICKS, ROSE }
enum  NeedleType { ARROW, FULLARROW, LINE }

Public Slots

void setDirection (int degrees)
 Set the direction.
void setDirection (double degrees)
 Set the direction as a double value.

Signals

void directionChanged (int)
 Signal emitted when the direction changed.
void directionChanged (double)
 Signal emitted when the direction changed.

Public Member Functions

 DtWindDirectionDialWidget (QWidget *parent=NULL)
 CTOR.
virtual ~DtWindDirectionDialWidget ()
 virtual DTOR
virtual void setBackGround (BackGroundType type)
 Set the background for the compass.
virtual BackGroundType backGround () const
 Get the background for the compass.
virtual void setNeedle (NeedleType type)
 Set the needle for the compass.
virtual NeedleType needle () const
 Get the needle for the compass.
int direction () const
 Get the direction.
double directionF () const
 Get the direction as a double value.

Protected Slots

void onValueChanged (int val)
 Convert the base class value to a direction (180 degree change).

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)
 Override the paint event to draw the widget.
virtual void resizeEvent (QResizeEvent *event)
 Override the resize event to change how the widget is displayed.
virtual void drawCompass (QPainter &painter, QRectF &rect)
 Utility function to draw the compass background.
virtual void drawCompassTick (QPainter &painter)
 Utility function to draw the compass tick.
virtual void drawHeadingNorth (QPainter &painter)
 Utility function to draw the letter N.
virtual void drawDirection (QPainter &painter, QRectF &rect)
 Utility function to draw the direction from.
virtual void drawNeedle (QPainter &painter)
 Utility function to draw the needle.

Protected Attributes

BackGroundType myBackGroundType
NeedleType myNeedleType
double myRemainder

Private Member Functions

int convert (int val) const
 Utility to convert from base class value to direction and back.

Detailed Description

A compass rose with a wind-direction arrow.

Member Enumeration Documentation

Enumerator:
TICKS 
ROSE 
Enumerator:
ARROW 
FULLARROW 
LINE 

Constructor & Destructor Documentation

makVrv::DtWindDirectionDialWidget::DtWindDirectionDialWidget ( QWidget *  parent = NULL)

CTOR.

Parameters
[in]parentis the parent to manage this widget.
virtual makVrv::DtWindDirectionDialWidget::~DtWindDirectionDialWidget ( )
virtual

virtual DTOR

Member Function Documentation

virtual void makVrv::DtWindDirectionDialWidget::setBackGround ( BackGroundType  type)
virtual

Set the background for the compass.

Parameters
[in]typeis the type of background, default TICKS.
virtual BackGroundType makVrv::DtWindDirectionDialWidget::backGround ( ) const
virtual

Get the background for the compass.

Returns
the type of background.
virtual void makVrv::DtWindDirectionDialWidget::setNeedle ( NeedleType  type)
virtual

Set the needle for the compass.

Parameters
[in]typeis the type of needle, default ARROW.
virtual NeedleType makVrv::DtWindDirectionDialWidget::needle ( ) const
virtual

Get the needle for the compass.

Returns
the type of needle.
int makVrv::DtWindDirectionDialWidget::direction ( ) const

Get the direction.

Returns
the direction.
Note
Converts the base class value to direction (180 degree change).
double makVrv::DtWindDirectionDialWidget::directionF ( ) const

Get the direction as a double value.

Returns
the direction.
Note
Converts the base class value to direction (180 degree change).
void makVrv::DtWindDirectionDialWidget::directionChanged ( int  )
signal

Signal emitted when the direction changed.

void makVrv::DtWindDirectionDialWidget::directionChanged ( double  )
signal

Signal emitted when the direction changed.

void makVrv::DtWindDirectionDialWidget::setDirection ( int  degrees)
slot

Set the direction.

Parameters
[in]degreesis the new direction (wrapped to range 0-359).
Note
Does not emit any signals.
void makVrv::DtWindDirectionDialWidget::setDirection ( double  degrees)
slot

Set the direction as a double value.

Parameters
[in]degreesis the new direction (wrapped to range 0-359).
Note
Does not emit any signals.
void makVrv::DtWindDirectionDialWidget::onValueChanged ( int  val)
protectedslot

Convert the base class value to a direction (180 degree change).

Note
Emits directionChanged(int) signal.
virtual void makVrv::DtWindDirectionDialWidget::paintEvent ( QPaintEvent *  event)
protectedvirtual

Override the paint event to draw the widget.

Parameters
[in]eventis the current paint event.
virtual void makVrv::DtWindDirectionDialWidget::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Override the resize event to change how the widget is displayed.

Parameters
[in]eventis the resize event event.
virtual void makVrv::DtWindDirectionDialWidget::drawCompass ( QPainter &  painter,
QRectF &  rect 
)
protectedvirtual

Utility function to draw the compass background.

Parameters
[in]painteris the painter to use for drawing.
[in]rectis the rectangular space to draw in.
virtual void makVrv::DtWindDirectionDialWidget::drawCompassTick ( QPainter &  painter)
protectedvirtual

Utility function to draw the compass tick.

Parameters
[in]painteris the painter to use for drawing.
virtual void makVrv::DtWindDirectionDialWidget::drawHeadingNorth ( QPainter &  painter)
protectedvirtual

Utility function to draw the letter N.

Parameters
[in]painteris the painter to use for drawing.
virtual void makVrv::DtWindDirectionDialWidget::drawDirection ( QPainter &  painter,
QRectF &  rect 
)
protectedvirtual

Utility function to draw the direction from.

Parameters
[in]painteris the painter to use for drawing.
[in]rectis the rectangular space to draw in.
virtual void makVrv::DtWindDirectionDialWidget::drawNeedle ( QPainter &  painter)
protectedvirtual

Utility function to draw the needle.

Parameters
[in]painteris the painter to use for drawing.
int makVrv::DtWindDirectionDialWidget::convert ( int  val) const
private

Utility to convert from base class value to direction and back.

Parameters
[in]valis value to convert.
Returns
the converted value.
Note
Base class value is zero at bottom of dial, this conversion is used to make zero the top of the dial (North).

Member Data Documentation

BackGroundType makVrv::DtWindDirectionDialWidget::myBackGroundType
protected
NeedleType makVrv::DtWindDirectionDialWidget::myNeedleType
protected
double makVrv::DtWindDirectionDialWidget::myRemainder
protected

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)