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