]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionblockstoggleview.cpp
3b8c84d459dfdfc06e4c23a2430cd281ef4acffc
[architektonas] / src / actions / rs_actionblockstoggleview.cpp
1 // rs_actionblockstoggleview.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/03/2010  Added this text. :-)
13 //
14
15 #include "rs_actionblockstoggleview.h"
16
17 #include "drawing.h"
18 #include "graphicview.h"
19
20 RS_ActionBlocksToggleView::RS_ActionBlocksToggleView(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Toggle Block Visibility",
21                 container, graphicView)
22 {
23 }
24
25 RS_ActionBlocksToggleView::~RS_ActionBlocksToggleView()
26 {
27 }
28
29 void RS_ActionBlocksToggleView::trigger()
30 {
31         RS_DEBUG->print("toggle block");
32
33         if (graphic != NULL)
34         {
35                 RS_Block * block = graphic->getActiveBlock();
36                 graphic->toggleBlock(block);
37         }
38
39         graphicView->redraw();
40         finish();
41 }
42
43 void RS_ActionBlocksToggleView::init(int status)
44 {
45         RS_ActionInterface::init(status);
46         trigger();
47 }
48