00001
00002
00003
00004
00005
00006
00007 #include "DataKey.h"
00008 #include "EnumsToQt.h"
00009 #include "GraphicsItemType.h"
00010 #include "GraphicsPoint.h"
00011 #include "GraphicsPointFactory.h"
00012 #include "PointStyle.h"
00013 #include <QColor>
00014 #include <QGraphicsScene>
00015 #include <QPointF>
00016 #include <QPolygonF>
00017
00018 GraphicsPointFactory::GraphicsPointFactory()
00019 {
00020 }
00021
00022 GraphicsPoint *GraphicsPointFactory::createPoint (QGraphicsScene &scene,
00023 const QString &identifier,
00024 const QPointF &posScreen,
00025 const PointStyle &pointStyle)
00026 {
00027 GraphicsPoint *item = 0;
00028
00029 switch (pointStyle.shape ())
00030 {
00031 case POINT_SHAPE_CIRCLE:
00032 {
00033 item = new GraphicsPoint (scene,
00034 identifier,
00035 posScreen,
00036 ColorPaletteToQColor (pointStyle.paletteColor ()),
00037 pointStyle.radius (),
00038 pointStyle.lineWidth());
00039 }
00040 break;
00041
00042 default:
00043 {
00044 item = new GraphicsPoint (scene,
00045 identifier,
00046 posScreen,
00047 ColorPaletteToQColor (pointStyle.paletteColor ()),
00048 pointStyle.polygon (),
00049 pointStyle.lineWidth());
00050 }
00051 break;
00052 }
00053
00054 return item;
00055 }