示例#1
0
void DlgSettingsCurveProperties::drawPoints (const PointStyle &pointStyle)
{
  const QString NULL_IDENTIFIER;
  GeometryWindow *NULL_GEOMETRY_WINDOW = 0;

  GraphicsPointFactory pointFactory;

  // Left point
  GraphicsPoint *pointLeft = pointFactory.createPoint (*m_scenePreview,
                                                       NULL_IDENTIFIER,
                                                       POS_LEFT,
                                                       pointStyle,
                                                       NULL_GEOMETRY_WINDOW);
  pointLeft->setPointStyle (pointStyle);

  // Center point
  GraphicsPoint *pointCenter = pointFactory.createPoint (*m_scenePreview,
                                                         NULL_IDENTIFIER,
                                                         POS_CENTER,
                                                         pointStyle,
                                                         NULL_GEOMETRY_WINDOW);
  pointCenter->setPointStyle (pointStyle);

  // Right point
  GraphicsPoint *pointRight = pointFactory.createPoint (*m_scenePreview,
                                                        NULL_IDENTIFIER,
                                                        POS_RIGHT,
                                                        pointStyle,
                                                        NULL_GEOMETRY_WINDOW);
  pointRight->setPointStyle (pointStyle);
}
GraphicsPoint *GraphicsScene::createPoint (const QString &identifier,
                                           const PointStyle &pointStyle,
                                           const QPointF &posScreen)
{
  LOG4CPP_INFO_S ((*mainCat)) << "GraphicsScene::createPoint"
                              << " identifier=" << identifier.toLatin1().data();

  // Ordinal value is initially computed as one plus the max ordinal seen so far. This initial ordinal value will be overridden if the
  // cordinates determine the ordinal values.
  //
  // This is an N-squared algorithm and may be worth replacing later
  GraphicsPointFactory pointFactory;
  GraphicsPoint *point = pointFactory.createPoint (*this,
                                                   identifier,
                                                   posScreen,
                                                   pointStyle);

  point->setToolTip (identifier);
  point->setData (DATA_KEY_GRAPHICS_ITEM_TYPE, GRAPHICS_ITEM_TYPE_POINT);

  return point;
}