Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Graphics
GraphicsPointFactory.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#include "
DataKey.h
"
8
#include "
EnumsToQt.h
"
9
#include "
GeometryWindow.h
"
10
#include "
GraphicsItemType.h
"
11
#include "
GraphicsPoint.h
"
12
#include "
GraphicsPointFactory.h
"
13
#include "
PointStyle.h
"
14
#include <QColor>
15
#include <QGraphicsScene>
16
#include <QPointF>
17
#include <QPolygonF>
18
19
GraphicsPointFactory::GraphicsPointFactory
()
20
{
21
}
22
23
GraphicsPoint
*
GraphicsPointFactory::createPoint
(QGraphicsScene &scene,
24
const
QString &identifier,
25
const
QPointF &posScreen,
26
const
PointStyle
&pointStyle,
27
GeometryWindow
*geometryWindow)
28
{
29
GraphicsPoint
*item =
nullptr
;
30
31
switch
(pointStyle.
shape
())
32
{
33
case
POINT_SHAPE_CIRCLE
:
34
{
35
item =
new
GraphicsPoint
(scene,
36
identifier,
37
posScreen,
38
ColorPaletteToQColor
(pointStyle.
paletteColor
()),
39
unsigned (pointStyle.
radius
()),
40
pointStyle.
lineWidth
(),
41
geometryWindow);
42
}
43
break
;
44
45
default
:
46
{
47
item =
new
GraphicsPoint
(scene,
48
identifier,
49
posScreen,
50
ColorPaletteToQColor
(pointStyle.
paletteColor
()),
51
pointStyle.
polygon
(),
52
pointStyle.
lineWidth
(),
53
geometryWindow);
54
}
55
break
;
56
}
57
58
return
item;
59
}
DataKey.h
ColorPaletteToQColor
QColor ColorPaletteToQColor(ColorPalette color)
Definition
EnumsToQt.cpp:16
EnumsToQt.h
GeometryWindow.h
GraphicsItemType.h
GraphicsPointFactory.h
GraphicsPoint.h
POINT_SHAPE_CIRCLE
@ POINT_SHAPE_CIRCLE
Definition
PointShape.h:13
PointStyle.h
GeometryWindow
Window that displays the geometry information, as a table, for the current curve.
Definition
GeometryWindow.h:29
GraphicsPointFactory::GraphicsPointFactory
GraphicsPointFactory()
Single constructor.
Definition
GraphicsPointFactory.cpp:19
GraphicsPointFactory::createPoint
GraphicsPoint * createPoint(QGraphicsScene &scene, const QString &identifier, const QPointF &posScreen, const PointStyle &pointStyle, GeometryWindow *geometryWindow)
Create circle or polygon point according to the PointStyle.
Definition
GraphicsPointFactory.cpp:23
GraphicsPoint
Graphics item for drawing a circular or polygonal Point.
Definition
GraphicsPoint.h:44
PointStyle
Details for a specific Point.
Definition
PointStyle.h:21
PointStyle::radius
unsigned int radius() const
Radius of point. For a circle this is all that is needed to draw a circle. For a polygon,...
Definition
PointStyle.cpp:274
PointStyle::polygon
QPolygonF polygon() const
Return the polygon for creating a QGraphicsPolygonItem. The size is determined by the radius.
Definition
PointStyle.cpp:158
PointStyle::shape
PointShape shape() const
Get method for point shape.
Definition
PointStyle.cpp:313
PointStyle::paletteColor
ColorPalette paletteColor() const
Get method for point color.
Definition
PointStyle.cpp:153
PointStyle::lineWidth
int lineWidth() const
Get method for line width.
Definition
PointStyle.cpp:122
Generated on
for Engauge Digitizer by
1.17.0