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 "actiondrawspline.h"
61 #include "actiondrawtext.h"
62 #include "actioneditcopy.h"
63 #include "actioneditpaste.h"
64 #include "actioneditundo.h"
65 #include "actionfileopen.h"
66 #include "actionfilesaveas.h"
67 #include "actioninfoangle.h"
68 #include "actioninfoarea.h"
69 #include "actioninfodist.h"
70 #include "actioninfodist2.h"
71 #include "actioninfoinside.h"
72 #include "actioninfototallength.h"
73 #include "actioninterface.h"
74 #include "actionlayersadd.h"
75 #include "actionlayersedit.h"
76 #include "actionlayersfreezeall.h"
77 #include "actionlayersremove.h"
78 #include "actionlayerstogglelock.h"
79 #include "actionlayerstoggleview.h"
80 #include "actionlibraryinsert.h"
81 #include "actionlockrelativezero.h"
82 #include "actionmodifyattributes.h"
83 #include "actionmodifybevel.h"
84 #include "actionmodifycut.h"
85 #include "actionmodifydelete.h"
86 #include "actionmodifydeletefree.h"
87 #include "actionmodifydeletequick.h"
88 #include "actionmodifyentity.h"
89 #include "actionmodifyexplodetext.h"
90 #include "actionmodifymirror.h"
91 #include "actionmodifymove.h"
92 #include "actionmodifymoverotate.h"
93 #include "actionmodifyrotate.h"
94 #include "actionmodifyrotate2.h"
95 #include "actionmodifyround.h"
96 #include "actionmodifyscale.h"
97 #include "actionmodifystretch.h"
98 #include "actionmodifytrim.h"
99 #include "actionmodifytrimamount.h"
100 #include "actionoptionsdrawing.h"
101 #include "actionselect.h"
102 #include "actionselectall.h"
103 #include "actionselectcontour.h"
104 #include "actionselectintersected.h"
105 #include "actionselectinvert.h"
106 #include "actionselectlayer.h"
107 #include "actionselectsingle.h"
108 #include "actionselectwindow.h"
109 #include "actionsetrelativezero.h"
110 #include "actionsetsnapmode.h"
111 #include "actionsetsnaprestriction.h"
112 #include "actionsnapintersectionmanual.h"
113 #include "actionzoomauto.h"
114 #include "actionzoomin.h"
115 #include "actionzoompan.h"
116 #include "actionzoomprevious.h"
117 #include "actionzoomredraw.h"
118 #include "actionzoomwindow.h"
120 #warning "!!! Need to add polyline functionality !!!"
122 #include "actiondrawpolyline.h"
123 #include "actionpolylineadd.h"
124 #include "actionpolylineappend.h"
125 #include "actionpolylinedel.h"
126 #include "actionpolylinedelbetween.h"
127 #include "actionpolylinetrim.h"
131 #include "actioncamexportauto.h"
132 #include "actioncamreorder.h"
135 #include "qg_mainwindowinterface.h"
136 #include "cadtoolbarsnap.h"
141 ActionHandler::ActionHandler(QG_MainWindowInterface * mw)
143 DEBUG->print("ActionHandler::ActionHandler");
154 restrictNothing = NULL;
155 restrictOrthogonal = NULL;
156 restrictHorizontal = NULL;
157 restrictVertical = NULL;
159 lockRelativeZero = NULL;
160 DEBUG->print("ActionHandler::ActionHandler: OK");
166 ActionHandler::~ActionHandler()
168 DEBUG->print("ActionHandler::~ActionHandler");
169 DEBUG->print("ActionHandler::~ActionHandler: OK");
173 * Kills all running selection actions. Called when a selection action
174 * is launched to reduce confusion.
176 void ActionHandler::killSelectActions()
178 GraphicView * gv = mainWindow->getGraphicView();
181 gv->killSelectActions();
185 * @return Current action or NULL.
187 ActionInterface * ActionHandler::getCurrentAction()
189 GraphicView * gv = mainWindow->getGraphicView();
192 return gv->getCurrentAction();
198 Instead of the following giant switch statement, you could something like the following:
199 ActionInterface * ActionHandler::setCurrentAction(ActionInterface * action)
201 GraphicView * gv = mainWindow->getGraphicView();
202 Document * doc = mainWindow->getDocument();
204 // only global options are allowed without a document:
205 if (gv == NULL || doc == NULL)
211 gv->setCurrentAction(action);
215 Then you'd call it with:
216 a = new ActionEditUndo(true, *doc, *gv);
218 Hmmm.... We need gv & doc *before* we call this...
220 What you'd do then is have the form of the thing worked ahead of time and the function
221 itself would create the gv & doc. So for the EditUndo, we'd have:
222 FunctionCreateAction(bool);
223 FunctionCreateAction(void);
225 Well... The problem is the action, they're all different...
229 * Sets current action.
231 * @return Pointer to the created action or NULL.
233 ActionInterface * ActionHandler::setCurrentAction(RS2::ActionType id)
235 DEBUG->print("ActionHandler::setCurrentAction()");
237 GraphicView * gv = mainWindow->getGraphicView();
238 Document * doc = mainWindow->getDocument();
239 ActionInterface * a = NULL;
241 // only global options are allowed without a document:
242 if (gv == NULL || doc == NULL)
244 DEBUG->print(Debug::D_WARNING,
245 "ActionHandler::setCurrentAction: graphic view or document is NULL");
251 //case RS2::ActionFileNew:
252 // a = new ActionFileNew(*doc, *gv);
254 //case RS2::ActionFileSave:
255 // a = new ActionFileSave(*doc, *gv);
257 //case RS2::ActionFileClose:
258 // //a = new ActionFileClose(*doc, *gv);
260 //case RS2::ActionFileQuit:
261 // //a = new ActionFileQuit(*doc, *gv);
263 case RS2::ActionFileOpen:
264 a = new ActionFileOpen(*doc, *gv);
266 case RS2::ActionFileSaveAs:
267 a = new ActionFileSaveAs(*doc, *gv);
272 case RS2::ActionEditUndo:
273 a = new ActionEditUndo(true, *doc, *gv);
275 case RS2::ActionEditRedo:
276 a = new ActionEditUndo(false, *doc, *gv);
278 case RS2::ActionEditCut:
279 a = new ActionSelect(*doc, *gv, RS2::ActionEditCutNoSelect);
281 case RS2::ActionEditCutNoSelect:
282 a = new ActionEditCopy(false, *doc, *gv);
284 case RS2::ActionEditCopy:
285 a = new ActionSelect(*doc, *gv, RS2::ActionEditCopyNoSelect);
287 case RS2::ActionEditCopyNoSelect:
288 a = new ActionEditCopy(true, *doc, *gv);
290 case RS2::ActionEditPaste:
291 a = new ActionEditPaste(*doc, *gv);
294 // Selecting actions:
296 case RS2::ActionSelectSingle:
297 gv->killSelectActions();
298 a = new ActionSelectSingle(*doc, *gv);
300 case RS2::ActionSelectContour:
301 gv->killSelectActions();
302 a = new ActionSelectContour(*doc, *gv);
304 case RS2::ActionSelectAll:
305 a = new ActionSelectAll(*doc, *gv, true);
307 case RS2::ActionDeselectAll:
308 a = new ActionSelectAll(*doc, *gv, false);
310 case RS2::ActionSelectWindow:
311 gv->killSelectActions();
312 a = new ActionSelectWindow(*doc, *gv, true);
314 case RS2::ActionDeselectWindow:
315 gv->killSelectActions();
316 a = new ActionSelectWindow(*doc, *gv, false);
318 case RS2::ActionSelectInvert:
319 a = new ActionSelectInvert(*doc, *gv);
321 case RS2::ActionSelectIntersected:
322 gv->killSelectActions();
323 a = new ActionSelectIntersected(*doc, *gv, true);
325 case RS2::ActionDeselectIntersected:
326 gv->killSelectActions();
327 a = new ActionSelectIntersected(*doc, *gv, false);
329 case RS2::ActionSelectLayer:
330 gv->killSelectActions();
331 a = new ActionSelectLayer(*doc, *gv);
337 // case RS2::ActionToolRegenerateDimensions:
338 // a = new ActionToolRegenerateDimensions(*doc, *gv);
343 case RS2::ActionZoomIn:
344 a = new ActionZoomIn(*doc, *gv, RS2::In, RS2::Both);
346 case RS2::ActionZoomOut:
347 a = new ActionZoomIn(*doc, *gv, RS2::Out, RS2::Both);
349 case RS2::ActionZoomAuto:
350 a = new ActionZoomAuto(*doc, *gv);
352 case RS2::ActionZoomWindow:
353 a = new ActionZoomWindow(*doc, *gv);
355 case RS2::ActionZoomPan:
356 a = new ActionZoomPan(*doc, *gv);
358 case RS2::ActionZoomPrevious:
359 a = new ActionZoomPrevious(*doc, *gv);
361 case RS2::ActionZoomRedraw:
362 a = new ActionZoomRedraw(*doc, *gv);
367 case RS2::ActionDrawPoint:
368 a = new ActionDrawPoint(*doc, *gv);
370 case RS2::ActionDrawLine:
371 a = new ActionDrawLine(*doc, *gv);
373 case RS2::ActionDrawLineAngle:
374 a = new ActionDrawLineAngle(*doc, *gv, 0.0, false);
376 case RS2::ActionDrawLineHorizontal:
377 a = new ActionDrawLineAngle(*doc, *gv, 0.0, true);
379 case RS2::ActionDrawLineHorVert:
380 a = new ActionDrawLineHorVert(*doc, *gv);
382 case RS2::ActionDrawLineVertical:
383 a = new ActionDrawLineAngle(*doc, *gv, M_PI / 2.0, true);
385 case RS2::ActionDrawLineFree:
386 a = new ActionDrawLineFree(*doc, *gv);
388 case RS2::ActionDrawLineParallel:
389 a = new ActionDrawLineParallel(*doc, *gv);
391 case RS2::ActionDrawLineParallelThrough:
392 a = new ActionDrawLineParallelThrough(*doc, *gv);
394 case RS2::ActionDrawLineRectangle:
395 a = new ActionDrawLineRectangle(*doc, *gv);
397 case RS2::ActionDrawLineBisector:
398 a = new ActionDrawLineBisector(*doc, *gv);
400 case RS2::ActionDrawLineTangent1:
401 a = new ActionDrawLineTangent1(*doc, *gv);
403 case RS2::ActionDrawLineTangent2:
404 a = new ActionDrawLineTangent2(*doc, *gv);
406 case RS2::ActionDrawLineOrthogonal:
407 a = new ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, true);
409 case RS2::ActionDrawLineRelAngle:
410 a = new ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, false);
412 #warning "!!! Need to add polyline functionality !!!"
414 case RS2::ActionDrawPolyline:
415 a = new ActionDrawPolyline(*doc, *gv);
417 case RS2::ActionPolylineAdd:
418 a = new ActionPolylineAdd(*doc, *gv);
420 case RS2::ActionPolylineAppend:
421 a = new ActionPolylineAppend(*doc, *gv);
423 case RS2::ActionPolylineDel:
424 a = new ActionPolylineDel(*doc, *gv);
426 case RS2::ActionPolylineDelBetween:
427 a = new ActionPolylineDelBetween(*doc, *gv);
429 case RS2::ActionPolylineTrim:
430 a = new ActionPolylineTrim(*doc, *gv);
433 case RS2::ActionDrawLinePolygon:
434 a = new ActionDrawLinePolygon(*doc, *gv);
436 case RS2::ActionDrawLinePolygon2:
437 a = new ActionDrawLinePolygon2(*doc, *gv);
439 case RS2::ActionDrawCircle:
440 a = new ActionDrawCircle(*doc, *gv);
442 case RS2::ActionDrawCircleCR:
443 a = new ActionDrawCircleCR(*doc, *gv);
445 case RS2::ActionDrawCircle2P:
446 a = new ActionDrawCircle2P(*doc, *gv);
448 case RS2::ActionDrawCircle3P:
449 a = new ActionDrawCircle3P(*doc, *gv);
451 case RS2::ActionDrawCircleParallel:
452 a = new ActionDrawLineParallel(*doc, *gv);
454 case RS2::ActionDrawArc:
455 a = new ActionDrawArc(*doc, *gv);
457 case RS2::ActionDrawArc3P:
458 a = new ActionDrawArc3P(*doc, *gv);
460 case RS2::ActionDrawArcParallel:
461 a = new ActionDrawLineParallel(*doc, *gv);
463 case RS2::ActionDrawArcTangential:
464 a = new ActionDrawArcTangential(*doc, *gv);
466 case RS2::ActionDrawEllipseAxis:
467 a = new ActionDrawEllipseAxis(*doc, *gv, false);
469 case RS2::ActionDrawEllipseArcAxis:
470 a = new ActionDrawEllipseAxis(*doc, *gv, true);
472 case RS2::ActionDrawSpline:
473 a = new ActionDrawSpline(*doc, *gv);
475 case RS2::ActionDrawText:
476 a = new ActionDrawText(*doc, *gv);
478 case RS2::ActionDrawHatch:
479 a = new ActionSelect(*doc, *gv, RS2::ActionDrawHatchNoSelect);
481 case RS2::ActionDrawHatchNoSelect:
482 a = new ActionDrawHatch(*doc, *gv);
484 case RS2::ActionDrawImage:
485 a = new ActionDrawImage(*doc, *gv);
488 // Dimensioning actions:
490 case RS2::ActionDimAligned:
491 a = new ActionDimAligned(*doc, *gv);
493 case RS2::ActionDimLinear:
494 a = new ActionDimLinear(*doc, *gv);
496 case RS2::ActionDimLinearHor:
497 a = new ActionDimLinear(*doc, *gv, 0.0, true);
499 case RS2::ActionDimLinearVer:
500 a = new ActionDimLinear(*doc, *gv, M_PI / 2.0, true);
502 case RS2::ActionDimRadial:
503 a = new ActionDimRadial(*doc, *gv);
505 case RS2::ActionDimDiametric:
506 a = new ActionDimDiametric(*doc, *gv);
508 case RS2::ActionDimAngular:
509 a = new ActionDimAngular(*doc, *gv);
511 case RS2::ActionDimLeader:
512 a = new ActionDimLeader(*doc, *gv);
515 // Modifying actions:
517 case RS2::ActionModifyAttributes:
518 a = new ActionSelect(*doc, *gv, RS2::ActionModifyAttributesNoSelect);
520 case RS2::ActionModifyAttributesNoSelect:
521 a = new ActionModifyAttributes(*doc, *gv);
523 case RS2::ActionModifyDelete:
524 a = new ActionSelect(*doc, *gv, RS2::ActionModifyDeleteNoSelect);
526 case RS2::ActionModifyDeleteNoSelect:
527 a = new ActionModifyDelete(*doc, *gv);
529 case RS2::ActionModifyDeleteQuick:
530 a = new ActionSelect(*doc, *gv, RS2::ActionModifyDeleteQuick);
532 case RS2::ActionModifyDeleteFree:
533 a = new ActionModifyDeleteFree(*doc, *gv);
535 case RS2::ActionModifyMove:
536 a = new ActionSelect(*doc, *gv, RS2::ActionModifyMoveNoSelect);
538 case RS2::ActionModifyMoveNoSelect:
539 a = new ActionModifyMove(*doc, *gv);
541 case RS2::ActionModifyRotate:
542 a = new ActionSelect(*doc, *gv, RS2::ActionModifyRotateNoSelect);
544 case RS2::ActionModifyRotateNoSelect:
545 a = new ActionModifyRotate(*doc, *gv);
547 case RS2::ActionModifyScale:
548 a = new ActionSelect(*doc, *gv, RS2::ActionModifyScaleNoSelect);
550 case RS2::ActionModifyScaleNoSelect:
551 a = new ActionModifyScale(*doc, *gv);
553 case RS2::ActionModifyMirror:
554 a = new ActionSelect(*doc, *gv, RS2::ActionModifyMirrorNoSelect);
556 case RS2::ActionModifyMirrorNoSelect:
557 a = new ActionModifyMirror(*doc, *gv);
559 case RS2::ActionModifyMoveRotate:
560 a = new ActionSelect(*doc, *gv, RS2::ActionModifyMoveRotateNoSelect);
562 case RS2::ActionModifyMoveRotateNoSelect:
563 a = new ActionModifyMoveRotate(*doc, *gv);
565 case RS2::ActionModifyRotate2:
566 a = new ActionSelect(*doc, *gv, RS2::ActionModifyRotate2NoSelect);
568 case RS2::ActionModifyRotate2NoSelect:
569 a = new ActionModifyRotate2(*doc, *gv);
571 case RS2::ActionModifyEntity:
572 a = new ActionModifyEntity(*doc, *gv);
574 case RS2::ActionModifyTrim:
575 a = new ActionModifyTrim(*doc, *gv, false);
577 case RS2::ActionModifyTrim2:
578 a = new ActionModifyTrim(*doc, *gv, true);
580 case RS2::ActionModifyTrimAmount:
581 a = new ActionModifyTrimAmount(*doc, *gv);
583 case RS2::ActionModifyCut:
584 a = new ActionModifyCut(*doc, *gv);
586 case RS2::ActionModifyStretch:
587 a = new ActionModifyStretch(*doc, *gv);
589 case RS2::ActionModifyBevel:
590 a = new ActionModifyBevel(*doc, *gv);
592 case RS2::ActionModifyRound:
593 a = new ActionModifyRound(*doc, *gv);
595 case RS2::ActionModifyExplodeText:
596 a = new ActionSelect(*doc, *gv, RS2::ActionModifyExplodeTextNoSelect);
598 case RS2::ActionModifyExplodeTextNoSelect:
599 a = new ActionModifyExplodeText(*doc, *gv);
604 case RS2::ActionSnapFree:
605 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapFree);
607 case RS2::ActionSnapGrid:
608 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapGrid);
610 case RS2::ActionSnapEndpoint:
611 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapEndpoint);
613 case RS2::ActionSnapOnEntity:
614 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapOnEntity);
616 case RS2::ActionSnapCenter:
617 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapCenter);
619 case RS2::ActionSnapMiddle:
620 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapMiddle);
622 case RS2::ActionSnapDist:
623 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapDist);
625 case RS2::ActionSnapIntersection:
626 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapIntersection);
628 case RS2::ActionSnapIntersectionManual:
629 a = new ActionSnapIntersectionManual(*doc, *gv);
632 // Snap restriction actions:
634 case RS2::ActionRestrictNothing:
635 a = new ActionSetSnapRestriction(*doc, *gv, RS2::RestrictNothing);
637 case RS2::ActionRestrictOrthogonal:
638 a = new ActionSetSnapRestriction(*doc, *gv,
639 RS2::RestrictOrthogonal);
641 case RS2::ActionRestrictHorizontal:
642 a = new ActionSetSnapRestriction(*doc, *gv,
643 RS2::RestrictHorizontal);
645 case RS2::ActionRestrictVertical:
646 a = new ActionSetSnapRestriction(*doc, *gv,
647 RS2::RestrictVertical);
652 case RS2::ActionSetRelativeZero:
653 a = new ActionSetRelativeZero(*doc, *gv);
655 case RS2::ActionLockRelativeZero:
656 a = new ActionLockRelativeZero(*doc, *gv, true);
658 case RS2::ActionUnlockRelativeZero:
659 a = new ActionLockRelativeZero(*doc, *gv, false);
664 case RS2::ActionInfoInside:
665 a = new ActionInfoInside(*doc, *gv);
667 case RS2::ActionInfoDist:
668 a = new ActionInfoDist(*doc, *gv);
670 case RS2::ActionInfoDist2:
671 a = new ActionInfoDist2(*doc, *gv);
673 case RS2::ActionInfoAngle:
674 a = new ActionInfoAngle(*doc, *gv);
676 case RS2::ActionInfoTotalLength:
677 a = new ActionSelect(*doc, *gv, RS2::ActionInfoTotalLengthNoSelect);
679 case RS2::ActionInfoTotalLengthNoSelect:
680 a = new ActionInfoTotalLength(*doc, *gv);
682 case RS2::ActionInfoArea:
683 a = new ActionInfoArea(*doc, *gv);
688 case RS2::ActionLayersDefreezeAll:
689 a = new ActionLayersFreezeAll(false, *doc, *gv);
691 case RS2::ActionLayersFreezeAll:
692 a = new ActionLayersFreezeAll(true, *doc, *gv);
694 case RS2::ActionLayersAdd:
695 a = new ActionLayersAdd(*doc, *gv);
697 case RS2::ActionLayersRemove:
698 a = new ActionLayersRemove(*doc, *gv);
700 case RS2::ActionLayersEdit:
701 a = new ActionLayersEdit(*doc, *gv);
703 case RS2::ActionLayersToggleView:
704 a = new ActionLayersToggleView(*doc, *gv);
706 case RS2::ActionLayersToggleLock:
707 a = new ActionLayersToggleLock(*doc, *gv);
712 case RS2::ActionBlocksDefreezeAll:
713 a = new ActionBlocksFreezeAll(false, *doc, *gv);
715 case RS2::ActionBlocksFreezeAll:
716 a = new ActionBlocksFreezeAll(true, *doc, *gv);
718 case RS2::ActionBlocksAdd:
719 a = new ActionBlocksAdd(*doc, *gv);
721 case RS2::ActionBlocksRemove:
722 a = new ActionBlocksRemove(*doc, *gv);
724 case RS2::ActionBlocksAttributes:
725 a = new ActionBlocksAttributes(*doc, *gv);
727 case RS2::ActionBlocksEdit:
728 a = new ActionBlocksEdit(*doc, *gv);
730 case RS2::ActionBlocksInsert:
731 a = new ActionBlocksInsert(*doc, *gv);
733 case RS2::ActionBlocksToggleView:
734 a = new ActionBlocksToggleView(*doc, *gv);
736 case RS2::ActionBlocksCreate:
737 a = new ActionSelect(*doc, *gv, RS2::ActionBlocksCreateNoSelect);
739 case RS2::ActionBlocksCreateNoSelect:
740 a = new ActionBlocksCreate(*doc, *gv);
742 case RS2::ActionBlocksExplode:
743 a = new ActionSelect(*doc, *gv, RS2::ActionBlocksExplodeNoSelect);
745 case RS2::ActionBlocksExplodeNoSelect:
746 a = new ActionBlocksExplode(*doc, *gv);
752 case RS2::ActionLibraryInsert:
753 a = new ActionLibraryInsert(*doc, *gv);
758 //case RS2::ActionOptionsGeneral:
759 // a = new ActionOptionsGeneral(*doc, *gv);
762 case RS2::ActionOptionsDrawing:
763 a = new ActionOptionsDrawing(*doc, *gv);
769 case RS2::ActionCamExportAuto:
770 a = new ActionCamExportAuto(*doc, *gv);
772 case RS2::ActionCamReorder:
773 a = new ActionCamReorder(*doc, *gv);
778 DEBUG->print(Debug::D_WARNING,
779 "ActionHandler::setCurrentAction(): No such action found.");
784 gv->setCurrentAction(a);
786 DEBUG->print("ActionHandler::setCurrentAction(): OK");
792 * @return Available commands of the application or the current action.
794 QStringList ActionHandler::getAvailableCommands()
796 ActionInterface * currentAction = getCurrentAction();
799 return currentAction->getAvailableCommands();
810 * Launches the command represented by the given keycode if possible.
812 * @return true: the command was recognized.
813 * false: the command is not known and was probably intended for a
816 bool ActionHandler::keycode(const QString & code)
818 QString c = code.toLower();
820 // pass keycode on to running action:
821 //RS_keycodeEvent e(cmd);
823 //GraphicView* gv = mainWindow->getGraphicView();
825 // gv->keycodeEvent(&e);
828 // if the current action can't deal with the keycode,
829 // it might be intended to launch a new keycode
830 //if (!e.isAccepted()) {
831 // keycode for new action:
832 RS2::ActionType type = COMMANDS->keycodeToAction(code);
833 if (type != RS2::ActionNone)
835 // some actions require special handling (GUI update):
838 case RS2::ActionSnapFree:
841 case RS2::ActionSnapGrid:
844 case RS2::ActionSnapEndpoint:
847 case RS2::ActionSnapOnEntity:
850 case RS2::ActionSnapCenter:
853 case RS2::ActionSnapMiddle:
856 case RS2::ActionSnapDist:
859 case RS2::ActionSnapIntersection:
860 slotSnapIntersection();
862 case RS2::ActionSnapIntersectionManual:
863 slotSnapIntersectionManual();
866 case RS2::ActionRestrictNothing:
867 slotRestrictNothing();
869 case RS2::ActionRestrictOrthogonal:
870 slotRestrictOrthogonal();
872 case RS2::ActionRestrictHorizontal:
873 slotRestrictHorizontal();
875 case RS2::ActionRestrictVertical:
876 slotRestrictVertical();
880 setCurrentAction(type);
891 * Launches the given command if possible.
893 * @return true: the command was recognized.
894 * false: the command is not known and was probably intended for a
897 bool ActionHandler::command(const QString & cmd)
899 DEBUG->print("ActionHandler::command: %s", cmd.toLatin1().data());
900 QString c = cmd.toLower();
904 GraphicView * gv = mainWindow->getGraphicView();
909 DEBUG->print("ActionHandler::command: back");
913 // pass command on to running action:
916 GraphicView * gv = mainWindow->getGraphicView();
920 DEBUG->print("ActionHandler::command: trigger command event in graphic view");
921 gv->commandEvent(&e);
924 // if the current action can't deal with the command,
925 // it might be intended to launch a new command
928 DEBUG->print("ActionHandler::command: convert cmd to action type");
929 // command for new action:
930 RS2::ActionType type = COMMANDS->cmdToAction(cmd);
932 if (type != RS2::ActionNone)
934 DEBUG->print("ActionHandler::command: setting current action");
935 setCurrentAction(type);
936 DEBUG->print("ActionHandler::command: current action set");
941 DEBUG->print("ActionHandler::command: current action not set");
945 //void ActionHandler::slotFileNew() {
946 // setCurrentAction(RS2::ActionFileNew);
949 void ActionHandler::slotFileOpen()
951 setCurrentAction(RS2::ActionFileOpen);
954 void ActionHandler::slotFileSave() {
955 setCurrentAction(RS2::ActionFileSave);
959 void ActionHandler::slotFileSaveAs()
961 setCurrentAction(RS2::ActionFileSaveAs);
965 void ActionHandler::slotFileClose()
967 setCurrentAction(RS2::ActionFileClose);
970 void ActionHandler::slotFilePrint()
972 setCurrentAction(RS2::ActionFilePrint);
976 void ActionHandler::slotZoomIn()
978 setCurrentAction(RS2::ActionZoomIn);
981 void ActionHandler::slotZoomOut()
983 setCurrentAction(RS2::ActionZoomOut);
986 void ActionHandler::slotZoomAuto()
988 setCurrentAction(RS2::ActionZoomAuto);
991 void ActionHandler::slotZoomWindow()
993 setCurrentAction(RS2::ActionZoomWindow);
996 void ActionHandler::slotZoomPan()
998 setCurrentAction(RS2::ActionZoomPan);
1001 void ActionHandler::slotZoomPrevious()
1003 setCurrentAction(RS2::ActionZoomPrevious);
1006 void ActionHandler::slotZoomRedraw()
1008 setCurrentAction(RS2::ActionZoomRedraw);
1011 void ActionHandler::slotToolRegenerateDimensions()
1013 setCurrentAction(RS2::ActionToolRegenerateDimensions);
1016 void ActionHandler::slotEditUndo()
1018 setCurrentAction(RS2::ActionEditUndo);
1021 void ActionHandler::slotEditRedo()
1023 setCurrentAction(RS2::ActionEditRedo);
1026 void ActionHandler::slotEditCut()
1028 setCurrentAction(RS2::ActionEditCut);
1031 void ActionHandler::slotEditCopy()
1033 setCurrentAction(RS2::ActionEditCopy);
1036 void ActionHandler::slotEditPaste()
1038 setCurrentAction(RS2::ActionEditPaste);
1041 void ActionHandler::slotSelectSingle()
1043 setCurrentAction(RS2::ActionSelectSingle);
1046 void ActionHandler::slotSelectContour()
1048 setCurrentAction(RS2::ActionSelectContour);
1051 void ActionHandler::slotSelectWindow()
1053 setCurrentAction(RS2::ActionSelectWindow);
1056 void ActionHandler::slotDeselectWindow()
1058 setCurrentAction(RS2::ActionDeselectWindow);
1061 void ActionHandler::slotSelectAll()
1063 setCurrentAction(RS2::ActionSelectAll);
1066 void ActionHandler::slotDeselectAll()
1068 setCurrentAction(RS2::ActionDeselectAll);
1071 void ActionHandler::slotSelectInvert()
1073 setCurrentAction(RS2::ActionSelectInvert);
1076 void ActionHandler::slotSelectIntersected()
1078 setCurrentAction(RS2::ActionSelectIntersected);
1081 void ActionHandler::slotDeselectIntersected()
1083 setCurrentAction(RS2::ActionDeselectIntersected);
1086 void ActionHandler::slotSelectLayer()
1088 setCurrentAction(RS2::ActionSelectLayer);
1091 void ActionHandler::slotDrawPoint()
1093 setCurrentAction(RS2::ActionDrawPoint);
1096 void ActionHandler::slotDrawLine()
1098 setCurrentAction(RS2::ActionDrawLine);
1101 void ActionHandler::slotDrawLineAngle()
1103 setCurrentAction(RS2::ActionDrawLineAngle);
1106 void ActionHandler::slotDrawLineHorizontal()
1108 setCurrentAction(RS2::ActionDrawLineHorizontal);
1111 void ActionHandler::slotDrawLineHorVert()
1113 setCurrentAction(RS2::ActionDrawLineHorVert);
1116 void ActionHandler::slotDrawLineVertical()
1118 setCurrentAction(RS2::ActionDrawLineVertical);
1121 void ActionHandler::slotDrawLineFree()
1123 setCurrentAction(RS2::ActionDrawLineFree);
1126 void ActionHandler::slotDrawLineParallel()
1128 setCurrentAction(RS2::ActionDrawLineParallel);
1131 void ActionHandler::slotDrawLineParallelThrough()
1133 setCurrentAction(RS2::ActionDrawLineParallelThrough);
1136 void ActionHandler::slotDrawLineRectangle()
1138 setCurrentAction(RS2::ActionDrawLineRectangle);
1141 void ActionHandler::slotDrawLineBisector()
1143 setCurrentAction(RS2::ActionDrawLineBisector);
1146 void ActionHandler::slotDrawLineTangent1()
1148 setCurrentAction(RS2::ActionDrawLineTangent1);
1151 void ActionHandler::slotDrawLineTangent2()
1153 setCurrentAction(RS2::ActionDrawLineTangent2);
1156 void ActionHandler::slotDrawLineOrthogonal()
1158 setCurrentAction(RS2::ActionDrawLineOrthogonal);
1161 void ActionHandler::slotDrawLineRelAngle()
1163 setCurrentAction(RS2::ActionDrawLineRelAngle);
1166 void ActionHandler::slotDrawPolyline()
1168 setCurrentAction(RS2::ActionDrawPolyline);
1171 void ActionHandler::slotPolylineAdd()
1173 setCurrentAction(RS2::ActionPolylineAdd);
1176 void ActionHandler::slotPolylineAppend()
1178 setCurrentAction(RS2::ActionPolylineAppend);
1181 void ActionHandler::slotPolylineDel()
1183 setCurrentAction(RS2::ActionPolylineDel);
1186 void ActionHandler::slotPolylineDelBetween()
1188 setCurrentAction(RS2::ActionPolylineDelBetween);
1191 void ActionHandler::slotPolylineTrim()
1193 setCurrentAction(RS2::ActionPolylineTrim);
1196 void ActionHandler::slotDrawLinePolygon()
1198 setCurrentAction(RS2::ActionDrawLinePolygon);
1201 void ActionHandler::slotDrawLinePolygon2()
1203 setCurrentAction(RS2::ActionDrawLinePolygon2);
1206 void ActionHandler::slotDrawCircle()
1208 setCurrentAction(RS2::ActionDrawCircle);
1211 void ActionHandler::slotDrawCircleCR()
1213 setCurrentAction(RS2::ActionDrawCircleCR);
1216 void ActionHandler::slotDrawCircle2P()
1218 setCurrentAction(RS2::ActionDrawCircle2P);
1221 void ActionHandler::slotDrawCircle3P()
1223 setCurrentAction(RS2::ActionDrawCircle3P);
1226 void ActionHandler::slotDrawCircleParallel()
1228 setCurrentAction(RS2::ActionDrawCircleParallel);
1231 void ActionHandler::slotDrawArc()
1233 setCurrentAction(RS2::ActionDrawArc);
1236 void ActionHandler::slotDrawArc3P()
1238 setCurrentAction(RS2::ActionDrawArc3P);
1241 void ActionHandler::slotDrawArcParallel()
1243 setCurrentAction(RS2::ActionDrawArcParallel);
1246 void ActionHandler::slotDrawArcTangential()
1248 setCurrentAction(RS2::ActionDrawArcTangential);
1251 void ActionHandler::slotDrawEllipseAxis()
1253 setCurrentAction(RS2::ActionDrawEllipseAxis);
1256 void ActionHandler::slotDrawEllipseArcAxis()
1258 setCurrentAction(RS2::ActionDrawEllipseArcAxis);
1261 void ActionHandler::slotDrawSpline()
1263 setCurrentAction(RS2::ActionDrawSpline);
1266 void ActionHandler::slotDrawText()
1268 setCurrentAction(RS2::ActionDrawText);
1271 void ActionHandler::slotDrawHatch()
1273 setCurrentAction(RS2::ActionDrawHatch);
1276 void ActionHandler::slotDrawImage()
1278 setCurrentAction(RS2::ActionDrawImage);
1281 void ActionHandler::slotDimAligned()
1283 setCurrentAction(RS2::ActionDimAligned);
1286 void ActionHandler::slotDimLinear()
1288 setCurrentAction(RS2::ActionDimLinear);
1291 void ActionHandler::slotDimLinearHor()
1293 setCurrentAction(RS2::ActionDimLinearHor);
1296 void ActionHandler::slotDimLinearVer()
1298 setCurrentAction(RS2::ActionDimLinearVer);
1301 void ActionHandler::slotDimRadial()
1303 setCurrentAction(RS2::ActionDimRadial);
1306 void ActionHandler::slotDimDiametric()
1308 setCurrentAction(RS2::ActionDimDiametric);
1311 void ActionHandler::slotDimAngular()
1313 setCurrentAction(RS2::ActionDimAngular);
1316 void ActionHandler::slotDimLeader()
1318 setCurrentAction(RS2::ActionDimLeader);
1322 void ActionHandler::slotModifyAttributes()
1324 setCurrentAction(RS2::ActionModifyAttributes);
1327 void ActionHandler::slotModifyDelete()
1329 setCurrentAction(RS2::ActionModifyDelete);
1332 void ActionHandler::slotModifyDeleteQuick()
1334 //setCurrentAction(RS2::ActionModifyDeleteQuick);
1335 setCurrentAction(RS2::ActionModifyDeleteNoSelect);
1338 void ActionHandler::slotModifyDeleteFree()
1340 setCurrentAction(RS2::ActionModifyDeleteFree);
1343 void ActionHandler::slotModifyMove()
1345 setCurrentAction(RS2::ActionModifyMove);
1348 void ActionHandler::slotModifyRotate()
1350 setCurrentAction(RS2::ActionModifyRotate);
1353 void ActionHandler::slotModifyScale()
1355 setCurrentAction(RS2::ActionModifyScale);
1358 void ActionHandler::slotModifyStretch()
1360 setCurrentAction(RS2::ActionModifyStretch);
1363 void ActionHandler::slotModifyBevel()
1365 setCurrentAction(RS2::ActionModifyBevel);
1368 void ActionHandler::slotModifyRound()
1370 setCurrentAction(RS2::ActionModifyRound);
1373 void ActionHandler::slotModifyMirror()
1375 setCurrentAction(RS2::ActionModifyMirror);
1378 void ActionHandler::slotModifyMoveRotate()
1380 setCurrentAction(RS2::ActionModifyMoveRotate);
1383 void ActionHandler::slotModifyRotate2()
1385 setCurrentAction(RS2::ActionModifyRotate2);
1388 void ActionHandler::slotModifyEntity()
1390 setCurrentAction(RS2::ActionModifyEntity);
1393 void ActionHandler::slotModifyTrim()
1395 setCurrentAction(RS2::ActionModifyTrim);
1398 void ActionHandler::slotModifyTrim2()
1400 setCurrentAction(RS2::ActionModifyTrim2);
1403 void ActionHandler::slotModifyTrimAmount()
1405 setCurrentAction(RS2::ActionModifyTrimAmount);
1408 void ActionHandler::slotModifyCut()
1410 setCurrentAction(RS2::ActionModifyCut);
1413 void ActionHandler::slotModifyExplodeText()
1415 setCurrentAction(RS2::ActionModifyExplodeText);
1419 void ActionHandler::slotSnapFree()
1424 snapFree->setChecked(true);
1427 cadToolBarSnap->setSnapMode(RS2::SnapFree);
1429 setCurrentAction(RS2::ActionSnapFree);
1432 void ActionHandler::slotSnapGrid()
1437 snapGrid->setChecked(true);
1441 cadToolBarSnap->setSnapMode(RS2::SnapGrid);
1443 setCurrentAction(RS2::ActionSnapGrid);
1446 void ActionHandler::slotSnapEndpoint()
1451 snapEndpoint->setChecked(true);
1455 cadToolBarSnap->setSnapMode(RS2::SnapEndpoint);
1457 setCurrentAction(RS2::ActionSnapEndpoint);
1460 void ActionHandler::slotSnapOnEntity()
1464 snapOnEntity->setChecked(true);
1467 cadToolBarSnap->setSnapMode(RS2::SnapOnEntity);
1469 setCurrentAction(RS2::ActionSnapOnEntity);
1472 void ActionHandler::slotSnapCenter()
1477 snapCenter->setChecked(true);
1481 cadToolBarSnap->setSnapMode(RS2::SnapCenter);
1484 setCurrentAction(RS2::ActionSnapCenter);
1487 void ActionHandler::slotSnapMiddle()
1492 snapMiddle->setChecked(true);
1496 cadToolBarSnap->setSnapMode(RS2::SnapMiddle);
1499 setCurrentAction(RS2::ActionSnapMiddle);
1502 void ActionHandler::slotSnapDist()
1507 snapDist->setChecked(true);
1511 cadToolBarSnap->setSnapMode(RS2::SnapDist);
1514 setCurrentAction(RS2::ActionSnapDist);
1517 void ActionHandler::slotSnapIntersection()
1521 if (snapIntersection)
1522 snapIntersection->setChecked(true);
1526 cadToolBarSnap->setSnapMode(RS2::SnapIntersection);
1529 setCurrentAction(RS2::ActionSnapIntersection);
1532 void ActionHandler::slotSnapIntersectionManual()
1535 /*if (snapIntersectionManual) {
1536 snapIntersectionManual->setChecked(true);
1538 /*if (cadToolBarSnap) {
1539 cadToolBarSnap->setSnapMode(RS2::SnapIntersectionManual);
1541 setCurrentAction(RS2::ActionSnapIntersectionManual);
1544 void ActionHandler::disableSnaps()
1547 snapFree->setChecked(false);
1550 snapGrid->setChecked(false);
1553 snapEndpoint->setChecked(false);
1556 snapOnEntity->setChecked(false);
1559 snapCenter->setChecked(false);
1562 snapMiddle->setChecked(false);
1565 snapDist->setChecked(false);
1567 if (snapIntersection)
1568 snapIntersection->setChecked(false);
1570 if (snapIntersectionManual)
1571 snapIntersectionManual->setChecked(false);
1575 cadToolBarSnap->disableSnaps();
1579 void ActionHandler::slotRestrictNothing()
1581 disableRestrictions();
1583 if (restrictNothing)
1584 restrictNothing->setChecked(true);
1588 cadToolBarSnap->setSnapRestriction(RS2::RestrictNothing);
1590 setCurrentAction(RS2::ActionRestrictNothing);
1593 void ActionHandler::slotRestrictOrthogonal()
1595 disableRestrictions();
1597 if (restrictOrthogonal)
1598 restrictOrthogonal->setChecked(true);
1602 cadToolBarSnap->setSnapRestriction(RS2::RestrictOrthogonal);
1604 setCurrentAction(RS2::ActionRestrictOrthogonal);
1607 void ActionHandler::slotRestrictHorizontal()
1609 disableRestrictions();
1611 if (restrictHorizontal)
1612 restrictHorizontal->setChecked(true);
1616 cadToolBarSnap->setSnapRestriction(RS2::RestrictHorizontal);
1619 setCurrentAction(RS2::ActionRestrictHorizontal);
1622 void ActionHandler::slotRestrictVertical()
1624 disableRestrictions();
1626 if (restrictVertical)
1627 restrictVertical->setChecked(true);
1631 cadToolBarSnap->setSnapRestriction(RS2::RestrictVertical);
1633 setCurrentAction(RS2::ActionRestrictVertical);
1636 void ActionHandler::disableRestrictions()
1638 if (restrictNothing)
1639 restrictNothing->setChecked(false);
1641 if (restrictOrthogonal)
1642 restrictOrthogonal->setChecked(false);
1644 if (restrictHorizontal)
1645 restrictHorizontal->setChecked(false);
1647 if (restrictVertical)
1648 restrictVertical->setChecked(false);
1652 cadToolBarSnap->disableRestrictions();
1657 * Updates the snap mode for the current document from the selected menu.
1658 * Used after the active window changed.
1660 void ActionHandler::updateSnapMode()
1662 if (snapFree && snapFree->isChecked())
1664 else if (snapGrid && snapGrid->isChecked())
1666 else if (snapEndpoint && snapEndpoint->isChecked())
1668 else if (snapOnEntity && snapOnEntity->isChecked())
1670 else if (snapCenter && snapCenter->isChecked())
1672 else if (snapMiddle && snapMiddle->isChecked())
1674 else if (snapDist && snapDist->isChecked())
1676 else if (snapIntersection && snapIntersection->isChecked())
1677 slotSnapIntersection();
1679 // snap restricitons:
1680 if (restrictNothing && restrictNothing->isChecked())
1681 slotRestrictNothing();
1682 else if (restrictOrthogonal && restrictOrthogonal->isChecked())
1683 slotRestrictOrthogonal();
1684 else if (restrictHorizontal && restrictHorizontal->isChecked())
1685 slotRestrictHorizontal();
1686 else if (restrictVertical && restrictVertical->isChecked())
1687 slotRestrictVertical();
1689 // lock of relative zero:
1690 if (lockRelativeZero)
1691 slotLockRelativeZero(lockRelativeZero->isChecked());
1694 void ActionHandler::slotSetRelativeZero()
1696 setCurrentAction(RS2::ActionSetRelativeZero);
1699 void ActionHandler::slotLockRelativeZero(bool on)
1701 if (lockRelativeZero)
1702 lockRelativeZero->setChecked(on);
1705 setCurrentAction(RS2::ActionLockRelativeZero);
1707 setCurrentAction(RS2::ActionUnlockRelativeZero);
1711 cadToolBarSnap->setLockRelativeZero(on);
1715 void ActionHandler::slotInfoInside()
1717 setCurrentAction(RS2::ActionInfoInside);
1720 void ActionHandler::slotInfoDist()
1722 setCurrentAction(RS2::ActionInfoDist);
1725 void ActionHandler::slotInfoDist2()
1727 setCurrentAction(RS2::ActionInfoDist2);
1730 void ActionHandler::slotInfoAngle()
1732 setCurrentAction(RS2::ActionInfoAngle);
1735 void ActionHandler::slotInfoTotalLength()
1737 setCurrentAction(RS2::ActionInfoTotalLength);
1740 void ActionHandler::slotInfoArea()
1742 setCurrentAction(RS2::ActionInfoArea);
1745 void ActionHandler::slotLayersDefreezeAll()
1747 setCurrentAction(RS2::ActionLayersDefreezeAll);
1750 void ActionHandler::slotLayersFreezeAll()
1752 setCurrentAction(RS2::ActionLayersFreezeAll);
1755 void ActionHandler::slotLayersAdd()
1757 setCurrentAction(RS2::ActionLayersAdd);
1760 void ActionHandler::slotLayersRemove()
1762 setCurrentAction(RS2::ActionLayersRemove);
1765 void ActionHandler::slotLayersEdit()
1767 setCurrentAction(RS2::ActionLayersEdit);
1770 void ActionHandler::slotLayersToggleView()
1772 setCurrentAction(RS2::ActionLayersToggleView);
1775 void ActionHandler::slotLayersToggleLock()
1777 setCurrentAction(RS2::ActionLayersToggleLock);
1781 void ActionHandler::slotBlocksDefreezeAll()
1783 setCurrentAction(RS2::ActionBlocksDefreezeAll);
1786 void ActionHandler::slotBlocksFreezeAll()
1788 setCurrentAction(RS2::ActionBlocksFreezeAll);
1791 void ActionHandler::slotBlocksAdd()
1793 setCurrentAction(RS2::ActionBlocksAdd);
1796 void ActionHandler::slotBlocksRemove()
1798 setCurrentAction(RS2::ActionBlocksRemove);
1801 void ActionHandler::slotBlocksAttributes()
1803 setCurrentAction(RS2::ActionBlocksAttributes);
1806 void ActionHandler::slotBlocksEdit()
1808 setCurrentAction(RS2::ActionBlocksEdit);
1811 void ActionHandler::slotBlocksInsert()
1813 setCurrentAction(RS2::ActionBlocksInsert);
1816 void ActionHandler::slotBlocksToggleView()
1818 setCurrentAction(RS2::ActionBlocksToggleView);
1821 void ActionHandler::slotBlocksCreate()
1823 setCurrentAction(RS2::ActionBlocksCreate);
1826 void ActionHandler::slotBlocksExplode()
1828 setCurrentAction(RS2::ActionBlocksExplode);
1832 void ActionHandler::slotOptionsDrawing()
1834 setCurrentAction(RS2::ActionOptionsDrawing);
1837 void ActionHandler::slotCamExportAuto()
1840 setCurrentAction(RS2::ActionCamExportAuto);
1844 void ActionHandler::slotCamReorder()
1847 setCurrentAction(RS2::ActionCamReorder);
1851 void ActionHandler::slotFocusNormal()
1853 //QG_GraphicView* gv = mainWindow->getGraphicView();
1856 mainWindow->setFocus2();
1860 void ActionHandler::setActionSnapFree(QAction * a)
1865 void ActionHandler::setActionSnapGrid(QAction * a)
1870 void ActionHandler::setActionSnapEndpoint(QAction * a)
1875 void ActionHandler::setActionSnapOnEntity(QAction * a)
1880 void ActionHandler::setActionSnapCenter(QAction * a)
1885 void ActionHandler::setActionSnapMiddle(QAction * a)
1890 void ActionHandler::setActionSnapDist(QAction * a)
1895 void ActionHandler::setActionSnapIntersection(QAction * a)
1897 snapIntersection = a;
1900 void ActionHandler::setActionSnapIntersectionManual(QAction * a)
1902 snapIntersectionManual = a;
1905 void ActionHandler::setActionRestrictNothing(QAction * a)
1907 restrictNothing = a;
1910 void ActionHandler::setActionRestrictOrthogonal(QAction * a)
1912 restrictOrthogonal = a;
1915 void ActionHandler::setActionRestrictHorizontal(QAction * a)
1917 restrictHorizontal = a;
1920 void ActionHandler::setActionRestrictVertical(QAction * a)
1922 restrictVertical = a;
1925 void ActionHandler::setActionLockRelativeZero(QAction * a)
1927 lockRelativeZero = a;
1931 * Creates link to snap tool bar so we can update the button
1932 * state if the snapping action changes.
1934 void ActionHandler::setCadToolBarSnap(CadToolBarSnap * tb)
1936 cadToolBarSnap = tb;