VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtWindDirectionDialWidget.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCoreQt/vrvCoreQt.h>
13 
14 #include <QtWidgets/QDial>
15 
16 class QPaintEvent;
17 class QPainter;
18 class QRectF;
19 class QResizeEvent;
20 
21 
22 namespace makVrv
23 {
24 
28  {
29  Q_OBJECT
30  Q_PROPERTY(QColor CompassTickColor MEMBER myCompassTickColor USER true)
31  Q_PROPERTY(QColor CompassHandColor MEMBER myCompassHandColor USER true)
32  Q_PROPERTY(QColor CompassNorthColor MEMBER myCompassNorthColor USER true)
33 
34  public:
35  typedef enum
36  {
38  ROSE
39  } BackGroundType;
40 
41  typedef enum
42  {
45  LINE
46  } NeedleType;
47 
50  DtWindDirectionDialWidget(QWidget* parent = NULL);
51 
53  virtual ~DtWindDirectionDialWidget();
54 
57  virtual void setBackGround(BackGroundType type);
58 
61  virtual BackGroundType backGround() const;
62 
65  virtual void setNeedle(NeedleType type);
66 
69  virtual NeedleType needle() const;
70 
74  int direction() const;
75 
79  double directionF() const;
80 
81  signals:
83  void directionChanged(int);
84 
86  void directionChanged(double);
87 
88  public slots:
92  void setDirection(int degrees);
93 
97  void setDirection(double degrees);
98 
99  protected slots:
102  void onValueChanged(int val);
103 
104  protected:
107  virtual void paintEvent(QPaintEvent* event);
108 
111  virtual void resizeEvent(QResizeEvent* event);
112 
116  virtual void drawCompass(QPainter& painter, QRectF& rect);
117 
120  virtual void drawCompassTick(QPainter& painter);
121 
124  virtual void drawHeadingNorth(QPainter& painter);
125 
129  virtual void drawDirection(QPainter& painter, QRectF& rect);
130 
133  virtual void drawNeedle(QPainter& painter);
134 
135  private:
141  int convert(int val) const;
142 
143  protected:
146  double myRemainder;
147 
151  };
152 
153 }
Definition: DtWindDirectionDialWidget.h:43
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
BackGroundType myBackGroundType
Definition: DtWindDirectionDialWidget.h:144
QColor myCompassHandColor
Definition: DtWindDirectionDialWidget.h:149
Definition: DtWindDirectionDialWidget.h:44
double myRemainder
Definition: DtWindDirectionDialWidget.h:146
BackGroundType
Definition: DtWindDirectionDialWidget.h:35
Definition: DtWindDirectionDialWidget.h:37
NeedleType myNeedleType
Definition: DtWindDirectionDialWidget.h:145
QColor myCompassTickColor
Definition: DtWindDirectionDialWidget.h:148
A compass rose with a wind-direction arrow.
Definition: DtWindDirectionDialWidget.h:27
NeedleType
Definition: DtWindDirectionDialWidget.h:41
QColor myCompassNorthColor
Definition: DtWindDirectionDialWidget.h:150

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)