]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionsetsnapmode.cpp
Last checkin before major refactor...
[architektonas] / src / actions / rs_actionsetsnapmode.cpp
1 // rs_actionsetsnapmode.cpp
2 //
3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // (C) 2010 Underground Software
7 //
8 // JLH = James L. Hammons <jlhamm@acm.org>
9 //
10 // Who  When        What
11 // ---  ----------  -----------------------------------------------------------
12 // JLH  06/05/2010  Added this text. :-)
13 //
14
15 #include "rs_actionsetsnapmode.h"
16
17 #include "graphicview.h"
18
19 /**
20  * Constructor.
21  *
22  * @param snapMode The new snap mode used from now on.
23  */
24 RS_ActionSetSnapMode::RS_ActionSetSnapMode(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapMode snapMode):
25         RS_ActionInterface("Set Snap Mode", container, graphicView)
26 {
27         this->snapMode = snapMode;
28 }
29
30 RS_ActionSetSnapMode::~RS_ActionSetSnapMode()
31 {
32 }
33
34 void RS_ActionSetSnapMode::trigger()
35 {
36         graphicView->setDefaultSnapMode(snapMode);
37         finish();
38 }
39
40 void RS_ActionSetSnapMode::init(int status)
41 {
42         RS_ActionInterface::init(status);
43         trigger();
44 }