-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSymbolCircle.h
137 lines (100 loc) · 2.76 KB
/
SymbolCircle.h
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/** <pre>
* The Multi-Purpose Viewer
* Copyright (c) 2008 The Boeing Company
*
* This component is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; specifically
* version 2.1 of the License.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* 2008-01-10 Andrew Sampson
* Initial Release.
* </pre>
*/
#ifndef SymbolCircle_h
#define SymbolCircle_h
#include "MPVCommonTypes.h"
#include <vector>
#include <CigiBaseSymbolCircleDef.h>
#include "Vect2.h"
#include "Symbol.h"
namespace mpv
{
//=========================================================
//! Circle symbol class. Inherits from Symbol.
//!
class MPVCMN_SPEC SymbolCircle : public Symbol
{
public:
class Circle
{
public:
Circle() :
centerPosition( 0, 0 ),
radius( 1.0 ),
innerRadius( 0.0 ),
startAngle( 0.0 ),
endAngle( 0.0 )
{
}
bool isCompleteCircle() const
{
if( startAngle == endAngle )
return true;
return false;
}
bool hasHole() const
{
if( innerRadius > 0.0 )
return true;
return false;
}
Vect2 centerPosition;
float radius;
float innerRadius;
float startAngle;
float endAngle;
};
enum SymbolCircleDrawStyle
{
Line = CigiBaseSymbolCircleDef::Line,
Fill = CigiBaseSymbolCircleDef::Fill
};
public:
boost::signal<void (SymbolCircle*)> drawingStyleChanged;
boost::signal<void (SymbolCircle*)> lineStyleChanged;
boost::signal<void (SymbolCircle*)> circlesChanged;
SymbolCircle();
virtual SymbolType getType() const;
void setDrawingStyle( SymbolCircleDrawStyle newStyle );
SymbolCircleDrawStyle getDrawingStyle() const;
void setStipplePattern( Cigi_uint16 newStipplePattern );
Cigi_uint16 getStipplePattern() const;
void setLineWidth( float newLineWidth );
float getLineWidth() const;
void setStipplePatternLength( float newStipplePatternLength );
float getStipplePatternLength() const;
void addCircle( const Circle &newCircle );
unsigned int getNumCircles() const;
const Circle &getCircle( unsigned int circleNum );
void removeAllCircles();
protected:
virtual ~SymbolCircle();
protected:
SymbolCircleDrawStyle drawingStyle;
Cigi_uint16 stipplePattern;
float lineWidth;
float stipplePatternLength;
std::vector<Circle> circles;
};
}
#endif