]> Shamusworld >> Repos - architektonas/blob - src/actions/actionselectinvert.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actionselectinvert.cpp
1 // actionselectinvert.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 "actionselectinvert.h"
16
17 #include "rs_dialogfactory.h"
18 #include "rs_selection.h"
19
20 ActionSelectInvert::ActionSelectInvert(RS_EntityContainer & container,
21         GraphicView & graphicView): ActionInterface("Invert Selection",
22                 container, graphicView)
23 {
24 }
25
26 ActionSelectInvert::~ActionSelectInvert()
27 {
28 }
29
30 /*virtual*/ RS2::ActionType ActionSelectInvert::rtti()
31 {
32         return RS2::ActionSelectInvert;
33 }
34
35 void ActionSelectInvert::init(int status)
36 {
37         ActionInterface::init(status);
38         trigger();
39         finish();
40 }
41
42 void ActionSelectInvert::trigger()
43 {
44         RS_Selection s(*container, graphicView);
45         s.invertSelection();
46
47         RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
48 }