API Documentation
Loading...
Searching...
No Matches
SunDial.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: SunDial
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Resource.h>
35#include <NDEVR/Vector.h>
36#include <QWidget>
37namespace NDEVR
38{
39 class NDEVR_WIDGETS_API SunDial : public QWidget
40 {
41 Q_OBJECT
42 public:
43 SunDial(QWidget* parent = nullptr);
44 virtual void mousePressEvent(QMouseEvent* ev) override;
45 Vector<2, fltp04> centerPoint() const;
46 Vector<2, fltp04> knobLocation() const;
48 {
49 return m_knob_radius * getMin(height(), width());
50 }
51 fltp04 outerRadius() const;
52 QSize sizeHint() const override
53 {
54 return QSize(300, 300);
55 }
56 virtual void mouseReleaseEvent(QMouseEvent*) override
57 {
58 m_dragging = false;
59 }
60 void setKnobColor(QColor inner, QColor outer);
61 void setBackgroundColor(QColor inner, QColor outer);
62 virtual void mouseMoveEvent(QMouseEvent* ev) override;
64 protected:
65 void paintEvent(QPaintEvent* paint_event) override;
66 protected:
70
73
76 };
77}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
Definition Toggle.h:41
Definition SunDial.h:40
QColor m_knob_inner_color
Definition SunDial.h:71
QColor m_inner_color
Definition SunDial.h:69
QSize sizeHint() const override
Definition SunDial.h:52
bool m_dragging
Definition SunDial.h:75
virtual void mouseReleaseEvent(QMouseEvent *) override
Definition SunDial.h:56
QColor m_knob_outer_color
Definition SunDial.h:72
fltp04 m_inner_radius
Definition SunDial.h:67
QColor m_outer_color
Definition SunDial.h:68
fltp04 m_knob_radius
Definition SunDial.h:74
fltp04 knobRadius() const
Definition SunDial.h:47
Resource< Vector< 2, fltp04 > > location
Definition SunDial.h:63
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:157
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator.
Definition BaseFunctions.hpp:67