Parallel Coordinate System with Time Series Data
VP_Widget.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdlib>
4 #include <qvector2d.h>
5 #include "PCAxis.h"
6 #include "PCLine.h"
7 #include "Painter2D.h"
8 #include <qpainter.h>
9 #include "Calendar.h"
10 #include "VP_Wall.h"
11 
12 //geometric representation of a line: y = m * x + d;
13 
23 struct Line {
24  float m, d;
25 };
26 
36 class VP_Widget
37 {
38 private:
39 
40  std::vector<std::vector<PCAxis>> pcAxes_alongTime;
41 
42 
43  std::vector<std::unordered_map<std::string, PCLine>> entity_line_maps;
44 
45  Calendar* calendarData;
46 public:
47  float timeLimit;
48  float ratio = 1.10f;
49 
50  QVector2D origVanishingPoint;
51  QVector2D vanishingPoint;
53  std::vector<std::unordered_map<std::string, QVector2D>> wallvalues;
54  std::vector<PCAxis*> axes;
55 
56  VP_Widget(std::vector<PCAxis*> additionalAxes, float timeLimit, Calendar* calendarData);
57  ~VP_Widget();
58 
59  void initAxis(PCAxis* a, std::vector<PCAxis>* alongTime, int day, bool borderLeft, bool borderRight);
60 
61  void init();
62  void updateAxis(PCAxis* a, std::vector<PCAxis>* alongTime, std::unordered_map<std::string, PCLine>* line_map, std::unordered_map<std::string, QVector2D>* wallvalue, PCAxis* wallAxis);
63  void update();
64  void draw(Painter2D* painter2D, QPainter* qPainter);
65  void clickWall(QVector2D mousePos);
66  void releaseWall();
67  void updateWall(QVector2D mousePos);
68  QVector2D calcBezier(float u, QVector2D p0, QVector2D p1, QVector2D p2, QVector2D p3);
69 };
70 
A Calendar from which you can access the whole data.
Definition: Calendar.h:83
A PC Axis, which represents one axis in the PC System. It holds its positional values on the plane an...
Definition: PCAxis.h:17
A 2D painter.
Definition: Painter2D.h:15
A Wall of a VP_Widget. It basically shows the wall and the Lines of a Vanishing Point Widget.
Definition: VP_Wall.h:15
A Vanishing Point Widget. It shows a separate Parallel Coordinate System which can be moved in time b...
Definition: VP_Widget.h:37
float timeLimit
Definition: VP_Widget.h:47
void releaseWall()
Releases the wall.
Definition: VP_Widget.cpp:389
void draw(Painter2D *painter2D, QPainter *qPainter)
Draws.
Definition: VP_Widget.cpp:292
~VP_Widget()
Destructor.
Definition: VP_Widget.cpp:67
QVector2D calcBezier(float u, QVector2D p0, QVector2D p1, QVector2D p2, QVector2D p3)
Calculates the bezier.
Definition: VP_Widget.cpp:427
float ratio
Definition: VP_Widget.h:48
QVector2D vanishingPoint
Definition: VP_Widget.h:51
void initAxis(PCAxis *a, std::vector< PCAxis > *alongTime, int day, bool borderLeft, bool borderRight)
Initializes the axis.
Definition: VP_Widget.cpp:86
void update()
Updates this object.
Definition: VP_Widget.cpp:267
void updateWall(QVector2D mousePos)
Updates the wall described by mousePos.
Definition: VP_Widget.cpp:405
void updateAxis(PCAxis *a, std::vector< PCAxis > *alongTime, std::unordered_map< std::string, PCLine > *line_map, std::unordered_map< std::string, QVector2D > *wallvalue, PCAxis *wallAxis)
Updates the axis.
Definition: VP_Widget.cpp:183
QVector2D origVanishingPoint
Definition: VP_Widget.h:50
void init()
Initializes this object.
Definition: VP_Widget.cpp:147
VP_Widget(std::vector< PCAxis * > additionalAxes, float timeLimit, Calendar *calendarData)
Constructor.
Definition: VP_Widget.cpp:17
std::vector< std::unordered_map< std::string, QVector2D > > wallvalues
Definition: VP_Widget.h:53
void clickWall(QVector2D mousePos)
Click wall.
Definition: VP_Widget.cpp:375
VP_Wall * wall
Definition: VP_Widget.h:52
std::vector< PCAxis * > axes
Definition: VP_Widget.h:54
A line.
Definition: VP_Widget.h:23
float m
Definition: VP_Widget.h:24
float d
Definition: VP_Widget.h:24