Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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. More...
 
GraphicsPointcreatePoint (QGraphicsScene &scene, const QString &identifier, const QPointF &posScreen, const PointStyle &pointStyle, GeometryWindow *geometryWindow)
 Create circle or polygon point according to the PointStyle. More...
 

Detailed Description

Factor for generating GraphicsPointAbstractBase class objects.

Definition at line 19 of file GraphicsPointFactory.h.

Constructor & Destructor Documentation

GraphicsPointFactory::GraphicsPointFactory ( )

Single constructor.

Definition at line 19 of file GraphicsPointFactory.cpp.

20 {
21 }

Member Function Documentation

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  {
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 }
int lineWidth() const
Get method for line width.
Definition: PointStyle.cpp:124
QPolygonF polygon() const
Return the polygon for creating a QGraphicsPolygonItem. The size is determined by the radius...
Definition: PointStyle.cpp:160
QColor ColorPaletteToQColor(ColorPalette color)
Definition: EnumsToQt.cpp:15
ColorPalette paletteColor() const
Get method for point color.
Definition: PointStyle.cpp:155
Graphics item for drawing a circular or polygonal Point.
Definition: GraphicsPoint.h:43
unsigned int radius() const
Radius of point. For a circle this is all that is needed to draw a circle. For a polygon, the radius determines the size of the polygon.
Definition: PointStyle.cpp:276
PointShape shape() const
Get method for point shape.
Definition: PointStyle.cpp:315

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