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 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 05/10/2010 Added this text. :-)
17 #include "actionhandler.h"
19 #include "commandevent.h"
21 #include "actionblocksadd.h"
22 #include "actionblocksattributes.h"
23 #include "actionblockscreate.h"
24 #include "actionblocksedit.h"
25 #include "actionblocksexplode.h"
26 #include "actionblocksfreezeall.h"
27 #include "actionblocksinsert.h"
28 #include "actionblocksremove.h"
29 #include "actionblockstoggleview.h"
30 #include "actiondimaligned.h"
31 #include "actiondimangular.h"
32 #include "actiondimdiametric.h"
33 #include "actiondimleader.h"
34 #include "actiondimlinear.h"
35 #include "actiondimradial.h"
36 #include "actiondrawarc.h"
37 #include "actiondrawarc3p.h"
38 #include "actiondrawarctangential.h"
39 #include "actiondrawcircle.h"
40 #include "actiondrawcircle2p.h"
41 #include "actiondrawcircle3p.h"
42 #include "actiondrawcirclecr.h"
43 #include "actiondrawellipseaxis.h"
44 #include "actiondrawhatch.h"
45 #include "actiondrawimage.h"
46 #include "actiondrawline.h"
47 #include "actiondrawlineangle.h"
48 #include "actiondrawlinebisector.h"
49 #include "actiondrawlinefree.h"
50 #include "actiondrawlinehorvert.h"
51 #include "actiondrawlineparallel.h"
52 #include "actiondrawlineparallelthrough.h"
53 #include "actiondrawlinepolygon.h"
54 #include "actiondrawlinepolygon2.h"
55 #include "actiondrawlinerectangle.h"
56 #include "actiondrawlinerelangle.h"
57 #include "actiondrawlinetangent1.h"
58 #include "actiondrawlinetangent2.h"
59 #include "actiondrawpoint.h"
60 #include "actiondrawpolyline.h"
61 #include "actiondrawspline.h"
62 #include "actiondrawtext.h"
63 #include "actioneditcopy.h"
64 #include "actioneditpaste.h"
65 #include "actioneditundo.h"
66 #include "actionfileopen.h"
67 #include "actionfilesaveas.h"
68 #include "actioninfoangle.h"
69 #include "actioninfoarea.h"
70 #include "actioninfodist.h"
71 #include "actioninfodist2.h"
72 #include "actioninfoinside.h"
73 #include "actioninfototallength.h"
74 #include "actioninterface.h"
75 #include "actionlayersadd.h"
76 #include "actionlayersedit.h"
77 #include "actionlayersfreezeall.h"
78 #include "actionlayersremove.h"
79 #include "actionlayerstogglelock.h"
80 #include "actionlayerstoggleview.h"
81 #include "actionlibraryinsert.h"
82 #include "actionlockrelativezero.h"
83 #include "actionmodifyattributes.h"
84 #include "actionmodifybevel.h"
85 #include "actionmodifycut.h"
86 #include "actionmodifydelete.h"
87 #include "actionmodifydeletefree.h"
88 #include "actionmodifydeletequick.h"
89 #include "actionmodifyentity.h"
90 #include "actionmodifyexplodetext.h"
91 #include "actionmodifymirror.h"
92 #include "actionmodifymove.h"
93 #include "actionmodifymoverotate.h"
94 #include "actionmodifyrotate.h"
95 #include "actionmodifyrotate2.h"
96 #include "actionmodifyround.h"
97 #include "actionmodifyscale.h"
98 #include "actionmodifystretch.h"
99 #include "actionmodifytrim.h"
100 #include "actionmodifytrimamount.h"
101 #include "actionoptionsdrawing.h"
102 #include "actionpolylineadd.h"
103 #include "actionpolylineappend.h"
104 #include "actionpolylinedel.h"
105 #include "actionpolylinedelbetween.h"
106 #include "actionpolylinetrim.h"
107 #include "actionselect.h"
108 #include "actionselectall.h"
109 #include "actionselectcontour.h"
110 #include "actionselectintersected.h"
111 #include "actionselectinvert.h"
112 #include "actionselectlayer.h"
113 #include "actionselectsingle.h"
114 #include "actionselectwindow.h"
115 #include "actionsetrelativezero.h"
116 #include "actionsetsnapmode.h"
117 #include "actionsetsnaprestriction.h"
118 #include "actionsnapintersectionmanual.h"
119 #include "actionzoomauto.h"
120 #include "actionzoomin.h"
121 #include "actionzoompan.h"
122 #include "actionzoomprevious.h"
123 #include "actionzoomredraw.h"
124 #include "actionzoomwindow.h"
127 #include "actioncamexportauto.h"
128 #include "actioncamreorder.h"
131 #include "qg_mainwindowinterface.h"
132 #include "cadtoolbarsnap.h"
137 ActionHandler::ActionHandler(QG_MainWindowInterface * mw)
139 DEBUG->print("ActionHandler::ActionHandler");
150 restrictNothing = NULL;
151 restrictOrthogonal = NULL;
152 restrictHorizontal = NULL;
153 restrictVertical = NULL;
155 lockRelativeZero = NULL;
156 DEBUG->print("ActionHandler::ActionHandler: OK");
162 ActionHandler::~ActionHandler()
164 DEBUG->print("ActionHandler::~ActionHandler");
165 DEBUG->print("ActionHandler::~ActionHandler: OK");
169 * Kills all running selection actions. Called when a selection action
170 * is launched to reduce confusion.
172 void ActionHandler::killSelectActions()
174 GraphicView * gv = mainWindow->getGraphicView();
177 gv->killSelectActions();
181 * @return Current action or NULL.
183 ActionInterface * ActionHandler::getCurrentAction()
185 GraphicView * gv = mainWindow->getGraphicView();
188 return gv->getCurrentAction();
194 Instead of the following giant switch statement, you could something like the following:
195 ActionInterface * ActionHandler::setCurrentAction(ActionInterface * action)
197 GraphicView * gv = mainWindow->getGraphicView();
198 Document * doc = mainWindow->getDocument();
200 // only global options are allowed without a document:
201 if (gv == NULL || doc == NULL)
207 gv->setCurrentAction(action);
211 Then you'd call it with:
212 a = new ActionEditUndo(true, *doc, *gv);
214 Hmmm.... We need gv & doc *before* we call this...
216 What you'd do then is have the form of the thing worked ahead of time and the function
217 itself would create the gv & doc. So for the EditUndo, we'd have:
218 FunctionCreateAction(bool);
219 FunctionCreateAction(void);
221 Well... The problem is the action, they're all different...
225 * Sets current action.
227 * @return Pointer to the created action or NULL.
229 ActionInterface * ActionHandler::setCurrentAction(RS2::ActionType id)
231 DEBUG->print("ActionHandler::setCurrentAction()");
233 GraphicView * gv = mainWindow->getGraphicView();
234 Document * doc = mainWindow->getDocument();
235 ActionInterface * a = NULL;
237 // only global options are allowed without a document:
238 if (gv == NULL || doc == NULL)
240 DEBUG->print(Debug::D_WARNING,
241 "ActionHandler::setCurrentAction: graphic view or document is NULL");
247 //case RS2::ActionFileNew:
248 // a = new ActionFileNew(*doc, *gv);
250 //case RS2::ActionFileSave:
251 // a = new ActionFileSave(*doc, *gv);
253 //case RS2::ActionFileClose:
254 // //a = new ActionFileClose(*doc, *gv);
256 //case RS2::ActionFileQuit:
257 // //a = new ActionFileQuit(*doc, *gv);
259 case RS2::ActionFileOpen:
260 a = new ActionFileOpen(*doc, *gv);
262 case RS2::ActionFileSaveAs:
263 a = new ActionFileSaveAs(*doc, *gv);
268 case RS2::ActionEditUndo:
269 a = new ActionEditUndo(true, *doc, *gv);
271 case RS2::ActionEditRedo:
272 a = new ActionEditUndo(false, *doc, *gv);
274 case RS2::ActionEditCut:
275 a = new ActionSelect(*doc, *gv, RS2::ActionEditCutNoSelect);
277 case RS2::ActionEditCutNoSelect:
278 a = new ActionEditCopy(false, *doc, *gv);
280 case RS2::ActionEditCopy:
281 a = new ActionSelect(*doc, *gv, RS2::ActionEditCopyNoSelect);
283 case RS2::ActionEditCopyNoSelect:
284 a = new ActionEditCopy(true, *doc, *gv);
286 case RS2::ActionEditPaste:
287 a = new ActionEditPaste(*doc, *gv);
290 // Selecting actions:
292 case RS2::ActionSelectSingle:
293 gv->killSelectActions();
294 a = new ActionSelectSingle(*doc, *gv);
296 case RS2::ActionSelectContour:
297 gv->killSelectActions();
298 a = new ActionSelectContour(*doc, *gv);
300 case RS2::ActionSelectAll:
301 a = new ActionSelectAll(*doc, *gv, true);
303 case RS2::ActionDeselectAll:
304 a = new ActionSelectAll(*doc, *gv, false);
306 case RS2::ActionSelectWindow:
307 gv->killSelectActions();
308 a = new ActionSelectWindow(*doc, *gv, true);
310 case RS2::ActionDeselectWindow:
311 gv->killSelectActions();
312 a = new ActionSelectWindow(*doc, *gv, false);
314 case RS2::ActionSelectInvert:
315 a = new ActionSelectInvert(*doc, *gv);
317 case RS2::ActionSelectIntersected:
318 gv->killSelectActions();
319 a = new ActionSelectIntersected(*doc, *gv, true);
321 case RS2::ActionDeselectIntersected:
322 gv->killSelectActions();
323 a = new ActionSelectIntersected(*doc, *gv, false);
325 case RS2::ActionSelectLayer:
326 gv->killSelectActions();
327 a = new ActionSelectLayer(*doc, *gv);
332 case RS2::ActionZoomIn:
333 a = new ActionZoomIn(*doc, *gv, RS2::In, RS2::Both);
335 case RS2::ActionZoomOut:
336 a = new ActionZoomIn(*doc, *gv, RS2::Out, RS2::Both);
338 case RS2::ActionZoomAuto:
339 a = new ActionZoomAuto(*doc, *gv);
341 case RS2::ActionZoomWindow:
342 a = new ActionZoomWindow(*doc, *gv);
344 case RS2::ActionZoomPan:
345 a = new ActionZoomPan(*doc, *gv);
347 case RS2::ActionZoomPrevious:
348 a = new ActionZoomPrevious(*doc, *gv);
350 case RS2::ActionZoomRedraw:
351 a = new ActionZoomRedraw(*doc, *gv);
356 case RS2::ActionDrawPoint:
357 a = new ActionDrawPoint(*doc, *gv);
359 case RS2::ActionDrawLine:
360 a = new ActionDrawLine(*doc, *gv);
362 case RS2::ActionDrawLineAngle:
363 a = new ActionDrawLineAngle(*doc, *gv, 0.0, false);
365 case RS2::ActionDrawLineHorizontal:
366 a = new ActionDrawLineAngle(*doc, *gv, 0.0, true);
368 case RS2::ActionDrawLineHorVert:
369 a = new ActionDrawLineHorVert(*doc, *gv);
371 case RS2::ActionDrawLineVertical:
372 a = new ActionDrawLineAngle(*doc, *gv, M_PI / 2.0, true);
374 case RS2::ActionDrawLineFree:
375 a = new ActionDrawLineFree(*doc, *gv);
377 case RS2::ActionDrawLineParallel:
378 a = new ActionDrawLineParallel(*doc, *gv);
380 case RS2::ActionDrawLineParallelThrough:
381 a = new ActionDrawLineParallelThrough(*doc, *gv);
383 case RS2::ActionDrawLineRectangle:
384 a = new ActionDrawLineRectangle(*doc, *gv);
386 case RS2::ActionDrawLineBisector:
387 a = new ActionDrawLineBisector(*doc, *gv);
389 case RS2::ActionDrawLineTangent1:
390 a = new ActionDrawLineTangent1(*doc, *gv);
392 case RS2::ActionDrawLineTangent2:
393 a = new ActionDrawLineTangent2(*doc, *gv);
395 case RS2::ActionDrawLineOrthogonal:
396 a = new ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, true);
398 case RS2::ActionDrawLineRelAngle:
399 a = new ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, false);
401 case RS2::ActionDrawPolyline:
402 a = new ActionDrawPolyline(*doc, *gv);
404 case RS2::ActionPolylineAdd:
405 a = new ActionPolylineAdd(*doc, *gv);
407 case RS2::ActionPolylineAppend:
408 a = new ActionPolylineAppend(*doc, *gv);
410 case RS2::ActionPolylineDel:
411 a = new ActionPolylineDel(*doc, *gv);
413 case RS2::ActionPolylineDelBetween:
414 a = new ActionPolylineDelBetween(*doc, *gv);
416 case RS2::ActionPolylineTrim:
417 a = new ActionPolylineTrim(*doc, *gv);
419 case RS2::ActionDrawLinePolygon:
420 a = new ActionDrawLinePolygon(*doc, *gv);
422 case RS2::ActionDrawLinePolygon2:
423 a = new ActionDrawLinePolygon2(*doc, *gv);
425 case RS2::ActionDrawCircle:
426 a = new ActionDrawCircle(*doc, *gv);
428 case RS2::ActionDrawCircleCR:
429 a = new ActionDrawCircleCR(*doc, *gv);
431 case RS2::ActionDrawCircle2P:
432 a = new ActionDrawCircle2P(*doc, *gv);
434 case RS2::ActionDrawCircle3P:
435 a = new ActionDrawCircle3P(*doc, *gv);
437 case RS2::ActionDrawCircleParallel:
438 a = new ActionDrawLineParallel(*doc, *gv);
440 case RS2::ActionDrawArc:
441 a = new ActionDrawArc(*doc, *gv);
443 case RS2::ActionDrawArc3P:
444 a = new ActionDrawArc3P(*doc, *gv);
446 case RS2::ActionDrawArcParallel:
447 a = new ActionDrawLineParallel(*doc, *gv);
449 case RS2::ActionDrawArcTangential:
450 a = new ActionDrawArcTangential(*doc, *gv);
452 case RS2::ActionDrawEllipseAxis:
453 a = new ActionDrawEllipseAxis(*doc, *gv, false);
455 case RS2::ActionDrawEllipseArcAxis:
456 a = new ActionDrawEllipseAxis(*doc, *gv, true);
458 case RS2::ActionDrawSpline:
459 a = new ActionDrawSpline(*doc, *gv);
461 case RS2::ActionDrawText:
462 a = new ActionDrawText(*doc, *gv);
464 case RS2::ActionDrawHatch:
465 a = new ActionSelect(*doc, *gv, RS2::ActionDrawHatchNoSelect);
467 case RS2::ActionDrawHatchNoSelect:
468 a = new ActionDrawHatch(*doc, *gv);
470 case RS2::ActionDrawImage:
471 a = new ActionDrawImage(*doc, *gv);
474 // Dimensioning actions:
476 case RS2::ActionDimAligned:
477 a = new ActionDimAligned(*doc, *gv);
479 case RS2::ActionDimLinear:
480 a = new ActionDimLinear(*doc, *gv);
482 case RS2::ActionDimLinearHor:
483 a = new ActionDimLinear(*doc, *gv, 0.0, true);
485 case RS2::ActionDimLinearVer:
486 a = new ActionDimLinear(*doc, *gv, M_PI / 2.0, true);
488 case RS2::ActionDimRadial:
489 a = new ActionDimRadial(*doc, *gv);
491 case RS2::ActionDimDiametric:
492 a = new ActionDimDiametric(*doc, *gv);
494 case RS2::ActionDimAngular:
495 a = new ActionDimAngular(*doc, *gv);
497 case RS2::ActionDimLeader:
498 a = new ActionDimLeader(*doc, *gv);
501 // Modifying actions:
503 case RS2::ActionModifyAttributes:
504 a = new ActionSelect(*doc, *gv, RS2::ActionModifyAttributesNoSelect);
506 case RS2::ActionModifyAttributesNoSelect:
507 a = new ActionModifyAttributes(*doc, *gv);
509 case RS2::ActionModifyDelete:
510 a = new ActionSelect(*doc, *gv, RS2::ActionModifyDeleteNoSelect);
512 case RS2::ActionModifyDeleteNoSelect:
513 a = new ActionModifyDelete(*doc, *gv);
515 case RS2::ActionModifyDeleteQuick:
516 a = new ActionSelect(*doc, *gv, RS2::ActionModifyDeleteQuick);
518 case RS2::ActionModifyDeleteFree:
519 a = new ActionModifyDeleteFree(*doc, *gv);
521 case RS2::ActionModifyMove:
522 a = new ActionSelect(*doc, *gv, RS2::ActionModifyMoveNoSelect);
524 case RS2::ActionModifyMoveNoSelect:
525 a = new ActionModifyMove(*doc, *gv);
527 case RS2::ActionModifyRotate:
528 a = new ActionSelect(*doc, *gv, RS2::ActionModifyRotateNoSelect);
530 case RS2::ActionModifyRotateNoSelect:
531 a = new ActionModifyRotate(*doc, *gv);
533 case RS2::ActionModifyScale:
534 a = new ActionSelect(*doc, *gv, RS2::ActionModifyScaleNoSelect);
536 case RS2::ActionModifyScaleNoSelect:
537 a = new ActionModifyScale(*doc, *gv);
539 case RS2::ActionModifyMirror:
540 a = new ActionSelect(*doc, *gv, RS2::ActionModifyMirrorNoSelect);
542 case RS2::ActionModifyMirrorNoSelect:
543 a = new ActionModifyMirror(*doc, *gv);
545 case RS2::ActionModifyMoveRotate:
546 a = new ActionSelect(*doc, *gv, RS2::ActionModifyMoveRotateNoSelect);
548 case RS2::ActionModifyMoveRotateNoSelect:
549 a = new ActionModifyMoveRotate(*doc, *gv);
551 case RS2::ActionModifyRotate2:
552 a = new ActionSelect(*doc, *gv, RS2::ActionModifyRotate2NoSelect);
554 case RS2::ActionModifyRotate2NoSelect:
555 a = new ActionModifyRotate2(*doc, *gv);
557 case RS2::ActionModifyEntity:
558 a = new ActionModifyEntity(*doc, *gv);
560 case RS2::ActionModifyTrim:
561 a = new ActionModifyTrim(*doc, *gv, false);
563 case RS2::ActionModifyTrim2:
564 a = new ActionModifyTrim(*doc, *gv, true);
566 case RS2::ActionModifyTrimAmount:
567 a = new ActionModifyTrimAmount(*doc, *gv);
569 case RS2::ActionModifyCut:
570 a = new ActionModifyCut(*doc, *gv);
572 case RS2::ActionModifyStretch:
573 a = new ActionModifyStretch(*doc, *gv);
575 case RS2::ActionModifyBevel:
576 a = new ActionModifyBevel(*doc, *gv);
578 case RS2::ActionModifyRound:
579 a = new ActionModifyRound(*doc, *gv);
581 case RS2::ActionModifyExplodeText:
582 a = new ActionSelect(*doc, *gv, RS2::ActionModifyExplodeTextNoSelect);
584 case RS2::ActionModifyExplodeTextNoSelect:
585 a = new ActionModifyExplodeText(*doc, *gv);
590 case RS2::ActionSnapFree:
591 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapFree);
593 case RS2::ActionSnapGrid:
594 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapGrid);
596 case RS2::ActionSnapEndpoint:
597 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapEndpoint);
599 case RS2::ActionSnapOnEntity:
600 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapOnEntity);
602 case RS2::ActionSnapCenter:
603 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapCenter);
605 case RS2::ActionSnapMiddle:
606 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapMiddle);
608 case RS2::ActionSnapDist:
609 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapDist);
611 case RS2::ActionSnapIntersection:
612 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapIntersection);
614 case RS2::ActionSnapIntersectionManual:
615 a = new ActionSnapIntersectionManual(*doc, *gv);
618 // Snap restriction actions:
620 case RS2::ActionRestrictNothing:
621 a = new ActionSetSnapRestriction(*doc, *gv, RS2::RestrictNothing);
623 case RS2::ActionRestrictOrthogonal:
624 a = new ActionSetSnapRestriction(*doc, *gv,
625 RS2::RestrictOrthogonal);
627 case RS2::ActionRestrictHorizontal:
628 a = new ActionSetSnapRestriction(*doc, *gv,
629 RS2::RestrictHorizontal);
631 case RS2::ActionRestrictVertical:
632 a = new ActionSetSnapRestriction(*doc, *gv,
633 RS2::RestrictVertical);
638 case RS2::ActionSetRelativeZero:
639 a = new ActionSetRelativeZero(*doc, *gv);
641 case RS2::ActionLockRelativeZero:
642 a = new ActionLockRelativeZero(*doc, *gv, true);
644 case RS2::ActionUnlockRelativeZero:
645 a = new ActionLockRelativeZero(*doc, *gv, false);
650 case RS2::ActionInfoInside:
651 a = new ActionInfoInside(*doc, *gv);
653 case RS2::ActionInfoDist:
654 a = new ActionInfoDist(*doc, *gv);
656 case RS2::ActionInfoDist2:
657 a = new ActionInfoDist2(*doc, *gv);
659 case RS2::ActionInfoAngle:
660 a = new ActionInfoAngle(*doc, *gv);
662 case RS2::ActionInfoTotalLength:
663 a = new ActionSelect(*doc, *gv, RS2::ActionInfoTotalLengthNoSelect);
665 case RS2::ActionInfoTotalLengthNoSelect:
666 a = new ActionInfoTotalLength(*doc, *gv);
668 case RS2::ActionInfoArea:
669 a = new ActionInfoArea(*doc, *gv);
674 case RS2::ActionLayersDefreezeAll:
675 a = new ActionLayersFreezeAll(false, *doc, *gv);
677 case RS2::ActionLayersFreezeAll:
678 a = new ActionLayersFreezeAll(true, *doc, *gv);
680 case RS2::ActionLayersAdd:
681 a = new ActionLayersAdd(*doc, *gv);
683 case RS2::ActionLayersRemove:
684 a = new ActionLayersRemove(*doc, *gv);
686 case RS2::ActionLayersEdit:
687 a = new ActionLayersEdit(*doc, *gv);
689 case RS2::ActionLayersToggleView:
690 a = new ActionLayersToggleView(*doc, *gv);
692 case RS2::ActionLayersToggleLock:
693 a = new ActionLayersToggleLock(*doc, *gv);
698 case RS2::ActionBlocksDefreezeAll:
699 a = new ActionBlocksFreezeAll(false, *doc, *gv);
701 case RS2::ActionBlocksFreezeAll:
702 a = new ActionBlocksFreezeAll(true, *doc, *gv);
704 case RS2::ActionBlocksAdd:
705 a = new ActionBlocksAdd(*doc, *gv);
707 case RS2::ActionBlocksRemove:
708 a = new ActionBlocksRemove(*doc, *gv);
710 case RS2::ActionBlocksAttributes:
711 a = new ActionBlocksAttributes(*doc, *gv);
713 case RS2::ActionBlocksEdit:
714 a = new ActionBlocksEdit(*doc, *gv);
716 case RS2::ActionBlocksInsert:
717 a = new ActionBlocksInsert(*doc, *gv);
719 case RS2::ActionBlocksToggleView:
720 a = new ActionBlocksToggleView(*doc, *gv);
722 case RS2::ActionBlocksCreate:
723 a = new ActionSelect(*doc, *gv, RS2::ActionBlocksCreateNoSelect);
725 case RS2::ActionBlocksCreateNoSelect:
726 a = new ActionBlocksCreate(*doc, *gv);
728 case RS2::ActionBlocksExplode:
729 a = new ActionSelect(*doc, *gv, RS2::ActionBlocksExplodeNoSelect);
731 case RS2::ActionBlocksExplodeNoSelect:
732 a = new ActionBlocksExplode(*doc, *gv);
738 case RS2::ActionLibraryInsert:
739 a = new ActionLibraryInsert(*doc, *gv);
744 //case RS2::ActionOptionsGeneral:
745 // a = new ActionOptionsGeneral(*doc, *gv);
748 case RS2::ActionOptionsDrawing:
749 a = new ActionOptionsDrawing(*doc, *gv);
755 case RS2::ActionCamExportAuto:
756 a = new ActionCamExportAuto(*doc, *gv);
758 case RS2::ActionCamReorder:
759 a = new ActionCamReorder(*doc, *gv);
764 DEBUG->print(Debug::D_WARNING,
765 "ActionHandler::setCurrentAction(): No such action found.");
770 gv->setCurrentAction(a);
772 DEBUG->print("ActionHandler::setCurrentAction(): OK");
778 * @return Available commands of the application or the current action.
780 QStringList ActionHandler::getAvailableCommands()
782 ActionInterface * currentAction = getCurrentAction();
785 return currentAction->getAvailableCommands();
796 * Launches the command represented by the given keycode if possible.
798 * @return true: the command was recognized.
799 * false: the command is not known and was probably intended for a
802 bool ActionHandler::keycode(const QString & code)
804 QString c = code.toLower();
806 // pass keycode on to running action:
807 //RS_keycodeEvent e(cmd);
809 //GraphicView* gv = mainWindow->getGraphicView();
811 // gv->keycodeEvent(&e);
814 // if the current action can't deal with the keycode,
815 // it might be intended to launch a new keycode
816 //if (!e.isAccepted()) {
817 // keycode for new action:
818 RS2::ActionType type = COMMANDS->keycodeToAction(code);
819 if (type != RS2::ActionNone)
821 // some actions require special handling (GUI update):
824 case RS2::ActionSnapFree:
827 case RS2::ActionSnapGrid:
830 case RS2::ActionSnapEndpoint:
833 case RS2::ActionSnapOnEntity:
836 case RS2::ActionSnapCenter:
839 case RS2::ActionSnapMiddle:
842 case RS2::ActionSnapDist:
845 case RS2::ActionSnapIntersection:
846 slotSnapIntersection();
848 case RS2::ActionSnapIntersectionManual:
849 slotSnapIntersectionManual();
852 case RS2::ActionRestrictNothing:
853 slotRestrictNothing();
855 case RS2::ActionRestrictOrthogonal:
856 slotRestrictOrthogonal();
858 case RS2::ActionRestrictHorizontal:
859 slotRestrictHorizontal();
861 case RS2::ActionRestrictVertical:
862 slotRestrictVertical();
866 setCurrentAction(type);
877 * Launches the given command if possible.
879 * @return true: the command was recognized.
880 * false: the command is not known and was probably intended for a
883 bool ActionHandler::command(const QString & cmd)
885 DEBUG->print("ActionHandler::command: %s", cmd.toLatin1().data());
886 QString c = cmd.toLower();
890 GraphicView * gv = mainWindow->getGraphicView();
895 DEBUG->print("ActionHandler::command: back");
899 // pass command on to running action:
902 GraphicView * gv = mainWindow->getGraphicView();
906 DEBUG->print("ActionHandler::command: trigger command event in graphic view");
907 gv->commandEvent(&e);
910 // if the current action can't deal with the command,
911 // it might be intended to launch a new command
914 DEBUG->print("ActionHandler::command: convert cmd to action type");
915 // command for new action:
916 RS2::ActionType type = COMMANDS->cmdToAction(cmd);
918 if (type != RS2::ActionNone)
920 DEBUG->print("ActionHandler::command: setting current action");
921 setCurrentAction(type);
922 DEBUG->print("ActionHandler::command: current action set");
927 DEBUG->print("ActionHandler::command: current action not set");
931 //void ActionHandler::slotFileNew() {
932 // setCurrentAction(RS2::ActionFileNew);
935 void ActionHandler::slotFileOpen()
937 setCurrentAction(RS2::ActionFileOpen);
940 void ActionHandler::slotFileSave() {
941 setCurrentAction(RS2::ActionFileSave);
945 void ActionHandler::slotFileSaveAs()
947 setCurrentAction(RS2::ActionFileSaveAs);
951 void ActionHandler::slotFileClose()
953 setCurrentAction(RS2::ActionFileClose);
956 void ActionHandler::slotFilePrint()
958 setCurrentAction(RS2::ActionFilePrint);
962 void ActionHandler::slotZoomIn()
964 setCurrentAction(RS2::ActionZoomIn);
967 void ActionHandler::slotZoomOut()
969 setCurrentAction(RS2::ActionZoomOut);
972 void ActionHandler::slotZoomAuto()
974 setCurrentAction(RS2::ActionZoomAuto);
977 void ActionHandler::slotZoomWindow()
979 setCurrentAction(RS2::ActionZoomWindow);
982 void ActionHandler::slotZoomPan()
984 setCurrentAction(RS2::ActionZoomPan);
987 void ActionHandler::slotZoomPrevious()
989 setCurrentAction(RS2::ActionZoomPrevious);
992 void ActionHandler::slotZoomRedraw()
994 setCurrentAction(RS2::ActionZoomRedraw);
997 void ActionHandler::slotToolRegenerateDimensions()
999 setCurrentAction(RS2::ActionToolRegenerateDimensions);
1002 void ActionHandler::slotEditUndo()
1004 setCurrentAction(RS2::ActionEditUndo);
1007 void ActionHandler::slotEditRedo()
1009 setCurrentAction(RS2::ActionEditRedo);
1012 void ActionHandler::slotEditCut()
1014 setCurrentAction(RS2::ActionEditCut);
1017 void ActionHandler::slotEditCopy()
1019 setCurrentAction(RS2::ActionEditCopy);
1022 void ActionHandler::slotEditPaste()
1024 setCurrentAction(RS2::ActionEditPaste);
1027 void ActionHandler::slotSelectSingle()
1029 setCurrentAction(RS2::ActionSelectSingle);
1032 void ActionHandler::slotSelectContour()
1034 setCurrentAction(RS2::ActionSelectContour);
1037 void ActionHandler::slotSelectWindow()
1039 setCurrentAction(RS2::ActionSelectWindow);
1042 void ActionHandler::slotDeselectWindow()
1044 setCurrentAction(RS2::ActionDeselectWindow);
1047 void ActionHandler::slotSelectAll()
1049 setCurrentAction(RS2::ActionSelectAll);
1052 void ActionHandler::slotDeselectAll()
1054 setCurrentAction(RS2::ActionDeselectAll);
1057 void ActionHandler::slotSelectInvert()
1059 setCurrentAction(RS2::ActionSelectInvert);
1062 void ActionHandler::slotSelectIntersected()
1064 setCurrentAction(RS2::ActionSelectIntersected);
1067 void ActionHandler::slotDeselectIntersected()
1069 setCurrentAction(RS2::ActionDeselectIntersected);
1072 void ActionHandler::slotSelectLayer()
1074 setCurrentAction(RS2::ActionSelectLayer);
1077 void ActionHandler::slotDrawPoint()
1079 setCurrentAction(RS2::ActionDrawPoint);
1082 void ActionHandler::slotDrawLine()
1084 setCurrentAction(RS2::ActionDrawLine);
1087 void ActionHandler::slotDrawLineAngle()
1089 setCurrentAction(RS2::ActionDrawLineAngle);
1092 void ActionHandler::slotDrawLineHorizontal()
1094 setCurrentAction(RS2::ActionDrawLineHorizontal);
1097 void ActionHandler::slotDrawLineHorVert()
1099 setCurrentAction(RS2::ActionDrawLineHorVert);
1102 void ActionHandler::slotDrawLineVertical()
1104 setCurrentAction(RS2::ActionDrawLineVertical);
1107 void ActionHandler::slotDrawLineFree()
1109 setCurrentAction(RS2::ActionDrawLineFree);
1112 void ActionHandler::slotDrawLineParallel()
1114 setCurrentAction(RS2::ActionDrawLineParallel);
1117 void ActionHandler::slotDrawLineParallelThrough()
1119 setCurrentAction(RS2::ActionDrawLineParallelThrough);
1122 void ActionHandler::slotDrawLineRectangle()
1124 setCurrentAction(RS2::ActionDrawLineRectangle);
1127 void ActionHandler::slotDrawLineBisector()
1129 setCurrentAction(RS2::ActionDrawLineBisector);
1132 void ActionHandler::slotDrawLineTangent1()
1134 setCurrentAction(RS2::ActionDrawLineTangent1);
1137 void ActionHandler::slotDrawLineTangent2()
1139 setCurrentAction(RS2::ActionDrawLineTangent2);
1142 void ActionHandler::slotDrawLineOrthogonal()
1144 setCurrentAction(RS2::ActionDrawLineOrthogonal);
1147 void ActionHandler::slotDrawLineRelAngle()
1149 setCurrentAction(RS2::ActionDrawLineRelAngle);
1152 void ActionHandler::slotDrawPolyline()
1154 setCurrentAction(RS2::ActionDrawPolyline);
1157 void ActionHandler::slotPolylineAdd()
1159 setCurrentAction(RS2::ActionPolylineAdd);
1162 void ActionHandler::slotPolylineAppend()
1164 setCurrentAction(RS2::ActionPolylineAppend);
1167 void ActionHandler::slotPolylineDel()
1169 setCurrentAction(RS2::ActionPolylineDel);
1172 void ActionHandler::slotPolylineDelBetween()
1174 setCurrentAction(RS2::ActionPolylineDelBetween);
1177 void ActionHandler::slotPolylineTrim()
1179 setCurrentAction(RS2::ActionPolylineTrim);
1182 void ActionHandler::slotDrawLinePolygon()
1184 setCurrentAction(RS2::ActionDrawLinePolygon);
1187 void ActionHandler::slotDrawLinePolygon2()
1189 setCurrentAction(RS2::ActionDrawLinePolygon2);
1192 void ActionHandler::slotDrawCircle()
1194 setCurrentAction(RS2::ActionDrawCircle);
1197 void ActionHandler::slotDrawCircleCR()
1199 setCurrentAction(RS2::ActionDrawCircleCR);
1202 void ActionHandler::slotDrawCircle2P()
1204 setCurrentAction(RS2::ActionDrawCircle2P);
1207 void ActionHandler::slotDrawCircle3P()
1209 setCurrentAction(RS2::ActionDrawCircle3P);
1212 void ActionHandler::slotDrawCircleParallel()
1214 setCurrentAction(RS2::ActionDrawCircleParallel);
1217 void ActionHandler::slotDrawArc()
1219 setCurrentAction(RS2::ActionDrawArc);
1222 void ActionHandler::slotDrawArc3P()
1224 setCurrentAction(RS2::ActionDrawArc3P);
1227 void ActionHandler::slotDrawArcParallel()
1229 setCurrentAction(RS2::ActionDrawArcParallel);
1232 void ActionHandler::slotDrawArcTangential()
1234 setCurrentAction(RS2::ActionDrawArcTangential);
1237 void ActionHandler::slotDrawEllipseAxis()
1239 setCurrentAction(RS2::ActionDrawEllipseAxis);
1242 void ActionHandler::slotDrawEllipseArcAxis()
1244 setCurrentAction(RS2::ActionDrawEllipseArcAxis);
1247 void ActionHandler::slotDrawSpline()
1249 setCurrentAction(RS2::ActionDrawSpline);
1252 void ActionHandler::slotDrawText()
1254 setCurrentAction(RS2::ActionDrawText);
1257 void ActionHandler::slotDrawHatch()
1259 setCurrentAction(RS2::ActionDrawHatch);
1262 void ActionHandler::slotDrawImage()
1264 setCurrentAction(RS2::ActionDrawImage);
1267 void ActionHandler::slotDimAligned()
1269 setCurrentAction(RS2::ActionDimAligned);
1272 void ActionHandler::slotDimLinear()
1274 setCurrentAction(RS2::ActionDimLinear);
1277 void ActionHandler::slotDimLinearHor()
1279 setCurrentAction(RS2::ActionDimLinearHor);
1282 void ActionHandler::slotDimLinearVer()
1284 setCurrentAction(RS2::ActionDimLinearVer);
1287 void ActionHandler::slotDimRadial()
1289 setCurrentAction(RS2::ActionDimRadial);
1292 void ActionHandler::slotDimDiametric()
1294 setCurrentAction(RS2::ActionDimDiametric);
1297 void ActionHandler::slotDimAngular()
1299 setCurrentAction(RS2::ActionDimAngular);
1302 void ActionHandler::slotDimLeader()
1304 setCurrentAction(RS2::ActionDimLeader);
1308 void ActionHandler::slotModifyAttributes()
1310 setCurrentAction(RS2::ActionModifyAttributes);
1313 void ActionHandler::slotModifyDelete()
1315 setCurrentAction(RS2::ActionModifyDelete);
1318 void ActionHandler::slotModifyDeleteQuick()
1320 //setCurrentAction(RS2::ActionModifyDeleteQuick);
1321 setCurrentAction(RS2::ActionModifyDeleteNoSelect);
1324 void ActionHandler::slotModifyDeleteFree()
1326 setCurrentAction(RS2::ActionModifyDeleteFree);
1329 void ActionHandler::slotModifyMove()
1331 setCurrentAction(RS2::ActionModifyMove);
1334 void ActionHandler::slotModifyRotate()
1336 setCurrentAction(RS2::ActionModifyRotate);
1339 void ActionHandler::slotModifyScale()
1341 setCurrentAction(RS2::ActionModifyScale);
1344 void ActionHandler::slotModifyStretch()
1346 setCurrentAction(RS2::ActionModifyStretch);
1349 void ActionHandler::slotModifyBevel()
1351 setCurrentAction(RS2::ActionModifyBevel);
1354 void ActionHandler::slotModifyRound()
1356 setCurrentAction(RS2::ActionModifyRound);
1359 void ActionHandler::slotModifyMirror()
1361 setCurrentAction(RS2::ActionModifyMirror);
1364 void ActionHandler::slotModifyMoveRotate()
1366 setCurrentAction(RS2::ActionModifyMoveRotate);
1369 void ActionHandler::slotModifyRotate2()
1371 setCurrentAction(RS2::ActionModifyRotate2);
1374 void ActionHandler::slotModifyEntity()
1376 setCurrentAction(RS2::ActionModifyEntity);
1379 void ActionHandler::slotModifyTrim()
1381 setCurrentAction(RS2::ActionModifyTrim);
1384 void ActionHandler::slotModifyTrim2()
1386 setCurrentAction(RS2::ActionModifyTrim2);
1389 void ActionHandler::slotModifyTrimAmount()
1391 setCurrentAction(RS2::ActionModifyTrimAmount);
1394 void ActionHandler::slotModifyCut()
1396 setCurrentAction(RS2::ActionModifyCut);
1399 void ActionHandler::slotModifyExplodeText()
1401 setCurrentAction(RS2::ActionModifyExplodeText);
1405 void ActionHandler::slotSnapFree()
1410 snapFree->setChecked(true);
1413 cadToolBarSnap->setSnapMode(RS2::SnapFree);
1415 setCurrentAction(RS2::ActionSnapFree);
1418 void ActionHandler::slotSnapGrid()
1423 snapGrid->setChecked(true);
1427 cadToolBarSnap->setSnapMode(RS2::SnapGrid);
1429 setCurrentAction(RS2::ActionSnapGrid);
1432 void ActionHandler::slotSnapEndpoint()
1437 snapEndpoint->setChecked(true);
1441 cadToolBarSnap->setSnapMode(RS2::SnapEndpoint);
1443 setCurrentAction(RS2::ActionSnapEndpoint);
1446 void ActionHandler::slotSnapOnEntity()
1450 snapOnEntity->setChecked(true);
1453 cadToolBarSnap->setSnapMode(RS2::SnapOnEntity);
1455 setCurrentAction(RS2::ActionSnapOnEntity);
1458 void ActionHandler::slotSnapCenter()
1463 snapCenter->setChecked(true);
1467 cadToolBarSnap->setSnapMode(RS2::SnapCenter);
1470 setCurrentAction(RS2::ActionSnapCenter);
1473 void ActionHandler::slotSnapMiddle()
1478 snapMiddle->setChecked(true);
1482 cadToolBarSnap->setSnapMode(RS2::SnapMiddle);
1485 setCurrentAction(RS2::ActionSnapMiddle);
1488 void ActionHandler::slotSnapDist()
1493 snapDist->setChecked(true);
1497 cadToolBarSnap->setSnapMode(RS2::SnapDist);
1500 setCurrentAction(RS2::ActionSnapDist);
1503 void ActionHandler::slotSnapIntersection()
1507 if (snapIntersection)
1508 snapIntersection->setChecked(true);
1512 cadToolBarSnap->setSnapMode(RS2::SnapIntersection);
1515 setCurrentAction(RS2::ActionSnapIntersection);
1518 void ActionHandler::slotSnapIntersectionManual()
1521 /*if (snapIntersectionManual) {
1522 snapIntersectionManual->setChecked(true);
1524 /*if (cadToolBarSnap) {
1525 cadToolBarSnap->setSnapMode(RS2::SnapIntersectionManual);
1527 setCurrentAction(RS2::ActionSnapIntersectionManual);
1530 void ActionHandler::disableSnaps()
1533 snapFree->setChecked(false);
1536 snapGrid->setChecked(false);
1539 snapEndpoint->setChecked(false);
1542 snapOnEntity->setChecked(false);
1545 snapCenter->setChecked(false);
1548 snapMiddle->setChecked(false);
1551 snapDist->setChecked(false);
1553 if (snapIntersection)
1554 snapIntersection->setChecked(false);
1556 if (snapIntersectionManual)
1557 snapIntersectionManual->setChecked(false);
1561 cadToolBarSnap->disableSnaps();
1565 void ActionHandler::slotRestrictNothing()
1567 disableRestrictions();
1569 if (restrictNothing)
1570 restrictNothing->setChecked(true);
1574 cadToolBarSnap->setSnapRestriction(RS2::RestrictNothing);
1576 setCurrentAction(RS2::ActionRestrictNothing);
1579 void ActionHandler::slotRestrictOrthogonal()
1581 disableRestrictions();
1583 if (restrictOrthogonal)
1584 restrictOrthogonal->setChecked(true);
1588 cadToolBarSnap->setSnapRestriction(RS2::RestrictOrthogonal);
1590 setCurrentAction(RS2::ActionRestrictOrthogonal);
1593 void ActionHandler::slotRestrictHorizontal()
1595 disableRestrictions();
1597 if (restrictHorizontal)
1598 restrictHorizontal->setChecked(true);
1602 cadToolBarSnap->setSnapRestriction(RS2::RestrictHorizontal);
1605 setCurrentAction(RS2::ActionRestrictHorizontal);
1608 void ActionHandler::slotRestrictVertical()
1610 disableRestrictions();
1612 if (restrictVertical)
1613 restrictVertical->setChecked(true);
1617 cadToolBarSnap->setSnapRestriction(RS2::RestrictVertical);
1619 setCurrentAction(RS2::ActionRestrictVertical);
1622 void ActionHandler::disableRestrictions()
1624 if (restrictNothing)
1625 restrictNothing->setChecked(false);
1627 if (restrictOrthogonal)
1628 restrictOrthogonal->setChecked(false);
1630 if (restrictHorizontal)
1631 restrictHorizontal->setChecked(false);
1633 if (restrictVertical)
1634 restrictVertical->setChecked(false);
1638 cadToolBarSnap->disableRestrictions();
1643 * Updates the snap mode for the current document from the selected menu.
1644 * Used after the active window changed.
1646 void ActionHandler::updateSnapMode()
1648 if (snapFree && snapFree->isChecked())
1650 else if (snapGrid && snapGrid->isChecked())
1652 else if (snapEndpoint && snapEndpoint->isChecked())
1654 else if (snapOnEntity && snapOnEntity->isChecked())
1656 else if (snapCenter && snapCenter->isChecked())
1658 else if (snapMiddle && snapMiddle->isChecked())
1660 else if (snapDist && snapDist->isChecked())
1662 else if (snapIntersection && snapIntersection->isChecked())
1663 slotSnapIntersection();
1665 // snap restricitons:
1666 if (restrictNothing && restrictNothing->isChecked())
1667 slotRestrictNothing();
1668 else if (restrictOrthogonal && restrictOrthogonal->isChecked())
1669 slotRestrictOrthogonal();
1670 else if (restrictHorizontal && restrictHorizontal->isChecked())
1671 slotRestrictHorizontal();
1672 else if (restrictVertical && restrictVertical->isChecked())
1673 slotRestrictVertical();
1675 // lock of relative zero:
1676 if (lockRelativeZero)
1677 slotLockRelativeZero(lockRelativeZero->isChecked());
1680 void ActionHandler::slotSetRelativeZero()
1682 setCurrentAction(RS2::ActionSetRelativeZero);
1685 void ActionHandler::slotLockRelativeZero(bool on)
1687 if (lockRelativeZero)
1688 lockRelativeZero->setChecked(on);
1691 setCurrentAction(RS2::ActionLockRelativeZero);
1693 setCurrentAction(RS2::ActionUnlockRelativeZero);
1697 cadToolBarSnap->setLockRelativeZero(on);
1701 void ActionHandler::slotInfoInside()
1703 setCurrentAction(RS2::ActionInfoInside);
1706 void ActionHandler::slotInfoDist()
1708 setCurrentAction(RS2::ActionInfoDist);
1711 void ActionHandler::slotInfoDist2()
1713 setCurrentAction(RS2::ActionInfoDist2);
1716 void ActionHandler::slotInfoAngle()
1718 setCurrentAction(RS2::ActionInfoAngle);
1721 void ActionHandler::slotInfoTotalLength()
1723 setCurrentAction(RS2::ActionInfoTotalLength);
1726 void ActionHandler::slotInfoArea()
1728 setCurrentAction(RS2::ActionInfoArea);
1731 void ActionHandler::slotLayersDefreezeAll()
1733 setCurrentAction(RS2::ActionLayersDefreezeAll);
1736 void ActionHandler::slotLayersFreezeAll()
1738 setCurrentAction(RS2::ActionLayersFreezeAll);
1741 void ActionHandler::slotLayersAdd()
1743 setCurrentAction(RS2::ActionLayersAdd);
1746 void ActionHandler::slotLayersRemove()
1748 setCurrentAction(RS2::ActionLayersRemove);
1751 void ActionHandler::slotLayersEdit()
1753 setCurrentAction(RS2::ActionLayersEdit);
1756 void ActionHandler::slotLayersToggleView()
1758 setCurrentAction(RS2::ActionLayersToggleView);
1761 void ActionHandler::slotLayersToggleLock()
1763 setCurrentAction(RS2::ActionLayersToggleLock);
1767 void ActionHandler::slotBlocksDefreezeAll()
1769 setCurrentAction(RS2::ActionBlocksDefreezeAll);
1772 void ActionHandler::slotBlocksFreezeAll()
1774 setCurrentAction(RS2::ActionBlocksFreezeAll);
1777 void ActionHandler::slotBlocksAdd()
1779 setCurrentAction(RS2::ActionBlocksAdd);
1782 void ActionHandler::slotBlocksRemove()
1784 setCurrentAction(RS2::ActionBlocksRemove);
1787 void ActionHandler::slotBlocksAttributes()
1789 setCurrentAction(RS2::ActionBlocksAttributes);
1792 void ActionHandler::slotBlocksEdit()
1794 setCurrentAction(RS2::ActionBlocksEdit);
1797 void ActionHandler::slotBlocksInsert()
1799 setCurrentAction(RS2::ActionBlocksInsert);
1802 void ActionHandler::slotBlocksToggleView()
1804 setCurrentAction(RS2::ActionBlocksToggleView);
1807 void ActionHandler::slotBlocksCreate()
1809 setCurrentAction(RS2::ActionBlocksCreate);
1812 void ActionHandler::slotBlocksExplode()
1814 setCurrentAction(RS2::ActionBlocksExplode);
1818 void ActionHandler::slotOptionsDrawing()
1820 setCurrentAction(RS2::ActionOptionsDrawing);
1823 void ActionHandler::slotCamExportAuto()
1826 setCurrentAction(RS2::ActionCamExportAuto);
1830 void ActionHandler::slotCamReorder()
1833 setCurrentAction(RS2::ActionCamReorder);
1837 void ActionHandler::slotFocusNormal()
1839 //QG_GraphicView* gv = mainWindow->getGraphicView();
1842 mainWindow->setFocus2();
1846 void ActionHandler::setActionSnapFree(QAction * a)
1851 void ActionHandler::setActionSnapGrid(QAction * a)
1856 void ActionHandler::setActionSnapEndpoint(QAction * a)
1861 void ActionHandler::setActionSnapOnEntity(QAction * a)
1866 void ActionHandler::setActionSnapCenter(QAction * a)
1871 void ActionHandler::setActionSnapMiddle(QAction * a)
1876 void ActionHandler::setActionSnapDist(QAction * a)
1881 void ActionHandler::setActionSnapIntersection(QAction * a)
1883 snapIntersection = a;
1886 void ActionHandler::setActionSnapIntersectionManual(QAction * a)
1888 snapIntersectionManual = a;
1891 void ActionHandler::setActionRestrictNothing(QAction * a)
1893 restrictNothing = a;
1896 void ActionHandler::setActionRestrictOrthogonal(QAction * a)
1898 restrictOrthogonal = a;
1901 void ActionHandler::setActionRestrictHorizontal(QAction * a)
1903 restrictHorizontal = a;
1906 void ActionHandler::setActionRestrictVertical(QAction * a)
1908 restrictVertical = a;
1911 void ActionHandler::setActionLockRelativeZero(QAction * a)
1913 lockRelativeZero = a;
1917 * Creates link to snap tool bar so we can update the button
1918 * state if the snapping action changes.
1920 void ActionHandler::setCadToolBarSnap(CadToolBarSnap * tb)
1922 cadToolBarSnap = tb;