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