1 // qg_actionhandler.cpp
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
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/10/2010 Added this text. :-)
15 #include "qg_actionhandler.h"
17 #include "rs_commandevent.h"
19 #include "actionblocksadd.h"
20 #include "actionblocksattributes.h"
21 #include "actionblockscreate.h"
22 #include "actionblocksedit.h"
23 #include "actionblocksexplode.h"
24 #include "actionblocksfreezeall.h"
25 #include "actionblocksinsert.h"
26 #include "actionblocksremove.h"
27 #include "actionblockstoggleview.h"
28 #include "actiondimaligned.h"
29 #include "actiondimangular.h"
30 #include "actiondimdiametric.h"
31 #include "actiondimleader.h"
32 #include "actiondimlinear.h"
33 #include "actiondimradial.h"
34 #include "actiondrawarc.h"
35 #include "actiondrawarc3p.h"
36 #include "actiondrawarctangential.h"
37 #include "actiondrawcircle.h"
38 #include "actiondrawcircle2p.h"
39 #include "actiondrawcircle3p.h"
40 #include "actiondrawcirclecr.h"
41 #include "actiondrawellipseaxis.h"
42 #include "actiondrawhatch.h"
43 #include "actiondrawimage.h"
44 #include "actiondrawline.h"
45 #include "actiondrawlineangle.h"
46 #include "actiondrawlinebisector.h"
47 #include "actiondrawlinefree.h"
48 #include "actiondrawlinehorvert.h"
49 #include "actiondrawlineparallel.h"
50 #include "actiondrawlineparallelthrough.h"
51 #include "actiondrawlinepolygon.h"
52 #include "actiondrawlinepolygon2.h"
53 #include "actiondrawlinerectangle.h"
54 #include "actiondrawlinerelangle.h"
55 #include "actiondrawlinetangent1.h"
56 #include "actiondrawlinetangent2.h"
57 #include "actiondrawpoint.h"
58 #include "actiondrawspline.h"
59 #include "actiondrawtext.h"
60 #include "actioneditcopy.h"
61 #include "actioneditpaste.h"
62 #include "actioneditundo.h"
63 #include "actionfileopen.h"
64 #include "actionfilesaveas.h"
65 #include "actioninfoangle.h"
66 #include "actioninfoarea.h"
67 #include "actioninfodist.h"
68 #include "actioninfodist2.h"
69 #include "actioninfoinside.h"
70 #include "actioninfototallength.h"
71 #include "actioninterface.h"
72 #include "actionlayersadd.h"
73 #include "actionlayersedit.h"
74 #include "actionlayersfreezeall.h"
75 #include "actionlayersremove.h"
76 #include "actionlayerstogglelock.h"
77 #include "actionlayerstoggleview.h"
78 #include "actionlibraryinsert.h"
79 #include "actionlockrelativezero.h"
80 #include "actionmodifyattributes.h"
81 #include "actionmodifybevel.h"
82 #include "actionmodifycut.h"
83 #include "actionmodifydelete.h"
84 #include "actionmodifydeletefree.h"
85 #include "actionmodifydeletequick.h"
86 #include "actionmodifyentity.h"
87 #include "actionmodifyexplodetext.h"
88 #include "actionmodifymirror.h"
89 #include "actionmodifymove.h"
90 #include "actionmodifymoverotate.h"
91 #include "actionmodifyrotate.h"
92 #include "actionmodifyrotate2.h"
93 #include "actionmodifyround.h"
94 #include "actionmodifyscale.h"
95 #include "actionmodifystretch.h"
96 #include "actionmodifytrim.h"
97 #include "actionmodifytrimamount.h"
98 #include "actionoptionsdrawing.h"
99 #include "actionselect.h"
100 #include "actionselectall.h"
101 #include "actionselectcontour.h"
102 #include "actionselectintersected.h"
103 #include "actionselectinvert.h"
104 #include "actionselectlayer.h"
105 #include "actionselectsingle.h"
106 #include "actionselectwindow.h"
107 #include "actionsetrelativezero.h"
108 #include "actionsetsnapmode.h"
109 #include "actionsetsnaprestriction.h"
110 #include "actionsnapintersectionmanual.h"
111 #include "actiontoolregeneratedimensions.h"
112 #include "actionzoomauto.h"
113 #include "actionzoomin.h"
114 #include "actionzoompan.h"
115 #include "actionzoomprevious.h"
116 #include "actionzoomredraw.h"
117 #include "actionzoomwindow.h"
119 #warning "!!! Need to add polyline functionality !!!"
121 #include "actiondrawpolyline.h"
122 #include "actionpolylineadd.h"
123 #include "actionpolylineappend.h"
124 #include "actionpolylinedel.h"
125 #include "actionpolylinedelbetween.h"
126 #include "actionpolylinetrim.h"
130 #include "rs_actioncamexportauto.h"
131 #include "rs_actioncamreorder.h"
134 #include "qg_mainwindowinterface.h"
135 #include "cadtoolbarsnap.h"
140 QG_ActionHandler::QG_ActionHandler(QG_MainWindowInterface * mw)
142 RS_DEBUG->print("QG_ActionHandler::QG_ActionHandler");
153 restrictNothing = NULL;
154 restrictOrthogonal = NULL;
155 restrictHorizontal = NULL;
156 restrictVertical = NULL;
158 lockRelativeZero = NULL;
159 RS_DEBUG->print("QG_ActionHandler::QG_ActionHandler: OK");
165 QG_ActionHandler::~QG_ActionHandler()
167 RS_DEBUG->print("QG_ActionHandler::~QG_ActionHandler");
168 RS_DEBUG->print("QG_ActionHandler::~QG_ActionHandler: OK");
172 * Kills all running selection actions. Called when a selection action
173 * is launched to reduce confusion.
175 void QG_ActionHandler::killSelectActions()
177 GraphicView * gv = mainWindow->getGraphicView();
180 gv->killSelectActions();
184 * @return Current action or NULL.
186 ActionInterface * QG_ActionHandler::getCurrentAction()
188 GraphicView * gv = mainWindow->getGraphicView();
191 return gv->getCurrentAction();
197 Instead of the following giant switch statement, you could something like the following:
198 ActionInterface * QG_ActionHandler::setCurrentAction(ActionInterface * action)
200 GraphicView * gv = mainWindow->getGraphicView();
201 RS_Document * doc = mainWindow->getDocument();
203 // only global options are allowed without a document:
204 if (gv == NULL || doc == NULL)
210 gv->setCurrentAction(action);
214 Then you'd call it with:
215 a = new ActionEditUndo(true, *doc, *gv);
217 Hmmm.... We need gv & doc *before* we call this...
219 What you'd do then is have the form of the thing worked ahead of time and the function
220 itself would create the gv & doc. So for the EditUndo, we'd have:
221 FunctionCreateAction(bool);
222 FunctionCreateAction(void);
224 Well... The problem is the action, they're all different...
228 * Sets current action.
230 * @return Pointer to the created action or NULL.
232 ActionInterface * QG_ActionHandler::setCurrentAction(RS2::ActionType id)
234 RS_DEBUG->print("QG_ActionHandler::setCurrentAction()");
236 GraphicView * gv = mainWindow->getGraphicView();
237 RS_Document * doc = mainWindow->getDocument();
238 ActionInterface * a = NULL;
240 // only global options are allowed without a document:
241 if (gv == NULL || doc == NULL)
243 RS_DEBUG->print(RS_Debug::D_WARNING,
244 "QG_ActionHandler::setCurrentAction: graphic view or document is NULL");
250 //case RS2::ActionFileNew:
251 // a = new ActionFileNew(*doc, *gv);
253 //case RS2::ActionFileSave:
254 // a = new ActionFileSave(*doc, *gv);
256 //case RS2::ActionFileClose:
257 // //a = new ActionFileClose(*doc, *gv);
259 //case RS2::ActionFileQuit:
260 // //a = new ActionFileQuit(*doc, *gv);
262 case RS2::ActionFileOpen:
263 a = new ActionFileOpen(*doc, *gv);
265 case RS2::ActionFileSaveAs:
266 a = new ActionFileSaveAs(*doc, *gv);
271 case RS2::ActionEditUndo:
272 a = new ActionEditUndo(true, *doc, *gv);
274 case RS2::ActionEditRedo:
275 a = new ActionEditUndo(false, *doc, *gv);
277 case RS2::ActionEditCut:
278 a = new ActionSelect(*doc, *gv, RS2::ActionEditCutNoSelect);
280 case RS2::ActionEditCutNoSelect:
281 a = new ActionEditCopy(false, *doc, *gv);
283 case RS2::ActionEditCopy:
284 a = new ActionSelect(*doc, *gv, RS2::ActionEditCopyNoSelect);
286 case RS2::ActionEditCopyNoSelect:
287 a = new ActionEditCopy(true, *doc, *gv);
289 case RS2::ActionEditPaste:
290 a = new ActionEditPaste(*doc, *gv);
293 // Selecting actions:
295 case RS2::ActionSelectSingle:
296 gv->killSelectActions();
297 a = new ActionSelectSingle(*doc, *gv);
299 case RS2::ActionSelectContour:
300 gv->killSelectActions();
301 a = new ActionSelectContour(*doc, *gv);
303 case RS2::ActionSelectAll:
304 a = new ActionSelectAll(*doc, *gv, true);
306 case RS2::ActionDeselectAll:
307 a = new ActionSelectAll(*doc, *gv, false);
309 case RS2::ActionSelectWindow:
310 gv->killSelectActions();
311 a = new ActionSelectWindow(*doc, *gv, true);
313 case RS2::ActionDeselectWindow:
314 gv->killSelectActions();
315 a = new ActionSelectWindow(*doc, *gv, false);
317 case RS2::ActionSelectInvert:
318 a = new ActionSelectInvert(*doc, *gv);
320 case RS2::ActionSelectIntersected:
321 gv->killSelectActions();
322 a = new ActionSelectIntersected(*doc, *gv, true);
324 case RS2::ActionDeselectIntersected:
325 gv->killSelectActions();
326 a = new ActionSelectIntersected(*doc, *gv, false);
328 case RS2::ActionSelectLayer:
329 gv->killSelectActions();
330 a = new ActionSelectLayer(*doc, *gv);
335 case RS2::ActionToolRegenerateDimensions:
336 a = new ActionToolRegenerateDimensions(*doc, *gv);
341 case RS2::ActionZoomIn:
342 a = new ActionZoomIn(*doc, *gv, RS2::In, RS2::Both);
344 case RS2::ActionZoomOut:
345 a = new ActionZoomIn(*doc, *gv, RS2::Out, RS2::Both);
347 case RS2::ActionZoomAuto:
348 a = new ActionZoomAuto(*doc, *gv);
350 case RS2::ActionZoomWindow:
351 a = new ActionZoomWindow(*doc, *gv);
353 case RS2::ActionZoomPan:
354 a = new ActionZoomPan(*doc, *gv);
356 case RS2::ActionZoomPrevious:
357 a = new ActionZoomPrevious(*doc, *gv);
359 case RS2::ActionZoomRedraw:
360 a = new ActionZoomRedraw(*doc, *gv);
365 case RS2::ActionDrawPoint:
366 a = new ActionDrawPoint(*doc, *gv);
368 case RS2::ActionDrawLine:
369 a = new ActionDrawLine(*doc, *gv);
371 case RS2::ActionDrawLineAngle:
372 a = new ActionDrawLineAngle(*doc, *gv, 0.0, false);
374 case RS2::ActionDrawLineHorizontal:
375 a = new ActionDrawLineAngle(*doc, *gv, 0.0, true);
377 case RS2::ActionDrawLineHorVert:
378 a = new ActionDrawLineHorVert(*doc, *gv);
380 case RS2::ActionDrawLineVertical:
381 a = new ActionDrawLineAngle(*doc, *gv, M_PI / 2.0, true);
383 case RS2::ActionDrawLineFree:
384 a = new ActionDrawLineFree(*doc, *gv);
386 case RS2::ActionDrawLineParallel:
387 a = new ActionDrawLineParallel(*doc, *gv);
389 case RS2::ActionDrawLineParallelThrough:
390 a = new ActionDrawLineParallelThrough(*doc, *gv);
392 case RS2::ActionDrawLineRectangle:
393 a = new ActionDrawLineRectangle(*doc, *gv);
395 case RS2::ActionDrawLineBisector:
396 a = new ActionDrawLineBisector(*doc, *gv);
398 case RS2::ActionDrawLineTangent1:
399 a = new ActionDrawLineTangent1(*doc, *gv);
401 case RS2::ActionDrawLineTangent2:
402 a = new ActionDrawLineTangent2(*doc, *gv);
404 case RS2::ActionDrawLineOrthogonal:
405 a = new ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, true);
407 case RS2::ActionDrawLineRelAngle:
408 a = new ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, false);
410 #warning "!!! Need to add polyline functionality !!!"
412 case RS2::ActionDrawPolyline:
413 a = new ActionDrawPolyline(*doc, *gv);
415 case RS2::ActionPolylineAdd:
416 a = new ActionPolylineAdd(*doc, *gv);
418 case RS2::ActionPolylineAppend:
419 a = new ActionPolylineAppend(*doc, *gv);
421 case RS2::ActionPolylineDel:
422 a = new ActionPolylineDel(*doc, *gv);
424 case RS2::ActionPolylineDelBetween:
425 a = new ActionPolylineDelBetween(*doc, *gv);
427 case RS2::ActionPolylineTrim:
428 a = new ActionPolylineTrim(*doc, *gv);
431 case RS2::ActionDrawLinePolygon:
432 a = new ActionDrawLinePolygon(*doc, *gv);
434 case RS2::ActionDrawLinePolygon2:
435 a = new ActionDrawLinePolygon2(*doc, *gv);
437 case RS2::ActionDrawCircle:
438 a = new ActionDrawCircle(*doc, *gv);
440 case RS2::ActionDrawCircleCR:
441 a = new ActionDrawCircleCR(*doc, *gv);
443 case RS2::ActionDrawCircle2P:
444 a = new ActionDrawCircle2P(*doc, *gv);
446 case RS2::ActionDrawCircle3P:
447 a = new ActionDrawCircle3P(*doc, *gv);
449 case RS2::ActionDrawCircleParallel:
450 a = new ActionDrawLineParallel(*doc, *gv);
452 case RS2::ActionDrawArc:
453 a = new ActionDrawArc(*doc, *gv);
455 case RS2::ActionDrawArc3P:
456 a = new ActionDrawArc3P(*doc, *gv);
458 case RS2::ActionDrawArcParallel:
459 a = new ActionDrawLineParallel(*doc, *gv);
461 case RS2::ActionDrawArcTangential:
462 a = new ActionDrawArcTangential(*doc, *gv);
464 case RS2::ActionDrawEllipseAxis:
465 a = new ActionDrawEllipseAxis(*doc, *gv, false);
467 case RS2::ActionDrawEllipseArcAxis:
468 a = new ActionDrawEllipseAxis(*doc, *gv, true);
470 case RS2::ActionDrawSpline:
471 a = new ActionDrawSpline(*doc, *gv);
473 case RS2::ActionDrawText:
474 a = new ActionDrawText(*doc, *gv);
476 case RS2::ActionDrawHatch:
477 a = new ActionSelect(*doc, *gv, RS2::ActionDrawHatchNoSelect);
479 case RS2::ActionDrawHatchNoSelect:
480 a = new ActionDrawHatch(*doc, *gv);
482 case RS2::ActionDrawImage:
483 a = new ActionDrawImage(*doc, *gv);
486 // Dimensioning actions:
488 case RS2::ActionDimAligned:
489 a = new ActionDimAligned(*doc, *gv);
491 case RS2::ActionDimLinear:
492 a = new ActionDimLinear(*doc, *gv);
494 case RS2::ActionDimLinearHor:
495 a = new ActionDimLinear(*doc, *gv, 0.0, true);
497 case RS2::ActionDimLinearVer:
498 a = new ActionDimLinear(*doc, *gv, M_PI / 2.0, true);
500 case RS2::ActionDimRadial:
501 a = new ActionDimRadial(*doc, *gv);
503 case RS2::ActionDimDiametric:
504 a = new ActionDimDiametric(*doc, *gv);
506 case RS2::ActionDimAngular:
507 a = new ActionDimAngular(*doc, *gv);
509 case RS2::ActionDimLeader:
510 a = new ActionDimLeader(*doc, *gv);
513 // Modifying actions:
515 case RS2::ActionModifyAttributes:
516 a = new ActionSelect(*doc, *gv, RS2::ActionModifyAttributesNoSelect);
518 case RS2::ActionModifyAttributesNoSelect:
519 a = new ActionModifyAttributes(*doc, *gv);
521 case RS2::ActionModifyDelete:
522 a = new ActionSelect(*doc, *gv, RS2::ActionModifyDeleteNoSelect);
524 case RS2::ActionModifyDeleteNoSelect:
525 a = new ActionModifyDelete(*doc, *gv);
527 case RS2::ActionModifyDeleteQuick:
528 a = new ActionSelect(*doc, *gv, RS2::ActionModifyDeleteQuick);
530 case RS2::ActionModifyDeleteFree:
531 a = new ActionModifyDeleteFree(*doc, *gv);
533 case RS2::ActionModifyMove:
534 a = new ActionSelect(*doc, *gv, RS2::ActionModifyMoveNoSelect);
536 case RS2::ActionModifyMoveNoSelect:
537 a = new ActionModifyMove(*doc, *gv);
539 case RS2::ActionModifyRotate:
540 a = new ActionSelect(*doc, *gv, RS2::ActionModifyRotateNoSelect);
542 case RS2::ActionModifyRotateNoSelect:
543 a = new ActionModifyRotate(*doc, *gv);
545 case RS2::ActionModifyScale:
546 a = new ActionSelect(*doc, *gv, RS2::ActionModifyScaleNoSelect);
548 case RS2::ActionModifyScaleNoSelect:
549 a = new ActionModifyScale(*doc, *gv);
551 case RS2::ActionModifyMirror:
552 a = new ActionSelect(*doc, *gv, RS2::ActionModifyMirrorNoSelect);
554 case RS2::ActionModifyMirrorNoSelect:
555 a = new ActionModifyMirror(*doc, *gv);
557 case RS2::ActionModifyMoveRotate:
558 a = new ActionSelect(*doc, *gv, RS2::ActionModifyMoveRotateNoSelect);
560 case RS2::ActionModifyMoveRotateNoSelect:
561 a = new ActionModifyMoveRotate(*doc, *gv);
563 case RS2::ActionModifyRotate2:
564 a = new ActionSelect(*doc, *gv, RS2::ActionModifyRotate2NoSelect);
566 case RS2::ActionModifyRotate2NoSelect:
567 a = new ActionModifyRotate2(*doc, *gv);
569 case RS2::ActionModifyEntity:
570 a = new ActionModifyEntity(*doc, *gv);
572 case RS2::ActionModifyTrim:
573 a = new ActionModifyTrim(*doc, *gv, false);
575 case RS2::ActionModifyTrim2:
576 a = new ActionModifyTrim(*doc, *gv, true);
578 case RS2::ActionModifyTrimAmount:
579 a = new ActionModifyTrimAmount(*doc, *gv);
581 case RS2::ActionModifyCut:
582 a = new ActionModifyCut(*doc, *gv);
584 case RS2::ActionModifyStretch:
585 a = new ActionModifyStretch(*doc, *gv);
587 case RS2::ActionModifyBevel:
588 a = new ActionModifyBevel(*doc, *gv);
590 case RS2::ActionModifyRound:
591 a = new ActionModifyRound(*doc, *gv);
593 case RS2::ActionModifyExplodeText:
594 a = new ActionSelect(*doc, *gv, RS2::ActionModifyExplodeTextNoSelect);
596 case RS2::ActionModifyExplodeTextNoSelect:
597 a = new ActionModifyExplodeText(*doc, *gv);
602 case RS2::ActionSnapFree:
603 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapFree);
605 case RS2::ActionSnapGrid:
606 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapGrid);
608 case RS2::ActionSnapEndpoint:
609 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapEndpoint);
611 case RS2::ActionSnapOnEntity:
612 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapOnEntity);
614 case RS2::ActionSnapCenter:
615 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapCenter);
617 case RS2::ActionSnapMiddle:
618 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapMiddle);
620 case RS2::ActionSnapDist:
621 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapDist);
623 case RS2::ActionSnapIntersection:
624 a = new ActionSetSnapMode(*doc, *gv, RS2::SnapIntersection);
626 case RS2::ActionSnapIntersectionManual:
627 a = new ActionSnapIntersectionManual(*doc, *gv);
630 // Snap restriction actions:
632 case RS2::ActionRestrictNothing:
633 a = new ActionSetSnapRestriction(*doc, *gv, RS2::RestrictNothing);
635 case RS2::ActionRestrictOrthogonal:
636 a = new ActionSetSnapRestriction(*doc, *gv,
637 RS2::RestrictOrthogonal);
639 case RS2::ActionRestrictHorizontal:
640 a = new ActionSetSnapRestriction(*doc, *gv,
641 RS2::RestrictHorizontal);
643 case RS2::ActionRestrictVertical:
644 a = new ActionSetSnapRestriction(*doc, *gv,
645 RS2::RestrictVertical);
650 case RS2::ActionSetRelativeZero:
651 a = new ActionSetRelativeZero(*doc, *gv);
653 case RS2::ActionLockRelativeZero:
654 a = new ActionLockRelativeZero(*doc, *gv, true);
656 case RS2::ActionUnlockRelativeZero:
657 a = new ActionLockRelativeZero(*doc, *gv, false);
662 case RS2::ActionInfoInside:
663 a = new ActionInfoInside(*doc, *gv);
665 case RS2::ActionInfoDist:
666 a = new ActionInfoDist(*doc, *gv);
668 case RS2::ActionInfoDist2:
669 a = new ActionInfoDist2(*doc, *gv);
671 case RS2::ActionInfoAngle:
672 a = new ActionInfoAngle(*doc, *gv);
674 case RS2::ActionInfoTotalLength:
675 a = new ActionSelect(*doc, *gv, RS2::ActionInfoTotalLengthNoSelect);
677 case RS2::ActionInfoTotalLengthNoSelect:
678 a = new ActionInfoTotalLength(*doc, *gv);
680 case RS2::ActionInfoArea:
681 a = new ActionInfoArea(*doc, *gv);
686 case RS2::ActionLayersDefreezeAll:
687 a = new ActionLayersFreezeAll(false, *doc, *gv);
689 case RS2::ActionLayersFreezeAll:
690 a = new ActionLayersFreezeAll(true, *doc, *gv);
692 case RS2::ActionLayersAdd:
693 a = new ActionLayersAdd(*doc, *gv);
695 case RS2::ActionLayersRemove:
696 a = new ActionLayersRemove(*doc, *gv);
698 case RS2::ActionLayersEdit:
699 a = new ActionLayersEdit(*doc, *gv);
701 case RS2::ActionLayersToggleView:
702 a = new ActionLayersToggleView(*doc, *gv);
704 case RS2::ActionLayersToggleLock:
705 a = new ActionLayersToggleLock(*doc, *gv);
710 case RS2::ActionBlocksDefreezeAll:
711 a = new ActionBlocksFreezeAll(false, *doc, *gv);
713 case RS2::ActionBlocksFreezeAll:
714 a = new ActionBlocksFreezeAll(true, *doc, *gv);
716 case RS2::ActionBlocksAdd:
717 a = new ActionBlocksAdd(*doc, *gv);
719 case RS2::ActionBlocksRemove:
720 a = new ActionBlocksRemove(*doc, *gv);
722 case RS2::ActionBlocksAttributes:
723 a = new ActionBlocksAttributes(*doc, *gv);
725 case RS2::ActionBlocksEdit:
726 a = new ActionBlocksEdit(*doc, *gv);
728 case RS2::ActionBlocksInsert:
729 a = new ActionBlocksInsert(*doc, *gv);
731 case RS2::ActionBlocksToggleView:
732 a = new ActionBlocksToggleView(*doc, *gv);
734 case RS2::ActionBlocksCreate:
735 a = new ActionSelect(*doc, *gv, RS2::ActionBlocksCreateNoSelect);
737 case RS2::ActionBlocksCreateNoSelect:
738 a = new ActionBlocksCreate(*doc, *gv);
740 case RS2::ActionBlocksExplode:
741 a = new ActionSelect(*doc, *gv, RS2::ActionBlocksExplodeNoSelect);
743 case RS2::ActionBlocksExplodeNoSelect:
744 a = new ActionBlocksExplode(*doc, *gv);
750 case RS2::ActionLibraryInsert:
751 a = new ActionLibraryInsert(*doc, *gv);
756 //case RS2::ActionOptionsGeneral:
757 // a = new ActionOptionsGeneral(*doc, *gv);
760 case RS2::ActionOptionsDrawing:
761 a = new ActionOptionsDrawing(*doc, *gv);
767 case RS2::ActionCamExportAuto:
768 a = new ActionCamExportAuto(*doc, *gv);
770 case RS2::ActionCamReorder:
771 a = new ActionCamReorder(*doc, *gv);
776 RS_DEBUG->print(RS_Debug::D_WARNING,
777 "QG_ActionHandler::setCurrentAction(): No such action found.");
782 gv->setCurrentAction(a);
784 RS_DEBUG->print("QG_ActionHandler::setCurrentAction(): OK");
790 * @return Available commands of the application or the current action.
792 QStringList QG_ActionHandler::getAvailableCommands()
794 ActionInterface * currentAction = getCurrentAction();
797 return currentAction->getAvailableCommands();
808 * Launches the command represented by the given keycode if possible.
810 * @return true: the command was recognized.
811 * false: the command is not known and was probably intended for a
814 bool QG_ActionHandler::keycode(const QString & code)
816 QString c = code.toLower();
818 // pass keycode on to running action:
819 //RS_keycodeEvent e(cmd);
821 //GraphicView* gv = mainWindow->getGraphicView();
823 // gv->keycodeEvent(&e);
826 // if the current action can't deal with the keycode,
827 // it might be intended to launch a new keycode
828 //if (!e.isAccepted()) {
829 // keycode for new action:
830 RS2::ActionType type = RS_COMMANDS->keycodeToAction(code);
831 if (type != RS2::ActionNone)
833 // some actions require special handling (GUI update):
836 case RS2::ActionSnapFree:
839 case RS2::ActionSnapGrid:
842 case RS2::ActionSnapEndpoint:
845 case RS2::ActionSnapOnEntity:
848 case RS2::ActionSnapCenter:
851 case RS2::ActionSnapMiddle:
854 case RS2::ActionSnapDist:
857 case RS2::ActionSnapIntersection:
858 slotSnapIntersection();
860 case RS2::ActionSnapIntersectionManual:
861 slotSnapIntersectionManual();
864 case RS2::ActionRestrictNothing:
865 slotRestrictNothing();
867 case RS2::ActionRestrictOrthogonal:
868 slotRestrictOrthogonal();
870 case RS2::ActionRestrictHorizontal:
871 slotRestrictHorizontal();
873 case RS2::ActionRestrictVertical:
874 slotRestrictVertical();
878 setCurrentAction(type);
889 * Launches the given command if possible.
891 * @return true: the command was recognized.
892 * false: the command is not known and was probably intended for a
895 bool QG_ActionHandler::command(const QString & cmd)
897 RS_DEBUG->print("QG_ActionHandler::command: %s", cmd.toLatin1().data());
898 QString c = cmd.toLower();
902 GraphicView * gv = mainWindow->getGraphicView();
907 RS_DEBUG->print("QG_ActionHandler::command: back");
911 // pass command on to running action:
912 RS_CommandEvent e(cmd);
914 GraphicView * gv = mainWindow->getGraphicView();
918 RS_DEBUG->print("QG_ActionHandler::command: trigger command event in graphic view");
919 gv->commandEvent(&e);
922 // if the current action can't deal with the command,
923 // it might be intended to launch a new command
926 RS_DEBUG->print("QG_ActionHandler::command: convert cmd to action type");
927 // command for new action:
928 RS2::ActionType type = RS_COMMANDS->cmdToAction(cmd);
930 if (type != RS2::ActionNone)
932 RS_DEBUG->print("QG_ActionHandler::command: setting current action");
933 setCurrentAction(type);
934 RS_DEBUG->print("QG_ActionHandler::command: current action set");
939 RS_DEBUG->print("QG_ActionHandler::command: current action not set");
943 //void QG_ActionHandler::slotFileNew() {
944 // setCurrentAction(RS2::ActionFileNew);
947 void QG_ActionHandler::slotFileOpen()
949 setCurrentAction(RS2::ActionFileOpen);
952 void QG_ActionHandler::slotFileSave() {
953 setCurrentAction(RS2::ActionFileSave);
957 void QG_ActionHandler::slotFileSaveAs()
959 setCurrentAction(RS2::ActionFileSaveAs);
963 void QG_ActionHandler::slotFileClose()
965 setCurrentAction(RS2::ActionFileClose);
968 void QG_ActionHandler::slotFilePrint()
970 setCurrentAction(RS2::ActionFilePrint);
974 void QG_ActionHandler::slotZoomIn()
976 setCurrentAction(RS2::ActionZoomIn);
979 void QG_ActionHandler::slotZoomOut()
981 setCurrentAction(RS2::ActionZoomOut);
984 void QG_ActionHandler::slotZoomAuto()
986 setCurrentAction(RS2::ActionZoomAuto);
989 void QG_ActionHandler::slotZoomWindow()
991 setCurrentAction(RS2::ActionZoomWindow);
994 void QG_ActionHandler::slotZoomPan()
996 setCurrentAction(RS2::ActionZoomPan);
999 void QG_ActionHandler::slotZoomPrevious()
1001 setCurrentAction(RS2::ActionZoomPrevious);
1004 void QG_ActionHandler::slotZoomRedraw()
1006 setCurrentAction(RS2::ActionZoomRedraw);
1009 void QG_ActionHandler::slotToolRegenerateDimensions()
1011 setCurrentAction(RS2::ActionToolRegenerateDimensions);
1014 void QG_ActionHandler::slotEditUndo()
1016 setCurrentAction(RS2::ActionEditUndo);
1019 void QG_ActionHandler::slotEditRedo()
1021 setCurrentAction(RS2::ActionEditRedo);
1024 void QG_ActionHandler::slotEditCut()
1026 setCurrentAction(RS2::ActionEditCut);
1029 void QG_ActionHandler::slotEditCopy()
1031 setCurrentAction(RS2::ActionEditCopy);
1034 void QG_ActionHandler::slotEditPaste()
1036 setCurrentAction(RS2::ActionEditPaste);
1039 void QG_ActionHandler::slotSelectSingle()
1041 setCurrentAction(RS2::ActionSelectSingle);
1044 void QG_ActionHandler::slotSelectContour()
1046 setCurrentAction(RS2::ActionSelectContour);
1049 void QG_ActionHandler::slotSelectWindow()
1051 setCurrentAction(RS2::ActionSelectWindow);
1054 void QG_ActionHandler::slotDeselectWindow()
1056 setCurrentAction(RS2::ActionDeselectWindow);
1059 void QG_ActionHandler::slotSelectAll()
1061 setCurrentAction(RS2::ActionSelectAll);
1064 void QG_ActionHandler::slotDeselectAll()
1066 setCurrentAction(RS2::ActionDeselectAll);
1069 void QG_ActionHandler::slotSelectInvert()
1071 setCurrentAction(RS2::ActionSelectInvert);
1074 void QG_ActionHandler::slotSelectIntersected()
1076 setCurrentAction(RS2::ActionSelectIntersected);
1079 void QG_ActionHandler::slotDeselectIntersected()
1081 setCurrentAction(RS2::ActionDeselectIntersected);
1084 void QG_ActionHandler::slotSelectLayer()
1086 setCurrentAction(RS2::ActionSelectLayer);
1089 void QG_ActionHandler::slotDrawPoint()
1091 setCurrentAction(RS2::ActionDrawPoint);
1094 void QG_ActionHandler::slotDrawLine()
1096 setCurrentAction(RS2::ActionDrawLine);
1099 void QG_ActionHandler::slotDrawLineAngle()
1101 setCurrentAction(RS2::ActionDrawLineAngle);
1104 void QG_ActionHandler::slotDrawLineHorizontal()
1106 setCurrentAction(RS2::ActionDrawLineHorizontal);
1109 void QG_ActionHandler::slotDrawLineHorVert()
1111 setCurrentAction(RS2::ActionDrawLineHorVert);
1114 void QG_ActionHandler::slotDrawLineVertical()
1116 setCurrentAction(RS2::ActionDrawLineVertical);
1119 void QG_ActionHandler::slotDrawLineFree()
1121 setCurrentAction(RS2::ActionDrawLineFree);
1124 void QG_ActionHandler::slotDrawLineParallel()
1126 setCurrentAction(RS2::ActionDrawLineParallel);
1129 void QG_ActionHandler::slotDrawLineParallelThrough()
1131 setCurrentAction(RS2::ActionDrawLineParallelThrough);
1134 void QG_ActionHandler::slotDrawLineRectangle()
1136 setCurrentAction(RS2::ActionDrawLineRectangle);
1139 void QG_ActionHandler::slotDrawLineBisector()
1141 setCurrentAction(RS2::ActionDrawLineBisector);
1144 void QG_ActionHandler::slotDrawLineTangent1()
1146 setCurrentAction(RS2::ActionDrawLineTangent1);
1149 void QG_ActionHandler::slotDrawLineTangent2()
1151 setCurrentAction(RS2::ActionDrawLineTangent2);
1154 void QG_ActionHandler::slotDrawLineOrthogonal()
1156 setCurrentAction(RS2::ActionDrawLineOrthogonal);
1159 void QG_ActionHandler::slotDrawLineRelAngle()
1161 setCurrentAction(RS2::ActionDrawLineRelAngle);
1164 void QG_ActionHandler::slotDrawPolyline()
1166 setCurrentAction(RS2::ActionDrawPolyline);
1169 void QG_ActionHandler::slotPolylineAdd()
1171 setCurrentAction(RS2::ActionPolylineAdd);
1174 void QG_ActionHandler::slotPolylineAppend()
1176 setCurrentAction(RS2::ActionPolylineAppend);
1179 void QG_ActionHandler::slotPolylineDel()
1181 setCurrentAction(RS2::ActionPolylineDel);
1184 void QG_ActionHandler::slotPolylineDelBetween()
1186 setCurrentAction(RS2::ActionPolylineDelBetween);
1189 void QG_ActionHandler::slotPolylineTrim()
1191 setCurrentAction(RS2::ActionPolylineTrim);
1194 void QG_ActionHandler::slotDrawLinePolygon()
1196 setCurrentAction(RS2::ActionDrawLinePolygon);
1199 void QG_ActionHandler::slotDrawLinePolygon2()
1201 setCurrentAction(RS2::ActionDrawLinePolygon2);
1204 void QG_ActionHandler::slotDrawCircle()
1206 setCurrentAction(RS2::ActionDrawCircle);
1209 void QG_ActionHandler::slotDrawCircleCR()
1211 setCurrentAction(RS2::ActionDrawCircleCR);
1214 void QG_ActionHandler::slotDrawCircle2P()
1216 setCurrentAction(RS2::ActionDrawCircle2P);
1219 void QG_ActionHandler::slotDrawCircle3P()
1221 setCurrentAction(RS2::ActionDrawCircle3P);
1224 void QG_ActionHandler::slotDrawCircleParallel()
1226 setCurrentAction(RS2::ActionDrawCircleParallel);
1229 void QG_ActionHandler::slotDrawArc()
1231 setCurrentAction(RS2::ActionDrawArc);
1234 void QG_ActionHandler::slotDrawArc3P()
1236 setCurrentAction(RS2::ActionDrawArc3P);
1239 void QG_ActionHandler::slotDrawArcParallel()
1241 setCurrentAction(RS2::ActionDrawArcParallel);
1244 void QG_ActionHandler::slotDrawArcTangential()
1246 setCurrentAction(RS2::ActionDrawArcTangential);
1249 void QG_ActionHandler::slotDrawEllipseAxis()
1251 setCurrentAction(RS2::ActionDrawEllipseAxis);
1254 void QG_ActionHandler::slotDrawEllipseArcAxis()
1256 setCurrentAction(RS2::ActionDrawEllipseArcAxis);
1259 void QG_ActionHandler::slotDrawSpline()
1261 setCurrentAction(RS2::ActionDrawSpline);
1264 void QG_ActionHandler::slotDrawText()
1266 setCurrentAction(RS2::ActionDrawText);
1269 void QG_ActionHandler::slotDrawHatch()
1271 setCurrentAction(RS2::ActionDrawHatch);
1274 void QG_ActionHandler::slotDrawImage()
1276 setCurrentAction(RS2::ActionDrawImage);
1279 void QG_ActionHandler::slotDimAligned()
1281 setCurrentAction(RS2::ActionDimAligned);
1284 void QG_ActionHandler::slotDimLinear()
1286 setCurrentAction(RS2::ActionDimLinear);
1289 void QG_ActionHandler::slotDimLinearHor()
1291 setCurrentAction(RS2::ActionDimLinearHor);
1294 void QG_ActionHandler::slotDimLinearVer()
1296 setCurrentAction(RS2::ActionDimLinearVer);
1299 void QG_ActionHandler::slotDimRadial()
1301 setCurrentAction(RS2::ActionDimRadial);
1304 void QG_ActionHandler::slotDimDiametric()
1306 setCurrentAction(RS2::ActionDimDiametric);
1309 void QG_ActionHandler::slotDimAngular()
1311 setCurrentAction(RS2::ActionDimAngular);
1314 void QG_ActionHandler::slotDimLeader()
1316 setCurrentAction(RS2::ActionDimLeader);
1320 void QG_ActionHandler::slotModifyAttributes()
1322 setCurrentAction(RS2::ActionModifyAttributes);
1325 void QG_ActionHandler::slotModifyDelete()
1327 setCurrentAction(RS2::ActionModifyDelete);
1330 void QG_ActionHandler::slotModifyDeleteQuick()
1332 //setCurrentAction(RS2::ActionModifyDeleteQuick);
1333 setCurrentAction(RS2::ActionModifyDeleteNoSelect);
1336 void QG_ActionHandler::slotModifyDeleteFree()
1338 setCurrentAction(RS2::ActionModifyDeleteFree);
1341 void QG_ActionHandler::slotModifyMove()
1343 setCurrentAction(RS2::ActionModifyMove);
1346 void QG_ActionHandler::slotModifyRotate()
1348 setCurrentAction(RS2::ActionModifyRotate);
1351 void QG_ActionHandler::slotModifyScale()
1353 setCurrentAction(RS2::ActionModifyScale);
1356 void QG_ActionHandler::slotModifyStretch()
1358 setCurrentAction(RS2::ActionModifyStretch);
1361 void QG_ActionHandler::slotModifyBevel()
1363 setCurrentAction(RS2::ActionModifyBevel);
1366 void QG_ActionHandler::slotModifyRound()
1368 setCurrentAction(RS2::ActionModifyRound);
1371 void QG_ActionHandler::slotModifyMirror()
1373 setCurrentAction(RS2::ActionModifyMirror);
1376 void QG_ActionHandler::slotModifyMoveRotate()
1378 setCurrentAction(RS2::ActionModifyMoveRotate);
1381 void QG_ActionHandler::slotModifyRotate2()
1383 setCurrentAction(RS2::ActionModifyRotate2);
1386 void QG_ActionHandler::slotModifyEntity()
1388 setCurrentAction(RS2::ActionModifyEntity);
1391 void QG_ActionHandler::slotModifyTrim()
1393 setCurrentAction(RS2::ActionModifyTrim);
1396 void QG_ActionHandler::slotModifyTrim2()
1398 setCurrentAction(RS2::ActionModifyTrim2);
1401 void QG_ActionHandler::slotModifyTrimAmount()
1403 setCurrentAction(RS2::ActionModifyTrimAmount);
1406 void QG_ActionHandler::slotModifyCut()
1408 setCurrentAction(RS2::ActionModifyCut);
1411 void QG_ActionHandler::slotModifyExplodeText()
1413 setCurrentAction(RS2::ActionModifyExplodeText);
1417 void QG_ActionHandler::slotSnapFree()
1422 snapFree->setChecked(true);
1425 cadToolBarSnap->setSnapMode(RS2::SnapFree);
1427 setCurrentAction(RS2::ActionSnapFree);
1430 void QG_ActionHandler::slotSnapGrid()
1435 snapGrid->setChecked(true);
1439 cadToolBarSnap->setSnapMode(RS2::SnapGrid);
1441 setCurrentAction(RS2::ActionSnapGrid);
1444 void QG_ActionHandler::slotSnapEndpoint()
1449 snapEndpoint->setChecked(true);
1453 cadToolBarSnap->setSnapMode(RS2::SnapEndpoint);
1455 setCurrentAction(RS2::ActionSnapEndpoint);
1458 void QG_ActionHandler::slotSnapOnEntity()
1462 snapOnEntity->setChecked(true);
1465 cadToolBarSnap->setSnapMode(RS2::SnapOnEntity);
1467 setCurrentAction(RS2::ActionSnapOnEntity);
1470 void QG_ActionHandler::slotSnapCenter()
1475 snapCenter->setChecked(true);
1479 cadToolBarSnap->setSnapMode(RS2::SnapCenter);
1482 setCurrentAction(RS2::ActionSnapCenter);
1485 void QG_ActionHandler::slotSnapMiddle()
1490 snapMiddle->setChecked(true);
1494 cadToolBarSnap->setSnapMode(RS2::SnapMiddle);
1497 setCurrentAction(RS2::ActionSnapMiddle);
1500 void QG_ActionHandler::slotSnapDist()
1505 snapDist->setChecked(true);
1509 cadToolBarSnap->setSnapMode(RS2::SnapDist);
1512 setCurrentAction(RS2::ActionSnapDist);
1515 void QG_ActionHandler::slotSnapIntersection()
1519 if (snapIntersection)
1520 snapIntersection->setChecked(true);
1524 cadToolBarSnap->setSnapMode(RS2::SnapIntersection);
1527 setCurrentAction(RS2::ActionSnapIntersection);
1530 void QG_ActionHandler::slotSnapIntersectionManual()
1533 /*if (snapIntersectionManual) {
1534 snapIntersectionManual->setChecked(true);
1536 /*if (cadToolBarSnap) {
1537 cadToolBarSnap->setSnapMode(RS2::SnapIntersectionManual);
1539 setCurrentAction(RS2::ActionSnapIntersectionManual);
1542 void QG_ActionHandler::disableSnaps()
1545 snapFree->setChecked(false);
1548 snapGrid->setChecked(false);
1551 snapEndpoint->setChecked(false);
1554 snapOnEntity->setChecked(false);
1557 snapCenter->setChecked(false);
1560 snapMiddle->setChecked(false);
1563 snapDist->setChecked(false);
1565 if (snapIntersection)
1566 snapIntersection->setChecked(false);
1568 if (snapIntersectionManual)
1569 snapIntersectionManual->setChecked(false);
1573 cadToolBarSnap->disableSnaps();
1577 void QG_ActionHandler::slotRestrictNothing()
1579 disableRestrictions();
1581 if (restrictNothing)
1582 restrictNothing->setChecked(true);
1586 cadToolBarSnap->setSnapRestriction(RS2::RestrictNothing);
1588 setCurrentAction(RS2::ActionRestrictNothing);
1591 void QG_ActionHandler::slotRestrictOrthogonal()
1593 disableRestrictions();
1595 if (restrictOrthogonal)
1596 restrictOrthogonal->setChecked(true);
1600 cadToolBarSnap->setSnapRestriction(RS2::RestrictOrthogonal);
1602 setCurrentAction(RS2::ActionRestrictOrthogonal);
1605 void QG_ActionHandler::slotRestrictHorizontal()
1607 disableRestrictions();
1609 if (restrictHorizontal)
1610 restrictHorizontal->setChecked(true);
1614 cadToolBarSnap->setSnapRestriction(RS2::RestrictHorizontal);
1617 setCurrentAction(RS2::ActionRestrictHorizontal);
1620 void QG_ActionHandler::slotRestrictVertical()
1622 disableRestrictions();
1624 if (restrictVertical)
1625 restrictVertical->setChecked(true);
1629 cadToolBarSnap->setSnapRestriction(RS2::RestrictVertical);
1631 setCurrentAction(RS2::ActionRestrictVertical);
1634 void QG_ActionHandler::disableRestrictions()
1636 if (restrictNothing)
1637 restrictNothing->setChecked(false);
1639 if (restrictOrthogonal)
1640 restrictOrthogonal->setChecked(false);
1642 if (restrictHorizontal)
1643 restrictHorizontal->setChecked(false);
1645 if (restrictVertical)
1646 restrictVertical->setChecked(false);
1650 cadToolBarSnap->disableRestrictions();
1655 * Updates the snap mode for the current document from the selected menu.
1656 * Used after the active window changed.
1658 void QG_ActionHandler::updateSnapMode()
1660 if (snapFree && snapFree->isChecked())
1662 else if (snapGrid && snapGrid->isChecked())
1664 else if (snapEndpoint && snapEndpoint->isChecked())
1666 else if (snapOnEntity && snapOnEntity->isChecked())
1668 else if (snapCenter && snapCenter->isChecked())
1670 else if (snapMiddle && snapMiddle->isChecked())
1672 else if (snapDist && snapDist->isChecked())
1674 else if (snapIntersection && snapIntersection->isChecked())
1675 slotSnapIntersection();
1677 // snap restricitons:
1678 if (restrictNothing && restrictNothing->isChecked())
1679 slotRestrictNothing();
1680 else if (restrictOrthogonal && restrictOrthogonal->isChecked())
1681 slotRestrictOrthogonal();
1682 else if (restrictHorizontal && restrictHorizontal->isChecked())
1683 slotRestrictHorizontal();
1684 else if (restrictVertical && restrictVertical->isChecked())
1685 slotRestrictVertical();
1687 // lock of relative zero:
1688 if (lockRelativeZero)
1689 slotLockRelativeZero(lockRelativeZero->isChecked());
1692 void QG_ActionHandler::slotSetRelativeZero()
1694 setCurrentAction(RS2::ActionSetRelativeZero);
1697 void QG_ActionHandler::slotLockRelativeZero(bool on)
1699 if (lockRelativeZero)
1700 lockRelativeZero->setChecked(on);
1703 setCurrentAction(RS2::ActionLockRelativeZero);
1705 setCurrentAction(RS2::ActionUnlockRelativeZero);
1709 cadToolBarSnap->setLockRelativeZero(on);
1713 void QG_ActionHandler::slotInfoInside()
1715 setCurrentAction(RS2::ActionInfoInside);
1718 void QG_ActionHandler::slotInfoDist()
1720 setCurrentAction(RS2::ActionInfoDist);
1723 void QG_ActionHandler::slotInfoDist2()
1725 setCurrentAction(RS2::ActionInfoDist2);
1728 void QG_ActionHandler::slotInfoAngle()
1730 setCurrentAction(RS2::ActionInfoAngle);
1733 void QG_ActionHandler::slotInfoTotalLength()
1735 setCurrentAction(RS2::ActionInfoTotalLength);
1738 void QG_ActionHandler::slotInfoArea()
1740 setCurrentAction(RS2::ActionInfoArea);
1743 void QG_ActionHandler::slotLayersDefreezeAll()
1745 setCurrentAction(RS2::ActionLayersDefreezeAll);
1748 void QG_ActionHandler::slotLayersFreezeAll()
1750 setCurrentAction(RS2::ActionLayersFreezeAll);
1753 void QG_ActionHandler::slotLayersAdd()
1755 setCurrentAction(RS2::ActionLayersAdd);
1758 void QG_ActionHandler::slotLayersRemove()
1760 setCurrentAction(RS2::ActionLayersRemove);
1763 void QG_ActionHandler::slotLayersEdit()
1765 setCurrentAction(RS2::ActionLayersEdit);
1768 void QG_ActionHandler::slotLayersToggleView()
1770 setCurrentAction(RS2::ActionLayersToggleView);
1773 void QG_ActionHandler::slotLayersToggleLock()
1775 setCurrentAction(RS2::ActionLayersToggleLock);
1779 void QG_ActionHandler::slotBlocksDefreezeAll()
1781 setCurrentAction(RS2::ActionBlocksDefreezeAll);
1784 void QG_ActionHandler::slotBlocksFreezeAll()
1786 setCurrentAction(RS2::ActionBlocksFreezeAll);
1789 void QG_ActionHandler::slotBlocksAdd()
1791 setCurrentAction(RS2::ActionBlocksAdd);
1794 void QG_ActionHandler::slotBlocksRemove()
1796 setCurrentAction(RS2::ActionBlocksRemove);
1799 void QG_ActionHandler::slotBlocksAttributes()
1801 setCurrentAction(RS2::ActionBlocksAttributes);
1804 void QG_ActionHandler::slotBlocksEdit()
1806 setCurrentAction(RS2::ActionBlocksEdit);
1809 void QG_ActionHandler::slotBlocksInsert()
1811 setCurrentAction(RS2::ActionBlocksInsert);
1814 void QG_ActionHandler::slotBlocksToggleView()
1816 setCurrentAction(RS2::ActionBlocksToggleView);
1819 void QG_ActionHandler::slotBlocksCreate()
1821 setCurrentAction(RS2::ActionBlocksCreate);
1824 void QG_ActionHandler::slotBlocksExplode()
1826 setCurrentAction(RS2::ActionBlocksExplode);
1830 void QG_ActionHandler::slotOptionsDrawing()
1832 setCurrentAction(RS2::ActionOptionsDrawing);
1835 void QG_ActionHandler::slotCamExportAuto()
1838 setCurrentAction(RS2::ActionCamExportAuto);
1842 void QG_ActionHandler::slotCamReorder()
1845 setCurrentAction(RS2::ActionCamReorder);
1849 void QG_ActionHandler::slotFocusNormal()
1851 //QG_GraphicView* gv = mainWindow->getGraphicView();
1854 mainWindow->setFocus2();
1858 void QG_ActionHandler::setActionSnapFree(QAction * a)
1863 void QG_ActionHandler::setActionSnapGrid(QAction * a)
1868 void QG_ActionHandler::setActionSnapEndpoint(QAction * a)
1873 void QG_ActionHandler::setActionSnapOnEntity(QAction * a)
1878 void QG_ActionHandler::setActionSnapCenter(QAction * a)
1883 void QG_ActionHandler::setActionSnapMiddle(QAction * a)
1888 void QG_ActionHandler::setActionSnapDist(QAction * a)
1893 void QG_ActionHandler::setActionSnapIntersection(QAction * a)
1895 snapIntersection = a;
1898 void QG_ActionHandler::setActionSnapIntersectionManual(QAction * a)
1900 snapIntersectionManual = a;
1903 void QG_ActionHandler::setActionRestrictNothing(QAction * a)
1905 restrictNothing = a;
1908 void QG_ActionHandler::setActionRestrictOrthogonal(QAction * a)
1910 restrictOrthogonal = a;
1913 void QG_ActionHandler::setActionRestrictHorizontal(QAction * a)
1915 restrictHorizontal = a;
1918 void QG_ActionHandler::setActionRestrictVertical(QAction * a)
1920 restrictVertical = a;
1923 void QG_ActionHandler::setActionLockRelativeZero(QAction * a)
1925 lockRelativeZero = a;
1929 * Creates link to snap tool bar so we can update the button
1930 * state if the snapping action changes.
1932 void QG_ActionHandler::setCadToolBarSnap(CadToolBarSnap * tb)
1934 cadToolBarSnap = tb;