Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GraphicsPointFactory Class Reference

Factor for generating GraphicsPointAbstractBase class objects. More...

#include <GraphicsPointFactory.h>

Collaboration diagram for GraphicsPointFactory:
Collaboration graph

Public Member Functions

 GraphicsPointFactory ()
 Single constructor.
 
GraphicsPointcreatePoint (QGraphicsScene &scene, const QString &identifier, const QPointF &posScreen, const PointStyle &pointStyle, GeometryWindow *geometryWindow)
 Create circle or polygon point according to the PointStyle.
 

Detailed Description

Factor for generating GraphicsPointAbstractBase class objects.

Definition at line 19 of file GraphicsPointFactory.h.

Constructor & Destructor Documentation

◆ GraphicsPointFactory()

GraphicsPointFactory::GraphicsPointFactory ( )

Single constructor.

Definition at line 19 of file GraphicsPointFactory.cpp.

20{
21}

Member Function Documentation

◆ createPoint()

GraphicsPoint * GraphicsPointFactory::createPoint ( QGraphicsScene &  scene,
const QString &  identifier,
const QPointF &  posScreen,
const PointStyle pointStyle,
GeometryWindow geometryWindow 
)

Create circle or polygon point according to the PointStyle.

Definition at line 23 of file GraphicsPointFactory.cpp.

28{
29 GraphicsPoint *item = nullptr;
30
31 switch (pointStyle.shape ())
32 {
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}
QColor ColorPaletteToQColor(ColorPalette color)
Definition: EnumsToQt.cpp:15
@ POINT_SHAPE_CIRCLE
Definition: PointShape.h:13
Graphics item for drawing a circular or polygonal Point.
Definition: GraphicsPoint.h:44
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:276
QPolygonF polygon() const
Return the polygon for creating a QGraphicsPolygonItem. The size is determined by the radius.
Definition: PointStyle.cpp:160
PointShape shape() const
Get method for point shape.
Definition: PointStyle.cpp:315
ColorPalette paletteColor() const
Get method for point color.
Definition: PointStyle.cpp:155
int lineWidth() const
Get method for line width.
Definition: PointStyle.cpp:124

The documentation for this class was generated from the following files: