+#endif
+
+ // Snap point (need to make sure the brush is NULL!)
+// painter->setPen(Pen(Color(0, 127, 255), RS2::Width00, RS2::DashLine));
+ painter->setPen(Pen(Color(255, 127, 0), RS2::Width00, RS2::DashLine));
+ painter->drawCircle(toGui(snapCoord), 4);
+
+ // Crosshairs
+ if (showCrosshairs)
+ {
+ painter->setPen(Pen(Color(0, 255, 255), RS2::Width00, RS2::DashLine));
+ painter->drawLine(Vector(0, toGuiY(snapCoord.y)),
+ Vector(getWidth(), toGuiY(snapCoord.y)));
+ painter->drawLine(Vector(toGuiX(snapCoord.x), 0),
+ Vector(toGuiX(snapCoord.x), getHeight()));
+ }
+
+ // Cursor
+ if (snapCoord != snapSpot)
+ {
+ painter->drawLine(toGui(snapSpot) + Vector(-5, 0), toGui(snapSpot) + Vector(-1, 4));
+ painter->drawLine(toGui(snapSpot) + Vector(0, 5), toGui(snapSpot) + Vector(4, 1));
+ painter->drawLine(toGui(snapSpot) + Vector(5, 0), toGui(snapSpot) + Vector(1, -4));
+ painter->drawLine(toGui(snapSpot) + Vector(0, -5), toGui(snapSpot) + Vector(-4, -1));
+ }
+}
+
+void GraphicView::SetSnapperVisible(bool visibility/*= true*/)
+{
+ snapperVisible = visibility;
+}
+
+bool GraphicView::SnapperVisible(void)
+{
+ return snapperVisible;
+}
+
+#if 0
+/*
+only place this is called is in ActionInterface. And its only function is to
+have it not drawn anymore. But, the GraphicView seems to draw it anyway... So
+some other approach is needed...
+*/
+void Snapper::finish()
+{
+ finished = true;
+}
+
+/**
+ * @return Pointer to the entity which was the key entity for the last
+ * successful snapping action. If the snap mode is "end point" the key entity
+ * is the entity whose end point was caught. If the snap mode didn't require an
+ * entity (e.g. free, grid) this method will return NULL.
+ */
+Entity * Snapper::getKeyEntity()
+{
+ return keyEntity;
+}
+
+/** Sets a new snap mode. */
+void Snapper::setSnapMode(RS2::SnapMode snapMode)
+{
+ this->snapMode = snapMode;
+}
+
+/** Sets a new snap restriction. */
+void Snapper::setSnapRestriction(RS2::SnapRestriction snapRes)
+{
+ this->snapRes = snapRes;
+}
+
+RS2::SnapMode Snapper::getSnapMode(void)
+{
+ return snapMode;
+}
+
+RS2::SnapRestriction Snapper::getSnapRestriction(void)
+{
+ return snapRes;
+}
+
+/**
+ * Sets the snap range in pixels for catchEntity().
+ *
+ * @see catchEntity()
+ */
+void Snapper::setSnapRange(int r)
+{
+ snapRange = r;
+}
+
+#if 0
+I think that these suspend() & resume() functions are not used anymore...
+#endif
+/**
+ * Suspends this snapper while another action takes place.
+ */
+/*virtual*/ void Snapper::suspend()
+{
+#warning "!!! This may need to have SetVisibility() called !!!"
+// deleteSnapper();
+ snapSpot = snapCoord = Vector(false);
+}
+
+/**
+ * Resumes this snapper after it has been suspended.
+ */
+/*virtual*/ void Snapper::resume()
+{
+#warning "!!! This may need to have SetVisibility() called !!!"
+// drawSnapper();
+}
+
+/**
+ * Hides the snapper options.
+ */
+/*virtual*/ void Snapper::hideOptions()
+{
+ if (snapMode == RS2::SnapDist && DIALOGFACTORY)
+ DIALOGFACTORY->requestSnapDistOptions(distance, false);
+}
+
+/**
+ * Shows the snapper options.
+ */
+/*virtual*/ void Snapper::showOptions()
+{
+ if (snapMode == RS2::SnapDist && DIALOGFACTORY)
+ DIALOGFACTORY->requestSnapDistOptions(distance, true);
+}
+#endif