]> Shamusworld >> Repos - architektonas/blob - src/actions/actionsetsnaprestriction.cpp
878942447d3807534776ad0a7f1050f08794b775
[architektonas] / src / actions / actionsetsnaprestriction.cpp
1 // actionsetsnaprestriction.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 "actionsetsnaprestriction.h"
16
17 #include "graphicview.h"
18
19 /**
20  * Constructor.
21  *
22  * @param snapRes The new snap mode used from now on.
23  * @param set true: set additional snap mode / false: unset
24  */
25 ActionSetSnapRestriction::ActionSetSnapRestriction(
26         RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapRestriction snapRes):
27         ActionInterface("Set Additional Snap Mode", container, graphicView)
28 {
29         this->snapRes = snapRes;
30 }
31
32 ActionSetSnapRestriction::~ActionSetSnapRestriction()
33 {
34 }
35
36 void ActionSetSnapRestriction::trigger()
37 {
38         graphicView->setSnapRestriction(snapRes);
39         finish();
40 }
41
42 void ActionSetSnapRestriction::init(int status)
43 {
44         ActionInterface::init(status);
45         trigger();
46 }