-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSVGObject.h
More file actions
executable file
·113 lines (94 loc) · 3.92 KB
/
SVGObject.h
File metadata and controls
executable file
·113 lines (94 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//------------------------------------------------------------------------------
/// Filename: SVGObject.h
/// Description: Header for Base Class SVGObject
/// Authors:
/// Ralph Ankele(0931951)
/// Tutor: Manuel Weber
/// Group: 24
/// Created: 08.09.2011
/// Last change: 25.09.2011
//------------------------------------------------------------------------------
#ifndef SVGOBJECT_H_INCLUDED
#define SVGOBJECT_H_INCLUDED
#include <string>
#include <vector>
#include <sstream>
#include "Coordinates.h"
class UserInterface;
class Database;
class SVGHandler;
class SVGObject
{
protected:
//----------------------------------------------------------------------------
/// Connection to UserInterface
UserInterface *ui_;
//----------------------------------------------------------------------------
/// Connection to Database
Database *db_;
//----------------------------------------------------------------------------
/// Connection to the SVGHandler
SVGHandler *svgh_;
//----------------------------------------------------------------------------
/// Identifier
signed int id_;
//----------------------------------------------------------------------------
/// Group Identifier
signed int group_id_;
//----------------------------------------------------------------------------
/// Coordinates for the Startpoint
std::vector<Coordinates> coordinates_;
//----------------------------------------------------------------------------
/// svg tag of objects
std::stringstream tag_;
public:
//----------------------------------------------------------------------------
/// Constructor
/// @param ui Connection to UserInterface
/// @param db Connection to Database
/// @param svgh Connection to SVHHandler
/// @param id id of the object
/// @param group_id group id of the object
/// @param coordinates vector with coordinates of the object
SVGObject(UserInterface *ui,
Database *db,
SVGHandler *svgh,
signed int id,
signed int group_id,
std::vector<Coordinates> coordinates);
//----------------------------------------------------------------------------
/// Destructor
virtual ~SVGObject() throw();
//----------------------------------------------------------------------------
/// move Method: moves the SVG Object
/// @param x is the x direction in which is moved
/// @param y is the y direction in which is moved
/// @return returns true if move is correct
virtual bool move(signed int x, signed int y);
//----------------------------------------------------------------------------
/// resize Method: resizes the SVG Object
/// @return returns true if resize was correct
virtual bool resize() { return true;}
//----------------------------------------------------------------------------
/// rotate Method: rotates the SVG Object
/// @param direction is the direction in which the object rotates
/// @return returns true if rotate was correct
virtual bool rotate(std::string direction);
//----------------------------------------------------------------------------
/// getSVGTag returns the svg tag of the object
/// @return returns the svg tag as string
virtual std::string getSVGTag() { return NULL; }
//----------------------------------------------------------------------------
/// getID returns the id of a SVGObject
/// @return returns the id
signed int getID() { return id_; }
//----------------------------------------------------------------------------
/// getGrpID returns the group of a SVGObject
/// @return returns the group
signed int getGrpID() { return group_id_; }
//----------------------------------------------------------------------------
/// getCoordinates() returns the coordinates of SVGObject
/// @return returns the coordinates
std::vector<Coordinates>& getCoordinates() { return coordinates_;}
};
#endif // SVGOBJECT_H_INCLUDED