void TutorialStateChecklistWizardAbstract::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateChecklistWizardAbstract::begin ()";

  m_title = createTitle ("Checklist Wizard and Checklist Guide");
  m_background = createPixmapItem (":/engauge/img/panel_checklist.png",
                                   QPoint (0, 30));
  m_text0 = createTextItem ("For new Engauge users, a Checklist Wizard\n"
                            "is available when importing an image file.\n"
                            "This wizard produces a helpful checklist of\n"
                            "steps to follow to digitize the image file.",
                            QPoint (260, 30));
  m_text1 = createTextItem ("Step 1 - Enable the menu option Help /\n"
                            "Checklist Guide Wizard.",
                            QPoint (285, 125));
  m_text2 = createTextItem ("Step 2 - Import the file using File /\n"
                            "Import. The Checklist Wizard will appear\n"
                            "and ask some simple questions to\n"
                            "determine how the image can be\n"
                            "digitized.",
                            QPoint (285, 175));
  m_text3 = createTextItem ("Additional options are available in\n"
                            "the various Settings menus.\n\n"
                            "This ends the tutorial. Good luck!",
                            QPoint (285, 270));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_previous = new TutorialButton ("Previous",
                                   context().tutorialDlg().scene());
  m_previous->setGeometry (QPoint (buttonMargin (),
                                   backgroundSize.height () - buttonMargin() - m_previous->size().height()));
}
void TutorialStateIntroduction::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateIntroduction::begin ()";

  m_title = createTitle (tr ("Introduction"));
  m_background = createPixmapItem (":/engauge/img/SpreadsheetsForDoc.png",
                                   QPoint (0, 0));
  m_text0 = createTextItem (tr ("Engauge Digitizer starts with\n"
                                "images of graphs and maps."),
                            QPoint (200, 40));
  m_text1 = createTextItem (tr ("You create (or digitize) points along\n"
                                "the graph and map curves."),
                            QPoint (240, 180));
  m_text2 = createTextItem (tr ("The digitized curve points can be\n"
                                "exported, as numbers, to other software tools."),
                            QPoint (210, 330));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_next = new TutorialButton (tr ("Next"),
                               context().tutorialDlg().scene());
  m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
                               backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
  connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
}
void TutorialStateCurveSelection::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::begin ()";

  m_title = createTitle ("Curve Selection");
  m_background = createPixmapItem (":/engauge/img/panel_curve_selection.png",
                                   QPoint (0, 30));
  m_text0 = createTextItem ("After the axis points have been created, a\n"
                            "curve is selected to receive curve points.\n"
                            "Step 1 - click on Curve, Point Match, Color\n"
                            "Picker or Segment Fill buttons.",
                            QPoint (250, 40));
  m_text1 = createTextItem ("Step 2 - Select the desired curve name. If\n"
                            "that curve name has not been created yet,\n"
                            "use the menu option Settings / Curve Names\n"
                            "to create it.",
                            QPoint (250, 120));
  m_text2 = createTextItem ("Step 3 - Change the background from the\n"
                            "original image to the filtered image\n"
                            "produced for the current curve, using the\n"
                            "menu option View / Background / Filtered\n"
                            "Image. This filtering enables the powerful\n"
                            "automated algorithms discussed later in\n"
                            "the tutorial.",
                            QPoint (250, 200));
  m_text3 = createTextItem ("If the current curve is no longer visible\n"
                            "in the filtered image, then change the\n"
                            "current Color Filter settings. In the figure,\n"
                            "the orange points have disappeared.",
                            QPoint (250, 330));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_previous = new TutorialButton ("Previous",
                                   context().tutorialDlg().scene());
  m_previous->setGeometry (QPoint (buttonMargin (),
                                   backgroundSize.height() - buttonMargin() - m_previous->size().height()));
  connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));

  m_colorFilter = new TutorialButton ("Color Filter Settings",
                                      context().tutorialDlg().scene());
  m_colorFilter->setGeometry (QPoint (backgroundSize.width () / 2.0 - m_colorFilter->size ().width () / 2,
                                      backgroundSize.height () - buttonMargin () - m_colorFilter->size ().height ()));
  connect (m_colorFilter, SIGNAL (signalTriggered ()), this, SLOT (slotColorFilter ()));

  m_next = new TutorialButton ("Next",
                               context().tutorialDlg().scene());
  m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
                               backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
  connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
}
Ejemplo n.º 4
0
void QgsMapToolRotatePointSymbols::canvasPressOnFeature( QgsMapMouseEvent *e, const QgsFeature &feature, const QgsPointXY &snappedPoint )
{
  //find out initial arrow direction
  QVariant attrVal = feature.attribute( mCurrentRotationAttributes.toList().at( 0 ) );

  mCurrentRotationFeature = attrVal.toDouble();
  createPixmapItem( mMarkerSymbol.get() );
  if ( mRotationItem )
  {
    mRotationItem->setPointLocation( snappedPoint );
  }
  mCurrentMouseAzimut = calculateAzimut( e->pos() );
  setPixmapItemRotation( ( int )( mCurrentMouseAzimut ) );
  mRotating = true;
}
void TutorialStateColorFilter::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateColorFilter::begin ()";

  m_title = createTitle (tr ("Color Filter"));
  m_background = createPixmapItem (":/engauge/img/panel_color_filter.png",
                                   QPoint (0, 30));
  m_text0 = createTextItem (tr ("Each curve has Color Filter settings that\n"
                                "are applied in Segment Fill mode. For\n"
                                "black lines the defaults work well, but for\n"
                                "colored lines the settings can be improved."),
                            QPoint (260, 30));
  m_text1 = createTextItem (tr ("Step 1 - Select the Settings / Color\n"
                                "Filter menu option."),
                            QPoint (285, 115));
  m_text2 = createTextItem (tr ("Step 2 - Select the curve that will\n"
                                "be given the new settings."),
                            QPoint (285, 165));
  m_text3 = createTextItem (tr ("Step 3 - Select the mode. Intensity is\n"
                                "suggested for uncolored lines, and Hue\n"
                                "is suggested for colored lines."),
                            QPoint (285, 210));
  m_text4 = createTextItem (tr ("Step 4 - Adjust the included range by\n"
                                "dragging the green handles, until the\n"
                                "curve is clear in the preview window\n"
                                "below. The graph shows a histogram\n"
                                "distribution of the values underneath.\n"
                                "Click Ok when finished."),
                            QPoint (285, 280));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_back = new TutorialButton (tr ("Back"),
                               context().tutorialDlg().scene());
  m_back->setGeometry (QPoint (backgroundSize.width () / 2 - m_back->size().width () / 2,
                               backgroundSize.height() - buttonMargin() - m_back->size().height()));
  connect (m_back, SIGNAL (signalTriggered ()), this, SLOT (slotBack ()));
}
void TutorialStateAxisPoints::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::begin ()";

  m_title = createTitle (tr ("Axis Points"));
  m_background = createPixmapItem (":/engauge/img/panel_axis_points.png",
                                   QPoint (0, 30));
  m_text0 = createTextItem (tr ("Axis points are first defined to\n"
                                "define the coordinates. Step 1 -\n"
                                "Click on the Axis Points button"),
                            QPoint (320, 60));
  m_text1 = createTextItem (tr ("Step 2 - Click on an axis or grid\n"
                                "line with known coordinates. An axis\n"
                                "point appears, with a dialog window\n"
                                "for entering the axis point's\n"
                                "coordinates"),
                            QPoint (300, 210));
  m_text2 = createTextItem (tr ("Step 3 - Enter the two coordinates\n"
                                "of the axis point and then click Ok.\n"
                                "Repeat steps 2 and 3 twice more\n"
                                "until three axis points are created"),
                            QPoint (280, 320));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_previous = new TutorialButton (tr ("Previous"),
                                   context().tutorialDlg().scene());
  m_previous->setGeometry (QPoint (buttonMargin (),
                                   backgroundSize.height() - buttonMargin() - m_previous->size().height()));
  connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));

  m_next = new TutorialButton (tr ("Next"),
                               context().tutorialDlg().scene());
  m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
                               backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
  connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
}
void QgsMapToolRotatePointSymbols::canvasPressEvent( QMouseEvent *e )
{
  if ( !mCanvas )
  {
    return;
  }

  mActiveLayer = currentVectorLayer();
  if ( !mActiveLayer )
  {
    notifyNotVectorLayer();
    return;
  }

  if ( !mActiveLayer->isEditable() )
  {
    notifyNotEditableLayer();
    return;
  }

  if ( mActiveLayer->geometryType() != QGis::Point )
  {
    return;
  }

  //find the closest feature to the pressed position
  QgsMapCanvasSnapper canvasSnapper( mCanvas );
  QList<QgsSnappingResult> snapResults;
  if ( canvasSnapper.snapToCurrentLayer( e->pos(), snapResults, QgsSnapper::SnapToVertex, -1 ) != 0 || snapResults.size() < 1 )
  {
    QMessageBox::critical( 0, tr( "No point feature" ), tr( "No point feature was detected at the clicked position. Please click closer to the feature or enhance the search tolerance under Settings->Options->Digitizing->Serch radius for vertex edits" ) );
    return; //error during snapping
  }

  mFeatureNumber = snapResults.at( 0 ).snappedAtGeometry;

  //get list with renderer rotation attributes
  if ( layerRotationAttributes( mActiveLayer, mCurrentRotationAttributes ) != 0 )
  {
    return;
  }

  if ( mCurrentRotationAttributes.size() < 1 )
  {
    QMessageBox::critical( 0, tr( "No rotation Attributes" ), tr( "The active point layer does not have a rotation attribute" ) );
    return;
  }

  mSnappedPoint = toCanvasCoordinates( snapResults.at( 0 ).snappedVertex );

  //find out initial arrow direction
  QgsFeature pointFeature;
  if ( !mActiveLayer->featureAtId( mFeatureNumber, pointFeature, false, true ) )
  {
    return;
  }
  const QgsAttributeMap pointFeatureAttributes = pointFeature.attributeMap();
  const QgsAttributeMap::const_iterator attIt = pointFeatureAttributes.find( mCurrentRotationAttributes.at( 0 ) );
  if ( attIt == pointFeatureAttributes.constEnd() )
  {
    return;
  }

  mCurrentRotationFeature = attIt.value().toDouble();
  createPixmapItem( pointFeature );
  if ( mRotationItem )
  {
    mRotationItem->setPointLocation( snapResults.at( 0 ).snappedVertex );
  }
  mCurrentMouseAzimut = calculateAzimut( e->pos() );
  setPixmapItemRotation(( int )( mCurrentMouseAzimut ) );
  mRotating = true;
}