ActionInterface("Default", container, graphicView)
{
DEBUG->print("ActionDefault::ActionDefault");
- //hm.
-// graphicView.snapper.SetVisible();
-// graphicView.preview.SetVisible();
DEBUG->print("ActionDefault::ActionDefault: OK");
}
ActionInterface::init(status);
v1 = v2 = Vector(false);
- graphicView->snapper.setSnapMode(RS2::SnapFree);
- graphicView->snapper.setSnapRestriction(RS2::RestrictNothing);
+// graphicView->snapper.setSnapMode(RS2::SnapFree);
+// graphicView->snapper.setSnapRestriction(RS2::RestrictNothing);
+ graphicView->setDefaultSnapMode(RS2::SnapFree);
+ graphicView->setSnapRestriction(RS2::RestrictNothing);
restrBak = RS2::RestrictNothing;
DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
{
if (e->key() == Qt::Key_Shift)
{
- restrBak = graphicView->snapper.getSnapRestriction();
- graphicView->snapper.setSnapRestriction(RS2::RestrictOrthogonal);
+// restrBak = graphicView->snapper.getSnapRestriction();
+// graphicView->snapper.setSnapRestriction(RS2::RestrictOrthogonal);
+ restrBak = graphicView->getSnapRestriction();
+ graphicView->setSnapRestriction(RS2::RestrictOrthogonal);
}
}
void ActionDefault::keyReleaseEvent(QKeyEvent * e)
{
if (e->key() == Qt::Key_Shift)
- graphicView->snapper.setSnapRestriction(restrBak);
+// graphicView->snapper.setSnapRestriction(restrBak);
+ graphicView->setSnapRestriction(restrBak);
}
void ActionDefault::mouseMoveEvent(QMouseEvent * e)
{
Vector mouse = graphicView->toGraph(Vector(e->x(), e->y()));
Vector relMouse = mouse - graphicView->getRelativeZero();
-
DIALOGFACTORY->updateCoordinateWidget(mouse, relMouse);
switch (getStatus())
else
{
// test for an entity to drag:
- Entity * en = graphicView->snapper.catchEntity(v1);
+// Entity * en = graphicView->snapper.catchEntity(v1);
+ Entity * en = graphicView->CatchEntity(v1);
if (en && en->isSelected())
{
graphicView->preview.clear();
graphicView->preview.addSelectionFrom(*container);
graphicView->preview.moveRef(v1, v2 -v1);
- graphicView->snapper.SetVisible();
+// graphicView->snapper.SetVisible();
+ graphicView->SetSnapperVisible();
graphicView->preview.SetVisible();
graphicView->redraw();
break;
graphicView->preview.clear();
graphicView->preview.addSelectionFrom(*container);
graphicView->preview.move(v2 -v1);
- graphicView->snapper.SetVisible();
+// graphicView->snapper.SetVisible();
+ graphicView->SetSnapperVisible();
graphicView->preview.SetVisible();
graphicView->redraw();
break;
DIALOGFACTORY->updateSelectionWidget(container->countSelected());
DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
}
- break;
+ break;
case MovingRef:
{
DIALOGFACTORY->updateSelectionWidget(container->countSelected());
DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
}
- break;
+ break;
default:
break;
case Dragging:
{
// select single entity:
- Entity * en = graphicView->snapper.catchEntity(e);
+// Entity * en = graphicView->snapper.catchEntity(e);
+ Entity * en = graphicView->CatchEntity(e);
if (en)
{
Selection s(*container, graphicView);
s.selectSingle(en);
-
DIALOGFACTORY->updateSelectionWidget(container->countSelected());
-
e->accept();
setStatus(Neutral);
}
default:
// Was either moving entity or point, so clear that shiatsu
- graphicView->snapper.SetVisible(false);
+// graphicView->snapper.SetVisible(false);
+ graphicView->SetSnapperVisible(false);
graphicView->preview.SetVisible(false);
graphicView->redraw();
break;
break;
default:
- graphicView->snapper.SetVisible(false);
+// graphicView->snapper.SetVisible(false);
+ graphicView->SetSnapperVisible(false);
graphicView->preview.SetVisible(false);
DIALOGFACTORY->requestPreviousMenu();
e->accept();