Number5
Visualisierung 2 Project - Florian Schober (0828151, f.schober@live.com), Andreas Walch (0926780, walch.andreas89@gmail.com)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OwnCursor.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 class Application;
4 
9 class OwnCursor
10 {
14  double m_lastSpF;
15  double m_lastMeasure;
18  float m_scale;
19  float m_minScale;
20  float m_maxScale;
21  bool m_blink;
24  public:
34  void onKeyStateChanged(int key, bool pressed);
35 
36  public:
41  OwnCursor(Application* app);
48  void update(double time, double timeDelta);
55  void draw(double time, double timeDelta);
60  void setMinScale(float min);
65  void setMaxScale(float max);
70  float getScale() {return m_scale;}
75  float getCushion() {return m_cushion_factor;}
80  bool getScaleFunction() { return m_scale_linear;}
85  bool getCursorIcon() { return m_active_hand;}
91  vec2 calculateCursorPosInVisualSpace(vec2 cursorPosBeforeMove, vec2 const & deltaMotorSpace);
92 
93  private:
100  vec2 calculateCursorMoveDeltaInVisualSpace(vec2 const & cursorPosBeforeMove, vec2 const & deltaMotorSpace);
104  void toggleImage();
108  void toggleScaleFunction();
113  void updateCushionFactor(float value);
114 };
vec2 calculateCursorPosInVisualSpace(vec2 cursorPosBeforeMove, vec2 const &deltaMotorSpace)
Definition: OwnCursor.cpp:48
void toggleScaleFunction()
Definition: OwnCursor.cpp:24
float m_maxScale
Definition: OwnCursor.hpp:20
void updateCushionFactor(float value)
Definition: OwnCursor.cpp:29
bool m_active_hand
Definition: OwnCursor.hpp:16
float getCushion()
Definition: OwnCursor.hpp:75
bool m_blink
Definition: OwnCursor.hpp:21
float m_minScale
Definition: OwnCursor.hpp:19
bool getCursorIcon()
Definition: OwnCursor.hpp:85
float m_cushion_factor
Definition: OwnCursor.hpp:22
bool m_scale_linear
Definition: OwnCursor.hpp:17
double m_lastSpF
Definition: OwnCursor.hpp:14
vec2 calculateCursorMoveDeltaInVisualSpace(vec2 const &cursorPosBeforeMove, vec2 const &deltaMotorSpace)
Definition: OwnCursor.cpp:71
float m_scale
Definition: OwnCursor.hpp:18
void setMinScale(float min)
Texture * m_tex_hand
Definition: OwnCursor.hpp:13
void update(double time, double timeDelta)
Definition: OwnCursor.cpp:106
OwnCursor(Application *app)
Definition: OwnCursor.cpp:3
void setMaxScale(float max)
float getScale()
Definition: OwnCursor.hpp:70
void toggleImage()
Definition: OwnCursor.cpp:19
Application * m_app
Definition: OwnCursor.hpp:11
Texture * m_tex_arrow
Definition: OwnCursor.hpp:12
double m_lastMeasure
Definition: OwnCursor.hpp:15
bool getScaleFunction()
Definition: OwnCursor.hpp:80
void onKeyStateChanged(int key, bool pressed)
Definition: OwnCursor.cpp:34
void draw(double time, double timeDelta)
Definition: OwnCursor.cpp:118