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 /**--------------------------------------------------------------------------------------------------
40 \brief A decorated dial class that allows the user to set the lighting direction.
41 **/
42 class NDEVR_WIDGETS_API SunDial : public QWidget
43 {
44 Q_OBJECT
45 public:
46 SunDial(QWidget* parent = nullptr);
47 virtual void mousePressEvent(QMouseEvent* ev) override;
51 {
52 return m_knob_radius * getMin(height(), width());
53 }
55 QSize sizeHint() const override
56 {
57 return QSize(300, 300);
58 }
59 virtual void mouseReleaseEvent(QMouseEvent*) override
60 {
61 m_dragging = false;
62 }
63 void setKnobColor(QColor inner, QColor outer);
64 void setBackgroundColor(QColor inner, QColor outer);
65 virtual void mouseMoveEvent(QMouseEvent* ev) override;
67 protected:
68 void paintEvent(QPaintEvent* paint_event) override;
69 protected:
73
76
79 };
80}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
Definition Toggle.h:41
A decorated dial class that allows the user to set the lighting direction.
Definition SunDial.h:43
virtual void mousePressEvent(QMouseEvent *ev) override
QColor m_knob_inner_color
Definition SunDial.h:74
QColor m_inner_color
Definition SunDial.h:72
fltp04 outerRadius() const
QSize sizeHint() const override
Definition SunDial.h:55
bool m_dragging
Definition SunDial.h:78
void setKnobColor(QColor inner, QColor outer)
virtual void mouseReleaseEvent(QMouseEvent *) override
Definition SunDial.h:59
QColor m_knob_outer_color
Definition SunDial.h:75
fltp04 m_inner_radius
Definition SunDial.h:70
QColor m_outer_color
Definition SunDial.h:71
SunDial(QWidget *parent=nullptr)
fltp04 m_knob_radius
Definition SunDial.h:77
fltp04 knobRadius() const
Definition SunDial.h:50
void setBackgroundColor(QColor inner, QColor outer)
Resource< Vector< 2, fltp04 > > location
Definition SunDial.h:66
virtual void mouseMoveEvent(QMouseEvent *ev) override
void paintEvent(QPaintEvent *paint_event) override
Vector< 2, fltp04 > centerPoint() const
Vector< 2, fltp04 > knobLocation() const
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator Author: Tyler Parke Date: 2017-11-05...
Definition BaseFunctions.hpp:56