From: Shamus Hammons Date: Tue, 13 Jul 2010 22:09:40 +0000 (+0000) Subject: In the middle of major refactoring... X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d774c2655ba2c3657a565f325411144452392277;p=architektonas In the middle of major refactoring... --- diff --git a/architektonas.pro b/architektonas.pro index 85fe482..3a8b72a 100644 --- a/architektonas.pro +++ b/architektonas.pro @@ -28,7 +28,7 @@ INCLUDEPATH += \ HEADERS = \ src/base/rs.h \ - src/base/rs_actioninterface.h \ + src/base/actioninterface.h \ src/base/rs_arc.h \ src/base/rs_atomicentity.h \ src/base/rs_block.h \ @@ -80,14 +80,13 @@ HEADERS = \ src/base/rs_mainwindowinterface.h \ src/base/rs_math.h \ src/base/rs_modification.h \ - src/base/paintintf.h \ + src/base/paintinterface.h \ src/base/rs_pattern.h \ src/base/rs_patternlist.h \ src/base/rs_pen.h \ src/base/rs_point.h \ src/base/rs_polyline.h \ src/base/rs_preview.h \ - src/base/rs_previewactioninterface.h \ src/base/rs_python.h \ src/base/rs_python_wrappers.h \ src/base/rs_script.h \ @@ -111,7 +110,7 @@ HEADERS = \ src/base/vectorsolutions.h SOURCES = \ - src/base/rs_actioninterface.cpp \ + src/base/actioninterface.cpp \ src/base/rs_arc.cpp \ src/base/rs_atomicentity.cpp \ src/base/rs_block.cpp \ @@ -156,13 +155,12 @@ SOURCES = \ src/base/rs_linetypepattern.cpp \ src/base/rs_math.cpp \ src/base/rs_modification.cpp \ - src/base/paintintf.cpp \ + src/base/paintinterface.cpp \ src/base/rs_pattern.cpp \ src/base/rs_patternlist.cpp \ src/base/rs_point.cpp \ src/base/rs_polyline.cpp \ src/base/rs_preview.cpp \ - src/base/rs_previewactioninterface.cpp \ src/base/rs_python.cpp \ src/base/rs_python_wrappers.cpp \ src/base/rs_script.cpp \ @@ -186,220 +184,220 @@ SOURCES = \ src/base/vectorsolutions.cpp HEADERS += \ - src/actions/rs_actionblocksadd.h \ - src/actions/rs_actionblocksattributes.h \ - src/actions/rs_actionblockscreate.h \ - src/actions/rs_actionblocksedit.h \ - src/actions/rs_actionblocksexplode.h \ - src/actions/rs_actionblocksinsert.h \ - src/actions/rs_actionblocksfreezeall.h \ - src/actions/rs_actionblocksremove.h \ - src/actions/rs_actionblockstoggleview.h \ - src/actions/rs_actiondefault.h \ - src/actions/rs_actiondimaligned.h \ - src/actions/rs_actiondimangular.h \ - src/actions/rs_actiondimdiametric.h \ - src/actions/rs_actiondimension.h \ - src/actions/rs_actiondimleader.h \ - src/actions/rs_actiondimlinear.h \ - src/actions/rs_actiondimradial.h \ - src/actions/rs_actiondrawarc.h \ - src/actions/rs_actiondrawarc3p.h \ - src/actions/rs_actiondrawarctangential.h \ - src/actions/rs_actiondrawcircle.h \ - src/actions/rs_actiondrawcircle2p.h \ - src/actions/rs_actiondrawcircle3p.h \ - src/actions/rs_actiondrawcirclecr.h \ - src/actions/rs_actiondrawellipseaxis.h \ - src/actions/rs_actiondrawhatch.h \ - src/actions/rs_actiondrawimage.h \ - src/actions/rs_actiondrawline.h \ - src/actions/rs_actiondrawlineangle.h \ - src/actions/rs_actiondrawlinebisector.h \ - src/actions/rs_actiondrawlinefree.h \ - src/actions/rs_actiondrawlinehorvert.h \ - src/actions/rs_actiondrawlineparallel.h \ - src/actions/rs_actiondrawlineparallelthrough.h \ - src/actions/rs_actiondrawlinepolygon.h \ - src/actions/rs_actiondrawlinepolygon2.h \ - src/actions/rs_actiondrawlinerectangle.h \ - src/actions/rs_actiondrawlinerelangle.h \ - src/actions/rs_actiondrawlinetangent1.h \ - src/actions/rs_actiondrawlinetangent2.h \ - src/actions/rs_actiondrawpoint.h \ - src/actions/rs_actiondrawspline.h \ - src/actions/rs_actiondrawtext.h \ - src/actions/rs_actioneditcopy.h \ - src/actions/rs_actioneditpaste.h \ - src/actions/rs_actioneditundo.h \ - src/actions/rs_actionfilenew.h \ - src/actions/rs_actionfileopen.h \ - src/actions/rs_actionfilesave.h \ - src/actions/rs_actionfilesaveas.h \ - src/actions/rs_actioninfoangle.h \ - src/actions/rs_actioninfoarea.h \ - src/actions/rs_actioninfoinside.h \ - src/actions/rs_actioninfodist.h \ - src/actions/rs_actioninfodist2.h \ - src/actions/rs_actioninfototallength.h \ - src/actions/rs_actionlayersadd.h \ - src/actions/rs_actionlayersedit.h \ - src/actions/rs_actionlayersfreezeall.h \ - src/actions/rs_actionlayersremove.h \ - src/actions/rs_actionlayerstogglelock.h \ - src/actions/rs_actionlayerstoggleview.h \ - src/actions/rs_actionlibraryinsert.h \ - src/actions/rs_actionlockrelativezero.h \ - src/actions/rs_actionmodifyattributes.h \ - src/actions/rs_actionmodifybevel.h \ - src/actions/rs_actionmodifycut.h \ - src/actions/rs_actionmodifydelete.h \ - src/actions/rs_actionmodifydeletefree.h \ - src/actions/rs_actionmodifydeletequick.h \ - src/actions/rs_actionmodifyentity.h \ - src/actions/rs_actionmodifymirror.h \ - src/actions/rs_actionmodifymove.h \ - src/actions/rs_actionmodifymoverotate.h \ - src/actions/rs_actionmodifyrotate.h \ - src/actions/rs_actionmodifyrotate2.h \ - src/actions/rs_actionmodifyround.h \ - src/actions/rs_actionmodifyscale.h \ - src/actions/rs_actionmodifystretch.h \ - src/actions/rs_actionmodifytrim.h \ - src/actions/rs_actionmodifytrimamount.h \ - src/actions/rs_actionmodifyexplodetext.h \ - src/actions/rs_actionoptionsdrawing.h \ - src/actions/rs_actionprintpreview.h \ - src/actions/rs_actionselect.h \ - src/actions/rs_actionselectall.h \ - src/actions/rs_actionselectbase.h \ - src/actions/rs_actionselectcontour.h \ - src/actions/rs_actionselectintersected.h \ - src/actions/rs_actionselectinvert.h \ - src/actions/rs_actionselectsingle.h \ - src/actions/rs_actionselectwindow.h \ - src/actions/rs_actionselectlayer.h \ - src/actions/rs_actionsetrelativezero.h \ - src/actions/rs_actionsetsnapmode.h \ - src/actions/rs_actionsetsnaprestriction.h \ - src/actions/rs_actionsnapintersectionmanual.h \ - src/actions/rs_actiontoolregeneratedimensions.h \ - src/actions/rs_actionzoomauto.h \ - src/actions/rs_actionzoomautoy.h \ - src/actions/rs_actionzoomin.h \ - src/actions/rs_actionzoompan.h \ - src/actions/rs_actionzoomprevious.h \ - src/actions/rs_actionzoomredraw.h \ - src/actions/rs_actionzoomscroll.h \ - src/actions/rs_actionzoomwindow.h + src/actions/actionblocksadd.h \ + src/actions/actionblocksattributes.h \ + src/actions/actionblockscreate.h \ + src/actions/actionblocksedit.h \ + src/actions/actionblocksexplode.h \ + src/actions/actionblocksinsert.h \ + src/actions/actionblocksfreezeall.h \ + src/actions/actionblocksremove.h \ + src/actions/actionblockstoggleview.h \ + src/actions/actiondefault.h \ + src/actions/actiondimaligned.h \ + src/actions/actiondimangular.h \ + src/actions/actiondimdiametric.h \ + src/actions/actiondimension.h \ + src/actions/actiondimleader.h \ + src/actions/actiondimlinear.h \ + src/actions/actiondimradial.h \ + src/actions/actiondrawarc.h \ + src/actions/actiondrawarc3p.h \ + src/actions/actiondrawarctangential.h \ + src/actions/actiondrawcircle.h \ + src/actions/actiondrawcircle2p.h \ + src/actions/actiondrawcircle3p.h \ + src/actions/actiondrawcirclecr.h \ + src/actions/actiondrawellipseaxis.h \ + src/actions/actiondrawhatch.h \ + src/actions/actiondrawimage.h \ + src/actions/actiondrawline.h \ + src/actions/actiondrawlineangle.h \ + src/actions/actiondrawlinebisector.h \ + src/actions/actiondrawlinefree.h \ + src/actions/actiondrawlinehorvert.h \ + src/actions/actiondrawlineparallel.h \ + src/actions/actiondrawlineparallelthrough.h \ + src/actions/actiondrawlinepolygon.h \ + src/actions/actiondrawlinepolygon2.h \ + src/actions/actiondrawlinerectangle.h \ + src/actions/actiondrawlinerelangle.h \ + src/actions/actiondrawlinetangent1.h \ + src/actions/actiondrawlinetangent2.h \ + src/actions/actiondrawpoint.h \ + src/actions/actiondrawspline.h \ + src/actions/actiondrawtext.h \ + src/actions/actioneditcopy.h \ + src/actions/actioneditpaste.h \ + src/actions/actioneditundo.h \ + src/actions/actionfilenew.h \ + src/actions/actionfileopen.h \ + src/actions/actionfilesave.h \ + src/actions/actionfilesaveas.h \ + src/actions/actioninfoangle.h \ + src/actions/actioninfoarea.h \ + src/actions/actioninfoinside.h \ + src/actions/actioninfodist.h \ + src/actions/actioninfodist2.h \ + src/actions/actioninfototallength.h \ + src/actions/actionlayersadd.h \ + src/actions/actionlayersedit.h \ + src/actions/actionlayersfreezeall.h \ + src/actions/actionlayersremove.h \ + src/actions/actionlayerstogglelock.h \ + src/actions/actionlayerstoggleview.h \ + src/actions/actionlibraryinsert.h \ + src/actions/actionlockrelativezero.h \ + src/actions/actionmodifyattributes.h \ + src/actions/actionmodifybevel.h \ + src/actions/actionmodifycut.h \ + src/actions/actionmodifydelete.h \ + src/actions/actionmodifydeletefree.h \ + src/actions/actionmodifydeletequick.h \ + src/actions/actionmodifyentity.h \ + src/actions/actionmodifymirror.h \ + src/actions/actionmodifymove.h \ + src/actions/actionmodifymoverotate.h \ + src/actions/actionmodifyrotate.h \ + src/actions/actionmodifyrotate2.h \ + src/actions/actionmodifyround.h \ + src/actions/actionmodifyscale.h \ + src/actions/actionmodifystretch.h \ + src/actions/actionmodifytrim.h \ + src/actions/actionmodifytrimamount.h \ + src/actions/actionmodifyexplodetext.h \ + src/actions/actionoptionsdrawing.h \ + src/actions/actionprintpreview.h \ + src/actions/actionselect.h \ + src/actions/actionselectall.h \ + src/actions/actionselectbase.h \ + src/actions/actionselectcontour.h \ + src/actions/actionselectintersected.h \ + src/actions/actionselectinvert.h \ + src/actions/actionselectsingle.h \ + src/actions/actionselectwindow.h \ + src/actions/actionselectlayer.h \ + src/actions/actionsetrelativezero.h \ + src/actions/actionsetsnapmode.h \ + src/actions/actionsetsnaprestriction.h \ + src/actions/actionsnapintersectionmanual.h \ + src/actions/actiontoolregeneratedimensions.h \ + src/actions/actionzoomauto.h \ + src/actions/actionzoomautoy.h \ + src/actions/actionzoomin.h \ + src/actions/actionzoompan.h \ + src/actions/actionzoomprevious.h \ + src/actions/actionzoomredraw.h \ + src/actions/actionzoomscroll.h \ + src/actions/actionzoomwindow.h SOURCES += \ - src/actions/rs_actionblocksadd.cpp \ - src/actions/rs_actionblocksattributes.cpp \ - src/actions/rs_actionblockscreate.cpp \ - src/actions/rs_actionblocksedit.cpp \ - src/actions/rs_actionblocksexplode.cpp \ - src/actions/rs_actionblocksinsert.cpp \ - src/actions/rs_actionblocksfreezeall.cpp \ - src/actions/rs_actionblocksremove.cpp \ - src/actions/rs_actionblockstoggleview.cpp \ - src/actions/rs_actiondefault.cpp \ - src/actions/rs_actiondimaligned.cpp \ - src/actions/rs_actiondimangular.cpp \ - src/actions/rs_actiondimdiametric.cpp \ - src/actions/rs_actiondimension.cpp \ - src/actions/rs_actiondimleader.cpp \ - src/actions/rs_actiondimlinear.cpp \ - src/actions/rs_actiondimradial.cpp \ - src/actions/rs_actiondrawarc.cpp \ - src/actions/rs_actiondrawarc3p.cpp \ - src/actions/rs_actiondrawarctangential.cpp \ - src/actions/rs_actiondrawcircle.cpp \ - src/actions/rs_actiondrawcircle2p.cpp \ - src/actions/rs_actiondrawcircle3p.cpp \ - src/actions/rs_actiondrawcirclecr.cpp \ - src/actions/rs_actiondrawellipseaxis.cpp \ - src/actions/rs_actiondrawhatch.cpp \ - src/actions/rs_actiondrawimage.cpp \ - src/actions/rs_actiondrawline.cpp \ - src/actions/rs_actiondrawlineangle.cpp \ - src/actions/rs_actiondrawlinebisector.cpp \ - src/actions/rs_actiondrawlinefree.cpp \ - src/actions/rs_actiondrawlinehorvert.cpp \ - src/actions/rs_actiondrawlineparallel.cpp \ - src/actions/rs_actiondrawlineparallelthrough.cpp \ - src/actions/rs_actiondrawlinepolygon.cpp \ - src/actions/rs_actiondrawlinepolygon2.cpp \ - src/actions/rs_actiondrawlinerectangle.cpp \ - src/actions/rs_actiondrawlinerelangle.cpp \ - src/actions/rs_actiondrawlinetangent1.cpp \ - src/actions/rs_actiondrawlinetangent2.cpp \ - src/actions/rs_actiondrawpoint.cpp \ - src/actions/rs_actiondrawspline.cpp \ - src/actions/rs_actiondrawtext.cpp \ - src/actions/rs_actioneditcopy.cpp \ - src/actions/rs_actioneditpaste.cpp \ - src/actions/rs_actioneditundo.cpp \ - src/actions/rs_actionfilenew.cpp \ - src/actions/rs_actionfileopen.cpp \ - src/actions/rs_actionfilesave.cpp \ - src/actions/rs_actionfilesaveas.cpp \ - src/actions/rs_actioninfoangle.cpp \ - src/actions/rs_actioninfoarea.cpp \ - src/actions/rs_actioninfoinside.cpp \ - src/actions/rs_actioninfodist.cpp \ - src/actions/rs_actioninfodist2.cpp \ - src/actions/rs_actioninfototallength.cpp \ - src/actions/rs_actionlayersadd.cpp \ - src/actions/rs_actionlayersedit.cpp \ - src/actions/rs_actionlayersfreezeall.cpp \ - src/actions/rs_actionlayersremove.cpp \ - src/actions/rs_actionlayerstogglelock.cpp \ - src/actions/rs_actionlayerstoggleview.cpp \ - src/actions/rs_actionlibraryinsert.cpp \ - src/actions/rs_actionlockrelativezero.cpp \ - src/actions/rs_actionmodifyattributes.cpp \ - src/actions/rs_actionmodifybevel.cpp \ - src/actions/rs_actionmodifycut.cpp \ - src/actions/rs_actionmodifydelete.cpp \ - src/actions/rs_actionmodifydeletefree.cpp \ - src/actions/rs_actionmodifydeletequick.cpp \ - src/actions/rs_actionmodifyentity.cpp \ - src/actions/rs_actionmodifymirror.cpp \ - src/actions/rs_actionmodifymove.cpp \ - src/actions/rs_actionmodifymoverotate.cpp \ - src/actions/rs_actionmodifyrotate.cpp \ - src/actions/rs_actionmodifyrotate2.cpp \ - src/actions/rs_actionmodifyround.cpp \ - src/actions/rs_actionmodifyscale.cpp \ - src/actions/rs_actionmodifystretch.cpp \ - src/actions/rs_actionmodifytrim.cpp \ - src/actions/rs_actionmodifytrimamount.cpp \ - src/actions/rs_actionmodifyexplodetext.cpp \ - src/actions/rs_actionoptionsdrawing.cpp \ - src/actions/rs_actionprintpreview.cpp \ - src/actions/rs_actionselect.cpp \ - src/actions/rs_actionselectall.cpp \ - src/actions/rs_actionselectbase.cpp \ - src/actions/rs_actionselectcontour.cpp \ - src/actions/rs_actionselectintersected.cpp \ - src/actions/rs_actionselectinvert.cpp \ - src/actions/rs_actionselectsingle.cpp \ - src/actions/rs_actionselectwindow.cpp \ - src/actions/rs_actionselectlayer.cpp \ - src/actions/rs_actionsetrelativezero.cpp \ - src/actions/rs_actionsetsnapmode.cpp \ - src/actions/rs_actionsetsnaprestriction.cpp \ - src/actions/rs_actionsnapintersectionmanual.cpp \ - src/actions/rs_actiontoolregeneratedimensions.cpp \ - src/actions/rs_actionzoomauto.cpp \ - src/actions/rs_actionzoomautoy.cpp \ - src/actions/rs_actionzoomin.cpp \ - src/actions/rs_actionzoompan.cpp \ - src/actions/rs_actionzoomprevious.cpp \ - src/actions/rs_actionzoomredraw.cpp \ - src/actions/rs_actionzoomscroll.cpp \ - src/actions/rs_actionzoomwindow.cpp + src/actions/actionblocksadd.cpp \ + src/actions/actionblocksattributes.cpp \ + src/actions/actionblockscreate.cpp \ + src/actions/actionblocksedit.cpp \ + src/actions/actionblocksexplode.cpp \ + src/actions/actionblocksinsert.cpp \ + src/actions/actionblocksfreezeall.cpp \ + src/actions/actionblocksremove.cpp \ + src/actions/actionblockstoggleview.cpp \ + src/actions/actiondefault.cpp \ + src/actions/actiondimaligned.cpp \ + src/actions/actiondimangular.cpp \ + src/actions/actiondimdiametric.cpp \ + src/actions/actiondimension.cpp \ + src/actions/actiondimleader.cpp \ + src/actions/actiondimlinear.cpp \ + src/actions/actiondimradial.cpp \ + src/actions/actiondrawarc.cpp \ + src/actions/actiondrawarc3p.cpp \ + src/actions/actiondrawarctangential.cpp \ + src/actions/actiondrawcircle.cpp \ + src/actions/actiondrawcircle2p.cpp \ + src/actions/actiondrawcircle3p.cpp \ + src/actions/actiondrawcirclecr.cpp \ + src/actions/actiondrawellipseaxis.cpp \ + src/actions/actiondrawhatch.cpp \ + src/actions/actiondrawimage.cpp \ + src/actions/actiondrawline.cpp \ + src/actions/actiondrawlineangle.cpp \ + src/actions/actiondrawlinebisector.cpp \ + src/actions/actiondrawlinefree.cpp \ + src/actions/actiondrawlinehorvert.cpp \ + src/actions/actiondrawlineparallel.cpp \ + src/actions/actiondrawlineparallelthrough.cpp \ + src/actions/actiondrawlinepolygon.cpp \ + src/actions/actiondrawlinepolygon2.cpp \ + src/actions/actiondrawlinerectangle.cpp \ + src/actions/actiondrawlinerelangle.cpp \ + src/actions/actiondrawlinetangent1.cpp \ + src/actions/actiondrawlinetangent2.cpp \ + src/actions/actiondrawpoint.cpp \ + src/actions/actiondrawspline.cpp \ + src/actions/actiondrawtext.cpp \ + src/actions/actioneditcopy.cpp \ + src/actions/actioneditpaste.cpp \ + src/actions/actioneditundo.cpp \ + src/actions/actionfilenew.cpp \ + src/actions/actionfileopen.cpp \ + src/actions/actionfilesave.cpp \ + src/actions/actionfilesaveas.cpp \ + src/actions/actioninfoangle.cpp \ + src/actions/actioninfoarea.cpp \ + src/actions/actioninfoinside.cpp \ + src/actions/actioninfodist.cpp \ + src/actions/actioninfodist2.cpp \ + src/actions/actioninfototallength.cpp \ + src/actions/actionlayersadd.cpp \ + src/actions/actionlayersedit.cpp \ + src/actions/actionlayersfreezeall.cpp \ + src/actions/actionlayersremove.cpp \ + src/actions/actionlayerstogglelock.cpp \ + src/actions/actionlayerstoggleview.cpp \ + src/actions/actionlibraryinsert.cpp \ + src/actions/actionlockrelativezero.cpp \ + src/actions/actionmodifyattributes.cpp \ + src/actions/actionmodifybevel.cpp \ + src/actions/actionmodifycut.cpp \ + src/actions/actionmodifydelete.cpp \ + src/actions/actionmodifydeletefree.cpp \ + src/actions/actionmodifydeletequick.cpp \ + src/actions/actionmodifyentity.cpp \ + src/actions/actionmodifymirror.cpp \ + src/actions/actionmodifymove.cpp \ + src/actions/actionmodifymoverotate.cpp \ + src/actions/actionmodifyrotate.cpp \ + src/actions/actionmodifyrotate2.cpp \ + src/actions/actionmodifyround.cpp \ + src/actions/actionmodifyscale.cpp \ + src/actions/actionmodifystretch.cpp \ + src/actions/actionmodifytrim.cpp \ + src/actions/actionmodifytrimamount.cpp \ + src/actions/actionmodifyexplodetext.cpp \ + src/actions/actionoptionsdrawing.cpp \ + src/actions/actionprintpreview.cpp \ + src/actions/actionselect.cpp \ + src/actions/actionselectall.cpp \ + src/actions/actionselectbase.cpp \ + src/actions/actionselectcontour.cpp \ + src/actions/actionselectintersected.cpp \ + src/actions/actionselectinvert.cpp \ + src/actions/actionselectsingle.cpp \ + src/actions/actionselectwindow.cpp \ + src/actions/actionselectlayer.cpp \ + src/actions/actionsetrelativezero.cpp \ + src/actions/actionsetsnapmode.cpp \ + src/actions/actionsetsnaprestriction.cpp \ + src/actions/actionsnapintersectionmanual.cpp \ + src/actions/actiontoolregeneratedimensions.cpp \ + src/actions/actionzoomauto.cpp \ + src/actions/actionzoomautoy.cpp \ + src/actions/actionzoomin.cpp \ + src/actions/actionzoompan.cpp \ + src/actions/actionzoomprevious.cpp \ + src/actions/actionzoomredraw.cpp \ + src/actions/actionzoomscroll.cpp \ + src/actions/actionzoomwindow.cpp HEADERS += \ src/forms/arcoptions.h \ diff --git a/src/actions/actionblocksadd.cpp b/src/actions/actionblocksadd.cpp new file mode 100644 index 0000000..c187c0e --- /dev/null +++ b/src/actions/actionblocksadd.cpp @@ -0,0 +1,53 @@ +// actionblocksadd.cpp +// +// Part of the Architektonas Project +// Originally part of QCad Community Edition by Andrew Mustun +// Extensively rewritten and refactored by James L. Hammons +// (C) 2010 Underground Software +// +// JLH = James L. Hammons +// +// Who When What +// --- ---------- ----------------------------------------------------------- +// JLH 07/12/2010 Added this text. :-) +// + +#include "actionblocksadd.h" + +#include "drawing.h" +#include "rs_dialogfactory.h" + +ActionBlocksAdd::ActionBlocksAdd(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Add Block", container, graphicView) +{ +} + +ActionBlocksAdd::~ActionBlocksAdd() +{ +} + +void ActionBlocksAdd::trigger() +{ + RS_DEBUG->print("adding block"); + + if (graphic) + { + RS_BlockList * blockList = graphic->getBlockList(); + + if (blockList) + { + RS_BlockData d = RS_DIALOGFACTORY->requestNewBlockDialog(blockList); + + if (d.isValid()) + graphic->addBlock(new RS_Block(container, d)); + } + } + + finish(); +} + +void ActionBlocksAdd::init(int status) +{ + ActionInterface::init(status); + trigger(); +} diff --git a/src/actions/actionblocksadd.h b/src/actions/actionblocksadd.h new file mode 100644 index 0000000..491f469 --- /dev/null +++ b/src/actions/actionblocksadd.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONBLOCKSADD_H__ +#define __ACTIONBLOCKSADD_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to edit blocks. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionBlocksAdd: public ActionInterface +{ + public: + ActionBlocksAdd(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionBlocksAdd(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONBLOCKSADD_H__ diff --git a/src/actions/actionblocksattributes.cpp b/src/actions/actionblocksattributes.cpp new file mode 100644 index 0000000..7e6d09d --- /dev/null +++ b/src/actions/actionblocksattributes.cpp @@ -0,0 +1,63 @@ +// actionblocksattributes.cpp +// +// Part of the Architektonas Project +// Originally part of QCad Community Edition by Andrew Mustun +// Extensively rewritten and refactored by James L. Hammons +// (C) 2010 Underground Software +// +// JLH = James L. Hammons +// +// Who When What +// --- ---------- ----------------------------------------------------------- +// JLH 07/12/2010 Added this text. :-) +// + +#include "actionblocksattributes.h" + +#include "drawing.h" +#include "rs_dialogfactory.h" + +ActionBlocksAttributes::ActionBlocksAttributes( + RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Edit Block Attributes", container, graphicView) +{ +} + +ActionBlocksAttributes::~ActionBlocksAttributes() +{ +} + +void ActionBlocksAttributes::trigger() +{ + RS_DEBUG->print("editing block attributes"); + + if (graphic && RS_DIALOGFACTORY) + { + RS_Block * block = graphic->getActiveBlock(); + RS_BlockList * blockList = graphic->getBlockList(); + + if (blockList && block) + { + QString oldName = block->getName(); + RS_BlockData d = RS_DIALOGFACTORY->requestBlockAttributesDialog(blockList); + + if (d.isValid()) + { + QString newName = d.name; + blockList->rename(block, newName); + + // update the name of all inserts: + graphic->renameInserts(oldName, newName); + graphic->addBlockNotification(); + } + } + } + + finish(); +} + +void ActionBlocksAttributes::init(int status) +{ + ActionInterface::init(status); + trigger(); +} diff --git a/src/actions/actionblocksattributes.h b/src/actions/actionblocksattributes.h new file mode 100644 index 0000000..c825ad1 --- /dev/null +++ b/src/actions/actionblocksattributes.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONBLOCKSATTRIBUTES_H__ +#define __ACTIONBLOCKSATTRIBUTES_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to edit block attributes. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionBlocksAttributes: public ActionInterface +{ + public: + ActionBlocksAttributes(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionBlocksAttributes(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONBLOCKSATTRIBUTES_H__ diff --git a/src/actions/rs_actionblockscreate.cpp b/src/actions/actionblockscreate.cpp similarity index 70% rename from src/actions/rs_actionblockscreate.cpp rename to src/actions/actionblockscreate.cpp index 30e7a39..7b57aa7 100644 --- a/src/actions/rs_actionblockscreate.cpp +++ b/src/actions/actionblockscreate.cpp @@ -1,4 +1,4 @@ -// rs_actionblockscreate.cpp +// actionblockscreate.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -13,7 +13,7 @@ // JLH 06/03/2010 Scrubbed out all occurances of RS_CoordinateEvent // -#include "rs_actionblockscreate.h" +#include "actionblockscreate.h" #include "rs_creation.h" #include "rs_dialogfactory.h" @@ -24,17 +24,17 @@ /** * Constructor. */ -RS_ActionBlocksCreate::RS_ActionBlocksCreate(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Blocks Create", container, graphicView) +ActionBlocksCreate::ActionBlocksCreate(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Blocks Create", container, graphicView) { referencePoint = Vector(false); } -RS_ActionBlocksCreate::~RS_ActionBlocksCreate() +ActionBlocksCreate::~ActionBlocksCreate() { } #if 0 -QAction * RS_ActionBlocksCreate::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/) +QAction * ActionBlocksCreate::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/) { QAction * action = new QAction(tr("&Create Block"), 0); // QAction* action = new QAction(tr("Create Block"), @@ -47,19 +47,19 @@ QAction * RS_ActionBlocksCreate::createGUIAction(RS2::ActionType /*type*/, QObje #endif -/*virtual*/ RS2::ActionType RS_ActionBlocksCreate::rtti() +/*virtual*/ RS2::ActionType ActionBlocksCreate::rtti() { return RS2::ActionBlocksCreate; } -void RS_ActionBlocksCreate::init(int status) +void ActionBlocksCreate::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionBlocksCreate::trigger() +void ActionBlocksCreate::trigger() { - deleteSnapper(); +// deleteSnapper(); //deletePreview(); //clearPreview(); @@ -91,9 +91,10 @@ void RS_ActionBlocksCreate::trigger() graphicView->killSelectActions(); } -void RS_ActionBlocksCreate::mouseMoveEvent(QMouseEvent * e) +void ActionBlocksCreate::mouseMoveEvent(QMouseEvent * e) { - snapPoint(e); +// snapPoint(e); + graphicView->snapper.snapPoint(e); switch (getStatus()) { @@ -116,34 +117,29 @@ void RS_ActionBlocksCreate::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionBlocksCreate::mouseReleaseEvent(QMouseEvent * e) +void ActionBlocksCreate::mouseReleaseEvent(QMouseEvent * e) { -// if (e->button() == Qt::LeftButton) if (e->button() == Qt::LeftButton) { // Vector ce(snapPoint(e)); -// coordinateEvent(&ce); - Vector ce(snapPoint(e)); + Vector ce(graphicView->snapper.snapPoint(e)); coordinateEvent(&ce); } -// else if (e->button() == Qt::RightButton) else if (e->button() == Qt::RightButton) { - deleteSnapper(); +// deleteSnapper(); init(getStatus() - 1); } } -//void RS_ActionBlocksCreate::coordinateEvent(Vector * e) -void RS_ActionBlocksCreate::coordinateEvent(Vector * e) +void ActionBlocksCreate::coordinateEvent(Vector * e) { - if (e == NULL) + if (!e) return; switch (getStatus()) { case SetReferencePoint: -// referencePoint = e->getCoordinate(); referencePoint = *e; trigger(); break; @@ -153,7 +149,7 @@ void RS_ActionBlocksCreate::coordinateEvent(Vector * e) } } -void RS_ActionBlocksCreate::updateMouseButtonHints() +void ActionBlocksCreate::updateMouseButtonHints() { switch (getStatus()) { @@ -167,12 +163,12 @@ void RS_ActionBlocksCreate::updateMouseButtonHints() } } -void RS_ActionBlocksCreate::updateMouseCursor() +void ActionBlocksCreate::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionBlocksCreate::updateToolBar() +void ActionBlocksCreate::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); diff --git a/src/actions/rs_actionblockscreate.h b/src/actions/actionblockscreate.h similarity index 61% rename from src/actions/rs_actionblockscreate.h rename to src/actions/actionblockscreate.h index dacd03c..27a462a 100644 --- a/src/actions/rs_actionblockscreate.h +++ b/src/actions/actionblockscreate.h @@ -1,15 +1,17 @@ -#ifndef RS_ACTIONBLOCKSCREATE_H -#define RS_ACTIONBLOCKSCREATE_H +#ifndef __ACTIONBLOCKSCREATE_H__ +#define __ACTIONBLOCKSCREATE_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" +#include "vector.h" /** * This action class can handle user events for creating blocks from * existing entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionBlocksCreate: public RS_PreviewActionInterface +class ActionBlocksCreate: public ActionInterface { public: /** @@ -21,8 +23,8 @@ class RS_ActionBlocksCreate: public RS_PreviewActionInterface }; public: - RS_ActionBlocksCreate(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionBlocksCreate(); + ActionBlocksCreate(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionBlocksCreate(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -30,10 +32,6 @@ class RS_ActionBlocksCreate: public RS_PreviewActionInterface virtual void mouseMoveEvent(QMouseEvent * e); virtual void mouseReleaseEvent(QMouseEvent * e); virtual void coordinateEvent(Vector * e); - //virtual void commandEvent(RS_CommandEvent * e); - //virtual QStringList getAvailableCommands(); - //virtual void showOptions(); - //virtual void hideOptions(); virtual void updateMouseButtonHints(); virtual void updateMouseCursor(); virtual void updateToolBar(); @@ -42,4 +40,4 @@ class RS_ActionBlocksCreate: public RS_PreviewActionInterface Vector referencePoint; }; -#endif +#endif // __ACTIONBLOCKSCREATE_H__ diff --git a/src/actions/actionblocksedit.cpp b/src/actions/actionblocksedit.cpp new file mode 100644 index 0000000..548e4ce --- /dev/null +++ b/src/actions/actionblocksedit.cpp @@ -0,0 +1,45 @@ +// actionblocksedit.cpp +// +// Part of the Architektonas Project +// Originally part of QCad Community Edition by Andrew Mustun +// Extensively rewritten and refactored by James L. Hammons +// (C) 2010 Underground Software +// +// JLH = James L. Hammons +// +// Who When What +// --- ---------- ----------------------------------------------------------- +// JLH 07/12/2010 Added this text. :-) +// + +#include "actionblocksedit.h" + +#include "drawing.h" +#include "rs_dialogfactory.h" + +ActionBlocksEdit::ActionBlocksEdit(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Edit Block", container, graphicView) +{ +} + +ActionBlocksEdit::~ActionBlocksEdit() +{ +} + +void ActionBlocksEdit::trigger() +{ + RS_DEBUG->print("edit block"); + + if (graphic && RS_DIALOGFACTORY) + RS_DIALOGFACTORY->requestEditBlockWindow(graphic->getBlockList()); + else + RS_DEBUG->print(RS_Debug::D_WARNING, "ActionBlocksEdit::trigger(): graphic is NULL"); + + finish(); +} + +void ActionBlocksEdit::init(int status) +{ + ActionInterface::init(status); + trigger(); +} diff --git a/src/actions/actionblocksedit.h b/src/actions/actionblocksedit.h new file mode 100644 index 0000000..eab3610 --- /dev/null +++ b/src/actions/actionblocksedit.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONBLOCKSEDIT_H__ +#define __ACTIONBLOCKSEDIT_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to edit blocks. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionBlocksEdit: public ActionInterface +{ + public: + ActionBlocksEdit(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionBlocksEdit(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONBLOCKSEDIT_H__ diff --git a/src/actions/actionblocksexplode.cpp b/src/actions/actionblocksexplode.cpp new file mode 100644 index 0000000..4024148 --- /dev/null +++ b/src/actions/actionblocksexplode.cpp @@ -0,0 +1,48 @@ +// actionblocksexplode.cpp +// +// Part of the Architektonas Project +// Originally part of QCad Community Edition by Andrew Mustun +// Extensively rewritten and refactored by James L. Hammons +// (C) 2010 Underground Software +// +// JLH = James L. Hammons +// +// Who When What +// --- ---------- ----------------------------------------------------------- +// JLH 07/12/2010 Added this text. :-) +// + +#include "actionblocksexplode.h" + +#include "rs_modification.h" + +/** + * Constructor. + */ +ActionBlocksExplode::ActionBlocksExplode(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Blocks Explode", container, graphicView) +{ +} + +ActionBlocksExplode::~ActionBlocksExplode() +{ +} + +/*virtual*/ RS2::ActionType ActionBlocksExplode::rtti() +{ + return RS2::ActionBlocksExplode; +} + +void ActionBlocksExplode::init(int status) +{ + ActionInterface::init(status); + + trigger(); + finish(); +} + +void ActionBlocksExplode::trigger() +{ + RS_Modification m(*container, graphicView); + m.explode(); +} diff --git a/src/actions/actionblocksexplode.h b/src/actions/actionblocksexplode.h new file mode 100644 index 0000000..f28603e --- /dev/null +++ b/src/actions/actionblocksexplode.h @@ -0,0 +1,25 @@ +#ifndef __ACTIONBLOCKSEXPLODE_H__ +#define __ACTIONBLOCKSEXPLODE_H__ + +#include "actioninterface.h" +#include "rs_insert.h" + +/** + * This action class can handle user events for exploding blocks and + * other entity containers into single entities. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionBlocksExplode: public ActionInterface +{ + public: + ActionBlocksExplode(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionBlocksExplode(); + + virtual RS2::ActionType rtti(); + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONBLOCKSEXPLODE_H__ diff --git a/src/actions/rs_actionblocksfreezeall.cpp b/src/actions/actionblocksfreezeall.cpp similarity index 52% rename from src/actions/rs_actionblocksfreezeall.cpp rename to src/actions/actionblocksfreezeall.cpp index ef5f779..86321ee 100644 --- a/src/actions/rs_actionblocksfreezeall.cpp +++ b/src/actions/actionblocksfreezeall.cpp @@ -1,4 +1,4 @@ -// rs_actionblocksfreezeall.cpp +// actionblocksfreezeall.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,35 +12,34 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actionblocksfreezeall.h" +#include "actionblocksfreezeall.h" #include "drawing.h" #include "graphicview.h" -RS_ActionBlocksFreezeAll::RS_ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Freeze all Blocks", - container, graphicView) +ActionBlocksFreezeAll::ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Freeze all Blocks", container, graphicView) { this->freeze = freeze; } -RS_ActionBlocksFreezeAll::~RS_ActionBlocksFreezeAll() +ActionBlocksFreezeAll::~ActionBlocksFreezeAll() { } -void RS_ActionBlocksFreezeAll::trigger() +void ActionBlocksFreezeAll::trigger() { - RS_DEBUG->print("RS_ActionBlocksFreezeAll::trigger"); + RS_DEBUG->print("ActionBlocksFreezeAll::trigger"); - if (graphic != NULL) + if (graphic) graphic->freezeAllBlocks(freeze); graphicView->redraw(); finish(); } -void RS_ActionBlocksFreezeAll::init(int status) +void ActionBlocksFreezeAll::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionblocksfreezeall.h b/src/actions/actionblocksfreezeall.h new file mode 100644 index 0000000..31c359a --- /dev/null +++ b/src/actions/actionblocksfreezeall.h @@ -0,0 +1,25 @@ +#ifndef __ACTIONBLOCKSFREEZEALL_H__ +#define __ACTIONBLOCKSFREEZEALL_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to edit layers. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionBlocksFreezeAll: public ActionInterface +{ + public: + ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView); + ~ActionBlocksFreezeAll(); + + virtual void init(int status = 0); + virtual void trigger(); + + private: + bool freeze; +}; + +#endif // __ACTIONBLOCKSFREEZEALL_H__ diff --git a/src/actions/rs_actionblocksinsert.cpp b/src/actions/actionblocksinsert.cpp similarity index 65% rename from src/actions/rs_actionblocksinsert.cpp rename to src/actions/actionblocksinsert.cpp index 8e70dfb..4f2ccc9 100644 --- a/src/actions/rs_actionblocksinsert.cpp +++ b/src/actions/actionblocksinsert.cpp @@ -1,4 +1,4 @@ -// rs_actionblocksinsert.cpp +// actionblocksinsert.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -13,7 +13,7 @@ // JLH 06/03/2010 Scrubbed out all occurances of RS_CoordinateEvent // -#include "rs_actionblocksinsert.h" +#include "actionblocksinsert.h" #include "commands.h" #include "rs_commandevent.h" @@ -25,67 +25,53 @@ /** * Constructor. */ -RS_ActionBlocksInsert::RS_ActionBlocksInsert(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Blocks Insert", - container, graphicView) +ActionBlocksInsert::ActionBlocksInsert(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Blocks Insert", container, graphicView) { } -RS_ActionBlocksInsert::~RS_ActionBlocksInsert() +ActionBlocksInsert::~ActionBlocksInsert() { } -#if 0 -QAction * RS_ActionBlocksInsert::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/) -{ - QAction * action = new QAction(tr("&Insert Block"), 0); -// QAction* action = new QAction(tr("Insert Block"), tr("&Insert Block"), -// QKeySequence(), NULL); - action->setStatusTip(tr("Insert Block")); - - return action; -} - -#endif - -/*virtual*/ RS2::ActionType RS_ActionBlocksInsert::rtti() +/*virtual*/ RS2::ActionType ActionBlocksInsert::rtti() { return RS2::ActionBlocksInsert; } -void RS_ActionBlocksInsert::init(int status /*= 0*/) +void ActionBlocksInsert::init(int status /*= 0*/) { - RS_PreviewActionInterface::init(status); - + ActionInterface::init(status); reset(); - if (graphic != NULL) + if (graphic) { block = graphic->getActiveBlock(); - if (block != NULL) + if (block) data.name = block->getName(); else finish(); } } -void RS_ActionBlocksInsert::reset() +void ActionBlocksInsert::reset() { - data = RS_InsertData("", Vector(0.0, 0.0), Vector(1.0, 1.0), 0.0, - 1, 1, Vector(1.0, 1.0), NULL, RS2::Update); + data = RS_InsertData("", Vector(0.0, 0.0), Vector(1.0, 1.0), 0.0, 1, 1, + Vector(1.0, 1.0), NULL, RS2::Update); } -void RS_ActionBlocksInsert::trigger() +void ActionBlocksInsert::trigger() { - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); //RS_Modification m(*container, graphicView); //m.paste(data.insertionPoint); //std::cout << *RS_Clipboard::instance(); - if (block != NULL) + if (block) { RS_Creation creation(container, graphicView); data.updateMode = RS2::Update; @@ -93,27 +79,28 @@ void RS_ActionBlocksInsert::trigger() } graphicView->redraw(); - //finish(); } -void RS_ActionBlocksInsert::mouseMoveEvent(QMouseEvent * e) +void ActionBlocksInsert::mouseMoveEvent(QMouseEvent * e) { switch (getStatus()) { case SetTargetPoint: - data.insertionPoint = snapPoint(e); +// data.insertionPoint = snapPoint(e); + data.insertionPoint = graphicView->snapper.snapPoint(e); if (block != NULL) { - deletePreview(); - clearPreview(); +// deletePreview(); +// clearPreview(); //preview->addAllFrom(*block); //preview->move(data.insertionPoint); - RS_Creation creation(preview, NULL, false); +// RS_Creation creation(preview, NULL, false); + RS_Creation creation(&(graphicView->preview), NULL, false); // Create insert as preview only data.updateMode = RS2::PreviewUpdate; creation.createInsert(data); - drawPreview(); +// drawPreview(); } break; @@ -122,33 +109,31 @@ void RS_ActionBlocksInsert::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionBlocksInsert::mouseReleaseEvent(QMouseEvent * e) +void ActionBlocksInsert::mouseReleaseEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { - Vector ce(snapPoint(e)); +// Vector ce(snapPoint(e)); + Vector ce(graphicView->snapper.snapPoint(e)); coordinateEvent(&ce); } -// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) else if (e->button() == Qt::RightButton) { - deleteSnapper(); +// deleteSnapper(); init(getStatus() - 1); } } -void RS_ActionBlocksInsert::coordinateEvent(Vector * e) +void ActionBlocksInsert::coordinateEvent(Vector * e) { - if (e == NULL) + if (!e) return; -// data.insertionPoint = e->getCoordinate(); data.insertionPoint = *e; trigger(); } -void RS_ActionBlocksInsert::commandEvent(RS_CommandEvent * e) +void ActionBlocksInsert::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -165,49 +150,49 @@ void RS_ActionBlocksInsert::commandEvent(RS_CommandEvent * e) if (checkCommand("angle", c)) { - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); lastStatus = (Status)getStatus(); setStatus(SetAngle); } else if (checkCommand("factor", c)) { - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); lastStatus = (Status)getStatus(); setStatus(SetFactor); } else if (checkCommand("columns", c)) { - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); lastStatus = (Status)getStatus(); setStatus(SetColumns); } else if (checkCommand("rows", c)) { - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); lastStatus = (Status)getStatus(); setStatus(SetRows); } else if (checkCommand("columnspacing", c)) { - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); lastStatus = (Status)getStatus(); setStatus(SetColumnSpacing); } else if (checkCommand("rowspacing", c)) { - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); lastStatus = (Status)getStatus(); setStatus(SetRowSpacing); } @@ -218,10 +203,11 @@ void RS_ActionBlocksInsert::commandEvent(RS_CommandEvent * e) bool ok; double a = RS_Math::eval(c, &ok); - if (ok == true) + if (ok) data.angle = RS_Math::deg2rad(a); else RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + RS_DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } @@ -232,10 +218,11 @@ void RS_ActionBlocksInsert::commandEvent(RS_CommandEvent * e) bool ok; double f = RS_Math::eval(c, &ok); - if (ok == true) + if (ok) setFactor(f); else RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + RS_DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } @@ -246,10 +233,11 @@ void RS_ActionBlocksInsert::commandEvent(RS_CommandEvent * e) bool ok; int cols = (int)RS_Math::eval(c, &ok); - if (ok == true) + if (ok) data.cols = cols; else RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + RS_DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } @@ -260,10 +248,11 @@ void RS_ActionBlocksInsert::commandEvent(RS_CommandEvent * e) bool ok; int rows = (int)RS_Math::eval(c, &ok); - if (ok == true) + if (ok) data.rows = rows; else RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + RS_DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } @@ -274,10 +263,11 @@ void RS_ActionBlocksInsert::commandEvent(RS_CommandEvent * e) bool ok; double cs = (int)RS_Math::eval(c, &ok); - if (ok == true) + if (ok) data.spacing.x = cs; else RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + RS_DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } @@ -288,10 +278,11 @@ void RS_ActionBlocksInsert::commandEvent(RS_CommandEvent * e) bool ok; int rs = (int)RS_Math::eval(c, &ok); - if (ok == true) + if (ok) data.spacing.y = rs; else RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + RS_DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } @@ -302,7 +293,7 @@ void RS_ActionBlocksInsert::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionBlocksInsert::getAvailableCommands() +QStringList ActionBlocksInsert::getAvailableCommands() { QStringList cmd; @@ -324,19 +315,19 @@ QStringList RS_ActionBlocksInsert::getAvailableCommands() return cmd; } -void RS_ActionBlocksInsert::showOptions() +void ActionBlocksInsert::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionBlocksInsert::hideOptions() +void ActionBlocksInsert::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionBlocksInsert::updateMouseButtonHints() +void ActionBlocksInsert::updateMouseButtonHints() { switch (getStatus()) { @@ -374,12 +365,12 @@ void RS_ActionBlocksInsert::updateMouseButtonHints() } } -void RS_ActionBlocksInsert::updateMouseCursor() +void ActionBlocksInsert::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionBlocksInsert::updateToolBar() +void ActionBlocksInsert::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -387,63 +378,62 @@ void RS_ActionBlocksInsert::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } -double RS_ActionBlocksInsert::getAngle() +double ActionBlocksInsert::getAngle() { return data.angle; } -void RS_ActionBlocksInsert::setAngle(double a) +void ActionBlocksInsert::setAngle(double a) { data.angle = a; } -double RS_ActionBlocksInsert::getFactor() +double ActionBlocksInsert::getFactor() { return data.scaleFactor.x; } -void RS_ActionBlocksInsert::setFactor(double f) +void ActionBlocksInsert::setFactor(double f) { data.scaleFactor = Vector(f, f); } -int RS_ActionBlocksInsert::getColumns() +int ActionBlocksInsert::getColumns() { return data.cols; } -void RS_ActionBlocksInsert::setColumns(int c) +void ActionBlocksInsert::setColumns(int c) { data.cols = c; } -int RS_ActionBlocksInsert::getRows() +int ActionBlocksInsert::getRows() { return data.rows; } -void RS_ActionBlocksInsert::setRows(int r) +void ActionBlocksInsert::setRows(int r) { data.rows = r; } -double RS_ActionBlocksInsert::getColumnSpacing() +double ActionBlocksInsert::getColumnSpacing() { return data.spacing.x; } -void RS_ActionBlocksInsert::setColumnSpacing(double cs) +void ActionBlocksInsert::setColumnSpacing(double cs) { data.spacing.x = cs; } -double RS_ActionBlocksInsert::getRowSpacing() +double ActionBlocksInsert::getRowSpacing() { return data.spacing.y; } -void RS_ActionBlocksInsert::setRowSpacing(double rs) +void ActionBlocksInsert::setRowSpacing(double rs) { data.spacing.y = rs; } - diff --git a/src/actions/rs_actionblocksinsert.h b/src/actions/actionblocksinsert.h similarity index 84% rename from src/actions/rs_actionblocksinsert.h rename to src/actions/actionblocksinsert.h index 7e3fb94..1bdf49d 100644 --- a/src/actions/rs_actionblocksinsert.h +++ b/src/actions/actionblocksinsert.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONBLOCKSINSERT_H -#define RS_ACTIONBLOCKSINSERT_H +#ifndef __ACTIONBLOCKSINSERT_H__ +#define __ACTIONBLOCKSINSERT_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "rs_insert.h" /** * This action class can handle user events for inserting blocks into the * current drawing. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionBlocksInsert: public RS_PreviewActionInterface +class ActionBlocksInsert: public ActionInterface { public: /** @@ -27,8 +28,8 @@ class RS_ActionBlocksInsert: public RS_PreviewActionInterface }; public: - RS_ActionBlocksInsert(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionBlocksInsert(); + ActionBlocksInsert(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionBlocksInsert(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -66,4 +67,4 @@ class RS_ActionBlocksInsert: public RS_PreviewActionInterface Status lastStatus; }; -#endif +#endif // __ACTIONBLOCKSINSERT_H__ diff --git a/src/actions/rs_actionblocksremove.cpp b/src/actions/actionblocksremove.cpp similarity index 64% rename from src/actions/rs_actionblocksremove.cpp rename to src/actions/actionblocksremove.cpp index f1aa15b..9e9ffc2 100644 --- a/src/actions/rs_actionblocksremove.cpp +++ b/src/actions/actionblocksremove.cpp @@ -1,4 +1,4 @@ -// rs_actionblocksremove.cpp +// actionblocksremove.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actionblocksremove.h" +#include "actionblocksremove.h" #include "rs_block.h" #include "rs_dialogfactory.h" @@ -20,37 +20,34 @@ #include "graphicview.h" #include "rs_insert.h" -RS_ActionBlocksRemove::RS_ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Remove Block", container, graphicView) +ActionBlocksRemove::ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Remove Block", container, graphicView) { } -RS_ActionBlocksRemove::~RS_ActionBlocksRemove() +ActionBlocksRemove::~ActionBlocksRemove() { } -void RS_ActionBlocksRemove::trigger() +void ActionBlocksRemove::trigger() { - RS_DEBUG->print("RS_ActionBlocksRemove::trigger"); + RS_DEBUG->print("ActionBlocksRemove::trigger"); - if (graphic != NULL) + if (graphic) { RS_Block * block = RS_DIALOGFACTORY->requestBlockRemovalDialog(graphic->getBlockList()); // list of containers that might refer to the block via inserts: -// Q3PtrList containerList; QList containerList; containerList.append(graphic); RS_BlockList * blkLst = graphic->getBlockList(); - for (uint bi = 0; bi < blkLst->count(); bi++) + for(uint bi=0; bicount(); bi++) containerList.append(blkLst->at(bi)); - if (block != NULL) + if (block) { -// for (RS_EntityContainer * cont=containerList.first(); cont!=NULL; -// cont=containerList.next()) - for (int i = 0; i < containerList.size(); i++) + for(int i=0; ifirstEntity(RS2::ResolveNone); e != NULL; - e = cont->nextEntity(RS2::ResolveNone)) + for(RS_Entity * e=cont->firstEntity(RS2::ResolveNone); e!=NULL; + e=cont->nextEntity(RS2::ResolveNone)) + { if (e->rtti() == RS2::EntityInsert) { RS_Insert * ins = (RS_Insert *)e; @@ -73,12 +71,13 @@ void RS_ActionBlocksRemove::trigger() break; } } + } } while (!done); } // close all windows that are editing this block: - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->closeEditBlockWindow(block); // Now remove the block from the block list: @@ -92,9 +91,8 @@ void RS_ActionBlocksRemove::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionBlocksRemove::init(int status) +void ActionBlocksRemove::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionblocksremove.h b/src/actions/actionblocksremove.h new file mode 100644 index 0000000..85c9267 --- /dev/null +++ b/src/actions/actionblocksremove.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONBLOCKSREMOVE_H__ +#define __ACTIONBLOCKSREMOVE_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to remove blocks. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionBlocksRemove: public ActionInterface +{ + public: + ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionBlocksRemove(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONBLOCKSREMOVE_H__ diff --git a/src/actions/rs_actionblockstoggleview.cpp b/src/actions/actionblockstoggleview.cpp similarity index 57% rename from src/actions/rs_actionblockstoggleview.cpp rename to src/actions/actionblockstoggleview.cpp index 3b8c84d..75087d1 100644 --- a/src/actions/rs_actionblockstoggleview.cpp +++ b/src/actions/actionblockstoggleview.cpp @@ -1,4 +1,4 @@ -// rs_actionblockstoggleview.cpp +// actionblockstoggleview.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,25 +12,26 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actionblockstoggleview.h" +#include "actionblockstoggleview.h" #include "drawing.h" #include "graphicview.h" -RS_ActionBlocksToggleView::RS_ActionBlocksToggleView(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Toggle Block Visibility", - container, graphicView) +ActionBlocksToggleView::ActionBlocksToggleView(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Toggle Block Visibility", + container, graphicView) { } -RS_ActionBlocksToggleView::~RS_ActionBlocksToggleView() +ActionBlocksToggleView::~ActionBlocksToggleView() { } -void RS_ActionBlocksToggleView::trigger() +void ActionBlocksToggleView::trigger() { RS_DEBUG->print("toggle block"); - if (graphic != NULL) + if (graphic) { RS_Block * block = graphic->getActiveBlock(); graphic->toggleBlock(block); @@ -40,9 +41,8 @@ void RS_ActionBlocksToggleView::trigger() finish(); } -void RS_ActionBlocksToggleView::init(int status) +void ActionBlocksToggleView::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionblockstoggleview.h b/src/actions/actionblockstoggleview.h new file mode 100644 index 0000000..b890342 --- /dev/null +++ b/src/actions/actionblockstoggleview.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONBLOCKSTOGGLEVIEW_H__ +#define __ACTIONBLOCKSTOGGLEVIEW_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to edit layers. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionBlocksToggleView: public ActionInterface +{ + public: + ActionBlocksToggleView(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionBlocksToggleView(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONBLOCKSTOGGLEVIEW_H__ diff --git a/src/actions/rs_actiondefault.cpp b/src/actions/actiondefault.cpp similarity index 55% rename from src/actions/rs_actiondefault.cpp rename to src/actions/actiondefault.cpp index e49edd8..4385c7c 100644 --- a/src/actions/rs_actiondefault.cpp +++ b/src/actions/actiondefault.cpp @@ -1,4 +1,4 @@ -// rs_actiondefault.cpp +// actiondefault.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondefault.h" +#include "actiondefault.h" #include "rs.h" #include "rs_commandevent.h" @@ -26,52 +26,58 @@ /** * Constructor. */ -RS_ActionDefault::RS_ActionDefault(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Default", - container, graphicView) +ActionDefault::ActionDefault(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Default", + container, graphicView) { - RS_DEBUG->print("RS_ActionDefault::RS_ActionDefault"); - RS_DEBUG->print("RS_ActionDefault::RS_ActionDefault: OK"); + RS_DEBUG->print("ActionDefault::ActionDefault"); + RS_DEBUG->print("ActionDefault::ActionDefault: OK"); } -RS_ActionDefault::~RS_ActionDefault() +ActionDefault::~ActionDefault() { } -void RS_ActionDefault::init(int status) +/*virtual*/ RS2::ActionType ActionDefault::rtti() { - RS_DEBUG->print("RS_ActionDefault::init"); + return RS2::ActionDefault; +} + +void ActionDefault::init(int status /*= 0*/) +{ + RS_DEBUG->print("ActionDefault::init"); - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); v1 = v2 = Vector(false); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; +// snapMode = RS2::SnapFree; +// snapRes = RS2::RestrictNothing; restrBak = RS2::RestrictNothing; RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); - RS_DEBUG->print("RS_ActionDefault::init: OK"); + RS_DEBUG->print("ActionDefault::init: OK"); } -void RS_ActionDefault::trigger() +void ActionDefault::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); } -void RS_ActionDefault::keyPressEvent(QKeyEvent * e) +void ActionDefault::keyPressEvent(QKeyEvent * e) { if (e->key() == Qt::Key_Shift) { - restrBak = snapRes; - setSnapRestriction(RS2::RestrictOrthogonal); +// restrBak = snapRes; +// setSnapRestriction(RS2::RestrictOrthogonal); } } -void RS_ActionDefault::keyReleaseEvent(QKeyEvent * e) +void ActionDefault::keyReleaseEvent(QKeyEvent * e) { - if (e->key() == Qt::Key_Shift) - setSnapRestriction(restrBak); +// if (e->key() == Qt::Key_Shift) +// setSnapRestriction(restrBak); } -void RS_ActionDefault::mouseMoveEvent(QMouseEvent * e) +void ActionDefault::mouseMoveEvent(QMouseEvent * e) { Vector mouse = graphicView->toGraph(Vector(e->x(), e->y())); Vector relMouse = mouse - graphicView->getRelativeZero(); @@ -81,7 +87,6 @@ void RS_ActionDefault::mouseMoveEvent(QMouseEvent * e) switch (getStatus()) { case Dragging: - //v2 = graphicView->toGraph(e->x(), e->y()); v2 = mouse; if (graphicView->toGuiDX(v1.distanceTo(v2)) > 10) @@ -90,9 +95,9 @@ void RS_ActionDefault::mouseMoveEvent(QMouseEvent * e) double dist; Vector ref = container->getNearestSelectedRef(v1, &dist); - if (ref.valid == true && graphicView->toGuiDX(dist) < 8) + if (ref.valid && graphicView->toGuiDX(dist) < 8) { - RS_DEBUG->print("RS_ActionDefault::mouseMoveEvent: " + RS_DEBUG->print("ActionDefault::mouseMoveEvent: " "moving reference point"); setStatus(MovingRef); v1 = ref; @@ -101,11 +106,11 @@ void RS_ActionDefault::mouseMoveEvent(QMouseEvent * e) else { // test for an entity to drag: - RS_Entity * en = catchEntity(v1); + RS_Entity * en = graphicView->snapper.catchEntity(v1); - if (en != NULL && en->isSelected()) + if (en && en->isSelected()) { - RS_DEBUG->print("RS_ActionDefault::mouseMoveEvent: " + RS_DEBUG->print("ActionDefault::mouseMoveEvent: " "moving entity"); setStatus(Moving); v1 = en->getNearestRef(v1); @@ -116,48 +121,46 @@ void RS_ActionDefault::mouseMoveEvent(QMouseEvent * e) setStatus(SetCorner2); } } + break; case MovingRef: v2 = snapPoint(e); - deletePreview(); - clearPreview(); - preview->addSelectionFrom(*container); - preview->moveRef(v1, v2 - v1); - drawPreview(); +// deletePreview(); +// clearPreview(); +// preview->addSelectionFrom(*container); +// preview->moveRef(v1, v2 - v1); +// drawPreview(); break; case Moving: v2 = snapPoint(e); - deletePreview(); - clearPreview(); - preview->addSelectionFrom(*container); - preview->move(v2 - v1); - drawPreview(); +// deletePreview(); +// clearPreview(); +// preview->addSelectionFrom(*container); +// preview->move(v2 - v1); +// drawPreview(); break; case SetCorner2: - if (v1.valid) { - //v2 = snapPoint(e); v2 = mouse; - //deleteSnapper(); - deletePreview(); - clearPreview(); - - preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v1.x, v1.y), Vector(v2.x, v1.y)))); - preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y)))); - preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v2.x, v2.y), Vector(v1.x, v2.y)))); - preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y)))); - drawPreview(); +// deletePreview(); +// clearPreview(); + +// preview->addEntity(new RS_Line(preview, +// RS_LineData(Vector(v1.x, v1.y), Vector(v2.x, v1.y)))); +// preview->addEntity(new RS_Line(preview, +// RS_LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y)))); +// preview->addEntity(new RS_Line(preview, +// RS_LineData(Vector(v2.x, v2.y), Vector(v1.x, v2.y)))); +// preview->addEntity(new RS_Line(preview, +// RS_LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y)))); +// drawPreview(); } default: @@ -165,7 +168,7 @@ void RS_ActionDefault::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionDefault::mousePressEvent(QMouseEvent * e) +void ActionDefault::mousePressEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -179,9 +182,9 @@ void RS_ActionDefault::mousePressEvent(QMouseEvent * e) case Moving: { v2 = snapPoint(e); - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); RS_Modification m(*container, graphicView); RS_MoveData data; data.number = 0; @@ -198,15 +201,14 @@ void RS_ActionDefault::mousePressEvent(QMouseEvent * e) case MovingRef: { v2 = snapPoint(e); - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); RS_Modification m(*container, graphicView); RS_MoveRefData data; data.ref = v1; data.offset = v2 - v1; m.moveRef(data); - //container->moveSelectedRef(v1, v2-v2); setStatus(Neutral); RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); @@ -219,9 +221,9 @@ void RS_ActionDefault::mousePressEvent(QMouseEvent * e) } } -void RS_ActionDefault::mouseReleaseEvent(QMouseEvent * e) +void ActionDefault::mouseReleaseEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDefault::mouseReleaseEvent()"); + RS_DEBUG->print("ActionDefault::mouseReleaseEvent()"); if (e->button() == Qt::LeftButton) { @@ -232,20 +234,19 @@ void RS_ActionDefault::mouseReleaseEvent(QMouseEvent * e) case Dragging: { // select single entity: - RS_Entity * en = catchEntity(e); + RS_Entity * en = graphicView->snapper.catchEntity(e); - if (en != NULL) + if (en) { - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); RS_Selection s(*container, graphicView); s.selectSingle(en); RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); - //deleteSnapper(); e->accept(); setStatus(Neutral); } @@ -256,14 +257,12 @@ void RS_ActionDefault::mouseReleaseEvent(QMouseEvent * e) case SetCorner2: { - //v2 = snapPoint(e); v2 = graphicView->toGraph(e->x(), e->y()); // select window: - //if (graphicView->toGuiDX(v1.distanceTo(v2))>20) { - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); bool cross = (v2.y > v1.y); RS_Selection s(*container, graphicView); @@ -273,7 +272,6 @@ void RS_ActionDefault::mouseReleaseEvent(QMouseEvent * e) setStatus(Neutral); e->accept(); - //} } break; @@ -288,16 +286,17 @@ void RS_ActionDefault::mouseReleaseEvent(QMouseEvent * e) case SetCorner2: case Moving: case MovingRef: - deletePreview(); - clearPreview(); - deleteSnapper(); +// deletePreview(); +// clearPreview(); +// deleteSnapper(); setStatus(Neutral); RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); e->accept(); break; default: - deleteSnapper(); + graphicView->snapper.SetVisible(false); + graphicView->preview.SetVisible(false); RS_DIALOGFACTORY->requestPreviousMenu(); e->accept(); break; @@ -305,33 +304,19 @@ void RS_ActionDefault::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDefault::commandEvent(RS_CommandEvent * e) +void ActionDefault::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); - - // if the current action can't deal with the command, - // it might be intended to launch a new command - //if (!e.isAccepted()) { - // command for new action: - //RS2::ActionType type = RS_COMMANDS->cmdToAction(c); - //if (type!=RS2::ActionNone) { - //graphicView->setCurrentAction(type); - //return true; - //} - //} } -QStringList RS_ActionDefault::getAvailableCommands() +QStringList ActionDefault::getAvailableCommands() { QStringList cmd; - //cmd += "line"; - //cmd += "rectangle"; - return cmd; } -void RS_ActionDefault::updateMouseButtonHints() +void ActionDefault::updateMouseButtonHints() { switch (getStatus()) { @@ -340,7 +325,7 @@ void RS_ActionDefault::updateMouseButtonHints() break; case SetCorner2: - RS_DIALOGFACTORY->updateMouseWidget(tr("Choose second edge"), tr("Back")); + RS_DIALOGFACTORY->updateMouseWidget(tr("Drag to second point"), tr("Back")); break; default: @@ -349,7 +334,7 @@ void RS_ActionDefault::updateMouseButtonHints() } } -void RS_ActionDefault::updateMouseCursor() +void ActionDefault::updateMouseCursor() { switch (getStatus()) { @@ -367,14 +352,11 @@ void RS_ActionDefault::updateMouseCursor() } } -void RS_ActionDefault::updateToolBar() +void ActionDefault::updateToolBar() { - //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); switch (getStatus()) { case Neutral: - // would switch back to main in edit / measure / .. modes - //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); break; case Moving: @@ -386,4 +368,3 @@ void RS_ActionDefault::updateToolBar() break; } } - diff --git a/src/actions/rs_actiondefault.h b/src/actions/actiondefault.h similarity index 72% rename from src/actions/rs_actiondefault.h rename to src/actions/actiondefault.h index a329098..c02bfe0 100644 --- a/src/actions/rs_actiondefault.h +++ b/src/actions/actiondefault.h @@ -1,17 +1,17 @@ -#ifndef RS_ACTIONSELECTWINDOW_H -#define RS_ACTIONSELECTWINDOW_H +#ifndef __ACTIONDEFAULT_H__ +#define __ACTIONDEFAULT_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to select all entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDefault: public RS_PreviewActionInterface +class ActionDefault: public ActionInterface { - //Q_OBJECT public: /** * Action States. @@ -27,30 +27,19 @@ class RS_ActionDefault: public RS_PreviewActionInterface }; public: - RS_ActionDefault(RS_EntityContainer & container, GraphicView & graphicView); - virtual ~RS_ActionDefault(); - - static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); - - virtual RS2::ActionType rtti() - { - return RS2::ActionDefault; - } + ActionDefault(RS_EntityContainer & container, GraphicView & graphicView); + virtual ~ActionDefault(); + virtual RS2::ActionType rtti(); virtual void init(int status = 0); - virtual void trigger(); - virtual void keyPressEvent(QKeyEvent * e); virtual void keyReleaseEvent(QKeyEvent * e); - virtual void mouseMoveEvent(QMouseEvent * e); virtual void mousePressEvent(QMouseEvent * e); virtual void mouseReleaseEvent(QMouseEvent * e); - virtual void commandEvent(RS_CommandEvent * e); virtual QStringList getAvailableCommands(); - virtual void updateMouseButtonHints(); virtual void updateMouseCursor(); virtual void updateToolBar(); @@ -61,4 +50,4 @@ class RS_ActionDefault: public RS_PreviewActionInterface RS2::SnapRestriction restrBak; }; -#endif +#endif // __ACTIONDEFAULT_H__ diff --git a/src/actions/rs_actiondimaligned.cpp b/src/actions/actiondimaligned.cpp similarity index 76% rename from src/actions/rs_actiondimaligned.cpp rename to src/actions/actiondimaligned.cpp index 02be819..464d63a 100644 --- a/src/actions/rs_actiondimaligned.cpp +++ b/src/actions/actiondimaligned.cpp @@ -1,4 +1,4 @@ -// rs_actiondimaligned.cpp +// actiondimaligned.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondimaligned.h" +#include "actiondimaligned.h" #include "rs_commandevent.h" #include "rs_constructionline.h" @@ -21,24 +21,24 @@ #include "rs_preview.h" #include "rs_snapper.h" -RS_ActionDimAligned::RS_ActionDimAligned(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionDimension("Draw aligned dimensions", +ActionDimAligned::ActionDimAligned(RS_EntityContainer & container, GraphicView & graphicView): ActionDimension("Draw aligned dimensions", container, graphicView) { reset(); } -RS_ActionDimAligned::~RS_ActionDimAligned() +ActionDimAligned::~ActionDimAligned() { } -/*virtual*/ RS2::ActionType RS_ActionDimAligned::rtti() +/*virtual*/ RS2::ActionType ActionDimAligned::rtti() { return RS2::ActionDimAligned; } -void RS_ActionDimAligned::reset() +void ActionDimAligned::reset() { - RS_ActionDimension::reset(); + ActionDimension::reset(); edata = RS_DimAlignedData(Vector(false), Vector(false)); lastStatus = SetExtPoint1; @@ -46,9 +46,9 @@ void RS_ActionDimAligned::reset() RS_DIALOGFACTORY->requestOptions(this, true, true); } -void RS_ActionDimAligned::trigger() +void ActionDimAligned::trigger() { - RS_ActionDimension::trigger(); + ActionDimension::trigger(); preparePreview(); graphicView->moveRelativeZero(data.definitionPoint); @@ -74,21 +74,21 @@ void RS_ActionDimAligned::trigger() graphicView->moveRelativeZero(rz); drawSnapper(); - RS_DEBUG->print("RS_ActionDimAligned::trigger(): dim added: %d", dim->getId()); + RS_DEBUG->print("ActionDimAligned::trigger(): dim added: %d", dim->getId()); } -void RS_ActionDimAligned::preparePreview() +void ActionDimAligned::preparePreview() { Vector dirV; dirV.setPolar(100.0, edata.extensionPoint1.angleTo(edata.extensionPoint2) + M_PI / 2.0); RS_ConstructionLine cl(NULL, RS_ConstructionLineData(edata.extensionPoint2, - edata.extensionPoint2 + dirV)); + edata.extensionPoint2 + dirV)); data.definitionPoint = cl.getNearestPointOnEntity(data.definitionPoint); } -void RS_ActionDimAligned::mouseMoveEvent(QMouseEvent * e) +void ActionDimAligned::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDimAligned::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDimAligned::mouseMoveEvent begin"); Vector mouse = snapPoint(e); switch (getStatus()) @@ -102,8 +102,7 @@ void RS_ActionDimAligned::mouseMoveEvent(QMouseEvent * e) { deletePreview(); clearPreview(); - preview->addEntity(new RS_Line(preview, - RS_LineData(edata.extensionPoint1, mouse))); +// preview->addEntity(new RS_Line(preview, RS_LineData(edata.extensionPoint1, mouse))); drawPreview(); } break; @@ -119,9 +118,9 @@ void RS_ActionDimAligned::mouseMoveEvent(QMouseEvent * e) preparePreview(); //data.text = getText(); - RS_DimAligned * dim = new RS_DimAligned(preview, data, edata); - dim->update(); - preview->addEntity(dim); +// RS_DimAligned * dim = new RS_DimAligned(preview, data, edata); +// dim->update(); +// preview->addEntity(dim); drawPreview(); } break; @@ -130,10 +129,10 @@ void RS_ActionDimAligned::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionDimAligned::mouseMoveEvent end"); + RS_DEBUG->print("ActionDimAligned::mouseMoveEvent end"); } -void RS_ActionDimAligned::mouseReleaseEvent(QMouseEvent * e) +void ActionDimAligned::mouseReleaseEvent(QMouseEvent * e) { // if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) @@ -150,7 +149,7 @@ void RS_ActionDimAligned::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDimAligned::coordinateEvent(Vector * e) +void ActionDimAligned::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -183,7 +182,7 @@ void RS_ActionDimAligned::coordinateEvent(Vector * e) } } -void RS_ActionDimAligned::commandEvent(RS_CommandEvent * e) +void ActionDimAligned::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -220,7 +219,7 @@ void RS_ActionDimAligned::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDimAligned::getAvailableCommands() +QStringList ActionDimAligned::getAvailableCommands() { QStringList cmd; @@ -239,7 +238,7 @@ QStringList RS_ActionDimAligned::getAvailableCommands() return cmd; } -void RS_ActionDimAligned::updateMouseButtonHints() +void ActionDimAligned::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -268,17 +267,17 @@ void RS_ActionDimAligned::updateMouseButtonHints() } } -void RS_ActionDimAligned::hideOptions() +void ActionDimAligned::hideOptions() { if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, false); - RS_ActionDimension::hideOptions(); + ActionDimension::hideOptions(); } -void RS_ActionDimAligned::showOptions() +void ActionDimAligned::showOptions() { - RS_ActionDimension::showOptions(); + ActionDimension::showOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, true); diff --git a/src/actions/rs_actiondimaligned.h b/src/actions/actiondimaligned.h similarity index 77% rename from src/actions/rs_actiondimaligned.h rename to src/actions/actiondimaligned.h index b7bf152..731aab1 100644 --- a/src/actions/rs_actiondimaligned.h +++ b/src/actions/actiondimaligned.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONDIMALIGNED_H -#define RS_ACTIONDIMALIGNED_H +#ifndef __ACTIONDIMALIGNED_H__ +#define __ACTIONDIMALIGNED_H__ -#include "rs_actiondimension.h" +#include "actiondimension.h" #include "rs_dimaligned.h" /** * This action class can handle user events to draw * aligned dimensions. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDimAligned: public RS_ActionDimension +class ActionDimAligned: public ActionDimension { public: /** @@ -24,8 +25,8 @@ class RS_ActionDimAligned: public RS_ActionDimension }; public: - RS_ActionDimAligned(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDimAligned(); + ActionDimAligned(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDimAligned(); virtual RS2::ActionType rtti(); virtual void reset(); @@ -50,4 +51,4 @@ class RS_ActionDimAligned: public RS_ActionDimension Status lastStatus; }; -#endif +#endif // __ACTIONDIMALIGNED_H__ diff --git a/src/actions/rs_actiondimangular.cpp b/src/actions/actiondimangular.cpp similarity index 77% rename from src/actions/rs_actiondimangular.cpp rename to src/actions/actiondimangular.cpp index 3442ad7..e41561d 100644 --- a/src/actions/rs_actiondimangular.cpp +++ b/src/actions/actiondimangular.cpp @@ -1,4 +1,4 @@ -// rs_actiondimangular.cpp +// actiondimangular.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondimangular.h" +#include "actiondimangular.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" @@ -20,24 +20,24 @@ #include "rs_information.h" #include "rs_preview.h" -RS_ActionDimAngular::RS_ActionDimAngular(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionDimension("Draw Angular Dimensions", +ActionDimAngular::ActionDimAngular(RS_EntityContainer & container, GraphicView & graphicView): ActionDimension("Draw Angular Dimensions", container, graphicView) { reset(); } -RS_ActionDimAngular::~RS_ActionDimAngular() +ActionDimAngular::~ActionDimAngular() { } -/*virtual*/ RS2::ActionType RS_ActionDimAngular::rtti() +/*virtual*/ RS2::ActionType ActionDimAngular::rtti() { return RS2::ActionDimAngular; } -void RS_ActionDimAngular::reset() +void ActionDimAngular::reset() { - RS_ActionDimension::reset(); + ActionDimension::reset(); edata = RS_DimAngularData(Vector(false), Vector(false), Vector(false), Vector(false)); line1 = NULL; line2 = NULL; @@ -45,9 +45,9 @@ void RS_ActionDimAngular::reset() RS_DIALOGFACTORY->requestOptions(this, true, true); } -void RS_ActionDimAngular::trigger() +void ActionDimAngular::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); if (line1 != NULL && line2 != NULL) { @@ -76,13 +76,13 @@ void RS_ActionDimAngular::trigger() graphicView->moveRelativeZero(rz); } else - RS_DEBUG->print("RS_ActionDimAngular::trigger:" + RS_DEBUG->print("ActionDimAngular::trigger:" " Entity is NULL\n"); } -void RS_ActionDimAngular::mouseMoveEvent(QMouseEvent * e) +void ActionDimAngular::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDimAngular::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDimAngular::mouseMoveEvent begin"); Vector mouse(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); @@ -96,18 +96,18 @@ void RS_ActionDimAngular::mouseMoveEvent(QMouseEvent * e) case SetPos: - if (line1 != NULL && line2 != NULL && center.valid) + if (line1 && line2 && center.valid) { Vector mouse = snapPoint(e); edata.definitionPoint4 = mouse; - RS_DimAngular * d = new RS_DimAngular(preview, data, edata); - d->update(); - - deletePreview(); - clearPreview(); - preview->addEntity(d); - drawPreview(); +// RS_DimAngular * d = new RS_DimAngular(preview, data, edata); +// d->update(); +// +// deletePreview(); +// clearPreview(); +// preview->addEntity(d); +// drawPreview(); } break; @@ -115,16 +115,17 @@ void RS_ActionDimAngular::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionDimAngular::mouseMoveEvent end"); + RS_DEBUG->print("ActionDimAngular::mouseMoveEvent end"); } -void RS_ActionDimAngular::mouseReleaseEvent(QMouseEvent * e) +void ActionDimAngular::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { switch (getStatus()) { - case SetLine1: { + case SetLine1: + { RS_Entity * en = catchEntity(e, RS2::ResolveAll); if (en != NULL @@ -136,7 +137,8 @@ void RS_ActionDimAngular::mouseReleaseEvent(QMouseEvent * e) } break; - case SetLine2: { + case SetLine2: + { RS_Entity * en = catchEntity(e, RS2::ResolveAll); if (en != NULL @@ -181,7 +183,8 @@ void RS_ActionDimAngular::mouseReleaseEvent(QMouseEvent * e) } break; - case SetPos: { + case SetPos: + { Vector ce(snapPoint(e)); coordinateEvent(&ce); } @@ -197,9 +200,9 @@ void RS_ActionDimAngular::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDimAngular::coordinateEvent(Vector * e) +void ActionDimAngular::coordinateEvent(Vector * e) { - if (e == NULL) + if (!e) return; switch (getStatus()) @@ -216,7 +219,7 @@ void RS_ActionDimAngular::coordinateEvent(Vector * e) } } -void RS_ActionDimAngular::commandEvent(RS_CommandEvent * e) +void ActionDimAngular::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -246,7 +249,7 @@ void RS_ActionDimAngular::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDimAngular::getAvailableCommands() +QStringList ActionDimAngular::getAvailableCommands() { QStringList cmd; @@ -265,21 +268,21 @@ QStringList RS_ActionDimAngular::getAvailableCommands() return cmd; } -void RS_ActionDimAngular::showOptions() +void ActionDimAngular::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDimAngular::hideOptions() +void ActionDimAngular::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDimAngular::updateMouseButtonHints() +void ActionDimAngular::updateMouseButtonHints() { switch (getStatus()) { @@ -307,5 +310,3 @@ void RS_ActionDimAngular::updateMouseButtonHints() break; } } - -// EOF diff --git a/src/actions/rs_actiondimangular.h b/src/actions/actiondimangular.h similarity index 79% rename from src/actions/rs_actiondimangular.h rename to src/actions/actiondimangular.h index 5f02dba..fa3643f 100644 --- a/src/actions/rs_actiondimangular.h +++ b/src/actions/actiondimangular.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONDIMANGULAR_H -#define RS_ACTIONDIMANGULAR_H +#ifndef __ACTIONDIMANGULAR_H__ +#define __ACTIONDIMANGULAR_H__ -#include "rs_actiondimension.h" +#include "actiondimension.h" #include "rs_dimangular.h" #include "vector.h" @@ -12,7 +12,7 @@ class RS_Line; * * @author Andrew Mustun */ -class RS_ActionDimAngular: public RS_ActionDimension +class ActionDimAngular: public ActionDimension { private: enum Status { @@ -23,8 +23,8 @@ class RS_ActionDimAngular: public RS_ActionDimension }; public: - RS_ActionDimAngular(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDimAngular(); + ActionDimAngular(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDimAngular(); virtual RS2::ActionType rtti(); virtual void reset(); @@ -51,4 +51,4 @@ class RS_ActionDimAngular: public RS_ActionDimension Status lastStatus; }; -#endif +#endif // __ACTIONDIMANGULAR_H__ diff --git a/src/actions/rs_actiondimdiametric.cpp b/src/actions/actiondimdiametric.cpp similarity index 76% rename from src/actions/rs_actiondimdiametric.cpp rename to src/actions/actiondimdiametric.cpp index 80264c5..2403f96 100644 --- a/src/actions/rs_actiondimdiametric.cpp +++ b/src/actions/actiondimdiametric.cpp @@ -1,4 +1,4 @@ -// rs_actiondimdiametric.cpp +// actiondimdiametric.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,44 +12,44 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondimdiametric.h" +#include "actiondimdiametric.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDimDiametric::RS_ActionDimDiametric(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionDimension("Draw Diametric Dimensions", - container, graphicView) +ActionDimDiametric::ActionDimDiametric(RS_EntityContainer & container, + GraphicView & graphicView): ActionDimension("Draw Diametric Dimensions", + container, graphicView) { reset(); } -RS_ActionDimDiametric::~RS_ActionDimDiametric() +ActionDimDiametric::~ActionDimDiametric() { } -/*virtual*/ RS2::ActionType RS_ActionDimDiametric::rtti() +/*virtual*/ RS2::ActionType ActionDimDiametric::rtti() { return RS2::ActionDimDiametric; } -void RS_ActionDimDiametric::reset() +void ActionDimDiametric::reset() { - RS_ActionDimension::reset(); + ActionDimension::reset(); edata = RS_DimDiametricData(Vector(false), 0.0); entity = NULL; pos = Vector(false); RS_DIALOGFACTORY->requestOptions(this, true, true); } -void RS_ActionDimDiametric::trigger() +void ActionDimDiametric::trigger() { - RS_PreviewActionInterface::trigger(); - + ActionInterface::trigger(); preparePreview(); - if (entity != NULL) + if (entity) { RS_DimDiametric * newEntity = NULL; @@ -63,12 +63,13 @@ void RS_ActionDimDiametric::trigger() container->addEntity(newEntity); // upd. undo list: - if (document != NULL) + if (document) { document->startUndoCycle(); document->addUndoable(newEntity); document->endUndoCycle(); } + deleteSnapper(); Vector rz = graphicView->getRelativeZero(); graphicView->moveRelativeZero(Vector(0.0, 0.0)); @@ -76,13 +77,12 @@ void RS_ActionDimDiametric::trigger() graphicView->moveRelativeZero(rz); } else - RS_DEBUG->print("RS_ActionDimDiametric::trigger:" - " Entity is NULL\n"); + RS_DEBUG->print("ActionDimDiametric::trigger: Entity is NULL\n"); } -void RS_ActionDimDiametric::preparePreview() +void ActionDimDiametric::preparePreview() { - if (entity != NULL) + if (entity) { double radius = 0.0; Vector center = Vector(false); @@ -107,9 +107,9 @@ void RS_ActionDimDiametric::preparePreview() } } -void RS_ActionDimDiametric::mouseMoveEvent(QMouseEvent * e) +void ActionDimDiametric::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDimDiametric::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDimDiametric::mouseMoveEvent begin"); Vector mouse(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); @@ -126,13 +126,13 @@ void RS_ActionDimDiametric::mouseMoveEvent(QMouseEvent * e) pos = snapPoint(e); preparePreview(); - RS_DimDiametric * d = new RS_DimDiametric(preview, data, edata); - d->update(); - - deletePreview(); - clearPreview(); - preview->addEntity(d); - drawPreview(); +// RS_DimDiametric * d = new RS_DimDiametric(preview, data, edata); +// d->update(); +// +// deletePreview(); +// clearPreview(); +// preview->addEntity(d); +// drawPreview(); } break; @@ -140,10 +140,10 @@ void RS_ActionDimDiametric::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionDimDiametric::mouseMoveEvent end"); + RS_DEBUG->print("ActionDimDiametric::mouseMoveEvent end"); } -void RS_ActionDimDiametric::mouseReleaseEvent(QMouseEvent * e) +void ActionDimDiametric::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -195,7 +195,7 @@ void RS_ActionDimDiametric::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDimDiametric::coordinateEvent(Vector * e) +void ActionDimDiametric::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -214,7 +214,7 @@ void RS_ActionDimDiametric::coordinateEvent(Vector * e) } } -void RS_ActionDimDiametric::commandEvent(RS_CommandEvent * e) +void ActionDimDiametric::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -263,7 +263,7 @@ void RS_ActionDimDiametric::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDimDiametric::getAvailableCommands() +QStringList ActionDimDiametric::getAvailableCommands() { QStringList cmd; @@ -281,7 +281,7 @@ QStringList RS_ActionDimDiametric::getAvailableCommands() return cmd; } -void RS_ActionDimDiametric::updateMouseButtonHints() +void ActionDimDiametric::updateMouseButtonHints() { switch (getStatus()) { @@ -305,19 +305,17 @@ void RS_ActionDimDiametric::updateMouseButtonHints() } } -void RS_ActionDimDiametric::showOptions() +void ActionDimDiametric::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDimDiametric::hideOptions() +void ActionDimDiametric::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); //RS_DIALOGFACTORY->requestDimDiametricOptions(edata, false); RS_DIALOGFACTORY->requestOptions(this, false); } - -// EOF diff --git a/src/actions/rs_actiondimdiametric.h b/src/actions/actiondimdiametric.h similarity index 77% rename from src/actions/rs_actiondimdiametric.h rename to src/actions/actiondimdiametric.h index e4b37c1..43859d1 100644 --- a/src/actions/rs_actiondimdiametric.h +++ b/src/actions/actiondimdiametric.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONDIMDIAMETRIC_H -#define RS_ACTIONDIMDIAMETRIC_H +#ifndef __ACTIONDIMDIAMETRIC_H__ +#define __ACTIONDIMDIAMETRIC_H__ -#include "rs_actiondimension.h" +#include "actiondimension.h" #include "rs_dimdiametric.h" #include "vector.h" @@ -10,9 +10,10 @@ class RS_Entity; /** * This action class can handle user events to draw diametric dimensions. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDimDiametric: public RS_ActionDimension +class ActionDimDiametric: public ActionDimension { private: enum Status { @@ -22,8 +23,8 @@ class RS_ActionDimDiametric: public RS_ActionDimension }; public: - RS_ActionDimDiametric(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDimDiametric(); + ActionDimDiametric(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDimDiametric(); virtual RS2::ActionType rtti(); virtual void reset(); @@ -49,4 +50,4 @@ class RS_ActionDimDiametric: public RS_ActionDimension Status lastStatus; }; -#endif +#endif // __ACTIONDIMDIAMETRIC_H__ diff --git a/src/actions/rs_actiondimension.cpp b/src/actions/actiondimension.cpp similarity index 60% rename from src/actions/rs_actiondimension.cpp rename to src/actions/actiondimension.cpp index 864b771..d4d3c66 100644 --- a/src/actions/rs_actiondimension.cpp +++ b/src/actions/actiondimension.cpp @@ -1,4 +1,4 @@ -// rs_actiondimension.cpp +// actiondimension.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,55 +12,55 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondimension.h" +#include "actiondimension.h" #include "rs_dialogfactory.h" #include "graphicview.h" -RS_ActionDimension::RS_ActionDimension(const char * name, RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface(name, container, graphicView) +ActionDimension::ActionDimension(const char * name, RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface(name, container, graphicView) { reset(); } -RS_ActionDimension::~RS_ActionDimension() +ActionDimension::~ActionDimension() { } -void RS_ActionDimension::reset() +void ActionDimension::reset() { data = RS_DimensionData(Vector(false), Vector(false), RS2::VAlignMiddle, RS2::HAlignCenter, RS2::Exact, 1.0, "", "Standard", 0.0); diameter = false; } -void RS_ActionDimension::init(int status) +void ActionDimension::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionDimension::hideOptions() +void ActionDimension::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDimension::showOptions() +void ActionDimension::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, true, true); } -void RS_ActionDimension::updateMouseCursor() +void ActionDimension::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDimension::updateToolBar() +void ActionDimension::updateToolBar() { if (RS_DIALOGFACTORY != NULL) { @@ -71,7 +71,7 @@ void RS_ActionDimension::updateToolBar() } } -QString RS_ActionDimension::getText() +QString ActionDimension::getText() { if (!data.text.isEmpty()) return data.text; @@ -90,52 +90,52 @@ QString RS_ActionDimension::getText() return l; } -void RS_ActionDimension::setText(const QString & t) +void ActionDimension::setText(const QString & t) { data.text = t; } -QString RS_ActionDimension::getLabel() +QString ActionDimension::getLabel() { return label; } -void RS_ActionDimension::setLabel(const QString & t) +void ActionDimension::setLabel(const QString & t) { label = t; } -QString RS_ActionDimension::getTol1() +QString ActionDimension::getTol1() { return tol1; } -void RS_ActionDimension::setTol1(const QString & t) +void ActionDimension::setTol1(const QString & t) { tol1 = t; } -QString RS_ActionDimension::getTol2() +QString ActionDimension::getTol2() { return tol2; } -void RS_ActionDimension::setTol2(const QString & t) +void ActionDimension::setTol2(const QString & t) { tol2 = t; } -bool RS_ActionDimension::getDiameter() +bool ActionDimension::getDiameter() { return diameter; } -void RS_ActionDimension::setDiameter(bool d) +void ActionDimension::setDiameter(bool d) { diameter = d; } -/*static*/ bool RS_ActionDimension::isDimensionAction(RS2::ActionType type) +/*static*/ bool ActionDimension::isDimensionAction(RS2::ActionType type) { return (type == RS2::ActionDimAligned || type == RS2::ActionDimLinear diff --git a/src/actions/rs_actiondimension.h b/src/actions/actiondimension.h similarity index 72% rename from src/actions/rs_actiondimension.h rename to src/actions/actiondimension.h index 910bfc0..e8f3b9d 100644 --- a/src/actions/rs_actiondimension.h +++ b/src/actions/actiondimension.h @@ -1,20 +1,21 @@ -#ifndef RS_ACTIONDIMENSION_H -#define RS_ACTIONDIMENSION_H +#ifndef __ACTIONDIMENSION_H__ +#define __ACTIONDIMENSION_H__ #include #include "rs_dimension.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" /** * Base class for dimension actions. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDimension: public RS_PreviewActionInterface +class ActionDimension: public ActionInterface { public: - RS_ActionDimension(const char * name, RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDimension(); + ActionDimension(const char * name, RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDimension(); virtual void reset(); virtual void init(int status = 0); @@ -46,4 +47,4 @@ class RS_ActionDimension: public RS_PreviewActionInterface bool diameter; }; -#endif +#endif // __ACTIONDIMENSION_H__ diff --git a/src/actions/rs_actiondimleader.cpp b/src/actions/actiondimleader.cpp similarity index 67% rename from src/actions/rs_actiondimleader.cpp rename to src/actions/actiondimleader.cpp index 31d2995..4f06589 100644 --- a/src/actions/rs_actiondimleader.cpp +++ b/src/actions/actiondimleader.cpp @@ -1,4 +1,4 @@ -// rs_actiondimleader.cpp +// actiondimleader.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,29 +12,29 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondimleader.h" +#include "actiondimleader.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDimLeader::RS_ActionDimLeader(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw leaders", container, graphicView) +ActionDimLeader::ActionDimLeader(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw leaders", container, graphicView) { reset(); } -RS_ActionDimLeader::~RS_ActionDimLeader() +ActionDimLeader::~ActionDimLeader() { } -/*virtual*/ RS2::ActionType RS_ActionDimLeader::rtti() +/*virtual*/ RS2::ActionType ActionDimLeader::rtti() { return RS2::ActionDimLeader; } -void RS_ActionDimLeader::reset() +void ActionDimLeader::reset() { //data = RS_LineData(Vector(false), Vector(false)); //start = Vector(false); @@ -42,16 +42,16 @@ void RS_ActionDimLeader::reset() points.clear(); } -void RS_ActionDimLeader::init(int status) +void ActionDimLeader::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); } -void RS_ActionDimLeader::trigger() +void ActionDimLeader::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); if (points.count() > 0) { @@ -83,13 +83,13 @@ void RS_ActionDimLeader::trigger() graphicView->moveRelativeZero(rz); //drawSnapper(); - RS_DEBUG->print("RS_ActionDimLeader::trigger(): leader added: %d", leader->getId()); + RS_DEBUG->print("ActionDimLeader::trigger(): leader added: %d", leader->getId()); } } -void RS_ActionDimLeader::mouseMoveEvent(QMouseEvent * e) +void ActionDimLeader::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDimLeader::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDimLeader::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -101,26 +101,25 @@ void RS_ActionDimLeader::mouseMoveEvent(QMouseEvent * e) // fill in lines that were already set: Vector last(false); -// for(Vector * v=points.first(); v!=NULL; v=points.next()) - for (int i = 0; i < points.size(); i++) + for(int i=0; iaddEntity(new RS_Line(preview, RS_LineData(last, *v))); +// if (last.valid) +// preview->addEntity(new RS_Line(preview, RS_LineData(last, *v))); last = *v; } Vector p = *points.last(); - preview->addEntity(new RS_Line(preview, RS_LineData(p, mouse))); +// preview->addEntity(new RS_Line(preview, RS_LineData(p, mouse))); drawPreview(); } - RS_DEBUG->print("RS_ActionDimLeader::mouseMoveEvent end"); + RS_DEBUG->print("ActionDimLeader::mouseMoveEvent end"); } -void RS_ActionDimLeader::mouseReleaseEvent(QMouseEvent * e) +void ActionDimLeader::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -144,7 +143,7 @@ void RS_ActionDimLeader::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDimLeader::keyPressEvent(QKeyEvent * e) +void ActionDimLeader::keyPressEvent(QKeyEvent * e) { if (getStatus() == SetEndpoint && e->key() == Qt::Key_Enter) { @@ -154,7 +153,7 @@ void RS_ActionDimLeader::keyPressEvent(QKeyEvent * e) } } -void RS_ActionDimLeader::coordinateEvent(Vector * e) +void ActionDimLeader::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -185,7 +184,7 @@ void RS_ActionDimLeader::coordinateEvent(Vector * e) } } -void RS_ActionDimLeader::commandEvent(RS_CommandEvent * e) +void ActionDimLeader::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -208,14 +207,14 @@ void RS_ActionDimLeader::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDimLeader::getAvailableCommands() +QStringList ActionDimLeader::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionDimLeader::updateMouseButtonHints() +void ActionDimLeader::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -236,28 +235,24 @@ void RS_ActionDimLeader::updateMouseButtonHints() } } -void RS_ActionDimLeader::showOptions() +void ActionDimLeader::showOptions() { - RS_ActionInterface::showOptions(); - - //RS_DIALOGFACTORY->requestOptions(this, true); + ActionInterface::showOptions(); } -void RS_ActionDimLeader::hideOptions() +void ActionDimLeader::hideOptions() { - RS_ActionInterface::hideOptions(); - - //RS_DIALOGFACTORY->requestOptions(this, false); + ActionInterface::hideOptions(); } -void RS_ActionDimLeader::updateMouseCursor() +void ActionDimLeader::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDimLeader::updateToolBar() +void ActionDimLeader::updateToolBar() { - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -265,4 +260,3 @@ void RS_ActionDimLeader::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarDim); } } - diff --git a/src/actions/rs_actiondimleader.h b/src/actions/actiondimleader.h similarity index 69% rename from src/actions/rs_actiondimleader.h rename to src/actions/actiondimleader.h index 91f5e3e..d014628 100644 --- a/src/actions/rs_actiondimleader.h +++ b/src/actions/actiondimleader.h @@ -1,19 +1,19 @@ -#ifndef RS_ACTIONDIMLEADER_H -#define RS_ACTIONDIMLEADER_H +#ifndef __ACTIONDIMLEADER_H__ +#define __ACTIONDIMLEADER_H__ #include +#include "actioninterface.h" #include "rs_leader.h" -#include "rs_previewactioninterface.h" class Vector; /** - * This action class can handle user events to draw - * leaders (arrows). + * This action class can handle user events to draw leaders (arrows). * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDimLeader: public RS_PreviewActionInterface +class ActionDimLeader: public ActionInterface { public: /** @@ -25,10 +25,8 @@ class RS_ActionDimLeader: public RS_PreviewActionInterface }; public: - RS_ActionDimLeader(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDimLeader(); - - //static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); + ActionDimLeader(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDimLeader(); virtual RS2::ActionType rtti(); void reset(); @@ -58,4 +56,4 @@ class RS_ActionDimLeader: public RS_PreviewActionInterface QList points; }; -#endif +#endif // __ACTIONDIMLEADER_H__ diff --git a/src/actions/rs_actiondimlinear.cpp b/src/actions/actiondimlinear.cpp similarity index 77% rename from src/actions/rs_actiondimlinear.cpp rename to src/actions/actiondimlinear.cpp index 9fe8fab..fd35835 100644 --- a/src/actions/rs_actiondimlinear.cpp +++ b/src/actions/actiondimlinear.cpp @@ -1,4 +1,4 @@ -// rs_actiondimlinear.cpp +// actiondimlinear.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actiondimlinear.h" +#include "actiondimlinear.h" #include "rs_commandevent.h" #include "rs_constructionline.h" @@ -27,8 +27,8 @@ * @param fixedAngle true: The user can't change the angle. * false: The user can change the angle in a option widget. */ -RS_ActionDimLinear::RS_ActionDimLinear(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle): - RS_ActionDimension("Draw linear dimensions", container, graphicView) +ActionDimLinear::ActionDimLinear(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle): + ActionDimension("Draw linear dimensions", container, graphicView) { edata.angle = angle; this->fixedAngle = fixedAngle; @@ -36,27 +36,27 @@ RS_ActionDimLinear::RS_ActionDimLinear(RS_EntityContainer & container, GraphicVi reset(); } -RS_ActionDimLinear::~RS_ActionDimLinear() +ActionDimLinear::~ActionDimLinear() { } -/*virtual*/ RS2::ActionType RS_ActionDimLinear::rtti() +/*virtual*/ RS2::ActionType ActionDimLinear::rtti() { return RS2::ActionDimLinear; } -void RS_ActionDimLinear::reset() +void ActionDimLinear::reset() { - RS_ActionDimension::reset(); + ActionDimension::reset(); edata = RS_DimLinearData(Vector(false), Vector(false), (fixedAngle ? edata.angle : 0.0), 0.0); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, true, true); } -void RS_ActionDimLinear::trigger() +void ActionDimLinear::trigger() { - RS_ActionDimension::trigger(); + ActionDimension::trigger(); preparePreview(); RS_DimLinear * dim = new RS_DimLinear(container, data, edata); dim->setLayerToActive(); @@ -79,10 +79,10 @@ void RS_ActionDimLinear::trigger() graphicView->moveRelativeZero(rz); drawSnapper(); - RS_DEBUG->print("RS_ActionDimLinear::trigger(): dim added: %d", dim->getId()); + RS_DEBUG->print("ActionDimLinear::trigger(): dim added: %d", dim->getId()); } -void RS_ActionDimLinear::preparePreview() +void ActionDimLinear::preparePreview() { Vector dirV; dirV.setPolar(100.0, edata.angle + M_PI / 2.0); @@ -96,9 +96,9 @@ void RS_ActionDimLinear::preparePreview() cl.getNearestPointOnEntity(data.definitionPoint); } -void RS_ActionDimLinear::mouseMoveEvent(QMouseEvent * e) +void ActionDimLinear::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDimLinear::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDimLinear::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -113,9 +113,8 @@ void RS_ActionDimLinear::mouseMoveEvent(QMouseEvent * e) { deletePreview(); clearPreview(); - preview->addEntity(new RS_Line(preview, - RS_LineData(edata.extensionPoint1, - mouse))); +// preview->addEntity(new RS_Line(preview, +// RS_LineData(edata.extensionPoint1, mouse))); drawPreview(); } break; @@ -130,18 +129,18 @@ void RS_ActionDimLinear::mouseMoveEvent(QMouseEvent * e) preparePreview(); - RS_DimLinear * dim = new RS_DimLinear(preview, data, edata); - dim->update(); - preview->addEntity(dim); +// RS_DimLinear * dim = new RS_DimLinear(preview, data, edata); +// dim->update(); +// preview->addEntity(dim); drawPreview(); } break; } - RS_DEBUG->print("RS_ActionDimLinear::mouseMoveEvent end"); + RS_DEBUG->print("ActionDimLinear::mouseMoveEvent end"); } -void RS_ActionDimLinear::mouseReleaseEvent(QMouseEvent * e) +void ActionDimLinear::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -156,7 +155,7 @@ void RS_ActionDimLinear::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDimLinear::coordinateEvent(Vector * e) +void ActionDimLinear::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -189,7 +188,7 @@ void RS_ActionDimLinear::coordinateEvent(Vector * e) } } -void RS_ActionDimLinear::commandEvent(RS_CommandEvent * e) +void ActionDimLinear::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -245,7 +244,7 @@ void RS_ActionDimLinear::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDimLinear::getAvailableCommands() +QStringList ActionDimLinear::getAvailableCommands() { QStringList cmd; @@ -267,7 +266,7 @@ QStringList RS_ActionDimLinear::getAvailableCommands() return cmd; } -void RS_ActionDimLinear::updateMouseButtonHints() +void ActionDimLinear::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -303,34 +302,33 @@ void RS_ActionDimLinear::updateMouseButtonHints() } } -void RS_ActionDimLinear::showOptions() +void ActionDimLinear::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, true, true); } -void RS_ActionDimLinear::hideOptions() +void ActionDimLinear::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, false); } -double RS_ActionDimLinear::getAngle() +double ActionDimLinear::getAngle() { return edata.angle; } -void RS_ActionDimLinear::setAngle(double a) +void ActionDimLinear::setAngle(double a) { edata.angle = a; } -bool RS_ActionDimLinear::hasFixedAngle() +bool ActionDimLinear::hasFixedAngle() { return fixedAngle; } - diff --git a/src/actions/rs_actiondimlinear.h b/src/actions/actiondimlinear.h similarity index 75% rename from src/actions/rs_actiondimlinear.h rename to src/actions/actiondimlinear.h index 289d243..6011366 100644 --- a/src/actions/rs_actiondimlinear.h +++ b/src/actions/actiondimlinear.h @@ -1,16 +1,16 @@ -#ifndef RS_ACTIONDIMLINEAR_H -#define RS_ACTIONDIMLINEAR_H +#ifndef __ACTIONDIMLINEAR_H__ +#define __ACTIONDIMLINEAR_H__ -#include "rs_actiondimension.h" +#include "actiondimension.h" #include "rs_dimlinear.h" /** - * This action class can handle user events to draw - * aligned dimensions. + * This action class can handle user events to draw aligned dimensions. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDimLinear: public RS_ActionDimension +class ActionDimLinear: public ActionDimension { public: /** @@ -34,8 +34,8 @@ class RS_ActionDimLinear: public RS_ActionDimension }; public: - RS_ActionDimLinear(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); - ~RS_ActionDimLinear(); + ActionDimLinear(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); + ~ActionDimLinear(); virtual RS2::ActionType rtti(); void reset(); @@ -67,4 +67,4 @@ class RS_ActionDimLinear: public RS_ActionDimension Status lastStatus; }; -#endif +#endif // __ACTIONDIMLINEAR_H__ diff --git a/src/actions/rs_actiondimradial.cpp b/src/actions/actiondimradial.cpp similarity index 73% rename from src/actions/rs_actiondimradial.cpp rename to src/actions/actiondimradial.cpp index 6248e5b..22cda34 100644 --- a/src/actions/rs_actiondimradial.cpp +++ b/src/actions/actiondimradial.cpp @@ -1,4 +1,4 @@ -// rs_actiondimradial.cpp +// actiondimradial.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,65 +12,60 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondimradial.h" +#include "actiondimradial.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDimRadial::RS_ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionDimension("Draw Radial Dimensions", - container, graphicView) +ActionDimRadial::ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView): + ActionDimension("Draw Radial Dimensions", container, graphicView) { reset(); } -RS_ActionDimRadial::~RS_ActionDimRadial() +ActionDimRadial::~ActionDimRadial() { } -/*virtual*/ RS2::ActionType RS_ActionDimRadial::rtti() +/*virtual*/ RS2::ActionType ActionDimRadial::rtti() { return RS2::ActionDimRadial; } -void RS_ActionDimRadial::reset() +void ActionDimRadial::reset() { - RS_ActionDimension::reset(); + ActionDimension::reset(); - edata = RS_DimRadialData(Vector(false), - 0.0); + edata = RS_DimRadialData(Vector(false), 0.0); entity = NULL; pos = Vector(false); RS_DIALOGFACTORY->requestOptions(this, true, true); } -void RS_ActionDimRadial::trigger() +void ActionDimRadial::trigger() { - RS_ActionDimension::trigger(); + ActionDimension::trigger(); preparePreview(); - if (entity != NULL) + if (entity) { - RS_DimRadial * newEntity = NULL; - - newEntity = new RS_DimRadial(container, - data, - edata); - + RS_DimRadial * newEntity = new RS_DimRadial(container, data, edata); newEntity->setLayerToActive(); newEntity->setPenToActive(); newEntity->update(); container->addEntity(newEntity); // upd. undo list: - if (document != NULL) + if (document) { document->startUndoCycle(); document->addUndoable(newEntity); document->endUndoCycle(); } + deleteSnapper(); Vector rz = graphicView->getRelativeZero(); graphicView->moveRelativeZero(Vector(0.0, 0.0)); @@ -79,11 +74,10 @@ void RS_ActionDimRadial::trigger() //drawSnapper(); } else - RS_DEBUG->print("RS_ActionDimRadial::trigger:" - " Entity is NULL\n"); + RS_DEBUG->print("ActionDimRadial::trigger: Entity is NULL\n"); } -void RS_ActionDimRadial::preparePreview() +void ActionDimRadial::preparePreview() { if (entity != NULL) { @@ -100,12 +94,9 @@ void RS_ActionDimRadial::preparePreview() } } -void RS_ActionDimRadial::mouseMoveEvent(QMouseEvent * e) +void ActionDimRadial::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDimRadial::mouseMoveEvent begin"); - - //Vector mouse(graphicView->toGraphX(e->x()), - // graphicView->toGraphY(e->y())); + RS_DEBUG->print("ActionDimRadial::mouseMoveEvent begin"); switch (getStatus()) { @@ -115,19 +106,19 @@ void RS_ActionDimRadial::mouseMoveEvent(QMouseEvent * e) case SetPos: - if (entity != NULL) + if (entity) { pos = snapPoint(e); preparePreview(); - RS_DimRadial * d = new RS_DimRadial(preview, data, edata); - d->update(); - - deletePreview(); - clearPreview(); - preview->addEntity(d); - drawPreview(); +// RS_DimRadial * d = new RS_DimRadial(preview, data, edata); +// d->update(); +// +// deletePreview(); +// clearPreview(); +// preview->addEntity(d); +// drawPreview(); } break; @@ -135,10 +126,10 @@ void RS_ActionDimRadial::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionDimRadial::mouseMoveEvent end"); + RS_DEBUG->print("ActionDimRadial::mouseMoveEvent end"); } -void RS_ActionDimRadial::mouseReleaseEvent(QMouseEvent * e) +void ActionDimRadial::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -189,7 +180,7 @@ void RS_ActionDimRadial::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDimRadial::coordinateEvent(Vector * e) +void ActionDimRadial::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -208,7 +199,7 @@ void RS_ActionDimRadial::coordinateEvent(Vector * e) } } -void RS_ActionDimRadial::commandEvent(RS_CommandEvent * e) +void ActionDimRadial::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -258,7 +249,7 @@ void RS_ActionDimRadial::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDimRadial::getAvailableCommands() +QStringList ActionDimRadial::getAvailableCommands() { QStringList cmd; @@ -276,7 +267,7 @@ QStringList RS_ActionDimRadial::getAvailableCommands() return cmd; } -void RS_ActionDimRadial::updateMouseButtonHints() +void ActionDimRadial::updateMouseButtonHints() { switch (getStatus()) { @@ -301,20 +292,20 @@ void RS_ActionDimRadial::updateMouseButtonHints() } } -void RS_ActionDimRadial::showOptions() +void ActionDimRadial::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); //RS_DIALOGFACTORY->requestDimRadialOptions(edata, true); } -void RS_ActionDimRadial::hideOptions() +void ActionDimRadial::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); //RS_DIALOGFACTORY->requestDimRadialOptions(edata, false); RS_DIALOGFACTORY->requestOptions(this, false); } -// EOF + diff --git a/src/actions/rs_actiondimradial.h b/src/actions/actiondimradial.h similarity index 78% rename from src/actions/rs_actiondimradial.h rename to src/actions/actiondimradial.h index 04ff60f..e928f3a 100644 --- a/src/actions/rs_actiondimradial.h +++ b/src/actions/actiondimradial.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONDIMRADIAL_H -#define RS_ACTIONDIMRADIAL_H +#ifndef __ACTIONDIMRADIAL_H__ +#define __ACTIONDIMRADIAL_H__ -#include "rs_actiondimension.h" +#include "actiondimension.h" #include "rs_dimradial.h" #include "vector.h" @@ -10,9 +10,10 @@ class RS_Entity; /** * This action class can handle user events to draw radial dimensions. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDimRadial: public RS_ActionDimension +class ActionDimRadial: public ActionDimension { private: enum Status { @@ -22,8 +23,8 @@ class RS_ActionDimRadial: public RS_ActionDimension }; public: - RS_ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDimRadial(); + ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDimRadial(); virtual RS2::ActionType rtti(); virtual void reset(); @@ -49,4 +50,4 @@ class RS_ActionDimRadial: public RS_ActionDimension Status lastStatus; }; -#endif +#endif // __ACTIONDIMRADIAL_H__ diff --git a/src/actions/rs_actiondrawarc.cpp b/src/actions/actiondrawarc.cpp similarity index 80% rename from src/actions/rs_actiondrawarc.cpp rename to src/actions/actiondrawarc.cpp index e47f1bd..16f43f4 100644 --- a/src/actions/rs_actiondrawarc.cpp +++ b/src/actions/actiondrawarc.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawarc.cpp +// actiondrawarc.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondrawarc.h" +#include "actiondrawarc.h" #include "rs_commandevent.h" #include "commands.h" @@ -20,40 +20,38 @@ #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawArc::RS_ActionDrawArc(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw arcs", container, graphicView) +ActionDrawArc::ActionDrawArc(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw arcs", container, graphicView) { reset(); } -RS_ActionDrawArc::~RS_ActionDrawArc() +ActionDrawArc::~ActionDrawArc() { } -RS2::ActionType RS_ActionDrawArc::rtti() +RS2::ActionType ActionDrawArc::rtti() { return RS2::ActionDrawArc; } -void RS_ActionDrawArc::reset() +void ActionDrawArc::reset() { - //bool rev = data.reversed; - if (data.reversed) data = RS_ArcData(Vector(false), 0.0, 2 * M_PI, 0.0, true); else data = RS_ArcData(Vector(false), 0.0, 0.0, 2 * M_PI, false); } -void RS_ActionDrawArc::init(int status) +void ActionDrawArc::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); } -void RS_ActionDrawArc::trigger() +void ActionDrawArc::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); RS_Arc * arc = new RS_Arc(container, data); arc->setLayerToActive(); @@ -77,12 +75,12 @@ void RS_ActionDrawArc::trigger() setStatus(SetCenter); reset(); - RS_DEBUG->print("RS_ActionDrawArc::trigger(): arc added: %d", arc->getId()); + RS_DEBUG->print("ActionDrawArc::trigger(): arc added: %d", arc->getId()); } -void RS_ActionDrawArc::mouseMoveEvent(QMouseEvent * e) +void ActionDrawArc::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawArc::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawArc::mouseMoveEvent begin"); Vector mouse = snapPoint(e); switch (getStatus()) @@ -98,7 +96,7 @@ void RS_ActionDrawArc::mouseMoveEvent(QMouseEvent * e) data.radius = data.center.distanceTo(mouse); deletePreview(); clearPreview(); - preview->addEntity(new RS_Circle(preview, RS_CircleData(data.center, data.radius))); +// preview->addEntity(new RS_Circle(preview, RS_CircleData(data.center, data.radius))); drawPreview(); } break; @@ -113,7 +111,7 @@ void RS_ActionDrawArc::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); - preview->addEntity(new RS_Arc(preview, data)); +// preview->addEntity(new RS_Arc(preview, data)); drawPreview(); break; @@ -121,7 +119,7 @@ void RS_ActionDrawArc::mouseMoveEvent(QMouseEvent * e) data.angle2 = data.center.angleTo(mouse); deletePreview(); clearPreview(); - preview->addEntity(new RS_Arc(preview, data)); +// preview->addEntity(new RS_Arc(preview, data)); drawPreview(); break; @@ -129,7 +127,7 @@ void RS_ActionDrawArc::mouseMoveEvent(QMouseEvent * e) data.angle2 = data.angle1 + data.center.angleTo(mouse); deletePreview(); clearPreview(); - preview->addEntity(new RS_Arc(preview, data)); +// preview->addEntity(new RS_Arc(preview, data)); drawPreview(); break; @@ -142,7 +140,7 @@ void RS_ActionDrawArc::mouseMoveEvent(QMouseEvent * e) data.angle2 = data.angle1 + asin(x / (2 * data.radius)) * 2; deletePreview(); clearPreview(); - preview->addEntity(new RS_Arc(preview, data)); +// preview->addEntity(new RS_Arc(preview, data)); drawPreview(); } } @@ -152,10 +150,10 @@ void RS_ActionDrawArc::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionDrawArc::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawArc::mouseMoveEvent end"); } -void RS_ActionDrawArc::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawArc::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -170,7 +168,7 @@ void RS_ActionDrawArc::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawArc::coordinateEvent(Vector * e) +void ActionDrawArc::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -226,7 +224,7 @@ void RS_ActionDrawArc::coordinateEvent(Vector * e) } } -void RS_ActionDrawArc::commandEvent(RS_CommandEvent * e) +void ActionDrawArc::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -344,14 +342,14 @@ void RS_ActionDrawArc::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawArc::getAvailableCommands() +QStringList ActionDrawArc::getAvailableCommands() { QStringList cmd; cmd += RS_COMMANDS->command("reversed"); return cmd; } -void RS_ActionDrawArc::updateMouseButtonHints() +void ActionDrawArc::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -393,30 +391,30 @@ void RS_ActionDrawArc::updateMouseButtonHints() } } -void RS_ActionDrawArc::showOptions() +void ActionDrawArc::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawArc::hideOptions() +void ActionDrawArc::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawArc::updateMouseCursor() +void ActionDrawArc::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawArc::updateToolBar() +void ActionDrawArc::updateToolBar() { - if (RS_DIALOGFACTORY == NULL) + if (!RS_DIALOGFACTORY) return; if (!isFinished()) @@ -425,13 +423,12 @@ void RS_ActionDrawArc::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarArcs); } -bool RS_ActionDrawArc::isReversed() +bool ActionDrawArc::isReversed() { return data.reversed; } -void RS_ActionDrawArc::setReversed(bool r) +void ActionDrawArc::setReversed(bool r) { data.reversed = r; } - diff --git a/src/actions/rs_actiondrawarc.h b/src/actions/actiondrawarc.h similarity index 73% rename from src/actions/rs_actiondrawarc.h rename to src/actions/actiondrawarc.h index 90fec85..a834a3a 100644 --- a/src/actions/rs_actiondrawarc.h +++ b/src/actions/actiondrawarc.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONDRAWARC_H -#define RS_ACTIONDRAWARC_H +#ifndef __ACTIONDRAWARC_H__ +#define __ACTIONDRAWARC_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "rs_arc.h" /** - * This action class can handle user events to draw - * simple arcs with the center, radius, start- and endangle given. + * This action class can handle user events to draw simple arcs with the + * center, radius, start- and endangle given. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawArc: public RS_PreviewActionInterface +class ActionDrawArc: public ActionInterface { public: /** @@ -26,8 +27,8 @@ class RS_ActionDrawArc: public RS_PreviewActionInterface }; public: - RS_ActionDrawArc(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawArc(); + ActionDrawArc(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawArc(); virtual RS2::ActionType rtti(); void reset(); @@ -53,4 +54,4 @@ class RS_ActionDrawArc: public RS_PreviewActionInterface RS_ArcData data; }; -#endif +#endif // __ACTIONDRAWARC_H__ diff --git a/src/actions/rs_actiondrawarc3p.cpp b/src/actions/actiondrawarc3p.cpp similarity index 71% rename from src/actions/rs_actiondrawarc3p.cpp rename to src/actions/actiondrawarc3p.cpp index 2450e76..9cd7bbd 100644 --- a/src/actions/rs_actiondrawarc3p.cpp +++ b/src/actions/actiondrawarc3p.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawarc3p.cpp +// actiondrawarc3p.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,26 +12,26 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondrawarc3p.h" +#include "actiondrawarc3p.h" -#include "rs_actiondrawarc.h" +#include "actiondrawarc.h" #include "rs_commandevent.h" #include "commands.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawArc3P::RS_ActionDrawArc3P(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw arcs 3P", container, graphicView) +ActionDrawArc3P::ActionDrawArc3P(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw arcs 3P", container, graphicView) { reset(); } -RS_ActionDrawArc3P::~RS_ActionDrawArc3P() +ActionDrawArc3P::~ActionDrawArc3P() { } -void RS_ActionDrawArc3P::reset() +void ActionDrawArc3P::reset() { data.reset(); point1 = Vector(false); @@ -39,16 +39,16 @@ void RS_ActionDrawArc3P::reset() point3 = Vector(false); } -void RS_ActionDrawArc3P::init(int status) +void ActionDrawArc3P::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); //reset(); } -void RS_ActionDrawArc3P::trigger() +void ActionDrawArc3P::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); preparePreview(); if (data.isValid()) @@ -79,7 +79,7 @@ void RS_ActionDrawArc3P::trigger() RS_DIALOGFACTORY->commandMessage(tr("Invalid arc data.")); } -void RS_ActionDrawArc3P::preparePreview() +void ActionDrawArc3P::preparePreview() { data.reset(); @@ -93,7 +93,7 @@ void RS_ActionDrawArc3P::preparePreview() } } -void RS_ActionDrawArc3P::mouseMoveEvent(QMouseEvent * e) +void ActionDrawArc3P::mouseMoveEvent(QMouseEvent * e) { Vector mouse = snapPoint(e); @@ -108,12 +108,12 @@ void RS_ActionDrawArc3P::mouseMoveEvent(QMouseEvent * e) if (point1.valid) { - RS_Line * line = new RS_Line(preview, RS_LineData(point1, point2)); - - deletePreview(); - clearPreview(); - preview->addEntity(line); - drawPreview(); +// RS_Line * line = new RS_Line(preview, RS_LineData(point1, point2)); +// +// deletePreview(); +// clearPreview(); +// preview->addEntity(line); +// drawPreview(); } break; @@ -123,12 +123,12 @@ void RS_ActionDrawArc3P::mouseMoveEvent(QMouseEvent * e) if (data.isValid()) { - RS_Arc * arc = new RS_Arc(preview, data); - - deletePreview(); - clearPreview(); - preview->addEntity(arc); - drawPreview(); +// RS_Arc * arc = new RS_Arc(preview, data); +// +// deletePreview(); +// clearPreview(); +// preview->addEntity(arc); +// drawPreview(); } break; @@ -137,7 +137,7 @@ void RS_ActionDrawArc3P::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionDrawArc3P::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawArc3P::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -152,7 +152,7 @@ void RS_ActionDrawArc3P::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawArc3P::coordinateEvent(Vector * e) +void ActionDrawArc3P::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -183,7 +183,7 @@ void RS_ActionDrawArc3P::coordinateEvent(Vector * e) } } -void RS_ActionDrawArc3P::commandEvent(RS_CommandEvent * e) +void ActionDrawArc3P::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -197,17 +197,17 @@ void RS_ActionDrawArc3P::commandEvent(RS_CommandEvent * e) if (RS_COMMANDS->checkCommand("center", c, rtti())) { finish(); - graphicView->setCurrentAction(new RS_ActionDrawArc(*container, *graphicView)); + graphicView->setCurrentAction(new ActionDrawArc(*container, *graphicView)); } } -QStringList RS_ActionDrawArc3P::getAvailableCommands() +QStringList ActionDrawArc3P::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionDrawArc3P::updateMouseButtonHints() +void ActionDrawArc3P::updateMouseButtonHints() { switch (getStatus()) { @@ -229,12 +229,12 @@ void RS_ActionDrawArc3P::updateMouseButtonHints() } } -void RS_ActionDrawArc3P::updateMouseCursor() +void ActionDrawArc3P::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawArc3P::updateToolBar() +void ActionDrawArc3P::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); diff --git a/src/actions/rs_actiondrawarc3p.h b/src/actions/actiondrawarc3p.h similarity index 78% rename from src/actions/rs_actiondrawarc3p.h rename to src/actions/actiondrawarc3p.h index 5402631..ffca07f 100644 --- a/src/actions/rs_actiondrawarc3p.h +++ b/src/actions/actiondrawarc3p.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONDRAWARC3P_H -#define RS_ACTIONDRAWARC3P_H +#ifndef __ACTIONDRAWARC3P_H__ +#define __ACTIONDRAWARC3P_H__ #include "rs_arc.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to draw * arcs with three points given. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawArc3P: public RS_PreviewActionInterface +class ActionDrawArc3P: public ActionInterface { public: /** @@ -24,8 +25,8 @@ class RS_ActionDrawArc3P: public RS_PreviewActionInterface }; public: - RS_ActionDrawArc3P(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawArc3P(); + ActionDrawArc3P(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawArc3P(); void reset(); virtual void init(int status = 0); @@ -59,4 +60,4 @@ class RS_ActionDrawArc3P: public RS_PreviewActionInterface Vector point3; }; -#endif +#endif // __ACTIONDRAWARC3P_H__ diff --git a/src/actions/rs_actiondrawarctangential.cpp b/src/actions/actiondrawarctangential.cpp similarity index 70% rename from src/actions/rs_actiondrawarctangential.cpp rename to src/actions/actiondrawarctangential.cpp index 1bdc135..6f7fa4f 100644 --- a/src/actions/rs_actiondrawarctangential.cpp +++ b/src/actions/actiondrawarctangential.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawarctangential.cpp +// actiondrawarctangential.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,48 +12,48 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondrawarctangential.h" +#include "actiondrawarctangential.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawArcTangential::RS_ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw arcs tangential", +ActionDrawArcTangential::ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw arcs tangential", container, graphicView) { reset(); } -RS_ActionDrawArcTangential::~RS_ActionDrawArcTangential() +ActionDrawArcTangential::~ActionDrawArcTangential() { } -/*virtual*/ RS2::ActionType RS_ActionDrawArcTangential::rtti() +/*virtual*/ RS2::ActionType ActionDrawArcTangential::rtti() { return RS2::ActionDrawArcTangential; } -void RS_ActionDrawArcTangential::reset() +void ActionDrawArcTangential::reset() { baseEntity = NULL; isStartPoint = false; point = Vector(false); } -void RS_ActionDrawArcTangential::init(int status) +void ActionDrawArcTangential::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); //reset(); } -void RS_ActionDrawArcTangential::trigger() +void ActionDrawArcTangential::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); if (point.valid == false || baseEntity == NULL) { - RS_DEBUG->print("RS_ActionDrawArcTangential::trigger: " + RS_DEBUG->print("ActionDrawArcTangential::trigger: " "conditions not met"); return; } @@ -82,7 +82,7 @@ void RS_ActionDrawArcTangential::trigger() reset(); } -void RS_ActionDrawArcTangential::preparePreview() +void ActionDrawArcTangential::preparePreview() { if (baseEntity != NULL && point.valid) { @@ -108,7 +108,7 @@ void RS_ActionDrawArcTangential::preparePreview() } } -void RS_ActionDrawArcTangential::mouseMoveEvent(QMouseEvent * e) +void ActionDrawArcTangential::mouseMoveEvent(QMouseEvent * e) { switch (getStatus()) { @@ -121,11 +121,11 @@ void RS_ActionDrawArcTangential::mouseMoveEvent(QMouseEvent * e) if (data.isValid()) { - RS_Arc * arc = new RS_Arc(preview, data); - deletePreview(); - clearPreview(); - preview->addEntity(arc); - drawPreview(); +// RS_Arc * arc = new RS_Arc(preview, data); +// deletePreview(); +// clearPreview(); +// preview->addEntity(arc); +// drawPreview(); } break; @@ -134,14 +134,15 @@ void RS_ActionDrawArcTangential::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionDrawArcTangential::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawArcTangential::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { switch (getStatus()) { // set base entity: - case SetBaseEntity: { + case SetBaseEntity: + { Vector coord = graphicView->toGraph(e->x(), e->y()); RS_Entity * entity = catchEntity(coord, RS2::ResolveAll); @@ -167,14 +168,15 @@ void RS_ActionDrawArcTangential::mouseReleaseEvent(QMouseEvent * e) else deleteSnapper(); } - break; + break; // set angle (point that defines the angle) - case SetEndAngle: { + case SetEndAngle: + { Vector ce(snapPoint(e)); coordinateEvent(&ce); } - break; + break; } } else if (e->button() == Qt::RightButton) @@ -185,9 +187,9 @@ void RS_ActionDrawArcTangential::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawArcTangential::coordinateEvent(Vector * e) +void ActionDrawArcTangential::coordinateEvent(Vector * e) { - if (e == NULL) + if (!e) return; Vector mouse = *e; @@ -207,7 +209,7 @@ void RS_ActionDrawArcTangential::coordinateEvent(Vector * e) } } -void RS_ActionDrawArcTangential::commandEvent(RS_CommandEvent * e) +void ActionDrawArcTangential::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -219,30 +221,30 @@ void RS_ActionDrawArcTangential::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawArcTangential::getAvailableCommands() +QStringList ActionDrawArcTangential::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionDrawArcTangential::showOptions() +void ActionDrawArcTangential::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, true); updateMouseButtonHints(); } -void RS_ActionDrawArcTangential::hideOptions() +void ActionDrawArcTangential::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawArcTangential::updateMouseButtonHints() +void ActionDrawArcTangential::updateMouseButtonHints() { switch (getStatus()) { @@ -263,12 +265,12 @@ void RS_ActionDrawArcTangential::updateMouseButtonHints() } } -void RS_ActionDrawArcTangential::updateMouseCursor() +void ActionDrawArcTangential::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawArcTangential::updateToolBar() +void ActionDrawArcTangential::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -276,13 +278,12 @@ void RS_ActionDrawArcTangential::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarArcs); } -void RS_ActionDrawArcTangential::setRadius(double r) +void ActionDrawArcTangential::setRadius(double r) { data.radius = r; } -double RS_ActionDrawArcTangential::getRadius() +double ActionDrawArcTangential::getRadius() { return data.radius; } - diff --git a/src/actions/rs_actiondrawarctangential.h b/src/actions/actiondrawarctangential.h similarity index 78% rename from src/actions/rs_actiondrawarctangential.h rename to src/actions/actiondrawarctangential.h index 1d56f14..d1f3ac2 100644 --- a/src/actions/rs_actiondrawarctangential.h +++ b/src/actions/actiondrawarctangential.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONDRAWARCTANGENTIAL_H -#define RS_ACTIONDRAWARCTANGENTIAL_H +#ifndef __ACTIONDRAWARCTANGENTIAL_H__ +#define __ACTIONDRAWARCTANGENTIAL_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "rs_arc.h" #include "vector.h" @@ -11,9 +11,10 @@ class RS_AtomicEntity; * This action class can handle user events to draw * arcs with three points given. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawArcTangential: public RS_PreviewActionInterface +class ActionDrawArcTangential: public ActionInterface { public: /** @@ -25,8 +26,8 @@ class RS_ActionDrawArcTangential: public RS_PreviewActionInterface }; public: - RS_ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawArcTangential(); + ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawArcTangential(); virtual RS2::ActionType rtti(); void reset(); @@ -65,4 +66,4 @@ class RS_ActionDrawArcTangential: public RS_PreviewActionInterface RS_ArcData data; }; -#endif +#endif // __ACTIONDRAWARCTANGENTIAL_H__ diff --git a/src/actions/rs_actiondrawcircle.cpp b/src/actions/actiondrawcircle.cpp similarity index 61% rename from src/actions/rs_actiondrawcircle.cpp rename to src/actions/actiondrawcircle.cpp index cf20b47..a6ddd14 100644 --- a/src/actions/rs_actiondrawcircle.cpp +++ b/src/actions/actiondrawcircle.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawcircle.cpp +// actiondrawcircle.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,43 +12,43 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondrawcircle.h" +#include "actiondrawcircle.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawCircle::RS_ActionDrawCircle(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw circles", container, graphicView) +ActionDrawCircle::ActionDrawCircle(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw circles", container, graphicView) { reset(); } -RS_ActionDrawCircle::~RS_ActionDrawCircle() +ActionDrawCircle::~ActionDrawCircle() { } -/*virtual*/ RS2::ActionType RS_ActionDrawCircle::rtti() +/*virtual*/ RS2::ActionType ActionDrawCircle::rtti() { return RS2::ActionDrawCircle; } -void RS_ActionDrawCircle::reset() +void ActionDrawCircle::reset() { data = RS_CircleData(Vector(false), 0.0); } -void RS_ActionDrawCircle::init(int status) +void ActionDrawCircle::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); } -void RS_ActionDrawCircle::trigger() +void ActionDrawCircle::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); RS_Circle * circle = new RS_Circle(container, data); circle->setLayerToActive(); @@ -73,12 +73,12 @@ void RS_ActionDrawCircle::trigger() setStatus(SetCenter); reset(); - RS_DEBUG->print("RS_ActionDrawCircle::trigger(): circle added: %d", circle->getId()); + RS_DEBUG->print("ActionDrawCircle::trigger(): circle added: %d", circle->getId()); } -void RS_ActionDrawCircle::mouseMoveEvent(QMouseEvent * e) +void ActionDrawCircle::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawCircle::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawCircle::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -95,17 +95,16 @@ void RS_ActionDrawCircle::mouseMoveEvent(QMouseEvent * e) data.radius = data.center.distanceTo(mouse); deletePreview(); clearPreview(); - preview->addEntity(new RS_Circle(preview, - data)); +// preview->addEntity(new RS_Circle(preview, data)); drawPreview(); } break; } - RS_DEBUG->print("RS_ActionDrawCircle::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawCircle::mouseMoveEvent end"); } -void RS_ActionDrawCircle::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawCircle::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -120,9 +119,9 @@ void RS_ActionDrawCircle::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawCircle::coordinateEvent(Vector * e) +void ActionDrawCircle::coordinateEvent(Vector * e) { - if (e == NULL) + if (!e) return; Vector mouse = *e; @@ -151,13 +150,13 @@ void RS_ActionDrawCircle::coordinateEvent(Vector * e) } } -void RS_ActionDrawCircle::commandEvent(RS_CommandEvent * e) +void ActionDrawCircle::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; @@ -165,83 +164,76 @@ void RS_ActionDrawCircle::commandEvent(RS_CommandEvent * e) switch (getStatus()) { - case SetRadius: { + case SetRadius: + { bool ok; double r = RS_Math::eval(c, &ok); - if (ok == true) + if (ok) data.radius = r; - else if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->commandMessage( - tr("Not a valid expression")); + else if (RS_DIALOGFACTORY) + RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); trigger(); //setStatus(SetCenter); } - break; + break; default: break; } } -QStringList RS_ActionDrawCircle::getAvailableCommands() +QStringList ActionDrawCircle::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionDrawCircle::updateMouseButtonHints() +void ActionDrawCircle::updateMouseButtonHints() { switch (getStatus()) { case SetCenter: - - if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->updateMouseWidget( - tr("Specify center"), tr("Cancel")); + if (RS_DIALOGFACTORY) + RS_DIALOGFACTORY->updateMouseWidget(tr("Specify center"), tr("Cancel")); break; case SetRadius: - - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->updateMouseWidget(tr("Specify radius"), tr("Back")); break; default: - - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->updateMouseWidget("", ""); break; } } -void RS_ActionDrawCircle::showOptions() +void ActionDrawCircle::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); } -void RS_ActionDrawCircle::hideOptions() +void ActionDrawCircle::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); } -void RS_ActionDrawCircle::updateMouseCursor() +void ActionDrawCircle::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawCircle::updateToolBar() +void ActionDrawCircle::updateToolBar() { if (!isFinished()) { - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); } - else if (RS_DIALOGFACTORY != NULL) + else if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarCircles); } - -// EOF - diff --git a/src/actions/rs_actiondrawcircle.h b/src/actions/actiondrawcircle.h similarity index 76% rename from src/actions/rs_actiondrawcircle.h rename to src/actions/actiondrawcircle.h index c5ca1fd..763d184 100644 --- a/src/actions/rs_actiondrawcircle.h +++ b/src/actions/actiondrawcircle.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONDRAWCIRCLE_H -#define RS_ACTIONDRAWCIRCLE_H +#ifndef __ACTIONDRAWCIRCLE_H__ +#define __ACTIONDRAWCIRCLE_H__ #include "rs_circle.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" /** * This action class can handle user events to draw * circles with a given center and a point on the circle line. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawCircle: public RS_PreviewActionInterface +class ActionDrawCircle: public ActionInterface { public: /** @@ -22,8 +23,8 @@ class RS_ActionDrawCircle: public RS_PreviewActionInterface }; public: - RS_ActionDrawCircle(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawCircle(); + ActionDrawCircle(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawCircle(); virtual RS2::ActionType rtti(); void reset(); @@ -47,4 +48,4 @@ class RS_ActionDrawCircle: public RS_PreviewActionInterface RS_CircleData data; }; -#endif +#endif // __ACTIONDRAWCIRCLE_H__ diff --git a/src/actions/rs_actiondrawcircle2p.cpp b/src/actions/actiondrawcircle2p.cpp similarity index 71% rename from src/actions/rs_actiondrawcircle2p.cpp rename to src/actions/actiondrawcircle2p.cpp index d942555..43e3003 100644 --- a/src/actions/rs_actiondrawcircle2p.cpp +++ b/src/actions/actiondrawcircle2p.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawcircle2p.cpp +// actiondrawcircle2p.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,40 +12,40 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondrawcircle2p.h" +#include "actiondrawcircle2p.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawCircle2P::RS_ActionDrawCircle2P(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw circles", +ActionDrawCircle2P::ActionDrawCircle2P(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw circles", container, graphicView) { reset(); } -RS_ActionDrawCircle2P::~RS_ActionDrawCircle2P() +ActionDrawCircle2P::~ActionDrawCircle2P() { } -void RS_ActionDrawCircle2P::reset() +void ActionDrawCircle2P::reset() { data.reset(); point1 = Vector(false); point2 = Vector(false); } -void RS_ActionDrawCircle2P::init(int status) +void ActionDrawCircle2P::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); } -void RS_ActionDrawCircle2P::trigger() +void ActionDrawCircle2P::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); preparePreview(); @@ -78,7 +78,7 @@ void RS_ActionDrawCircle2P::trigger() RS_DIALOGFACTORY->requestWarningDialog(tr("Invalid Circle data.")); } -void RS_ActionDrawCircle2P::preparePreview() +void ActionDrawCircle2P::preparePreview() { data.reset(); @@ -92,7 +92,7 @@ void RS_ActionDrawCircle2P::preparePreview() } } -void RS_ActionDrawCircle2P::mouseMoveEvent(QMouseEvent * e) +void ActionDrawCircle2P::mouseMoveEvent(QMouseEvent * e) { Vector mouse = snapPoint(e); @@ -108,11 +108,11 @@ void RS_ActionDrawCircle2P::mouseMoveEvent(QMouseEvent * e) if (data.isValid()) { - RS_Circle * circle = new RS_Circle(preview, data); - deletePreview(); - clearPreview(); - preview->addEntity(circle); - drawPreview(); +// RS_Circle * circle = new RS_Circle(preview, data); +// deletePreview(); +// clearPreview(); +// preview->addEntity(circle); +// drawPreview(); } break; @@ -121,15 +121,13 @@ void RS_ActionDrawCircle2P::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionDrawCircle2P::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawCircle2P::mouseReleaseEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { Vector ce(snapPoint(e)); coordinateEvent(&ce); } -// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) else if (e->button() == Qt::RightButton) { deletePreview(); @@ -138,7 +136,7 @@ void RS_ActionDrawCircle2P::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawCircle2P::coordinateEvent(Vector * e) +void ActionDrawCircle2P::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -164,7 +162,7 @@ void RS_ActionDrawCircle2P::coordinateEvent(Vector * e) } } -void RS_ActionDrawCircle2P::commandEvent(RS_CommandEvent * e) +void ActionDrawCircle2P::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -177,13 +175,13 @@ void RS_ActionDrawCircle2P::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawCircle2P::getAvailableCommands() +QStringList ActionDrawCircle2P::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionDrawCircle2P::updateMouseButtonHints() +void ActionDrawCircle2P::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -206,14 +204,14 @@ void RS_ActionDrawCircle2P::updateMouseButtonHints() } } -void RS_ActionDrawCircle2P::updateMouseCursor() +void ActionDrawCircle2P::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawCircle2P::updateToolBar() +void ActionDrawCircle2P::updateToolBar() { - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -221,6 +219,3 @@ void RS_ActionDrawCircle2P::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarCircles); } } - -// EOF - diff --git a/src/actions/rs_actiondrawcircle2p.h b/src/actions/actiondrawcircle2p.h similarity index 76% rename from src/actions/rs_actiondrawcircle2p.h rename to src/actions/actiondrawcircle2p.h index aebbbae..8f47cb7 100644 --- a/src/actions/rs_actiondrawcircle2p.h +++ b/src/actions/actiondrawcircle2p.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONDRAWCIRCLE2P_H -#define RS_ACTIONDRAWCIRCLE2P_H +#ifndef __ACTIONDRAWCIRCLE2P_H__ +#define __ACTIONDRAWCIRCLE2P_H__ #include "rs_circle.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to draw * simple arcs with the center, radius, start- and endangle given. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawCircle2P: public RS_PreviewActionInterface +class ActionDrawCircle2P: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionDrawCircle2P: public RS_PreviewActionInterface }; public: - RS_ActionDrawCircle2P(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawCircle2P(); + ActionDrawCircle2P(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawCircle2P(); void reset(); virtual void init(int status = 0); @@ -54,4 +55,4 @@ class RS_ActionDrawCircle2P: public RS_PreviewActionInterface Vector point2; }; -#endif +#endif // __ACTIONDRAWCIRCLE2P_H__ diff --git a/src/actions/rs_actiondrawcircle3p.cpp b/src/actions/actiondrawcircle3p.cpp similarity index 67% rename from src/actions/rs_actiondrawcircle3p.cpp rename to src/actions/actiondrawcircle3p.cpp index 1d01eff..7985bb5 100644 --- a/src/actions/rs_actiondrawcircle3p.cpp +++ b/src/actions/actiondrawcircle3p.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawcircle3p.cpp +// actiondrawcircle3p.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,24 +12,25 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondrawcircle3p.h" +#include "actiondrawcircle3p.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawCircle3P::RS_ActionDrawCircle3P(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw circles", - container, graphicView) +ActionDrawCircle3P::ActionDrawCircle3P(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Draw circles", + container, graphicView) { reset(); } -RS_ActionDrawCircle3P::~RS_ActionDrawCircle3P() +ActionDrawCircle3P::~ActionDrawCircle3P() { } -void RS_ActionDrawCircle3P::reset() +void ActionDrawCircle3P::reset() { data.reset(); point1 = Vector(false); @@ -37,34 +38,34 @@ void RS_ActionDrawCircle3P::reset() point3 = Vector(false); } -void RS_ActionDrawCircle3P::init(int status) +void ActionDrawCircle3P::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); } -void RS_ActionDrawCircle3P::trigger() +void ActionDrawCircle3P::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); preparePreview(); if (data.isValid()) { - RS_Circle * circle = new RS_Circle(container, - data); + RS_Circle * circle = new RS_Circle(container, data); circle->setLayerToActive(); circle->setPenToActive(); container->addEntity(circle); // upd. undo list: - if (document != NULL) + if (document) { document->startUndoCycle(); document->addUndoable(circle); document->endUndoCycle(); } + deleteSnapper(); Vector rz = graphicView->getRelativeZero(); graphicView->moveRelativeZero(Vector(0.0, 0.0)); @@ -79,21 +80,21 @@ void RS_ActionDrawCircle3P::trigger() RS_DIALOGFACTORY->requestWarningDialog(tr("Invalid circle data.")); } -void RS_ActionDrawCircle3P::preparePreview() +void ActionDrawCircle3P::preparePreview() { data.reset(); if (point1.valid && point2.valid && point3.valid) { RS_Circle circle(NULL, data); - bool suc = circle.createFrom3P(point1, point2, point3); + bool success = circle.createFrom3P(point1, point2, point3); - if (suc) + if (success) data = circle.getData(); } } -void RS_ActionDrawCircle3P::mouseMoveEvent(QMouseEvent * e) +void ActionDrawCircle3P::mouseMoveEvent(QMouseEvent * e) { Vector mouse = snapPoint(e); @@ -113,26 +114,24 @@ void RS_ActionDrawCircle3P::mouseMoveEvent(QMouseEvent * e) if (data.isValid()) { - RS_Circle * circle = new RS_Circle(preview, data); - - deletePreview(); - clearPreview(); - preview->addEntity(circle); - drawPreview(); +// RS_Circle * circle = new RS_Circle(preview, data); +// +// deletePreview(); +// clearPreview(); +// preview->addEntity(circle); +// drawPreview(); } break; } } -void RS_ActionDrawCircle3P::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawCircle3P::mouseReleaseEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { Vector ce(snapPoint(e)); coordinateEvent(&ce); } -// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) else if (e->button() == Qt::RightButton) { deletePreview(); @@ -141,7 +140,7 @@ void RS_ActionDrawCircle3P::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawCircle3P::coordinateEvent(Vector * e) +void ActionDrawCircle3P::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -172,7 +171,7 @@ void RS_ActionDrawCircle3P::coordinateEvent(Vector * e) } } -void RS_ActionDrawCircle3P::commandEvent(RS_CommandEvent * e) +void ActionDrawCircle3P::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -184,29 +183,26 @@ void RS_ActionDrawCircle3P::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawCircle3P::getAvailableCommands() +QStringList ActionDrawCircle3P::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionDrawCircle3P::updateMouseButtonHints() +void ActionDrawCircle3P::updateMouseButtonHints() { switch (getStatus()) { case SetPoint1: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify first point"), - tr("Cancel")); + RS_DIALOGFACTORY->updateMouseWidget(tr("Specify first point"), tr("Cancel")); break; case SetPoint2: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify second point"), - tr("Back")); + RS_DIALOGFACTORY->updateMouseWidget(tr("Specify second point"), tr("Back")); break; case SetPoint3: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify third point"), - tr("Back")); + RS_DIALOGFACTORY->updateMouseWidget(tr("Specify third point"), tr("Back")); break; default: @@ -215,18 +211,15 @@ void RS_ActionDrawCircle3P::updateMouseButtonHints() } } -void RS_ActionDrawCircle3P::updateMouseCursor() +void ActionDrawCircle3P::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawCircle3P::updateToolBar() +void ActionDrawCircle3P::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarCircles); } - -// EOF - diff --git a/src/actions/rs_actiondrawcircle3p.h b/src/actions/actiondrawcircle3p.h similarity index 71% rename from src/actions/rs_actiondrawcircle3p.h rename to src/actions/actiondrawcircle3p.h index a00e04b..d2d64b4 100644 --- a/src/actions/rs_actiondrawcircle3p.h +++ b/src/actions/actiondrawcircle3p.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONDRAWCIRCLE3P_H -#define RS_ACTIONDRAWCIRCLE3P_H +#ifndef __ACTIONDRAWCIRCLE3P_H__ +#define __ACTIONDRAWCIRCLE3P_H__ #include "rs_circle.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** - * This action class can handle user events to draw - * circles with three points given. + * This action class can handle user events to draw circles with three points + * given. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawCircle3P: public RS_PreviewActionInterface +class ActionDrawCircle3P: public ActionInterface { public: /** @@ -24,8 +25,8 @@ class RS_ActionDrawCircle3P: public RS_PreviewActionInterface }; public: - RS_ActionDrawCircle3P(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawCircle3P(); + ActionDrawCircle3P(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawCircle3P(); void reset(); virtual void init(int status = 0); @@ -59,4 +60,4 @@ class RS_ActionDrawCircle3P: public RS_PreviewActionInterface Vector point3; }; -#endif +#endif // __ACTIONDRAWCIRCLE3P_H__ diff --git a/src/actions/rs_actiondrawcirclecr.cpp b/src/actions/actiondrawcirclecr.cpp similarity index 66% rename from src/actions/rs_actiondrawcirclecr.cpp rename to src/actions/actiondrawcirclecr.cpp index 9e9d49a..34af3c9 100644 --- a/src/actions/rs_actiondrawcirclecr.cpp +++ b/src/actions/actiondrawcirclecr.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawcirclecr.cpp +// actiondrawcirclecr.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondrawcirclecr.h" +#include "actiondrawcirclecr.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" @@ -22,34 +22,34 @@ /** * Constructor. */ -RS_ActionDrawCircleCR::RS_ActionDrawCircleCR(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw circles CR", +ActionDrawCircleCR::ActionDrawCircleCR(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw circles CR", container, graphicView) { reset(); } -RS_ActionDrawCircleCR::~RS_ActionDrawCircleCR() +ActionDrawCircleCR::~ActionDrawCircleCR() { } -/*virtual*/ RS2::ActionType RS_ActionDrawCircleCR::rtti() +/*virtual*/ RS2::ActionType ActionDrawCircleCR::rtti() { return RS2::ActionDrawCircleCR; } -void RS_ActionDrawCircleCR::reset() +void ActionDrawCircleCR::reset() { data = RS_CircleData(Vector(false), 0.0); } -void RS_ActionDrawCircleCR::init(int status) +void ActionDrawCircleCR::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionDrawCircleCR::trigger() +void ActionDrawCircleCR::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); RS_Circle * circle = new RS_Circle(container, data); circle->setLayerToActive(); @@ -73,12 +73,12 @@ void RS_ActionDrawCircleCR::trigger() setStatus(SetCenter); - RS_DEBUG->print("RS_ActionDrawCircleCR::trigger(): circle added: %d", circle->getId()); + RS_DEBUG->print("ActionDrawCircleCR::trigger(): circle added: %d", circle->getId()); } -void RS_ActionDrawCircleCR::mouseMoveEvent(QMouseEvent * e) +void ActionDrawCircleCR::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawCircleCR::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawCircleCR::mouseMoveEvent begin"); Vector mouse = snapPoint(e); switch (getStatus()) @@ -87,23 +87,21 @@ void RS_ActionDrawCircleCR::mouseMoveEvent(QMouseEvent * e) data.center = mouse; deletePreview(); clearPreview(); - preview->addEntity(new RS_Circle(preview, data)); +// preview->addEntity(new RS_Circle(preview, data)); drawPreview(); break; } - RS_DEBUG->print("RS_ActionDrawCircleCR::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawCircleCR::mouseMoveEvent end"); } -void RS_ActionDrawCircleCR::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawCircleCR::mouseReleaseEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { Vector ce(snapPoint(e)); coordinateEvent(&ce); } -// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) else if (e->button() == Qt::RightButton) { deletePreview(); @@ -112,7 +110,7 @@ void RS_ActionDrawCircleCR::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawCircleCR::coordinateEvent(Vector * e) +void ActionDrawCircleCR::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -131,7 +129,7 @@ void RS_ActionDrawCircleCR::coordinateEvent(Vector * e) } } -void RS_ActionDrawCircleCR::commandEvent(RS_CommandEvent * e) +void ActionDrawCircleCR::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -175,7 +173,7 @@ void RS_ActionDrawCircleCR::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawCircleCR::getAvailableCommands() +QStringList ActionDrawCircleCR::getAvailableCommands() { QStringList cmd; @@ -192,7 +190,7 @@ QStringList RS_ActionDrawCircleCR::getAvailableCommands() return cmd; } -void RS_ActionDrawCircleCR::updateMouseButtonHints() +void ActionDrawCircleCR::updateMouseButtonHints() { switch (getStatus()) { @@ -210,26 +208,26 @@ void RS_ActionDrawCircleCR::updateMouseButtonHints() } } -void RS_ActionDrawCircleCR::showOptions() +void ActionDrawCircleCR::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawCircleCR::hideOptions() +void ActionDrawCircleCR::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawCircleCR::updateMouseCursor() +void ActionDrawCircleCR::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawCircleCR::updateToolBar() +void ActionDrawCircleCR::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -237,13 +235,12 @@ void RS_ActionDrawCircleCR::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarCircles); } -double RS_ActionDrawCircleCR::getRadius() +double ActionDrawCircleCR::getRadius() { return data.radius; } -void RS_ActionDrawCircleCR::setRadius(double r) +void ActionDrawCircleCR::setRadius(double r) { data.radius = r; } - diff --git a/src/actions/rs_actiondrawcirclecr.h b/src/actions/actiondrawcirclecr.h similarity index 67% rename from src/actions/rs_actiondrawcirclecr.h rename to src/actions/actiondrawcirclecr.h index 8bd35ec..6e50f44 100644 --- a/src/actions/rs_actiondrawcirclecr.h +++ b/src/actions/actiondrawcirclecr.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONDRAWCIRCLECR_H -#define RS_ACTIONDRAWCIRCLECR_H +#ifndef __ACTIONDRAWCIRCLECR_H__ +#define __ACTIONDRAWCIRCLECR_H__ #include "rs_circle.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" /** - * This action class can handle user events to draw - * simple arcs with the center, radius, start- and endangle given. + * This action class can handle user events to draw simple arcs with the + * center, radius, start and end angle given. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawCircleCR: public RS_PreviewActionInterface +class ActionDrawCircleCR: public ActionInterface { public: /** @@ -22,8 +23,8 @@ class RS_ActionDrawCircleCR: public RS_PreviewActionInterface }; public: - RS_ActionDrawCircleCR(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawCircleCR(); + ActionDrawCircleCR(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawCircleCR(); virtual RS2::ActionType rtti(); void reset(); @@ -49,4 +50,4 @@ class RS_ActionDrawCircleCR: public RS_PreviewActionInterface RS_CircleData data; }; -#endif +#endif // __ACTIONDRAWCIRCLECR_H__ diff --git a/src/actions/rs_actiondrawellipseaxis.cpp b/src/actions/actiondrawellipseaxis.cpp similarity index 78% rename from src/actions/rs_actiondrawellipseaxis.cpp rename to src/actions/actiondrawellipseaxis.cpp index f1c7261..6f6a7f6 100644 --- a/src/actions/rs_actiondrawellipseaxis.cpp +++ b/src/actions/actiondrawellipseaxis.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawellipseaxis.cpp +// actiondrawellipseaxis.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actiondrawellipseaxis.h" +#include "actiondrawellipseaxis.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" @@ -25,7 +25,7 @@ * @param isArc true if this action will produce an ellipse arc. * false if it will produce a full ellipse. */ -RS_ActionDrawEllipseAxis::RS_ActionDrawEllipseAxis(RS_EntityContainer & container, GraphicView & graphicView, bool isArc): RS_PreviewActionInterface("Draw ellipse with axis", +ActionDrawEllipseAxis::ActionDrawEllipseAxis(RS_EntityContainer & container, GraphicView & graphicView, bool isArc): ActionInterface("Draw ellipse with axis", container, graphicView) { this->isArc = isArc; @@ -36,13 +36,13 @@ RS_ActionDrawEllipseAxis::RS_ActionDrawEllipseAxis(RS_EntityContainer & containe angle2 = 2 * M_PI; } -RS_ActionDrawEllipseAxis::~RS_ActionDrawEllipseAxis() +ActionDrawEllipseAxis::~ActionDrawEllipseAxis() { } -void RS_ActionDrawEllipseAxis::init(int status) +void ActionDrawEllipseAxis::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); if (status == SetCenter) center = Vector(false); @@ -60,9 +60,9 @@ void RS_ActionDrawEllipseAxis::init(int status) angle2 = 2 * M_PI; } -void RS_ActionDrawEllipseAxis::trigger() +void ActionDrawEllipseAxis::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); RS_EllipseData ellipseData(center, major, ratio, angle1, angle2, false); RS_Ellipse * ellipse = new RS_Ellipse(container, ellipseData); @@ -88,13 +88,13 @@ void RS_ActionDrawEllipseAxis::trigger() setStatus(SetCenter); - RS_DEBUG->print("RS_ActionDrawEllipseAxis::trigger():" + RS_DEBUG->print("ActionDrawEllipseAxis::trigger():" " entity added: %d", ellipse->getId()); } -void RS_ActionDrawEllipseAxis::mouseMoveEvent(QMouseEvent * e) +void ActionDrawEllipseAxis::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawEllipseAxis::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawEllipseAxis::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -110,7 +110,7 @@ void RS_ActionDrawEllipseAxis::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); RS_EllipseData ed(center, mouse - center, 0.5, 0.0, 2 * M_PI, false); - preview->addEntity(new RS_Ellipse(preview, ed)); +// preview->addEntity(new RS_Ellipse(preview, ed)); drawPreview(); } break; @@ -125,7 +125,7 @@ void RS_ActionDrawEllipseAxis::mouseMoveEvent(QMouseEvent * e) double d = line.getDistanceToPoint(mouse); ratio = d / (line.getLength() / 2); RS_EllipseData ed(center, major, ratio, 0.0, 2 * M_PI, false); - preview->addEntity(new RS_Ellipse(preview, ed)); +// preview->addEntity(new RS_Ellipse(preview, ed)); drawPreview(); } break; @@ -145,10 +145,10 @@ void RS_ActionDrawEllipseAxis::mouseMoveEvent(QMouseEvent * e) v.scale(Vector(1.0, 1.0 / ratio)); angle1 = v.angle(); // + major.angle(); - preview->addEntity(new RS_Line(preview, RS_LineData(center, mouse))); +// preview->addEntity(new RS_Line(preview, RS_LineData(center, mouse))); RS_EllipseData ed(center, major, ratio, angle1, angle1 + 1.0, false); - preview->addEntity(new RS_Ellipse(preview, ed)); +// preview->addEntity(new RS_Ellipse(preview, ed)); drawPreview(); } break; @@ -167,11 +167,10 @@ void RS_ActionDrawEllipseAxis::mouseMoveEvent(QMouseEvent * e) v.scale(Vector(1.0, 1.0 / ratio)); angle2 = v.angle(); // + major.angle(); - preview->addEntity(new RS_Line(preview, RS_LineData(center, mouse))); +// preview->addEntity(new RS_Line(preview, RS_LineData(center, mouse))); - RS_EllipseData ed( - center, major, ratio, angle1, angle2, false); - preview->addEntity(new RS_Ellipse(preview, ed)); + RS_EllipseData ed(center, major, ratio, angle1, angle2, false); +// preview->addEntity(new RS_Ellipse(preview, ed)); drawPreview(); } @@ -179,20 +178,18 @@ void RS_ActionDrawEllipseAxis::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionDrawEllipseAxis::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawEllipseAxis::mouseMoveEvent end"); } -void RS_ActionDrawEllipseAxis::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawEllipseAxis::mouseReleaseEvent(QMouseEvent * e) { // Proceed to next status -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { Vector ce(snapPoint(e)); coordinateEvent(&ce); } // Return to last status: -// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) else if (e->button() == Qt::RightButton) { deletePreview(); @@ -201,7 +198,7 @@ void RS_ActionDrawEllipseAxis::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawEllipseAxis::coordinateEvent(Vector * e) +void ActionDrawEllipseAxis::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -266,7 +263,7 @@ void RS_ActionDrawEllipseAxis::coordinateEvent(Vector * e) } } -void RS_ActionDrawEllipseAxis::commandEvent(RS_CommandEvent * e) +void ActionDrawEllipseAxis::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -334,13 +331,13 @@ void RS_ActionDrawEllipseAxis::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawEllipseAxis::getAvailableCommands() +QStringList ActionDrawEllipseAxis::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionDrawEllipseAxis::updateMouseButtonHints() +void ActionDrawEllipseAxis::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -379,14 +376,14 @@ void RS_ActionDrawEllipseAxis::updateMouseButtonHints() } } -void RS_ActionDrawEllipseAxis::updateMouseCursor() +void ActionDrawEllipseAxis::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawEllipseAxis::updateToolBar() +void ActionDrawEllipseAxis::updateToolBar() { - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -394,5 +391,3 @@ void RS_ActionDrawEllipseAxis::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarEllipses); } } - -// EOF diff --git a/src/actions/rs_actiondrawellipseaxis.h b/src/actions/actiondrawellipseaxis.h similarity index 70% rename from src/actions/rs_actiondrawellipseaxis.h rename to src/actions/actiondrawellipseaxis.h index 2aacd50..31e54e3 100644 --- a/src/actions/rs_actiondrawellipseaxis.h +++ b/src/actions/actiondrawellipseaxis.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONDRAWELLIPSEAXIS_H -#define RS_ACTIONDRAWELLIPSEAXIS_H +#ifndef __ACTIONDRAWELLIPSEAXIS_H__ +#define __ACTIONDRAWELLIPSEAXIS_H__ #include "rs_ellipse.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" /** - * This action class can handle user events to draw ellipses - * with a center point and the endpoints of minor and major axis. + * This action class can handle user events to draw ellipses with a center + * point and the endpoints of minor and major axis. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawEllipseAxis: public RS_PreviewActionInterface +class ActionDrawEllipseAxis: public ActionInterface { public: /** @@ -25,8 +26,8 @@ class RS_ActionDrawEllipseAxis: public RS_PreviewActionInterface }; public: - RS_ActionDrawEllipseAxis(RS_EntityContainer & container, GraphicView & graphicView, bool isArc); - ~RS_ActionDrawEllipseAxis(); + ActionDrawEllipseAxis(RS_EntityContainer & container, GraphicView & graphicView, bool isArc); + ~ActionDrawEllipseAxis(); virtual void init(int status = 0); virtual void trigger(); @@ -54,4 +55,4 @@ class RS_ActionDrawEllipseAxis: public RS_PreviewActionInterface bool isArc; }; -#endif +#endif // __ACTIONDRAWELLIPSEAXIS_H__ diff --git a/src/actions/rs_actiondrawhatch.cpp b/src/actions/actiondrawhatch.cpp similarity index 59% rename from src/actions/rs_actiondrawhatch.cpp rename to src/actions/actiondrawhatch.cpp index 0fd90c2..b525589 100644 --- a/src/actions/rs_actiondrawhatch.cpp +++ b/src/actions/actiondrawhatch.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawhatch.cpp +// actiondrawhatch.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,25 +12,25 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actiondrawhatch.h" +#include "actiondrawhatch.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_information.h" -RS_ActionDrawHatch::RS_ActionDrawHatch(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw Hatch", container, graphicView) +ActionDrawHatch::ActionDrawHatch(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw Hatch", container, graphicView) { hatch = NULL; } -RS_ActionDrawHatch::~RS_ActionDrawHatch() +ActionDrawHatch::~ActionDrawHatch() { } -void RS_ActionDrawHatch::init(int status) +void ActionDrawHatch::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); clearPreview(); RS_Hatch tmp(container, data); @@ -48,40 +48,41 @@ void RS_ActionDrawHatch::init(int status) finish(); } -void RS_ActionDrawHatch::trigger() +void ActionDrawHatch::trigger() { - RS_DEBUG->print("RS_ActionDrawHatch::trigger()"); + RS_DEBUG->print("ActionDrawHatch::trigger()"); - //if (pos.valid) { - //deletePreview(); deleteSnapper(); RS_Entity * e; // deselect unhatchable entities: - for (e = container->firstEntity(RS2::ResolveNone); e != NULL; - e = container->nextEntity(RS2::ResolveNone)) + for(e=container->firstEntity(RS2::ResolveNone); e!=NULL; + e=container->nextEntity(RS2::ResolveNone)) + { if (e->isSelected() && (e->rtti() == RS2::EntityHatch - || e->rtti() == RS2::EntityEllipse || e->rtti() == RS2::EntityPoint - || e->rtti() == RS2::EntityText - || RS_Information::isDimension(e->rtti()))) + || e->rtti() == RS2::EntityEllipse || e->rtti() == RS2::EntityPoint + || e->rtti() == RS2::EntityText + || RS_Information::isDimension(e->rtti()))) e->setSelected(false); + } - - for (e = container->firstEntity(RS2::ResolveAll); e != NULL; - e = container->nextEntity(RS2::ResolveAll)) + for(e=container->firstEntity(RS2::ResolveAll); e!=NULL; + e=container->nextEntity(RS2::ResolveAll)) + { if (e->isSelected() - && (e->rtti() == RS2::EntityHatch - || e->rtti() == RS2::EntityEllipse || e->rtti() == RS2::EntityPoint - || e->rtti() == RS2::EntityText - || RS_Information::isDimension(e->rtti()))) + && (e->rtti() == RS2::EntityHatch + || e->rtti() == RS2::EntityEllipse || e->rtti() == RS2::EntityPoint + || e->rtti() == RS2::EntityText + || RS_Information::isDimension(e->rtti()))) e->setSelected(false); + } // look for selected contours: bool haveContour = false; - for (e = container->firstEntity(RS2::ResolveAll); e != NULL; - e = container->nextEntity(RS2::ResolveAll)) + for(e=container->firstEntity(RS2::ResolveAll); e!=NULL; + e=container->nextEntity(RS2::ResolveAll)) if (e->isSelected()) haveContour = true; @@ -98,23 +99,25 @@ void RS_ActionDrawHatch::trigger() loop->setPen(RS_Pen(RS2::FlagInvalid)); // add selected contour: - for (RS_Entity * e = container->firstEntity(RS2::ResolveAll); e != NULL; - e = container->nextEntity(RS2::ResolveAll)) - + for(RS_Entity * e=container->firstEntity(RS2::ResolveAll); e!=NULL; + e=container->nextEntity(RS2::ResolveAll)) + { if (e->isSelected()) { e->setSelected(false); // entity is part of a complex entity (spline, polyline, ..): if (e->getParent() != NULL - && (e->getParent()->rtti() == RS2::EntitySpline - || e->getParent()->rtti() == RS2::EntityPolyline)) + && (e->getParent()->rtti() == RS2::EntitySpline + || e->getParent()->rtti() == RS2::EntityPolyline)) e->getParent()->setSelected(false); + RS_Entity * cp = e->clone(); cp->setPen(RS_Pen(RS2::FlagInvalid)); cp->reparent(loop); loop->addEntity(cp); } + } hatch->addEntity(loop); @@ -128,10 +131,9 @@ void RS_ActionDrawHatch::trigger() document->addUndoable(hatch); document->endUndoCycle(); } - hatch->update(); + hatch->update(); graphicView->drawEntity(hatch); - RS_DIALOGFACTORY->commandMessage(tr("Hatch created successfully.")); } else @@ -139,14 +141,13 @@ void RS_ActionDrawHatch::trigger() delete hatch; hatch = NULL; RS_DIALOGFACTORY->commandMessage(tr("Invalid hatch area. Please check that " - "the entities chosen form one or more closed contours.")); + "the entities chosen form one or more closed contours.")); } - //} } -void RS_ActionDrawHatch::mouseMoveEvent(QMouseEvent *) +void ActionDrawHatch::mouseMoveEvent(QMouseEvent *) { - RS_DEBUG->print("RS_ActionDrawHatch::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawHatch::mouseMoveEvent begin"); /*if (getStatus()==SetPos) { Vector mouse = snapPoint(e); @@ -162,12 +163,11 @@ void RS_ActionDrawHatch::mouseMoveEvent(QMouseEvent *) drawPreview(); }*/ - RS_DEBUG->print("RS_ActionDrawHatch::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawHatch::mouseMoveEvent end"); } -void RS_ActionDrawHatch::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawHatch::mouseReleaseEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { Vector mouse = snapPoint(e); @@ -181,7 +181,6 @@ void RS_ActionDrawHatch::mouseReleaseEvent(QMouseEvent * e) break; } } -// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) else if (e->button() == Qt::RightButton) { //deletePreview(); @@ -190,18 +189,17 @@ void RS_ActionDrawHatch::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawHatch::updateMouseButtonHints() +void ActionDrawHatch::updateMouseButtonHints() { RS_DIALOGFACTORY->updateMouseWidget("", ""); } -void RS_ActionDrawHatch::updateMouseCursor() +void ActionDrawHatch::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawHatch::updateToolBar() +void ActionDrawHatch::updateToolBar() { RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } - diff --git a/src/actions/rs_actiondrawhatch.h b/src/actions/actiondrawhatch.h similarity index 66% rename from src/actions/rs_actiondrawhatch.h rename to src/actions/actiondrawhatch.h index 2954564..20c2a0a 100644 --- a/src/actions/rs_actiondrawhatch.h +++ b/src/actions/actiondrawhatch.h @@ -1,15 +1,16 @@ -#ifndef RS_ACTIONDRAWHATCH_H -#define RS_ACTIONDRAWHATCH_H +#ifndef __ACTIONDRAWHATCH_H__ +#define __ACTIONDRAWHATCH_H__ #include "rs_hatch.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" /** * This action class can handle user events to draw hatches. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawHatch: public RS_PreviewActionInterface +class ActionDrawHatch: public ActionInterface { public: /** @@ -20,8 +21,8 @@ class RS_ActionDrawHatch: public RS_PreviewActionInterface }; public: - RS_ActionDrawHatch(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawHatch(); + ActionDrawHatch(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawHatch(); virtual void init(int status = 0); virtual void trigger(); @@ -36,4 +37,4 @@ class RS_ActionDrawHatch: public RS_PreviewActionInterface RS_Hatch * hatch; }; -#endif +#endif // __ACTIONDRAWHATCH_H__ diff --git a/src/actions/rs_actiondrawimage.cpp b/src/actions/actiondrawimage.cpp similarity index 63% rename from src/actions/rs_actiondrawimage.cpp rename to src/actions/actiondrawimage.cpp index b80cfd5..b30d98e 100644 --- a/src/actions/rs_actiondrawimage.cpp +++ b/src/actions/actiondrawimage.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawimage.cpp +// actiondrawimage.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actiondrawimage.h" +#include "actiondrawimage.h" #include "rs_commandevent.h" #include "rs_creation.h" @@ -23,23 +23,23 @@ /** * Constructor. */ -RS_ActionDrawImage::RS_ActionDrawImage(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Image", container, graphicView) +ActionDrawImage::ActionDrawImage(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Image", container, graphicView) { } -RS_ActionDrawImage::~RS_ActionDrawImage() +ActionDrawImage::~ActionDrawImage() { } -/*virtual*/ RS2::ActionType RS_ActionDrawImage::rtti() +/*virtual*/ RS2::ActionType ActionDrawImage::rtti() { return RS2::ActionDrawImage; } -void RS_ActionDrawImage::init(int status) +void ActionDrawImage::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); @@ -61,7 +61,7 @@ void RS_ActionDrawImage::init(int status) } } -void RS_ActionDrawImage::reset() +void ActionDrawImage::reset() { data = RS_ImageData(0, Vector(0.0, 0.0), @@ -72,7 +72,7 @@ void RS_ActionDrawImage::reset() 50, 50, 0); } -void RS_ActionDrawImage::trigger() +void ActionDrawImage::trigger() { deleteSnapper(); deletePreview(); @@ -85,38 +85,35 @@ void RS_ActionDrawImage::trigger() } graphicView->redraw(); - //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); finish(); updateToolBar(); } -void RS_ActionDrawImage::mouseMoveEvent(QMouseEvent * e) +void ActionDrawImage::mouseMoveEvent(QMouseEvent * e) { switch (getStatus()) { case SetTargetPoint: data.insertionPoint = snapPoint(e); - deletePreview(); - clearPreview(); - //RS_Creation creation(preview, NULL, false); - //creation.createInsert(data); - RS_Line * line; - line = new RS_Line(preview, RS_LineData(Vector(0, 0), Vector(img.width(), 0))); - preview->addEntity(line); - line = new RS_Line(preview, - RS_LineData(Vector(img.width(), 0), Vector(img.width(), img.height()))); - preview->addEntity(line); - line = new RS_Line(preview, - RS_LineData(Vector(img.width(), img.height()), Vector(0, img.height()))); - preview->addEntity(line); - line = new RS_Line(preview, RS_LineData(Vector(0, img.height()), Vector(0, 0))); - preview->addEntity(line); - preview->scale(Vector(0, 0), Vector(data.uVector.magnitude(), data.uVector.magnitude())); - preview->rotate(Vector(0, 0), data.uVector.angle()); - preview->move(data.insertionPoint); - - drawPreview(); +// deletePreview(); +// clearPreview(); +// RS_Line * line; +// line = new RS_Line(preview, RS_LineData(Vector(0, 0), Vector(img.width(), 0))); +// preview->addEntity(line); +// line = new RS_Line(preview, +// RS_LineData(Vector(img.width(), 0), Vector(img.width(), img.height()))); +// preview->addEntity(line); +// line = new RS_Line(preview, +// RS_LineData(Vector(img.width(), img.height()), Vector(0, img.height()))); +// preview->addEntity(line); +// line = new RS_Line(preview, RS_LineData(Vector(0, img.height()), Vector(0, 0))); +// preview->addEntity(line); +// preview->scale(Vector(0, 0), Vector(data.uVector.magnitude(), data.uVector.magnitude())); +// preview->rotate(Vector(0, 0), data.uVector.angle()); +// preview->move(data.insertionPoint); +// +// drawPreview(); break; default: @@ -124,33 +121,30 @@ void RS_ActionDrawImage::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionDrawImage::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawImage::mouseReleaseEvent(QMouseEvent * e) { -// if (e->button() == Qt::LeftButton) if (e->button() == Qt::LeftButton) { Vector ce(snapPoint(e)); coordinateEvent(&ce); } -// else if (e->button() == Qt::RightButton) else if (e->button() == Qt::RightButton) { deleteSnapper(); - //init(getStatus()-1); finish(); } } -void RS_ActionDrawImage::coordinateEvent(Vector * e) +void ActionDrawImage::coordinateEvent(Vector * e) { - if (e == NULL) + if (!e) return; data.insertionPoint = *e; trigger(); } -void RS_ActionDrawImage::commandEvent(RS_CommandEvent * e) +void ActionDrawImage::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -188,10 +182,11 @@ void RS_ActionDrawImage::commandEvent(RS_CommandEvent * e) bool ok; double a = RS_Math::eval(c, &ok); - if (ok == true) + if (ok) setAngle(RS_Math::deg2rad(a)); else RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + RS_DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } @@ -202,10 +197,11 @@ void RS_ActionDrawImage::commandEvent(RS_CommandEvent * e) bool ok; double f = RS_Math::eval(c, &ok); - if (ok == true) + if (ok) setFactor(f); else RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + RS_DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } @@ -216,7 +212,7 @@ void RS_ActionDrawImage::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawImage::getAvailableCommands() +QStringList ActionDrawImage::getAvailableCommands() { QStringList cmd; @@ -234,21 +230,21 @@ QStringList RS_ActionDrawImage::getAvailableCommands() return cmd; } -void RS_ActionDrawImage::showOptions() +void ActionDrawImage::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawImage::hideOptions() +void ActionDrawImage::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawImage::updateMouseButtonHints() +void ActionDrawImage::updateMouseButtonHints() { switch (getStatus()) { @@ -270,12 +266,12 @@ void RS_ActionDrawImage::updateMouseButtonHints() } } -void RS_ActionDrawImage::updateMouseCursor() +void ActionDrawImage::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawImage::updateToolBar() +void ActionDrawImage::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -283,24 +279,24 @@ void RS_ActionDrawImage::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } -double RS_ActionDrawImage::getAngle() +double ActionDrawImage::getAngle() { return data.uVector.angle(); } -void RS_ActionDrawImage::setAngle(double a) +void ActionDrawImage::setAngle(double a) { double l = data.uVector.magnitude(); data.uVector.setPolar(l, a); data.vVector.setPolar(l, a + M_PI / 2); } -double RS_ActionDrawImage::getFactor() +double ActionDrawImage::getFactor() { return data.uVector.magnitude(); } -void RS_ActionDrawImage::setFactor(double f) +void ActionDrawImage::setFactor(double f) { double a = data.uVector.angle(); data.uVector.setPolar(f, a); diff --git a/src/actions/rs_actiondrawimage.h b/src/actions/actiondrawimage.h similarity index 83% rename from src/actions/rs_actiondrawimage.h rename to src/actions/actiondrawimage.h index 47a3307..79b3e8f 100644 --- a/src/actions/rs_actiondrawimage.h +++ b/src/actions/actiondrawimage.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONDRAWIMAGE_H -#define RS_ACTIONDRAWIMAGE_H +#ifndef __ACTIONDRAWIMAGE_H__ +#define __ACTIONDRAWIMAGE_H__ #include #include "rs_image.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" /** * This action class can handle user events for inserting bitmaps into the * current drawing. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawImage: public RS_PreviewActionInterface +class ActionDrawImage: public ActionInterface { public: /** @@ -29,8 +30,8 @@ class RS_ActionDrawImage: public RS_PreviewActionInterface }; public: - RS_ActionDrawImage(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawImage(); + ActionDrawImage(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawImage(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -59,4 +60,4 @@ class RS_ActionDrawImage: public RS_PreviewActionInterface Status lastStatus; }; -#endif +#endif // __ACTIONDRAWIMAGE_H__ diff --git a/src/actions/rs_actiondrawline.cpp b/src/actions/actiondrawline.cpp similarity index 69% rename from src/actions/rs_actiondrawline.cpp rename to src/actions/actiondrawline.cpp index d3fad72..e6ae87a 100644 --- a/src/actions/rs_actiondrawline.cpp +++ b/src/actions/actiondrawline.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawline.cpp +// actiondrawline.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,57 +12,57 @@ // JLH 05/19/2010 Added this text. :-) // -#include "rs_actiondrawline.h" +#include "actiondrawline.h" -#include "rs_actioneditundo.h" +#include "actioneditundo.h" #include "rs_commandevent.h" #include "commands.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLine::RS_ActionDrawLine(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw lines", container, graphicView) +ActionDrawLine::ActionDrawLine(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw lines", container, graphicView) { - RS_DEBUG->print("RS_ActionDrawLine::RS_ActionDrawLine"); + RS_DEBUG->print("ActionDrawLine::ActionDrawLine"); reset(); //hm. graphicView.snapper.SetContainer(&container); graphicView.snapper.SetGraphicView(&graphicView); graphicView.snapper.SetVisible(); graphicView.preview.SetVisible(); - RS_DEBUG->print("RS_ActionDrawLine::RS_ActionDrawLine: OK"); + RS_DEBUG->print("ActionDrawLine::ActionDrawLine: OK"); } -RS_ActionDrawLine::~RS_ActionDrawLine() +ActionDrawLine::~ActionDrawLine() { ClearHistory(); } -/*virtual*/ RS2::ActionType RS_ActionDrawLine::rtti() +/*virtual*/ RS2::ActionType ActionDrawLine::rtti() { return RS2::ActionDrawLine; } -void RS_ActionDrawLine::reset() +void ActionDrawLine::reset() { - RS_DEBUG->print("RS_ActionDrawLine::reset"); + RS_DEBUG->print("ActionDrawLine::reset"); data = RS_LineData(Vector(false), Vector(false)); start = Vector(false); ClearHistory(); - RS_DEBUG->print("RS_ActionDrawLine::reset: OK"); + RS_DEBUG->print("ActionDrawLine::reset: OK"); } -void RS_ActionDrawLine::init(int status) +void ActionDrawLine::init(int status) { - RS_DEBUG->print("RS_ActionDrawLine::init"); -// RS_PreviewActionInterface::init(status); - RS_ActionInterface::init(status); + RS_DEBUG->print("ActionDrawLine::init"); +// ActionInterface::init(status); + ActionInterface::init(status); reset(); - RS_DEBUG->print("RS_ActionDrawLine::init: OK"); + RS_DEBUG->print("ActionDrawLine::init: OK"); } -void RS_ActionDrawLine::trigger() +void ActionDrawLine::trigger() { graphicView->preview.clear(); @@ -71,7 +71,7 @@ void RS_ActionDrawLine::trigger() line->setPenToActive(); container->addEntity(line); //std::cout << container; -//printf("RS_ActionDrawLine::trigger(): new line is %f,%f to %f,%f\n", data.startpoint.x, data.startpoint.y, data.endpoint.x, data.endpoint.y); +//printf("ActionDrawLine::trigger(): new line is %f,%f to %f,%f\n", data.startpoint.x, data.startpoint.y, data.endpoint.x, data.endpoint.y); //This makes it come back as "Unknown Entity" //std::cout << *((RS_Entity *)container); //std::cout << *container; @@ -87,20 +87,20 @@ void RS_ActionDrawLine::trigger() graphicView->moveRelativeZero(line->getEndpoint()); //hm. [OK, it just moves the relative zero tho. Overkill. And remove preview, so OK.] graphicView->redraw(); - RS_DEBUG->print("RS_ActionDrawLine::trigger(): line added: %d", line->getId()); + RS_DEBUG->print("ActionDrawLine::trigger(): line added: %d", line->getId()); } -void RS_ActionDrawLine::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLine::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLine::mouseMoveEvent begin"); - RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent: snap point"); + RS_DEBUG->print("ActionDrawLine::mouseMoveEvent: snap point"); Vector mouse = graphicView->snapper.snapPoint(e); - RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent: snap point: OK"); + RS_DEBUG->print("ActionDrawLine::mouseMoveEvent: snap point: OK"); if (getStatus() == SetEndpoint && data.startpoint.valid) { - RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent: update preview"); + RS_DEBUG->print("ActionDrawLine::mouseMoveEvent: update preview"); // This is lame. Creating a new Line every time the endpoint moves. // Surely we can alter the line entity inside the preview, no? #if 0 @@ -125,10 +125,10 @@ void RS_ActionDrawLine::mouseMoveEvent(QMouseEvent * e) //hm. [ok, this works. :-D] graphicView->redraw(); - RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLine::mouseMoveEvent end"); } -void RS_ActionDrawLine::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLine::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -151,13 +151,13 @@ void RS_ActionDrawLine::mouseReleaseEvent(QMouseEvent * e) graphicView->redraw(); } -void RS_ActionDrawLine::coordinateEvent(Vector * e) +void ActionDrawLine::coordinateEvent(Vector * e) { - RS_DEBUG->print("RS_ActionDrawLine::coordinateEvent"); + RS_DEBUG->print("ActionDrawLine::coordinateEvent"); if (!e) { - RS_DEBUG->print("RS_ActionDrawLine::coordinateEvent: event was NULL"); + RS_DEBUG->print("ActionDrawLine::coordinateEvent: event was NULL"); return; } @@ -187,12 +187,12 @@ void RS_ActionDrawLine::coordinateEvent(Vector * e) break; } - RS_DEBUG->print("RS_ActionDrawLine::coordinateEvent: OK"); + RS_DEBUG->print("ActionDrawLine::coordinateEvent: OK"); } -void RS_ActionDrawLine::commandEvent(RS_CommandEvent * e) +void ActionDrawLine::commandEvent(RS_CommandEvent * e) { - RS_DEBUG->print("RS_ActionDrawLine::commandEvent"); + RS_DEBUG->print("ActionDrawLine::commandEvent"); QString c = e->getCommand().toLower(); switch (getStatus()) @@ -228,10 +228,10 @@ void RS_ActionDrawLine::commandEvent(RS_CommandEvent * e) break; } - RS_DEBUG->print("RS_ActionDrawLine::commandEvent: OK"); + RS_DEBUG->print("ActionDrawLine::commandEvent: OK"); } -QStringList RS_ActionDrawLine::getAvailableCommands() +QStringList ActionDrawLine::getAvailableCommands() { QStringList cmd; @@ -257,7 +257,7 @@ QStringList RS_ActionDrawLine::getAvailableCommands() return cmd; } -void RS_ActionDrawLine::updateMouseButtonHints() +void ActionDrawLine::updateMouseButtonHints() { switch (getStatus()) { @@ -291,26 +291,28 @@ void RS_ActionDrawLine::updateMouseButtonHints() } } -void RS_ActionDrawLine::showOptions() +void ActionDrawLine::showOptions() { - RS_DEBUG->print("RS_ActionDrawLine::showOptions"); - RS_ActionInterface::showOptions(); + RS_DEBUG->print("ActionDrawLine::showOptions"); +// ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); - RS_DEBUG->print("RS_ActionDrawLine::showOptions: OK"); + RS_DEBUG->print("ActionDrawLine::showOptions: OK"); } -void RS_ActionDrawLine::hideOptions() +void ActionDrawLine::hideOptions() { - RS_ActionInterface::hideOptions(); +// ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawLine::updateMouseCursor() +void ActionDrawLine::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLine::updateToolBar() +void ActionDrawLine::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -318,7 +320,7 @@ void RS_ActionDrawLine::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } -void RS_ActionDrawLine::close() +void ActionDrawLine::close() { //NOTE: We should grey out the "close" button until the conditions for its use are satisfied. // Though I can see how this would be called via cmd line... So I guess it's OK @@ -333,13 +335,13 @@ void RS_ActionDrawLine::close() RS_DIALOGFACTORY->commandMessage(tr("Cannot close sequence of lines: Not enough entities defined yet.")); } -void RS_ActionDrawLine::undo() +void ActionDrawLine::undo() { //NOTE: We should grey out the "undo" button until the conditions for its use are satisfied. if (history.count() > 1) { history.removeLast(); - graphicView->setCurrentAction(new RS_ActionEditUndo(true, *container, *graphicView)); + graphicView->setCurrentAction(new ActionEditUndo(true, *container, *graphicView)); data.startpoint = *history.last(); graphicView->moveRelativeZero(data.startpoint); graphicView->preview.clear(); @@ -349,7 +351,7 @@ void RS_ActionDrawLine::undo() RS_DIALOGFACTORY->commandMessage(tr("Cannot undo: Not enough entities defined yet.")); } -void RS_ActionDrawLine::ClearHistory(void) +void ActionDrawLine::ClearHistory(void) { while (!history.isEmpty()) delete history.takeFirst(); diff --git a/src/actions/rs_actiondrawline.h b/src/actions/actiondrawline.h similarity index 80% rename from src/actions/rs_actiondrawline.h rename to src/actions/actiondrawline.h index b059d6e..fde8b4f 100644 --- a/src/actions/rs_actiondrawline.h +++ b/src/actions/actiondrawline.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONDRAWLINE_H -#define RS_ACTIONDRAWLINE_H +#ifndef __ACTIONDRAWLINE_H__ +#define __ACTIONDRAWLINE_H__ #include -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "rs_line.h" /** * This action class can handle user events to draw * simple lines with the start- and endpoint given. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLine: public RS_PreviewActionInterface +class ActionDrawLine: public ActionInterface { public: /** @@ -24,8 +25,8 @@ class RS_ActionDrawLine: public RS_PreviewActionInterface }; public: - RS_ActionDrawLine(RS_EntityContainer & container, GraphicView & graphicView); - virtual ~RS_ActionDrawLine(); + ActionDrawLine(RS_EntityContainer & container, GraphicView & graphicView); + virtual ~ActionDrawLine(); virtual RS2::ActionType rtti(); void reset(); @@ -62,4 +63,4 @@ class RS_ActionDrawLine: public RS_PreviewActionInterface QList history; }; -#endif +#endif // __ACTIONDRAWLINE_H__ diff --git a/src/actions/rs_actiondrawlineangle.cpp b/src/actions/actiondrawlineangle.cpp similarity index 68% rename from src/actions/rs_actiondrawlineangle.cpp rename to src/actions/actiondrawlineangle.cpp index a71dbe8..53edc1f 100644 --- a/src/actions/rs_actiondrawlineangle.cpp +++ b/src/actions/actiondrawlineangle.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlineangle.cpp +// actiondrawlineangle.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -13,15 +13,15 @@ // JLH 06/03/2010 Moved implementation from header to this file // -#include "rs_actiondrawlineangle.h" +#include "actiondrawlineangle.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineAngle::RS_ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle): - RS_PreviewActionInterface("Draw lines with given angle", +ActionDrawLineAngle::ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle): + ActionInterface("Draw lines with given angle", container, graphicView) { this->angle = angle; @@ -32,56 +32,56 @@ RS_ActionDrawLineAngle::RS_ActionDrawLineAngle(RS_EntityContainer & container, G reset(); } -RS_ActionDrawLineAngle::~RS_ActionDrawLineAngle() +ActionDrawLineAngle::~ActionDrawLineAngle() { } -/*virtual*/ RS2::ActionType RS_ActionDrawLineAngle::rtti() +/*virtual*/ RS2::ActionType ActionDrawLineAngle::rtti() { return RS2::ActionDrawLineAngle; } -void RS_ActionDrawLineAngle::reset() +void ActionDrawLineAngle::reset() { data = RS_LineData(Vector(false), Vector(false)); } -void RS_ActionDrawLineAngle::init(int status) +void ActionDrawLineAngle::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); } -void RS_ActionDrawLineAngle::trigger() +void ActionDrawLineAngle::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); preparePreview(); - RS_Line * line = new RS_Line(container, - data); + RS_Line * line = new RS_Line(container, data); line->setLayerToActive(); line->setPenToActive(); container->addEntity(line); // upd. undo list: - if (document != NULL) + if (document) { document->startUndoCycle(); document->addUndoable(line); document->endUndoCycle(); } + deleteSnapper(); graphicView->moveRelativeZero(Vector(0.0, 0.0)); graphicView->drawEntity(line); graphicView->moveRelativeZero(data.startpoint); - RS_DEBUG->print("RS_ActionDrawLineAngle::trigger(): line added: %d", + RS_DEBUG->print("ActionDrawLineAngle::trigger(): line added: %d", line->getId()); } -void RS_ActionDrawLineAngle::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineAngle::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineAngle::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLineAngle::mouseMoveEvent begin"); if (getStatus() == SetPos) { @@ -89,15 +89,14 @@ void RS_ActionDrawLineAngle::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); preparePreview(); - preview->addEntity(new RS_Line(preview, - data)); +// preview->addEntity(new RS_Line(preview, data)); drawPreview(); } - RS_DEBUG->print("RS_ActionDrawLineAngle::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineAngle::mouseMoveEvent end"); } -void RS_ActionDrawLineAngle::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineAngle::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -115,7 +114,7 @@ void RS_ActionDrawLineAngle::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLineAngle::preparePreview() +void ActionDrawLineAngle::preparePreview() { Vector p1, p2; @@ -135,7 +134,7 @@ void RS_ActionDrawLineAngle::preparePreview() data = RS_LineData(p1, p2); } -void RS_ActionDrawLineAngle::coordinateEvent(Vector * e) +void ActionDrawLineAngle::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -152,7 +151,7 @@ void RS_ActionDrawLineAngle::coordinateEvent(Vector * e) } } -void RS_ActionDrawLineAngle::commandEvent(RS_CommandEvent * e) +void ActionDrawLineAngle::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -214,7 +213,7 @@ void RS_ActionDrawLineAngle::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawLineAngle::getAvailableCommands() +QStringList ActionDrawLineAngle::getAvailableCommands() { QStringList cmd; @@ -234,7 +233,7 @@ QStringList RS_ActionDrawLineAngle::getAvailableCommands() return cmd; } -void RS_ActionDrawLineAngle::updateMouseButtonHints() +void ActionDrawLineAngle::updateMouseButtonHints() { switch (getStatus()) { @@ -256,26 +255,26 @@ void RS_ActionDrawLineAngle::updateMouseButtonHints() } } -void RS_ActionDrawLineAngle::showOptions() +void ActionDrawLineAngle::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawLineAngle::hideOptions() +void ActionDrawLineAngle::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawLineAngle::updateMouseCursor() +void ActionDrawLineAngle::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineAngle::updateToolBar() +void ActionDrawLineAngle::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -283,38 +282,37 @@ void RS_ActionDrawLineAngle::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } -void RS_ActionDrawLineAngle::setSnapPoint(int sp) +void ActionDrawLineAngle::setSnapPoint(int sp) { snpPoint = sp; } -int RS_ActionDrawLineAngle::getSnapPoint() +int ActionDrawLineAngle::getSnapPoint() { return snpPoint; } -void RS_ActionDrawLineAngle::setAngle(double a) +void ActionDrawLineAngle::setAngle(double a) { angle = a; } -double RS_ActionDrawLineAngle::getAngle() +double ActionDrawLineAngle::getAngle() { return angle; } -void RS_ActionDrawLineAngle::setLength(double l) +void ActionDrawLineAngle::setLength(double l) { length = l; } -double RS_ActionDrawLineAngle::getLength() +double ActionDrawLineAngle::getLength() { return length; } -bool RS_ActionDrawLineAngle::hasFixedAngle() +bool ActionDrawLineAngle::hasFixedAngle() { return fixedAngle; } - diff --git a/src/actions/rs_actiondrawlineangle.h b/src/actions/actiondrawlineangle.h similarity index 75% rename from src/actions/rs_actiondrawlineangle.h rename to src/actions/actiondrawlineangle.h index 49b1c3c..5282c66 100644 --- a/src/actions/rs_actiondrawlineangle.h +++ b/src/actions/actiondrawlineangle.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONDRAWLINEANGLE_H -#define RS_ACTIONDRAWLINEANGLE_H +#ifndef __ACTIONDRAWLINEANGLE_H__ +#define __ACTIONDRAWLINEANGLE_H__ #include "rs_line.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** - * This action class can handle user events to draw - * simple lines at a gien angle. + * This action class can handle user events to draw simple lines at a given + * angle. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLineAngle: public RS_PreviewActionInterface +class ActionDrawLineAngle: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionDrawLineAngle: public RS_PreviewActionInterface SetLength /**< Setting length in the command line. */ }; - RS_ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); - ~RS_ActionDrawLineAngle(); + ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); + ~ActionDrawLineAngle(); virtual RS2::ActionType rtti(); void reset(); @@ -76,5 +77,4 @@ class RS_ActionDrawLineAngle: public RS_PreviewActionInterface int snpPoint; }; -#endif - +#endif // __ACTIONDRAWLINEANGLE_H__ diff --git a/src/actions/rs_actiondrawlinebisector.cpp b/src/actions/actiondrawlinebisector.cpp similarity index 71% rename from src/actions/rs_actiondrawlinebisector.cpp rename to src/actions/actiondrawlinebisector.cpp index 285be69..23b4107 100644 --- a/src/actions/rs_actiondrawlinebisector.cpp +++ b/src/actions/actiondrawlinebisector.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinebisector.cpp +// actiondrawlinebisector.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/03/2010 Added this text. :-) // -#include "rs_actiondrawlinebisector.h" +#include "actiondrawlinebisector.h" #include "rs_commandevent.h" #include "rs_creation.h" @@ -20,8 +20,8 @@ #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineBisector::RS_ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw Bisectors", container, graphicView) +ActionDrawLineBisector::ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw Bisectors", container, graphicView) { bisector = NULL; length = 10.0; @@ -33,18 +33,18 @@ RS_ActionDrawLineBisector::RS_ActionDrawLineBisector(RS_EntityContainer & contai lastStatus = SetLine1; } -RS_ActionDrawLineBisector::~RS_ActionDrawLineBisector() +ActionDrawLineBisector::~ActionDrawLineBisector() { } -/*virtual*/ RS2::ActionType RS_ActionDrawLineBisector::rtti() +/*virtual*/ RS2::ActionType ActionDrawLineBisector::rtti() { return RS2::ActionDrawLineBisector; } -void RS_ActionDrawLineBisector::trigger() +void ActionDrawLineBisector::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); //if (bisector!=NULL) { RS_Creation creation(container, graphicView); @@ -78,14 +78,14 @@ void RS_ActionDrawLineBisector::trigger() bisector = NULL; */ /*} else { - RS_DEBUG->print("RS_ActionDrawLineBisector::trigger:" + RS_DEBUG->print("ActionDrawLineBisector::trigger:" " Entity is NULL\n"); }*/ } -void RS_ActionDrawLineBisector::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineBisector::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineBisector::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLineBisector::mouseMoveEvent begin"); Vector mouse = Vector(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); @@ -95,37 +95,33 @@ void RS_ActionDrawLineBisector::mouseMoveEvent(QMouseEvent * e) case SetLine1: break; - case SetLine2: { + case SetLine2: + { coord2 = mouse; RS_Entity * en = catchEntity(e, RS2::ResolveAll); - if (en != NULL && en->rtti() == RS2::EntityLine) + if (en && en->rtti() == RS2::EntityLine) { - line2 = (RS_Line *)en; - - deletePreview(); - clearPreview(); - - RS_Creation creation(preview, NULL, false); - creation.createBisector(coord1, - coord2, - length, - number, - line1, - line2); - drawPreview(); +// line2 = (RS_Line *)en; +// +// deletePreview(); +// clearPreview(); +// +// RS_Creation creation(preview, NULL, false); +// creation.createBisector(coord1, coord2, length, number, line1, line2); +// drawPreview(); } } - break; + break; default: break; } - RS_DEBUG->print("RS_ActionDrawLineBisector::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineBisector::mouseMoveEvent end"); } -void RS_ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) { @@ -136,11 +132,12 @@ void RS_ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) else { Vector mouse = Vector(graphicView->toGraphX(e->x()), - graphicView->toGraphY(e->y())); + graphicView->toGraphY(e->y())); switch (getStatus()) { - case SetLine1: { + case SetLine1: + { coord1 = mouse; RS_Entity * en = catchEntity(e, RS2::ResolveAll); @@ -159,7 +156,7 @@ void RS_ActionDrawLineBisector::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLineBisector::commandEvent(RS_CommandEvent * e) +void ActionDrawLineBisector::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -223,7 +220,7 @@ void RS_ActionDrawLineBisector::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawLineBisector::getAvailableCommands() +QStringList ActionDrawLineBisector::getAvailableCommands() { QStringList cmd; @@ -242,7 +239,7 @@ QStringList RS_ActionDrawLineBisector::getAvailableCommands() return cmd; } -void RS_ActionDrawLineBisector::updateMouseButtonHints() +void ActionDrawLineBisector::updateMouseButtonHints() { switch (getStatus()) { @@ -272,47 +269,46 @@ void RS_ActionDrawLineBisector::updateMouseButtonHints() } } -void RS_ActionDrawLineBisector::showOptions() +void ActionDrawLineBisector::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawLineBisector::hideOptions() +void ActionDrawLineBisector::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawLineBisector::updateMouseCursor() +void ActionDrawLineBisector::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineBisector::updateToolBar() +void ActionDrawLineBisector::updateToolBar() { RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } -void RS_ActionDrawLineBisector::setLength(double l) +void ActionDrawLineBisector::setLength(double l) { length = l; } -double RS_ActionDrawLineBisector::getLength() +double ActionDrawLineBisector::getLength() { return length; } -void RS_ActionDrawLineBisector::setNumber(int n) +void ActionDrawLineBisector::setNumber(int n) { number = n; } -int RS_ActionDrawLineBisector::getNumber() +int ActionDrawLineBisector::getNumber() { return number; } - diff --git a/src/actions/rs_actiondrawlinebisector.h b/src/actions/actiondrawlinebisector.h similarity index 81% rename from src/actions/rs_actiondrawlinebisector.h rename to src/actions/actiondrawlinebisector.h index d524b2d..b0b9b04 100644 --- a/src/actions/rs_actiondrawlinebisector.h +++ b/src/actions/actiondrawlinebisector.h @@ -1,8 +1,8 @@ -#ifndef RS_ACTIONDRAWLINEBISECTOR_H -#define RS_ACTIONDRAWLINEBISECTOR_H +#ifndef __ACTIONDRAWLINEBISECTOR_H__ +#define __ACTIONDRAWLINEBISECTOR_H__ #include "rs_line.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Line; @@ -10,9 +10,10 @@ class RS_Line; /** * This action class can handle user events to draw bisectors. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLineBisector: public RS_PreviewActionInterface +class ActionDrawLineBisector: public ActionInterface { private: enum Status { @@ -23,8 +24,8 @@ class RS_ActionDrawLineBisector: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLineBisector(); + ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLineBisector(); virtual RS2::ActionType rtti(); virtual void trigger(); @@ -63,4 +64,4 @@ class RS_ActionDrawLineBisector: public RS_PreviewActionInterface Status lastStatus; }; -#endif +#endif // __ACTIONDRAWLINEBISECTOR_H__ diff --git a/src/actions/rs_actiondrawlinefree.cpp b/src/actions/actiondrawlinefree.cpp similarity index 62% rename from src/actions/rs_actiondrawlinefree.cpp rename to src/actions/actiondrawlinefree.cpp index 8c36b10..464813a 100644 --- a/src/actions/rs_actiondrawlinefree.cpp +++ b/src/actions/actiondrawlinefree.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinefree.cpp +// actiondrawlinefree.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,28 +12,29 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actiondrawlinefree.h" +#include "actiondrawlinefree.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_polyline.h" -RS_ActionDrawLineFree::RS_ActionDrawLineFree(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Draw freehand lines", - container, graphicView) +ActionDrawLineFree::ActionDrawLineFree(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Draw freehand lines", + container, graphicView) { vertex = Vector(false); polyline = NULL; } -RS_ActionDrawLineFree::~RS_ActionDrawLineFree() +ActionDrawLineFree::~ActionDrawLineFree() { - if (polyline != NULL) + if (polyline) delete polyline; } -void RS_ActionDrawLineFree::trigger() +void ActionDrawLineFree::trigger() { - if (polyline != NULL) + if (polyline) { container->addEntity(polyline); deleteSnapper(); @@ -45,15 +46,15 @@ void RS_ActionDrawLineFree::trigger() document->endUndoCycle(); } - RS_DEBUG->print("RS_ActionDrawLineFree::trigger():" + RS_DEBUG->print("ActionDrawLineFree::trigger():" " polyline added: %d", polyline->getId()); polyline = NULL; } } -void RS_ActionDrawLineFree::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineFree::mouseMoveEvent(QMouseEvent * e) { - if (vertex.valid && polyline != NULL) + if (vertex.valid && polyline) { Vector v = snapPoint(e); RS_Entity * ent = polyline->addVertex(v); @@ -66,14 +67,13 @@ void RS_ActionDrawLineFree::mouseMoveEvent(QMouseEvent * e) vertex = v; - RS_DEBUG->print("RS_ActionDrawLineFree::mouseMoveEvent():" + RS_DEBUG->print("ActionDrawLineFree::mouseMoveEvent():" " line added: %d", ent->getId()); } } -void RS_ActionDrawLineFree::mousePressEvent(QMouseEvent * e) +void ActionDrawLineFree::mousePressEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { vertex = snapPoint(e); @@ -81,22 +81,18 @@ void RS_ActionDrawLineFree::mousePressEvent(QMouseEvent * e) polyline->setLayerToActive(); polyline->setPenToActive(); } - //else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton && !vertex.valid) { - //} } -void RS_ActionDrawLineFree::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineFree::mouseReleaseEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { vertex = Vector(false); trigger(); } -// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) else if (e->button() == Qt::RightButton) { - if (polyline != NULL) + if (polyline) { delete polyline; polyline = NULL; @@ -107,7 +103,7 @@ void RS_ActionDrawLineFree::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLineFree::updateMouseButtonHints() +void ActionDrawLineFree::updateMouseButtonHints() { switch (getStatus()) { @@ -121,16 +117,15 @@ void RS_ActionDrawLineFree::updateMouseButtonHints() } } -void RS_ActionDrawLineFree::updateMouseCursor() +void ActionDrawLineFree::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineFree::updateToolBar() +void ActionDrawLineFree::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } - diff --git a/src/actions/rs_actiondrawlinefree.h b/src/actions/actiondrawlinefree.h similarity index 61% rename from src/actions/rs_actiondrawlinefree.h rename to src/actions/actiondrawlinefree.h index 97c781c..2aabde6 100644 --- a/src/actions/rs_actiondrawlinefree.h +++ b/src/actions/actiondrawlinefree.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONDRAWLINEFREE_H -#define RS_ACTIONDRAWLINEFREE_H +#ifndef __ACTIONDRAWLINEFREE_H__ +#define __ACTIONDRAWLINEFREE_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Polyline; @@ -9,13 +9,14 @@ class RS_Polyline; /** * This action class can handle user events to draw freehand lines. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLineFree: public RS_ActionInterface +class ActionDrawLineFree: public ActionInterface { public: - RS_ActionDrawLineFree(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLineFree(); + ActionDrawLineFree(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLineFree(); virtual void trigger(); virtual void mouseMoveEvent(QMouseEvent * e); @@ -30,4 +31,4 @@ class RS_ActionDrawLineFree: public RS_ActionInterface RS_Polyline * polyline; }; -#endif +#endif // __ACTIONDRAWLINEFREE_H__ diff --git a/src/actions/rs_actiondrawlinehorvert.cpp b/src/actions/actiondrawlinehorvert.cpp similarity index 64% rename from src/actions/rs_actiondrawlinehorvert.cpp rename to src/actions/actiondrawlinehorvert.cpp index 71f650f..b8bf5b7 100644 --- a/src/actions/rs_actiondrawlinehorvert.cpp +++ b/src/actions/actiondrawlinehorvert.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinehorvert.cpp +// actiondrawlinehorvert.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,38 +12,38 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actiondrawlinehorvert.h" +#include "actiondrawlinehorvert.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineHorVert::RS_ActionDrawLineHorVert(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw horizontal/vertical lines", +ActionDrawLineHorVert::ActionDrawLineHorVert(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw horizontal/vertical lines", container, graphicView) { reset(); - RS_DEBUG->print("RS_ActionDrawLineHorVert::constructor"); + RS_DEBUG->print("ActionDrawLineHorVert::constructor"); } -RS_ActionDrawLineHorVert::~RS_ActionDrawLineHorVert() +ActionDrawLineHorVert::~ActionDrawLineHorVert() { } -void RS_ActionDrawLineHorVert::reset() +void ActionDrawLineHorVert::reset() { data = RS_LineData(Vector(false), Vector(false)); } -void RS_ActionDrawLineHorVert::init(int status) +void ActionDrawLineHorVert::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); - RS_DEBUG->print("RS_ActionDrawLineHorVert::init"); + RS_DEBUG->print("ActionDrawLineHorVert::init"); } -void RS_ActionDrawLineHorVert::trigger() +void ActionDrawLineHorVert::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); RS_Line * line = new RS_Line(container, data); line->setLayerToActive(); @@ -62,13 +62,13 @@ void RS_ActionDrawLineHorVert::trigger() graphicView->moveRelativeZero(Vector(0.0, 0.0)); graphicView->drawEntity(line); graphicView->moveRelativeZero(line->getMiddlepoint()); - RS_DEBUG->print("RS_ActionDrawLineHorVert::trigger():" + RS_DEBUG->print("ActionDrawLineHorVert::trigger():" " line added: %d", line->getId()); } -void RS_ActionDrawLineHorVert::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineHorVert::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineHorVert::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLineHorVert::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -85,16 +85,15 @@ void RS_ActionDrawLineHorVert::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); data = RS_LineData(p1, p2); - preview->addEntity(new RS_Line(preview, data)); +// preview->addEntity(new RS_Line(preview, data)); drawPreview(); } - RS_DEBUG->print("RS_ActionDrawLineHorVert::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineHorVert::mouseMoveEvent end"); } -void RS_ActionDrawLineHorVert::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineHorVert::mouseReleaseEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { Vector mouse = snapPoint(e); @@ -116,7 +115,6 @@ void RS_ActionDrawLineHorVert::mouseReleaseEvent(QMouseEvent * e) break; } } -// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) else if (e->button() == Qt::RightButton) { deletePreview(); @@ -125,7 +123,7 @@ void RS_ActionDrawLineHorVert::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLineHorVert::updateMouseButtonHints() +void ActionDrawLineHorVert::updateMouseButtonHints() { switch (getStatus()) { @@ -143,16 +141,15 @@ void RS_ActionDrawLineHorVert::updateMouseButtonHints() } } -void RS_ActionDrawLineHorVert::updateMouseCursor() +void ActionDrawLineHorVert::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineHorVert::updateToolBar() +void ActionDrawLineHorVert::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } - diff --git a/src/actions/rs_actiondrawlinehorvert.h b/src/actions/actiondrawlinehorvert.h similarity index 73% rename from src/actions/rs_actiondrawlinehorvert.h rename to src/actions/actiondrawlinehorvert.h index 5a88b90..8c0fb45 100644 --- a/src/actions/rs_actiondrawlinehorvert.h +++ b/src/actions/actiondrawlinehorvert.h @@ -1,8 +1,8 @@ -#ifndef RS_ACTIONDRAWLINEHORVERT_H -#define RS_ACTIONDRAWLINEHORVERT_H +#ifndef __ACTIONDRAWLINEHORVERT_H__ +#define __ACTIONDRAWLINEHORVERT_H__ #include "rs_line.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** @@ -13,7 +13,7 @@ * * @author Ulf Lehnert */ -class RS_ActionDrawLineHorVert: public RS_PreviewActionInterface +class ActionDrawLineHorVert: public ActionInterface { public: /** @@ -25,8 +25,8 @@ class RS_ActionDrawLineHorVert: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineHorVert(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLineHorVert(); + ActionDrawLineHorVert(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLineHorVert(); void reset(); virtual void init(int status = 0); @@ -49,4 +49,4 @@ class RS_ActionDrawLineHorVert: public RS_PreviewActionInterface Vector p2; }; -#endif +#endif // __ACTIONDRAWLINEHORVERT_H__ diff --git a/src/actions/rs_actiondrawlineparallel.cpp b/src/actions/actiondrawlineparallel.cpp similarity index 66% rename from src/actions/rs_actiondrawlineparallel.cpp rename to src/actions/actiondrawlineparallel.cpp index a9e687c..979df05 100644 --- a/src/actions/rs_actiondrawlineparallel.cpp +++ b/src/actions/actiondrawlineparallel.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlineparallel.cpp +// actiondrawlineparallel.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,9 +12,9 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actiondrawlineparallel.h" +#include "actiondrawlineparallel.h" -#include "rs_actiondrawlineparallelthrough.h" +#include "actiondrawlineparallelthrough.h" #include "rs_commandevent.h" #include "commands.h" #include "rs_creation.h" @@ -22,8 +22,9 @@ #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineParallel::RS_ActionDrawLineParallel(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Parallels", - container, graphicView) +ActionDrawLineParallel::ActionDrawLineParallel(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Draw Parallels", + container, graphicView) { parallel = NULL; entity = NULL; @@ -32,29 +33,29 @@ RS_ActionDrawLineParallel::RS_ActionDrawLineParallel(RS_EntityContainer & contai coord = Vector(false); } -RS_ActionDrawLineParallel::~RS_ActionDrawLineParallel() +ActionDrawLineParallel::~ActionDrawLineParallel() { } -/*virtual*/ RS2::ActionType RS_ActionDrawLineParallel::rtti() +/*virtual*/ RS2::ActionType ActionDrawLineParallel::rtti() { return RS2::ActionDrawLineParallel; } -void RS_ActionDrawLineParallel::trigger() +void ActionDrawLineParallel::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); RS_Creation creation(container, graphicView); RS_Entity * e = creation.createParallel(coord, distance, number, entity); - if (e == NULL) - RS_DEBUG->print("RS_ActionDrawLineParallel::trigger: No parallels added\n"); + if (!e) + RS_DEBUG->print("ActionDrawLineParallel::trigger: No parallels added\n"); } -void RS_ActionDrawLineParallel::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineParallel::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineParallel::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLineParallel::mouseMoveEvent begin"); coord = Vector(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); entity = catchEntity(e, RS2::ResolveAll); @@ -64,8 +65,8 @@ void RS_ActionDrawLineParallel::mouseMoveEvent(QMouseEvent * e) { deletePreview(); clearPreview(); - RS_Creation creation(preview, NULL, false); - creation.createParallel(coord, distance, number, entity); +// RS_Creation creation(preview, NULL, false); +// creation.createParallel(coord, distance, number, entity); drawPreview(); } break; @@ -74,19 +75,18 @@ void RS_ActionDrawLineParallel::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionDrawLineParallel::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineParallel::mouseMoveEvent end"); } -void RS_ActionDrawLineParallel::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineParallel::mouseReleaseEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) if (e->button() == Qt::RightButton) init(getStatus() - 1); else trigger(); } -void RS_ActionDrawLineParallel::updateMouseButtonHints() +void ActionDrawLineParallel::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -110,9 +110,9 @@ void RS_ActionDrawLineParallel::updateMouseButtonHints() } } -void RS_ActionDrawLineParallel::showOptions() +void ActionDrawLineParallel::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, true); @@ -120,15 +120,15 @@ void RS_ActionDrawLineParallel::showOptions() updateMouseButtonHints(); } -void RS_ActionDrawLineParallel::hideOptions() +void ActionDrawLineParallel::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawLineParallel::commandEvent(RS_CommandEvent * e) +void ActionDrawLineParallel::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -147,7 +147,7 @@ void RS_ActionDrawLineParallel::commandEvent(RS_CommandEvent * e) if (checkCommand("through", c)) { finish(); - graphicView->setCurrentAction(new RS_ActionDrawLineParallelThrough(*container, + graphicView->setCurrentAction(new ActionDrawLineParallelThrough(*container, *graphicView)); } else if (checkCommand("number", c)) @@ -205,7 +205,7 @@ void RS_ActionDrawLineParallel::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawLineParallel::getAvailableCommands() +QStringList ActionDrawLineParallel::getAvailableCommands() { QStringList cmd; @@ -223,34 +223,33 @@ QStringList RS_ActionDrawLineParallel::getAvailableCommands() return cmd; } -void RS_ActionDrawLineParallel::updateMouseCursor() +void ActionDrawLineParallel::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineParallel::updateToolBar() +void ActionDrawLineParallel::updateToolBar() { if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } -double RS_ActionDrawLineParallel::getDistance() +double ActionDrawLineParallel::getDistance() { return distance; } -void RS_ActionDrawLineParallel::setDistance(double d) +void ActionDrawLineParallel::setDistance(double d) { distance = d; } -int RS_ActionDrawLineParallel::getNumber() +int ActionDrawLineParallel::getNumber() { return number; } -void RS_ActionDrawLineParallel::setNumber(int n) +void ActionDrawLineParallel::setNumber(int n) { number = n; } - diff --git a/src/actions/rs_actiondrawlineparallel.h b/src/actions/actiondrawlineparallel.h similarity index 74% rename from src/actions/rs_actiondrawlineparallel.h rename to src/actions/actiondrawlineparallel.h index f3666cd..cabe41f 100644 --- a/src/actions/rs_actiondrawlineparallel.h +++ b/src/actions/actiondrawlineparallel.h @@ -1,19 +1,20 @@ -#ifndef RS_ACTIONDRAWLINEPARALLEL_H -#define RS_ACTIONDRAWLINEPARALLEL_H +#ifndef __ACTIONDRAWLINEPARALLEL_H__ +#define __ACTIONDRAWLINEPARALLEL_H__ #include "rs_line.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; /** - * This action class can handle user events to draw parallel - * lines, arcs and circles. + * This action class can handle user events to draw parallel lines, arcs and + * circles. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLineParallel: public RS_PreviewActionInterface +class ActionDrawLineParallel: public ActionInterface { private: enum Status { @@ -24,8 +25,8 @@ class RS_ActionDrawLineParallel: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineParallel(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLineParallel(); + ActionDrawLineParallel(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLineParallel(); virtual RS2::ActionType rtti(); virtual void trigger(); @@ -58,4 +59,4 @@ class RS_ActionDrawLineParallel: public RS_PreviewActionInterface RS_Entity * entity; }; -#endif +#endif // __ACTIONDRAWLINEPARALLEL_H__ diff --git a/src/actions/rs_actiondrawlineparallelthrough.cpp b/src/actions/actiondrawlineparallelthrough.cpp similarity index 61% rename from src/actions/rs_actiondrawlineparallelthrough.cpp rename to src/actions/actiondrawlineparallelthrough.cpp index 81a9bce..902e8b1 100644 --- a/src/actions/rs_actiondrawlineparallelthrough.cpp +++ b/src/actions/actiondrawlineparallelthrough.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlineparallelthrough.cpp +// actiondrawlineparallelthrough.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actiondrawlineparallelthrough.h" +#include "actiondrawlineparallelthrough.h" #include "rs_commandevent.h" #include "rs_creation.h" @@ -20,73 +20,60 @@ #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineParallelThrough::RS_ActionDrawLineParallelThrough( +ActionDrawLineParallelThrough::ActionDrawLineParallelThrough( RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw Parallels", container, graphicView) + ActionInterface("Draw Parallels", container, graphicView) { parallel = NULL; entity = NULL; - distance = 1.0; +//??? distance = 1.0; number = 1; coord = Vector(false); } -RS_ActionDrawLineParallelThrough::~RS_ActionDrawLineParallelThrough() +ActionDrawLineParallelThrough::~ActionDrawLineParallelThrough() { } -/*virtual*/ RS2::ActionType RS_ActionDrawLineParallelThrough::rtti() +/*virtual*/ RS2::ActionType ActionDrawLineParallelThrough::rtti() { return RS2::ActionDrawLineParallelThrough; } -void RS_ActionDrawLineParallelThrough::trigger() +void ActionDrawLineParallelThrough::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); deleteSnapper(); - if (entity != NULL) + if (entity) { RS_Creation creation(container, graphicView); RS_Entity * e = creation.createParallelThrough(coord, number, entity); - if (e == NULL) - RS_DEBUG->print("RS_ActionDrawLineParallelThrough::trigger:" + if (!e) + RS_DEBUG->print("ActionDrawLineParallelThrough::trigger:" " No parallels added\n"); } } -void RS_ActionDrawLineParallelThrough::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineParallelThrough::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineParallelThrough::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent begin"); switch (getStatus()) { case SetEntity: entity = catchEntity(e, RS2::ResolveAll); - /*deletePreview(); - clearPreview(); - - RS_Creation creation(preview, NULL, false); - creation.createParallelThrough(coord, - number, - entity); - - drawPreview();*/ break; case SetPos: { coord = snapPoint(e); - //Vector(graphicView->toGraphX(e->x()), - // graphicView->toGraphY(e->y())); deletePreview(); clearPreview(); - RS_Creation creation(preview, NULL, false); - creation.createParallelThrough(coord, - number, - entity); +// RS_Creation creation(preview, NULL, false); +// creation.createParallelThrough(coord, number, entity); drawPreview(); } @@ -96,12 +83,11 @@ void RS_ActionDrawLineParallelThrough::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionDrawLineParallelThrough::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineParallelThrough::mouseMoveEvent end"); } -void RS_ActionDrawLineParallelThrough::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineParallelThrough::mouseReleaseEvent(QMouseEvent * e) { -// if (RS2::qtToRsButtonState(e->button())==RS2::LeftButton) if (e->button() == Qt::LeftButton) { switch (getStatus()) @@ -109,7 +95,7 @@ void RS_ActionDrawLineParallelThrough::mouseReleaseEvent(QMouseEvent * e) case SetEntity: entity = catchEntity(e, RS2::ResolveAll); - if (entity != NULL) + if (entity) { entity->setHighlighted(true); graphicView->drawEntity(entity); @@ -129,13 +115,12 @@ void RS_ActionDrawLineParallelThrough::mouseReleaseEvent(QMouseEvent * e) break; } } -// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton) else if (e->button() == Qt::RightButton) { deletePreview(); deleteSnapper(); - if (entity != NULL) + if (entity) { entity->setHighlighted(false); graphicView->drawEntity(entity); @@ -146,7 +131,7 @@ void RS_ActionDrawLineParallelThrough::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLineParallelThrough::coordinateEvent(Vector * e) +void ActionDrawLineParallelThrough::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -165,7 +150,7 @@ void RS_ActionDrawLineParallelThrough::coordinateEvent(Vector * e) } } -void RS_ActionDrawLineParallelThrough::updateMouseButtonHints() +void ActionDrawLineParallelThrough::updateMouseButtonHints() { switch (getStatus()) { @@ -187,22 +172,20 @@ void RS_ActionDrawLineParallelThrough::updateMouseButtonHints() } } -void RS_ActionDrawLineParallelThrough::showOptions() +void ActionDrawLineParallelThrough::showOptions() { - RS_ActionInterface::showOptions(); - + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); updateMouseButtonHints(); } -void RS_ActionDrawLineParallelThrough::hideOptions() +void ActionDrawLineParallelThrough::hideOptions() { - RS_ActionInterface::hideOptions(); - + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawLineParallelThrough::commandEvent(RS_CommandEvent * e) +void ActionDrawLineParallelThrough::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -228,7 +211,8 @@ void RS_ActionDrawLineParallelThrough::commandEvent(RS_CommandEvent * e) } break; - case SetNumber: { + case SetNumber: + { bool ok; int n = c.toInt(&ok); @@ -245,14 +229,14 @@ void RS_ActionDrawLineParallelThrough::commandEvent(RS_CommandEvent * e) RS_DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } - break; + break; default: break; } } -QStringList RS_ActionDrawLineParallelThrough::getAvailableCommands() +QStringList ActionDrawLineParallelThrough::getAvailableCommands() { QStringList cmd; @@ -269,12 +253,12 @@ QStringList RS_ActionDrawLineParallelThrough::getAvailableCommands() return cmd; } -void RS_ActionDrawLineParallelThrough::updateMouseCursor() +void ActionDrawLineParallelThrough::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineParallelThrough::updateToolBar() +void ActionDrawLineParallelThrough::updateToolBar() { if (getStatus() == SetPos && !isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -282,13 +266,12 @@ void RS_ActionDrawLineParallelThrough::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } -int RS_ActionDrawLineParallelThrough::getNumber() +int ActionDrawLineParallelThrough::getNumber() { return number; } -void RS_ActionDrawLineParallelThrough::setNumber(int n) +void ActionDrawLineParallelThrough::setNumber(int n) { number = n; } - diff --git a/src/actions/rs_actiondrawlineparallelthrough.h b/src/actions/actiondrawlineparallelthrough.h similarity index 71% rename from src/actions/rs_actiondrawlineparallelthrough.h rename to src/actions/actiondrawlineparallelthrough.h index 8a6acd3..ddf5492 100644 --- a/src/actions/rs_actiondrawlineparallelthrough.h +++ b/src/actions/actiondrawlineparallelthrough.h @@ -1,19 +1,20 @@ -#ifndef RS_ACTIONDRAWLINEPARALLELTHROUGH_H -#define RS_ACTIONDRAWLINEPARALLELTHROUGH_H +#ifndef __ACTIONDRAWLINEPARALLELTHROUGH_H__ +#define __ACTIONDRAWLINEPARALLELTHROUGH_H__ #include "rs_line.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; /** - * This action class can handle user events to draw parallel - * lines, arcs and circles. + * This action class can handle user events to draw parallel lines, arcs and + * circles. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLineParallelThrough: public RS_PreviewActionInterface +class ActionDrawLineParallelThrough: public ActionInterface { private: enum Status { @@ -23,8 +24,8 @@ class RS_ActionDrawLineParallelThrough: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineParallelThrough(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLineParallelThrough(); + ActionDrawLineParallelThrough(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLineParallelThrough(); virtual RS2::ActionType rtti(); virtual void trigger(); @@ -56,4 +57,4 @@ class RS_ActionDrawLineParallelThrough: public RS_PreviewActionInterface Status lastStatus; }; -#endif +#endif // __ACTIONDRAWLINEPARALLELTHROUGH_H__ diff --git a/src/actions/rs_actiondrawlinepolygon.cpp b/src/actions/actiondrawlinepolygon.cpp similarity index 70% rename from src/actions/rs_actiondrawlinepolygon.cpp rename to src/actions/actiondrawlinepolygon.cpp index 7bfe2bc..dc0a2e0 100644 --- a/src/actions/rs_actiondrawlinepolygon.cpp +++ b/src/actions/actiondrawlinepolygon.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinepolygon.cpp +// actiondrawlinepolygon.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actiondrawlinepolygon.h" +#include "actiondrawlinepolygon.h" #include "rs_commandevent.h" #include "rs_creation.h" @@ -20,8 +20,9 @@ #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLinePolygon::RS_ActionDrawLinePolygon(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Polygons", - container, graphicView) +ActionDrawLinePolygon::ActionDrawLinePolygon(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Draw Polygons", + container, graphicView) { center = Vector(false); corner = Vector(false); @@ -29,33 +30,33 @@ RS_ActionDrawLinePolygon::RS_ActionDrawLinePolygon(RS_EntityContainer & containe number = 3; } -RS_ActionDrawLinePolygon::~RS_ActionDrawLinePolygon() +ActionDrawLinePolygon::~ActionDrawLinePolygon() { } -/*virtual*/ RS2::ActionType RS_ActionDrawLinePolygon::rtti() +/*virtual*/ RS2::ActionType ActionDrawLinePolygon::rtti() { return RS2::ActionDrawLinePolygon; } -void RS_ActionDrawLinePolygon::trigger() +void ActionDrawLinePolygon::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); - deleteSnapper(); - deletePreview(); - clearPreview(); +// deleteSnapper(); +// deletePreview(); +// clearPreview(); RS_Creation creation(container, graphicView); bool ok = creation.createPolygon(center, corner, number); if (!ok) - RS_DEBUG->print("RS_ActionDrawLinePolygon::trigger: No polygon added\n"); + RS_DEBUG->print("ActionDrawLinePolygon::trigger: No polygon added\n"); } -void RS_ActionDrawLinePolygon::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLinePolygon::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLinePolygon::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLinePolygon::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -72,8 +73,8 @@ void RS_ActionDrawLinePolygon::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); - RS_Creation creation(preview, NULL, false); - creation.createPolygon(center, corner, number); +// RS_Creation creation(preview, NULL, false); +// creation.createPolygon(center, corner, number); drawPreview(); } @@ -84,7 +85,7 @@ void RS_ActionDrawLinePolygon::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionDrawLinePolygon::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLinePolygon::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -100,7 +101,7 @@ void RS_ActionDrawLinePolygon::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLinePolygon::coordinateEvent(Vector * e) +void ActionDrawLinePolygon::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -125,7 +126,7 @@ void RS_ActionDrawLinePolygon::coordinateEvent(Vector * e) } } -void RS_ActionDrawLinePolygon::updateMouseButtonHints() +void ActionDrawLinePolygon::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -151,23 +152,23 @@ void RS_ActionDrawLinePolygon::updateMouseButtonHints() } } -void RS_ActionDrawLinePolygon::showOptions() +void ActionDrawLinePolygon::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawLinePolygon::hideOptions() +void ActionDrawLinePolygon::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawLinePolygon::commandEvent(RS_CommandEvent * e) +void ActionDrawLinePolygon::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -221,7 +222,7 @@ void RS_ActionDrawLinePolygon::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawLinePolygon::getAvailableCommands() +QStringList ActionDrawLinePolygon::getAvailableCommands() { QStringList cmd; @@ -239,12 +240,12 @@ QStringList RS_ActionDrawLinePolygon::getAvailableCommands() return cmd; } -void RS_ActionDrawLinePolygon::updateMouseCursor() +void ActionDrawLinePolygon::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLinePolygon::updateToolBar() +void ActionDrawLinePolygon::updateToolBar() { if (RS_DIALOGFACTORY != NULL) { @@ -255,13 +256,12 @@ void RS_ActionDrawLinePolygon::updateToolBar() } } -int RS_ActionDrawLinePolygon::getNumber() +int ActionDrawLinePolygon::getNumber() { return number; } -void RS_ActionDrawLinePolygon::setNumber(int n) +void ActionDrawLinePolygon::setNumber(int n) { number = n; } - diff --git a/src/actions/rs_actiondrawlinepolygon.h b/src/actions/actiondrawlinepolygon.h similarity index 75% rename from src/actions/rs_actiondrawlinepolygon.h rename to src/actions/actiondrawlinepolygon.h index 8f787a6..60150f4 100644 --- a/src/actions/rs_actiondrawlinepolygon.h +++ b/src/actions/actiondrawlinepolygon.h @@ -1,15 +1,16 @@ -#ifndef RS_ACTIONDRAWLINEPOLYGON_H -#define RS_ACTIONDRAWLINEPOLYGON_H +#ifndef __ACTIONDRAWLINEPOLYGON_H__ +#define __ACTIONDRAWLINEPOLYGON_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to draw polygons. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLinePolygon: public RS_PreviewActionInterface +class ActionDrawLinePolygon: public ActionInterface { private: enum Status { @@ -19,8 +20,8 @@ class RS_ActionDrawLinePolygon: public RS_PreviewActionInterface }; public: - RS_ActionDrawLinePolygon(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLinePolygon(); + ActionDrawLinePolygon(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLinePolygon(); virtual RS2::ActionType rtti(); virtual void trigger(); @@ -48,4 +49,4 @@ class RS_ActionDrawLinePolygon: public RS_PreviewActionInterface Status lastStatus; }; -#endif +#endif // __ACTIONDRAWLINEPOLYGON_H__ diff --git a/src/actions/rs_actiondrawlinepolygon2.cpp b/src/actions/actiondrawlinepolygon2.cpp similarity index 71% rename from src/actions/rs_actiondrawlinepolygon2.cpp rename to src/actions/actiondrawlinepolygon2.cpp index fb783d6..d1d1f8f 100644 --- a/src/actions/rs_actiondrawlinepolygon2.cpp +++ b/src/actions/actiondrawlinepolygon2.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinepolygon2.cpp +// actiondrawlinepolygon2.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actiondrawlinepolygon2.h" +#include "actiondrawlinepolygon2.h" #include "rs_commandevent.h" #include "rs_creation.h" @@ -20,7 +20,7 @@ #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLinePolygon2::RS_ActionDrawLinePolygon2(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Polygons", +ActionDrawLinePolygon2::ActionDrawLinePolygon2(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw Polygons", container, graphicView) { corner1 = Vector(false); @@ -29,18 +29,18 @@ RS_ActionDrawLinePolygon2::RS_ActionDrawLinePolygon2(RS_EntityContainer & contai number = 3; } -RS_ActionDrawLinePolygon2::~RS_ActionDrawLinePolygon2() +ActionDrawLinePolygon2::~ActionDrawLinePolygon2() { } -/*virtual*/ RS2::ActionType RS_ActionDrawLinePolygon2::rtti() +/*virtual*/ RS2::ActionType ActionDrawLinePolygon2::rtti() { return RS2::ActionDrawLinePolygon2; } -void RS_ActionDrawLinePolygon2::trigger() +void ActionDrawLinePolygon2::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); deleteSnapper(); deletePreview(); @@ -50,12 +50,12 @@ void RS_ActionDrawLinePolygon2::trigger() bool ok = creation.createPolygon2(corner1, corner2, number); if (!ok) - RS_DEBUG->print("RS_ActionDrawLinePolygon2::trigger: No polygon added\n"); + RS_DEBUG->print("ActionDrawLinePolygon2::trigger: No polygon added\n"); } -void RS_ActionDrawLinePolygon2::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLinePolygon2::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLinePolygon2::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLinePolygon2::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -72,8 +72,8 @@ void RS_ActionDrawLinePolygon2::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); - RS_Creation creation(preview, NULL, false); - creation.createPolygon2(corner1, corner2, number); +// RS_Creation creation(preview, NULL, false); +// creation.createPolygon2(corner1, corner2, number); drawPreview(); } @@ -84,7 +84,7 @@ void RS_ActionDrawLinePolygon2::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionDrawLinePolygon2::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLinePolygon2::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -100,9 +100,9 @@ void RS_ActionDrawLinePolygon2::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLinePolygon2::coordinateEvent(Vector * e) +void ActionDrawLinePolygon2::coordinateEvent(Vector * e) { - if (e == NULL) + if (!e) return; Vector mouse = *e; @@ -125,7 +125,7 @@ void RS_ActionDrawLinePolygon2::coordinateEvent(Vector * e) } } -void RS_ActionDrawLinePolygon2::updateMouseButtonHints() +void ActionDrawLinePolygon2::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -152,23 +152,23 @@ void RS_ActionDrawLinePolygon2::updateMouseButtonHints() } } -void RS_ActionDrawLinePolygon2::showOptions() +void ActionDrawLinePolygon2::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawLinePolygon2::hideOptions() +void ActionDrawLinePolygon2::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawLinePolygon2::commandEvent(RS_CommandEvent * e) +void ActionDrawLinePolygon2::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -222,7 +222,7 @@ void RS_ActionDrawLinePolygon2::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawLinePolygon2::getAvailableCommands() +QStringList ActionDrawLinePolygon2::getAvailableCommands() { QStringList cmd; @@ -240,12 +240,12 @@ QStringList RS_ActionDrawLinePolygon2::getAvailableCommands() return cmd; } -void RS_ActionDrawLinePolygon2::updateMouseCursor() +void ActionDrawLinePolygon2::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLinePolygon2::updateToolBar() +void ActionDrawLinePolygon2::updateToolBar() { if (RS_DIALOGFACTORY != NULL) { @@ -256,13 +256,12 @@ void RS_ActionDrawLinePolygon2::updateToolBar() } } -int RS_ActionDrawLinePolygon2::getNumber() +int ActionDrawLinePolygon2::getNumber() { return number; } -void RS_ActionDrawLinePolygon2::setNumber(int n) +void ActionDrawLinePolygon2::setNumber(int n) { number = n; } - diff --git a/src/actions/rs_actiondrawlinepolygon2.h b/src/actions/actiondrawlinepolygon2.h similarity index 75% rename from src/actions/rs_actiondrawlinepolygon2.h rename to src/actions/actiondrawlinepolygon2.h index 243a56f..8355f1b 100644 --- a/src/actions/rs_actiondrawlinepolygon2.h +++ b/src/actions/actiondrawlinepolygon2.h @@ -1,15 +1,16 @@ -#ifndef RS_ACTIONDRAWLINEPOLYGON2_H -#define RS_ACTIONDRAWLINEPOLYGON2_H +#ifndef __ACTIONDRAWLINEPOLYGON2_H__ +#define __ACTIONDRAWLINEPOLYGON2_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to draw polygons. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLinePolygon2: public RS_PreviewActionInterface +class ActionDrawLinePolygon2: public ActionInterface { private: enum Status { @@ -19,8 +20,8 @@ class RS_ActionDrawLinePolygon2: public RS_PreviewActionInterface }; public: - RS_ActionDrawLinePolygon2(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLinePolygon2(); + ActionDrawLinePolygon2(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLinePolygon2(); virtual RS2::ActionType rtti(); virtual void trigger(); @@ -48,4 +49,4 @@ class RS_ActionDrawLinePolygon2: public RS_PreviewActionInterface Status lastStatus; }; -#endif +#endif // __ACTIONDRAWLINEPOLYGON2_H__ diff --git a/src/actions/rs_actiondrawlinerectangle.cpp b/src/actions/actiondrawlinerectangle.cpp similarity index 66% rename from src/actions/rs_actiondrawlinerectangle.cpp rename to src/actions/actiondrawlinerectangle.cpp index db82d01..9882256 100644 --- a/src/actions/rs_actiondrawlinerectangle.cpp +++ b/src/actions/actiondrawlinerectangle.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinerectangle.cpp +// actiondrawlinerectangle.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,60 +12,60 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actiondrawlinerectangle.h" +#include "actiondrawlinerectangle.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineRectangle::RS_ActionDrawLineRectangle( +ActionDrawLineRectangle::ActionDrawLineRectangle( RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw rectangles", container, graphicView) + ActionInterface("Draw rectangles", container, graphicView) { reset(); } -RS_ActionDrawLineRectangle::~RS_ActionDrawLineRectangle() +ActionDrawLineRectangle::~ActionDrawLineRectangle() { } -void RS_ActionDrawLineRectangle::reset() +void ActionDrawLineRectangle::reset() { - for (int i = 0; i < 4; ++i) + for(int i=0; i<4; i++) data[i] = RS_LineData(Vector(false), Vector(false)); } -void RS_ActionDrawLineRectangle::init(int status) +void ActionDrawLineRectangle::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); } -void RS_ActionDrawLineRectangle::trigger() +void ActionDrawLineRectangle::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); RS_Line * line[4]; preparePreview(); // create and add rectangle: - for (int i = 0; i < 4; ++i) + for(int i=0; i<4; i++) { - line[i] = new RS_Line(container, - data[i]); + line[i] = new RS_Line(container, data[i]); line[i]->setLayerToActive(); line[i]->setPenToActive(); container->addEntity(line[i]); } // upd. undo list: - if (document != NULL) + if (document) { document->startUndoCycle(); - for (int i = 0; i < 4; ++i) + for(int i=0; i<4; i++) document->addUndoable(line[i]); + document->endUndoCycle(); } @@ -73,19 +73,18 @@ void RS_ActionDrawLineRectangle::trigger() deleteSnapper(); graphicView->moveRelativeZero(Vector(0.0, 0.0)); - for (int i = 0; i < 4; ++i) + for(int i=0; i<4; i++) { graphicView->drawEntity(line[i]); - RS_DEBUG->print("RS_ActionDrawLineRectangle::trigger():" - " line added: %d", + RS_DEBUG->print("ActionDrawLineRectangle::trigger(): line added: %d", line[i]->getId()); } graphicView->moveRelativeZero(corner2); } -void RS_ActionDrawLineRectangle::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineRectangle::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineRectangle::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLineRectangle::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -97,15 +96,16 @@ void RS_ActionDrawLineRectangle::mouseMoveEvent(QMouseEvent * e) preparePreview(); - for (int i = 0; i < 4; ++i) - preview->addEntity(new RS_Line(preview, data[i])); +// for(int i=0; i<4; i++) +// preview->addEntity(new RS_Line(preview, data[i])); + drawPreview(); } - RS_DEBUG->print("RS_ActionDrawLineRectangle::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineRectangle::mouseMoveEvent end"); } -void RS_ActionDrawLineRectangle::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineRectangle::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -120,7 +120,7 @@ void RS_ActionDrawLineRectangle::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLineRectangle::preparePreview() +void ActionDrawLineRectangle::preparePreview() { data[0] = RS_LineData(corner1, Vector(corner2.x, corner1.y)); data[1] = RS_LineData(Vector(corner2.x, corner1.y), corner2); @@ -128,7 +128,7 @@ void RS_ActionDrawLineRectangle::preparePreview() data[3] = RS_LineData(Vector(corner1.x, corner2.y), corner1); } -void RS_ActionDrawLineRectangle::coordinateEvent(Vector * e) +void ActionDrawLineRectangle::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -154,7 +154,7 @@ void RS_ActionDrawLineRectangle::coordinateEvent(Vector * e) } } -void RS_ActionDrawLineRectangle::commandEvent(RS_CommandEvent * e) +void ActionDrawLineRectangle::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -167,13 +167,13 @@ void RS_ActionDrawLineRectangle::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawLineRectangle::getAvailableCommands() +QStringList ActionDrawLineRectangle::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionDrawLineRectangle::updateMouseButtonHints() +void ActionDrawLineRectangle::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -196,12 +196,12 @@ void RS_ActionDrawLineRectangle::updateMouseButtonHints() } } -void RS_ActionDrawLineRectangle::updateMouseCursor() +void ActionDrawLineRectangle::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineRectangle::updateToolBar() +void ActionDrawLineRectangle::updateToolBar() { if (RS_DIALOGFACTORY != NULL) { @@ -212,4 +212,4 @@ void RS_ActionDrawLineRectangle::updateToolBar() } } -// EOF + diff --git a/src/actions/rs_actiondrawlinerectangle.h b/src/actions/actiondrawlinerectangle.h similarity index 67% rename from src/actions/rs_actiondrawlinerectangle.h rename to src/actions/actiondrawlinerectangle.h index 2bf88a0..829ea2e 100644 --- a/src/actions/rs_actiondrawlinerectangle.h +++ b/src/actions/actiondrawlinerectangle.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONDRAWLINERECTANGLE_H -#define RS_ACTIONDRAWLINERECTANGLE_H +#ifndef __ACTIONDRAWLINERECTANGLE_H__ +#define __ACTIONDRAWLINERECTANGLE_H__ #include "rs_line.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** - * This action class can handle user events to draw - * rectangles with two corners given. + * This action class can handle user events to draw rectangles with two corners + * given. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLineRectangle: public RS_PreviewActionInterface +class ActionDrawLineRectangle: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionDrawLineRectangle: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineRectangle(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLineRectangle(); + ActionDrawLineRectangle(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLineRectangle(); void reset(); virtual void init(int status = 0); @@ -54,4 +55,4 @@ class RS_ActionDrawLineRectangle: public RS_PreviewActionInterface Vector corner2; }; -#endif +#endif // __ACTIONDRAWLINERECTANGLE_H__ diff --git a/src/actions/rs_actiondrawlinerelangle.cpp b/src/actions/actiondrawlinerelangle.cpp similarity index 52% rename from src/actions/rs_actiondrawlinerelangle.cpp rename to src/actions/actiondrawlinerelangle.cpp index 911a165..6385a81 100644 --- a/src/actions/rs_actiondrawlinerelangle.cpp +++ b/src/actions/actiondrawlinerelangle.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinerelangle.cpp +// actiondrawlinerelangle.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actiondrawlinerelangle.h" +#include "actiondrawlinerelangle.h" #include "rs_commandevent.h" #include "rs_creation.h" @@ -20,9 +20,9 @@ #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineRelAngle::RS_ActionDrawLineRelAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle): - RS_PreviewActionInterface("Draw Lines with relative angles", - container, graphicView) +ActionDrawLineRelAngle::ActionDrawLineRelAngle(RS_EntityContainer & container, + GraphicView & graphicView, double angle, bool fixedAngle): + ActionInterface("Draw Lines with relative angles", container, graphicView) { entity = NULL; this->angle = angle; @@ -31,65 +31,30 @@ RS_ActionDrawLineRelAngle::RS_ActionDrawLineRelAngle(RS_EntityContainer & contai pos = Vector(false); } -RS_ActionDrawLineRelAngle::~RS_ActionDrawLineRelAngle() +ActionDrawLineRelAngle::~ActionDrawLineRelAngle() { } -/*virtual*/ RS2::ActionType RS_ActionDrawLineRelAngle::rtti() +/*virtual*/ RS2::ActionType ActionDrawLineRelAngle::rtti() { return RS2::ActionDrawLineRelAngle; } -void RS_ActionDrawLineRelAngle::trigger() +void ActionDrawLineRelAngle::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); deleteSnapper(); deletePreview(); clearPreview(); RS_Creation creation(container, graphicView); - creation.createLineRelAngle(pos, - entity, - angle, - length); - - /* - if (line!=NULL) { - RS_Entity* newEntity = NULL; - - newEntity = new RS_Line(container, - line->getData()); - - if (newEntity!=NULL) { - newEntity->setLayerToActive(); - newEntity->setPenToActive(); - container->addEntity(newEntity); - - // upd. undo list: - if (document!=NULL) { - document->startUndoCycle(); - document->addUndoable(newEntity); - document->endUndoCycle(); - } - deleteSnapper(); - graphicView->drawEntity(newEntity); - setStatus(SetEntity); - } - //reset(); - delete line; - line = NULL; - } else { - RS_DEBUG->print("RS_ActionDrawLineRelAngle::trigger:" - " Line is NULL\n"); - } - */ + creation.createLineRelAngle(pos, entity, angle, length); } -void RS_ActionDrawLineRelAngle::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineRelAngle::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineRelAngle::mouseMoveEvent begin"); - + RS_DEBUG->print("ActionDrawLineRelAngle::mouseMoveEvent begin"); Vector mouse(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); switch (getStatus()) @@ -98,56 +63,35 @@ void RS_ActionDrawLineRelAngle::mouseMoveEvent(QMouseEvent * e) entity = catchEntity(e, RS2::ResolveAll); break; - case SetPos: { - //length = graphicView->toGraphDX(graphicView->getWidth()); - //Vector mouse = snapPoint(e); + case SetPos: + { pos = snapPoint(e); - /*RS_Creation creation(NULL, NULL); - RS_Line* l = creation.createLineRelAngle(mouse, - entity, - angle, - length);*/ - deletePreview(); clearPreview(); - RS_Creation creation(preview, NULL, false); - creation.createLineRelAngle(pos, - entity, - angle, - length); +// RS_Creation creation(preview, NULL, false); +// creation.createLineRelAngle(pos, entity, angle, length); drawPreview(); - - /*if (l!=NULL) { - if (line!=NULL) { - delete line; - } - line = (RS_Line*)l->clone(); - - deletePreview(); - clearPreview(); - preview->addEntity(l); - drawPreview(); - }*/ } - break; + break; default: break; } - RS_DEBUG->print("RS_ActionDrawLineRelAngle::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineRelAngle::mouseMoveEvent end"); } -void RS_ActionDrawLineRelAngle::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineRelAngle::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { switch (getStatus()) { - case SetEntity: { + case SetEntity: + { RS_Entity * en = catchEntity(e, RS2::ResolveAll); if (en != NULL @@ -163,13 +107,14 @@ void RS_ActionDrawLineRelAngle::mouseReleaseEvent(QMouseEvent * e) setStatus(SetPos); } } - break; + break; - case SetPos: { + case SetPos: + { Vector ce(snapPoint(e)); coordinateEvent(&ce); } - break; + break; default: break; @@ -181,16 +126,17 @@ void RS_ActionDrawLineRelAngle::mouseReleaseEvent(QMouseEvent * e) deleteSnapper(); clearPreview(); - if (entity != NULL) + if (entity) { entity->setHighlighted(false); graphicView->drawEntity(entity); } + init(getStatus() - 1); } } -void RS_ActionDrawLineRelAngle::coordinateEvent(Vector * e) +void ActionDrawLineRelAngle::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -207,7 +153,7 @@ void RS_ActionDrawLineRelAngle::coordinateEvent(Vector * e) } } -void RS_ActionDrawLineRelAngle::commandEvent(RS_CommandEvent * e) +void ActionDrawLineRelAngle::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -223,7 +169,6 @@ void RS_ActionDrawLineRelAngle::commandEvent(RS_CommandEvent * e) { case SetEntity: case SetPos: - if (!fixedAngle && checkCommand("angle", c)) { deleteSnapper(); @@ -240,42 +185,46 @@ void RS_ActionDrawLineRelAngle::commandEvent(RS_CommandEvent * e) } break; - case SetAngle: { + case SetAngle: + { bool ok; double a = RS_Math::eval(c, &ok); - if (ok == true) + if (ok) angle = RS_Math::deg2rad(a); - else if (RS_DIALOGFACTORY != NULL) + else if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, true, true); + setStatus(SetPos); } - break; + break; - case SetLength: { + case SetLength: + { bool ok; double l = RS_Math::eval(c, &ok); - if (ok == true) + if (ok) length = l; - else if (RS_DIALOGFACTORY != NULL) + else if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, true, true); + setStatus(SetPos); } - break; + break; default: break; } } -QStringList RS_ActionDrawLineRelAngle::getAvailableCommands() +QStringList ActionDrawLineRelAngle::getAvailableCommands() { QStringList cmd; @@ -283,7 +232,6 @@ QStringList RS_ActionDrawLineRelAngle::getAvailableCommands() { case SetPos: case SetLength: - if (!fixedAngle) cmd += command("angle"); cmd += command("length"); @@ -296,9 +244,9 @@ QStringList RS_ActionDrawLineRelAngle::getAvailableCommands() return cmd; } -void RS_ActionDrawLineRelAngle::updateMouseButtonHints() +void ActionDrawLineRelAngle::updateMouseButtonHints() { - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) { switch (getStatus()) { @@ -319,30 +267,30 @@ void RS_ActionDrawLineRelAngle::updateMouseButtonHints() } } -void RS_ActionDrawLineRelAngle::showOptions() +void ActionDrawLineRelAngle::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawLineRelAngle::hideOptions() +void ActionDrawLineRelAngle::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawLineRelAngle::updateMouseCursor() +void ActionDrawLineRelAngle::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineRelAngle::updateToolBar() +void ActionDrawLineRelAngle::updateToolBar() { - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -351,28 +299,27 @@ void RS_ActionDrawLineRelAngle::updateToolBar() } } -void RS_ActionDrawLineRelAngle::setAngle(double a) +void ActionDrawLineRelAngle::setAngle(double a) { angle = a; } -double RS_ActionDrawLineRelAngle::getAngle() +double ActionDrawLineRelAngle::getAngle() { return angle; } -void RS_ActionDrawLineRelAngle::setLength(double l) +void ActionDrawLineRelAngle::setLength(double l) { length = l; } -double RS_ActionDrawLineRelAngle::getLength() +double ActionDrawLineRelAngle::getLength() { return length; } -bool RS_ActionDrawLineRelAngle::hasFixedAngle() +bool ActionDrawLineRelAngle::hasFixedAngle() { return fixedAngle; } - diff --git a/src/actions/rs_actiondrawlinerelangle.h b/src/actions/actiondrawlinerelangle.h similarity index 77% rename from src/actions/rs_actiondrawlinerelangle.h rename to src/actions/actiondrawlinerelangle.h index beaf461..6120006 100644 --- a/src/actions/rs_actiondrawlinerelangle.h +++ b/src/actions/actiondrawlinerelangle.h @@ -1,8 +1,8 @@ -#ifndef RS_ACTIONDRAWLINERELANGLE_H -#define RS_ACTIONDRAWLINERELANGLE_H +#ifndef __ACTIONDRAWLINERELANGLE_H__ +#define __ACTIONDRAWLINERELANGLE_H__ #include "rs_line.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -11,9 +11,10 @@ class RS_Entity; * This action class can handle user events to draw lines with a given angle * to a given entity. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLineRelAngle: public RS_PreviewActionInterface +class ActionDrawLineRelAngle: public ActionInterface { private: enum Status { @@ -24,8 +25,8 @@ class RS_ActionDrawLineRelAngle: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineRelAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); - ~RS_ActionDrawLineRelAngle(); + ActionDrawLineRelAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); + ~ActionDrawLineRelAngle(); virtual RS2::ActionType rtti(); virtual void trigger(); @@ -66,4 +67,4 @@ class RS_ActionDrawLineRelAngle: public RS_PreviewActionInterface bool fixedAngle; }; -#endif +#endif // __ACTIONDRAWLINERELANGLE_H__ diff --git a/src/actions/rs_actiondrawlinetangent1.cpp b/src/actions/actiondrawlinetangent1.cpp similarity index 63% rename from src/actions/rs_actiondrawlinetangent1.cpp rename to src/actions/actiondrawlinetangent1.cpp index ed3703d..fbb128a 100644 --- a/src/actions/rs_actiondrawlinetangent1.cpp +++ b/src/actions/actiondrawlinetangent1.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinetangent1.cpp +// actiondrawlinetangent1.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,14 +12,14 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actiondrawlinetangent1.h" +#include "actiondrawlinetangent1.h" #include "rs_creation.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineTangent1::RS_ActionDrawLineTangent1(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Tangents 1", +ActionDrawLineTangent1::ActionDrawLineTangent1(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw Tangents 1", container, graphicView) { tangent = NULL; @@ -27,27 +27,27 @@ RS_ActionDrawLineTangent1::RS_ActionDrawLineTangent1(RS_EntityContainer & contai circle = NULL; } -RS_ActionDrawLineTangent1::~RS_ActionDrawLineTangent1() +ActionDrawLineTangent1::~ActionDrawLineTangent1() { } -void RS_ActionDrawLineTangent1::trigger() +void ActionDrawLineTangent1::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); - if (tangent != NULL) + if (tangent) { RS_Entity * newEntity = NULL; newEntity = new RS_Line(container, tangent->getData()); - if (newEntity != NULL) + if (newEntity) { newEntity->setLayerToActive(); newEntity->setPenToActive(); container->addEntity(newEntity); // upd. undo list: - if (document != NULL) + if (document) { document->startUndoCycle(); document->addUndoable(newEntity); @@ -64,14 +64,13 @@ void RS_ActionDrawLineTangent1::trigger() tangent = NULL; } else - RS_DEBUG->print("RS_ActionDrawLineTangent1::trigger:" + RS_DEBUG->print("ActionDrawLineTangent1::trigger:" " Entity is NULL\n"); } -void RS_ActionDrawLineTangent1::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineTangent1::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineTangent1::mouseMoveEvent begin"); - + RS_DEBUG->print("ActionDrawLineTangent1::mouseMoveEvent begin"); Vector mouse(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); switch (getStatus()) @@ -80,43 +79,42 @@ void RS_ActionDrawLineTangent1::mouseMoveEvent(QMouseEvent * e) point = snapPoint(e); break; - case SetCircle: { + case SetCircle: + { RS_Entity * en = catchEntity(e, RS2::ResolveAll); - if (en != NULL && (en->rtti() == RS2::EntityCircle - || en->rtti() == RS2::EntityArc - || en->rtti() == RS2::EntityEllipse)) + if (en && (en->rtti() == RS2::EntityCircle + || en->rtti() == RS2::EntityArc + || en->rtti() == RS2::EntityEllipse)) { circle = en; - RS_Creation creation(NULL, NULL); - RS_Line * t = creation.createTangent1(mouse, - point, - circle); + RS_Line * t = creation.createTangent1(mouse, point, circle); - if (t != NULL) + if (t) { - if (tangent != NULL) + if (tangent) delete tangent; + tangent = (RS_Line *)t->clone(); deletePreview(); clearPreview(); - preview->addEntity(t); +// preview->addEntity(t); drawPreview(); } } } - break; + break; default: break; } - RS_DEBUG->print("RS_ActionDrawLineTangent1::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineTangent1::mouseMoveEvent end"); } -void RS_ActionDrawLineTangent1::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineTangent1::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) { @@ -129,11 +127,12 @@ void RS_ActionDrawLineTangent1::mouseReleaseEvent(QMouseEvent * e) { switch (getStatus()) { - case SetPoint: { + case SetPoint: + { Vector ce(snapPoint(e)); coordinateEvent(&ce); } - break; + break; case SetCircle: trigger(); @@ -142,7 +141,7 @@ void RS_ActionDrawLineTangent1::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLineTangent1::coordinateEvent(Vector * e) +void ActionDrawLineTangent1::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -161,15 +160,14 @@ void RS_ActionDrawLineTangent1::coordinateEvent(Vector * e) } } -void RS_ActionDrawLineTangent1::updateMouseButtonHints() +void ActionDrawLineTangent1::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { switch (getStatus()) { case SetPoint: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify point"), - tr("Cancel")); + RS_DIALOGFACTORY->updateMouseWidget(tr("Specify point"), tr("Cancel")); break; case SetCircle: @@ -184,14 +182,14 @@ void RS_ActionDrawLineTangent1::updateMouseButtonHints() } } -void RS_ActionDrawLineTangent1::updateMouseCursor() +void ActionDrawLineTangent1::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineTangent1::updateToolBar() +void ActionDrawLineTangent1::updateToolBar() { - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -199,5 +197,3 @@ void RS_ActionDrawLineTangent1::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } } - -// EOF diff --git a/src/actions/rs_actiondrawlinetangent1.h b/src/actions/actiondrawlinetangent1.h similarity index 71% rename from src/actions/rs_actiondrawlinetangent1.h rename to src/actions/actiondrawlinetangent1.h index b772f74..8d369c8 100644 --- a/src/actions/rs_actiondrawlinetangent1.h +++ b/src/actions/actiondrawlinetangent1.h @@ -1,8 +1,8 @@ -#ifndef RS_ACTIONDRAWLINETANGENT1_H -#define RS_ACTIONDRAWLINETANGENT1_H +#ifndef __ACTIONDRAWLINETANGENT1_H__ +#define __ACTIONDRAWLINETANGENT1_H__ #include "rs_line.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Line; @@ -12,9 +12,10 @@ class RS_Entity; * This action class can handle user events to draw tangents from points * to circles. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLineTangent1: public RS_PreviewActionInterface +class ActionDrawLineTangent1: public ActionInterface { private: enum Status { @@ -23,8 +24,8 @@ class RS_ActionDrawLineTangent1: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineTangent1(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLineTangent1(); + ActionDrawLineTangent1(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLineTangent1(); virtual void trigger(); virtual void mouseMoveEvent(QMouseEvent * e); @@ -45,4 +46,4 @@ class RS_ActionDrawLineTangent1: public RS_PreviewActionInterface RS_LineData data; }; -#endif +#endif // __ACTIONDRAWLINETANGENT1_H__ diff --git a/src/actions/rs_actiondrawlinetangent2.cpp b/src/actions/actiondrawlinetangent2.cpp similarity index 70% rename from src/actions/rs_actiondrawlinetangent2.cpp rename to src/actions/actiondrawlinetangent2.cpp index f4bcf99..5580286 100644 --- a/src/actions/rs_actiondrawlinetangent2.cpp +++ b/src/actions/actiondrawlinetangent2.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawlinetangent2.cpp +// actiondrawlinetangent2.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,29 +12,29 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actiondrawlinetangent2.h" +#include "actiondrawlinetangent2.h" #include "rs_creation.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineTangent2::RS_ActionDrawLineTangent2( +ActionDrawLineTangent2::ActionDrawLineTangent2( RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw Tangents 2", container, graphicView) + ActionInterface("Draw Tangents 2", container, graphicView) { tangent = NULL; circle1 = NULL; circle2 = NULL; } -RS_ActionDrawLineTangent2::~RS_ActionDrawLineTangent2() +ActionDrawLineTangent2::~ActionDrawLineTangent2() { } -void RS_ActionDrawLineTangent2::trigger() +void ActionDrawLineTangent2::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); if (tangent != NULL) { @@ -62,13 +62,13 @@ void RS_ActionDrawLineTangent2::trigger() tangent = NULL; } else - RS_DEBUG->print("RS_ActionDrawLineTangent2::trigger:" + RS_DEBUG->print("ActionDrawLineTangent2::trigger:" " Entity is NULL\n"); } -void RS_ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e) +void ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawLineTangent2::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawLineTangent2::mouseMoveEvent begin"); Vector mouse(graphicView->toGraphX(e->x()), graphicView->toGraphY(e->y())); @@ -83,28 +83,27 @@ void RS_ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e) } break; - case SetCircle2: { + case SetCircle2: + { RS_Entity * en = catchEntity(e, RS2::ResolveAll); - if (en != NULL && (en->rtti() == RS2::EntityCircle - || en->rtti() == RS2::EntityArc)) + if (en && (en->rtti() == RS2::EntityCircle + || en->rtti() == RS2::EntityArc)) { circle2 = en; - RS_Creation creation(NULL, NULL); - RS_Line * t = creation.createTangent2(mouse, - circle1, - circle2); + RS_Line * t = creation.createTangent2(mouse, circle1, circle2); - if (t != NULL) + if (t) { - if (tangent != NULL) + if (tangent) delete tangent; + tangent = (RS_Line *)t->clone(); deletePreview(); clearPreview(); - preview->addEntity(t); +// preview->addEntity(t); drawPreview(); } } @@ -115,10 +114,10 @@ void RS_ActionDrawLineTangent2::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionDrawLineTangent2::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawLineTangent2::mouseMoveEvent end"); } -void RS_ActionDrawLineTangent2::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawLineTangent2::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) { @@ -141,7 +140,7 @@ void RS_ActionDrawLineTangent2::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawLineTangent2::updateMouseButtonHints() +void ActionDrawLineTangent2::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -164,15 +163,13 @@ void RS_ActionDrawLineTangent2::updateMouseButtonHints() } } -void RS_ActionDrawLineTangent2::updateMouseCursor() +void ActionDrawLineTangent2::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawLineTangent2::updateToolBar() +void ActionDrawLineTangent2::updateToolBar() { if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines); } - -// EOF diff --git a/src/actions/rs_actiondrawlinetangent2.h b/src/actions/actiondrawlinetangent2.h similarity index 71% rename from src/actions/rs_actiondrawlinetangent2.h rename to src/actions/actiondrawlinetangent2.h index 374e304..62e315d 100644 --- a/src/actions/rs_actiondrawlinetangent2.h +++ b/src/actions/actiondrawlinetangent2.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONDRAWLINETANGENT2_H -#define RS_ACTIONDRAWLINETANGENT2_H +#ifndef __ACTIONDRAWLINETANGENT2_H__ +#define __ACTIONDRAWLINETANGENT2_H__ #include "rs_line.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" class RS_Entity; /** * This action class can handle user events to draw tangents from circle to * circle. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawLineTangent2: public RS_PreviewActionInterface +class ActionDrawLineTangent2: public ActionInterface { private: enum Status { @@ -20,8 +21,8 @@ class RS_ActionDrawLineTangent2: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineTangent2(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawLineTangent2(); + ActionDrawLineTangent2(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawLineTangent2(); virtual void trigger(); virtual void mouseMoveEvent(QMouseEvent * e); @@ -43,4 +44,4 @@ class RS_ActionDrawLineTangent2: public RS_PreviewActionInterface RS_LineData data; }; -#endif +#endif // __ACTIONDRAWLINETANGENT2_H__ diff --git a/src/actions/rs_actiondrawpoint.cpp b/src/actions/actiondrawpoint.cpp similarity index 72% rename from src/actions/rs_actiondrawpoint.cpp rename to src/actions/actiondrawpoint.cpp index 8208639..67476b3 100644 --- a/src/actions/rs_actiondrawpoint.cpp +++ b/src/actions/actiondrawpoint.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawpoint.cpp +// actiondrawpoint.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,23 +12,23 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actiondrawpoint.h" +#include "actiondrawpoint.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawPoint::RS_ActionDrawPoint(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw Points", container, graphicView) +ActionDrawPoint::ActionDrawPoint(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw Points", container, graphicView) { } -RS_ActionDrawPoint::~RS_ActionDrawPoint() +ActionDrawPoint::~ActionDrawPoint() { } -void RS_ActionDrawPoint::trigger() +void ActionDrawPoint::trigger() { if (pt.valid) { @@ -50,12 +50,12 @@ void RS_ActionDrawPoint::trigger() } } -void RS_ActionDrawPoint::mouseMoveEvent(QMouseEvent * e) +void ActionDrawPoint::mouseMoveEvent(QMouseEvent * e) { snapPoint(e); } -void RS_ActionDrawPoint::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawPoint::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -69,7 +69,7 @@ void RS_ActionDrawPoint::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawPoint::coordinateEvent(Vector * e) +void ActionDrawPoint::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -80,7 +80,7 @@ void RS_ActionDrawPoint::coordinateEvent(Vector * e) trigger(); } -void RS_ActionDrawPoint::commandEvent(RS_CommandEvent * e) +void ActionDrawPoint::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -94,13 +94,13 @@ void RS_ActionDrawPoint::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawPoint::getAvailableCommands() +QStringList ActionDrawPoint::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionDrawPoint::updateMouseButtonHints() +void ActionDrawPoint::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -117,12 +117,12 @@ void RS_ActionDrawPoint::updateMouseButtonHints() } } -void RS_ActionDrawPoint::updateMouseCursor() +void ActionDrawPoint::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawPoint::updateToolBar() +void ActionDrawPoint::updateToolBar() { if (RS_DIALOGFACTORY != NULL) { @@ -132,4 +132,3 @@ void RS_ActionDrawPoint::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarPoints); } } - diff --git a/src/actions/rs_actiondrawpoint.h b/src/actions/actiondrawpoint.h similarity index 64% rename from src/actions/rs_actiondrawpoint.h rename to src/actions/actiondrawpoint.h index e7efb20..7e2aa59 100644 --- a/src/actions/rs_actiondrawpoint.h +++ b/src/actions/actiondrawpoint.h @@ -1,19 +1,20 @@ -#ifndef RS_ACTIONDRAWPOINT_H -#define RS_ACTIONDRAWPOINT_H +#ifndef __ACTIONDRAWPOINT_H__ +#define __ACTIONDRAWPOINT_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to draw points. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawPoint: public RS_PreviewActionInterface +class ActionDrawPoint: public ActionInterface { public: - RS_ActionDrawPoint(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawPoint(); + ActionDrawPoint(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawPoint(); virtual void trigger(); virtual void mouseMoveEvent(QMouseEvent * e); @@ -29,4 +30,4 @@ class RS_ActionDrawPoint: public RS_PreviewActionInterface Vector pt; }; -#endif +#endif // __ACTIONDRAWPOINT_H__ diff --git a/src/actions/rs_actiondrawspline.cpp b/src/actions/actiondrawspline.cpp similarity index 57% rename from src/actions/rs_actiondrawspline.cpp rename to src/actions/actiondrawspline.cpp index 533ca4b..1372735 100644 --- a/src/actions/rs_actiondrawspline.cpp +++ b/src/actions/actiondrawspline.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawspline.cpp +// actiondrawspline.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actiondrawspline.h" +#include "actiondrawspline.h" #include "rs_commandevent.h" #include "commands.h" @@ -20,8 +20,8 @@ #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawSpline::RS_ActionDrawSpline(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Draw splines", container, graphicView) +ActionDrawSpline::ActionDrawSpline(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Draw splines", container, graphicView) { reset(); #warning "!!! Need to port setAutoDelete() behaviour from Qt3 to Qt4 !!!" @@ -30,16 +30,16 @@ RS_ActionDrawSpline::RS_ActionDrawSpline(RS_EntityContainer & container, Graphic //bHistory.setAutoDelete(true); } -RS_ActionDrawSpline::~RS_ActionDrawSpline() +ActionDrawSpline::~ActionDrawSpline() { } -/*virtual*/ RS2::ActionType RS_ActionDrawSpline::rtti() +/*virtual*/ RS2::ActionType ActionDrawSpline::rtti() { return RS2::ActionDrawSpline; } -void RS_ActionDrawSpline::reset() +void ActionDrawSpline::reset() { spline = NULL; //start = Vector(false); @@ -47,22 +47,21 @@ void RS_ActionDrawSpline::reset() //bHistory.clear(); } -void RS_ActionDrawSpline::init(int status) +void ActionDrawSpline::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); } -void RS_ActionDrawSpline::trigger() +void ActionDrawSpline::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); if (spline == NULL) return; // add the entity - //RS_Spline* spline = new RS_Spline(container, data); spline->setLayerToActive(); spline->setPenToActive(); spline->update(); @@ -83,19 +82,19 @@ void RS_ActionDrawSpline::trigger() graphicView->drawEntity(spline); graphicView->moveRelativeZero(r); drawSnapper(); - RS_DEBUG->print("RS_ActionDrawSpline::trigger(): spline added: %d", spline->getId()); + RS_DEBUG->print("ActionDrawSpline::trigger(): spline added: %d", spline->getId()); spline = NULL; //history.clear(); } -void RS_ActionDrawSpline::mouseMoveEvent(QMouseEvent * e) +void ActionDrawSpline::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawSpline::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawSpline::mouseMoveEvent begin"); Vector mouse = snapPoint(e); - if (getStatus() == SetNextPoint && spline != NULL /*&& point.valid*/) + if (getStatus() == SetNextPoint && spline) { deletePreview(); clearPreview(); @@ -103,21 +102,21 @@ void RS_ActionDrawSpline::mouseMoveEvent(QMouseEvent * e) RS_Spline * tmpSpline = (RS_Spline *)spline->clone(); tmpSpline->addControlPoint(mouse); tmpSpline->update(); - preview->addEntity(tmpSpline); +// preview->addEntity(tmpSpline); QList cpts = tmpSpline->getControlPoints(); QList::iterator it; - for(it = cpts.begin(); it != cpts.end(); ++it) - preview->addEntity(new RS_Point(preview, RS_PointData(*it))); +// for(it=cpts.begin(); it!=cpts.end(); it+) +// preview->addEntity(new RS_Point(preview, RS_PointData(*it))); drawPreview(); } - RS_DEBUG->print("RS_ActionDrawSpline::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawSpline::mouseMoveEvent end"); } -void RS_ActionDrawSpline::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawSpline::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -136,9 +135,9 @@ void RS_ActionDrawSpline::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawSpline::coordinateEvent(Vector * e) +void ActionDrawSpline::coordinateEvent(Vector * e) { - if (e == NULL) + if (!e) return; Vector mouse = *e; @@ -146,20 +145,15 @@ void RS_ActionDrawSpline::coordinateEvent(Vector * e) switch (getStatus()) { case SetStartpoint: - //data.startpoint = mouse; - //point = mouse; history.clear(); history.append(new Vector(mouse)); - if (spline == NULL) + if (!spline) { spline = new RS_Spline(container, data); spline->addControlPoint(mouse); } - //bHistory.clear(); - //bHistory.append(new double(0.0)); - //start = mouse; setStatus(SetNextPoint); graphicView->moveRelativeZero(mouse); updateMouseButtonHints(); @@ -167,31 +161,18 @@ void RS_ActionDrawSpline::coordinateEvent(Vector * e) case SetNextPoint: graphicView->moveRelativeZero(mouse); - //point = mouse; history.append(new Vector(mouse)); - //bHistory.append(new double(0.0)); - if (spline != NULL) + if (spline) { - //graphicView->deleteEntity(spline); spline->addControlPoint(mouse); - //spline->setEndpoint(mouse); - //if (spline->count()==1) { - //spline->setLayerToActive(); - //spline->setPenToActive(); - //container->addEntity(spline); - //} deletePreview(); clearPreview(); deleteSnapper(); - //graphicView->drawEntity(spline); drawSnapper(); } - //trigger(); - //data.startpoint = data.endpoint; updateMouseButtonHints(); - //graphicView->moveRelativeZero(mouse); break; default: @@ -199,35 +180,30 @@ void RS_ActionDrawSpline::coordinateEvent(Vector * e) } } -void RS_ActionDrawSpline::commandEvent(RS_CommandEvent * e) +void ActionDrawSpline::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); switch (getStatus()) { case SetStartpoint: - if (checkCommand("help", c)) { RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } + break; case SetNextPoint: - /*if (checkCommand("close", c)) { - close(); - updateMouseButtonHints(); - return; - }*/ - if (checkCommand("undo", c)) { undo(); updateMouseButtonHints(); return; } + break; default: @@ -235,7 +211,7 @@ void RS_ActionDrawSpline::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawSpline::getAvailableCommands() +QStringList ActionDrawSpline::getAvailableCommands() { QStringList cmd; @@ -245,13 +221,12 @@ QStringList RS_ActionDrawSpline::getAvailableCommands() break; case SetNextPoint: - if (history.count() >= 2) cmd += command("undo"); - if (history.count() >= 3) cmd += command("close"); + break; default: @@ -261,7 +236,7 @@ QStringList RS_ActionDrawSpline::getAvailableCommands() return cmd; } -void RS_ActionDrawSpline::updateMouseButtonHints() +void ActionDrawSpline::updateMouseButtonHints() { switch (getStatus()) { @@ -270,7 +245,8 @@ void RS_ActionDrawSpline::updateMouseButtonHints() tr("Cancel")); break; - case SetNextPoint: { + case SetNextPoint: + { QString msg = ""; if (history.count() >= 3) @@ -291,7 +267,7 @@ void RS_ActionDrawSpline::updateMouseButtonHints() tr("Specify next control point"), tr("Back")); } - break; + break; default: RS_DIALOGFACTORY->updateMouseWidget("", ""); @@ -299,110 +275,82 @@ void RS_ActionDrawSpline::updateMouseButtonHints() } } -void RS_ActionDrawSpline::showOptions() +void ActionDrawSpline::showOptions() { - RS_ActionInterface::showOptions(); - + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionDrawSpline::hideOptions() +void ActionDrawSpline::hideOptions() { - RS_ActionInterface::hideOptions(); - + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawSpline::updateMouseCursor() +void ActionDrawSpline::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawSpline::updateToolBar() +void ActionDrawSpline::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else - //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSplines); RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } -/* - void RS_ActionDrawSpline::close() { - if (history.count()>2 && start.valid) { - //data.endpoint = start; - //trigger(); - if (spline!=NULL) { - Vector e(spline->getStartpoint()); - coordinateEvent(&e); - } - trigger(); - setStatus(SetStartpoint); - graphicView->moveRelativeZero(start); - } else { - RS_DIALOGFACTORY->commandMessage( - tr("Cannot close sequence of lines: " - "Not enough entities defined yet.")); - } - } - */ - -void RS_ActionDrawSpline::undo() +void ActionDrawSpline::undo() { if (history.count() > 1) { history.removeLast(); - //bHistory.removeLast(); deletePreview(); clearPreview(); - //graphicView->setCurrentAction( - // new RS_ActionEditUndo(true, *container, *graphicView)); - if (history.last() != NULL) + if (history.last()) { //point = *history.last(); } - if (spline != NULL) + if (spline) { spline->removeLastControlPoint(); Vector * v = history.last(); - if (v != NULL) + if (v) graphicView->moveRelativeZero(*v); + graphicView->redraw(); } } else RS_DIALOGFACTORY->commandMessage( - tr("Cannot undo: " - "Not enough entities defined yet.")); + tr("Cannot undo: Not enough entities defined yet.")); } -void RS_ActionDrawSpline::setDegree(int deg) +void ActionDrawSpline::setDegree(int deg) { data.degree = deg; - if (spline != NULL) + if (spline) spline->setDegree(deg); } -int RS_ActionDrawSpline::getDegree() +int ActionDrawSpline::getDegree() { return data.degree; } -void RS_ActionDrawSpline::setClosed(bool c) +void ActionDrawSpline::setClosed(bool c) { data.closed = c; - if (spline != NULL) + if (spline) spline->setClosed(c); } -bool RS_ActionDrawSpline::isClosed() +bool ActionDrawSpline::isClosed() { return data.closed; } - -// EOF diff --git a/src/actions/rs_actiondrawspline.h b/src/actions/actiondrawspline.h similarity index 75% rename from src/actions/rs_actiondrawspline.h rename to src/actions/actiondrawspline.h index 928db1e..02722d7 100644 --- a/src/actions/rs_actiondrawspline.h +++ b/src/actions/actiondrawspline.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONDRAWSPLINE_H -#define RS_ACTIONDRAWSPLINE_H +#ifndef __ACTIONDRAWSPLINE_H__ +#define __ACTIONDRAWSPLINE_H__ #include -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "rs_spline.h" /** * This action class can handle user events to draw splines. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawSpline: public RS_PreviewActionInterface +class ActionDrawSpline: public ActionInterface { public: /** @@ -22,11 +23,10 @@ class RS_ActionDrawSpline: public RS_PreviewActionInterface }; public: - RS_ActionDrawSpline(RS_EntityContainer & container, GraphicView & graphicView); - virtual ~RS_ActionDrawSpline(); + ActionDrawSpline(RS_EntityContainer & container, GraphicView & graphicView); + virtual ~ActionDrawSpline(); virtual RS2::ActionType rtti(); - //static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); void reset(); virtual void init(int status = 0); virtual void trigger(); @@ -41,7 +41,6 @@ class RS_ActionDrawSpline: public RS_PreviewActionInterface virtual void updateMouseCursor(); virtual void updateToolBar(); - //void close(); void undo(); void setDegree(int deg); int getDegree(); @@ -65,4 +64,4 @@ class RS_ActionDrawSpline: public RS_PreviewActionInterface QList history; }; -#endif +#endif // __ACTIONDRAWSPLINE_H__ diff --git a/src/actions/rs_actiondrawtext.cpp b/src/actions/actiondrawtext.cpp similarity index 70% rename from src/actions/rs_actiondrawtext.cpp rename to src/actions/actiondrawtext.cpp index 1d3eb7c..3bb7b24 100644 --- a/src/actions/rs_actiondrawtext.cpp +++ b/src/actions/actiondrawtext.cpp @@ -1,4 +1,4 @@ -// rs_actiondrawtext.cpp +// actiondrawtext.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -14,31 +14,31 @@ // preview. // -#include "rs_actiondrawtext.h" +#include "actiondrawtext.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawText::RS_ActionDrawText(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Text", container, graphicView) +ActionDrawText::ActionDrawText(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Draw Text", container, graphicView) { pos = Vector(false); textChanged = true; } -RS_ActionDrawText::~RS_ActionDrawText() +ActionDrawText::~ActionDrawText() { } -/*virtual*/ RS2::ActionType RS_ActionDrawText::rtti() +/*virtual*/ RS2::ActionType ActionDrawText::rtti() { return RS2::ActionDrawText; } -void RS_ActionDrawText::init(int status) +void ActionDrawText::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); if (RS_DIALOGFACTORY == NULL) return; @@ -56,7 +56,7 @@ void RS_ActionDrawText::init(int status) { data = tmp.getData(); preparePreview(); - preview->setVisible(false); +// preview->setVisible(false); setStatus(SetPos); showOptions(); @@ -80,16 +80,16 @@ void RS_ActionDrawText::init(int status) } } -void RS_ActionDrawText::reset() +void ActionDrawText::reset() { data = RS_TextData(Vector(0.0, 0.0), 1.0, 100.0, RS2::VAlignTop, - RS2::HAlignLeft, RS2::LeftToRight, RS2::Exact, 1.0, data.text, - "standard", 0.0, RS2::Update); + RS2::HAlignLeft, RS2::LeftToRight, RS2::Exact, 1.0, data.text, + "standard", 0.0, RS2::Update); } -void RS_ActionDrawText::trigger() +void ActionDrawText::trigger() { - RS_DEBUG->print("RS_ActionDrawText::trigger()"); + RS_DEBUG->print("ActionDrawText::trigger()"); if (pos.valid) { @@ -117,20 +117,19 @@ void RS_ActionDrawText::trigger() } } -void RS_ActionDrawText::preparePreview() +void ActionDrawText::preparePreview() { - clearPreview(); +/* clearPreview(); data.insertionPoint = Vector(0.0, 0.0); RS_Text * text = new RS_Text(preview, data); text->update(); - //text->setVisible(false); preview->addEntity(text); - textChanged = false; + textChanged = false;*/ } -void RS_ActionDrawText::mouseMoveEvent(QMouseEvent * e) +void ActionDrawText::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionDrawText::mouseMoveEvent begin"); + RS_DEBUG->print("ActionDrawText::mouseMoveEvent begin"); if (getStatus() == SetPos) { @@ -145,17 +144,17 @@ void RS_ActionDrawText::mouseMoveEvent(QMouseEvent * e) if (textChanged) preparePreview(); - if (!preview->isVisible()) - preview->setVisible(true); - - offset = Vector(graphicView->toGuiDX(pos.x), -graphicView->toGuiDY(pos.y)); +// if (!preview->isVisible()) +// preview->setVisible(true); +// +// offset = Vector(graphicView->toGuiDX(pos.x), -graphicView->toGuiDY(pos.y)); drawPreview(); } - RS_DEBUG->print("RS_ActionDrawText::mouseMoveEvent end"); + RS_DEBUG->print("ActionDrawText::mouseMoveEvent end"); } -void RS_ActionDrawText::mouseReleaseEvent(QMouseEvent * e) +void ActionDrawText::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -177,7 +176,7 @@ void RS_ActionDrawText::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionDrawText::coordinateEvent(Vector * e) +void ActionDrawText::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -199,7 +198,7 @@ void RS_ActionDrawText::coordinateEvent(Vector * e) } } -void RS_ActionDrawText::commandEvent(RS_CommandEvent * e) +void ActionDrawText::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -229,7 +228,7 @@ void RS_ActionDrawText::commandEvent(RS_CommandEvent * e) case SetText: setText(e->getCommand()); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, true, true); graphicView->enableCoordinateInput(); @@ -241,7 +240,7 @@ void RS_ActionDrawText::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionDrawText::getAvailableCommands() +QStringList ActionDrawText::getAvailableCommands() { QStringList cmd; @@ -251,25 +250,25 @@ QStringList RS_ActionDrawText::getAvailableCommands() return cmd; } -void RS_ActionDrawText::showOptions() +void ActionDrawText::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, true, true); } -void RS_ActionDrawText::hideOptions() +void ActionDrawText::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionDrawText::updateMouseButtonHints() +void ActionDrawText::updateMouseButtonHints() { - if (RS_DIALOGFACTORY == NULL) + if (!RS_DIALOGFACTORY) return; switch (getStatus()) @@ -288,14 +287,14 @@ void RS_ActionDrawText::updateMouseButtonHints() } } -void RS_ActionDrawText::updateMouseCursor() +void ActionDrawText::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionDrawText::updateToolBar() +void ActionDrawText::updateToolBar() { - if (RS_DIALOGFACTORY == NULL) + if (!RS_DIALOGFACTORY) return; switch (getStatus()) @@ -310,25 +309,24 @@ void RS_ActionDrawText::updateToolBar() } } -void RS_ActionDrawText::setText(const QString & t) +void ActionDrawText::setText(const QString & t) { data.text = t; textChanged = true; } -QString RS_ActionDrawText::getText() +QString ActionDrawText::getText() { return data.text; } -void RS_ActionDrawText::setAngle(double a) +void ActionDrawText::setAngle(double a) { data.angle = a; textChanged = true; } -double RS_ActionDrawText::getAngle() +double ActionDrawText::getAngle() { return data.angle; } - diff --git a/src/actions/rs_actiondrawtext.h b/src/actions/actiondrawtext.h similarity index 78% rename from src/actions/rs_actiondrawtext.h rename to src/actions/actiondrawtext.h index a8e9c46..92c3380 100644 --- a/src/actions/rs_actiondrawtext.h +++ b/src/actions/actiondrawtext.h @@ -1,16 +1,16 @@ -#ifndef RS_ACTIONDRAWTEXT_H -#define RS_ACTIONDRAWTEXT_H +#ifndef __ACTIONDRAWTEXT_H__ +#define __ACTIONDRAWTEXT_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "rs_text.h" /** * This action class can handle user events to draw texts. * - * @author James L. Hammons + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionDrawText: public RS_PreviewActionInterface +class ActionDrawText: public ActionInterface { public: /** @@ -23,8 +23,8 @@ class RS_ActionDrawText: public RS_PreviewActionInterface }; public: - RS_ActionDrawText(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionDrawText(); + ActionDrawText(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionDrawText(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -52,4 +52,4 @@ class RS_ActionDrawText: public RS_PreviewActionInterface bool textChanged; }; -#endif +#endif // __ACTIONDRAWTEXT_H__ diff --git a/src/actions/rs_actioneditcopy.cpp b/src/actions/actioneditcopy.cpp similarity index 66% rename from src/actions/rs_actioneditcopy.cpp rename to src/actions/actioneditcopy.cpp index e174d42..1440318 100644 --- a/src/actions/rs_actioneditcopy.cpp +++ b/src/actions/actioneditcopy.cpp @@ -1,4 +1,4 @@ -// rs_actioneditcopy.cpp +// actioneditcopy.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actioneditcopy.h" +#include "actioneditcopy.h" #include "rs_dialogfactory.h" #include "rs_modification.h" @@ -22,42 +22,39 @@ * * @param undo true for undo and false for redo. */ -RS_ActionEditCopy::RS_ActionEditCopy(bool copy, RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Edit Copy", container, graphicView) +ActionEditCopy::ActionEditCopy(bool copy, RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Edit Copy", container, graphicView) { this->copy = copy; } -RS_ActionEditCopy::~RS_ActionEditCopy() +ActionEditCopy::~ActionEditCopy() { } -void RS_ActionEditCopy::init(int status) +void ActionEditCopy::init(int status) { - RS_ActionInterface::init(status); - //trigger(); + ActionInterface::init(status); } -void RS_ActionEditCopy::trigger() +void ActionEditCopy::trigger() { deleteSnapper(); RS_Modification m(*container, graphicView); m.copy(referencePoint, !copy); - //graphicView->redraw(); finish(); graphicView->killSelectActions(); - //init(getStatus()-1); RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionEditCopy::mouseMoveEvent(QMouseEvent * e) +void ActionEditCopy::mouseMoveEvent(QMouseEvent * e) { snapPoint(e); } -void RS_ActionEditCopy::mouseReleaseEvent(QMouseEvent * e) +void ActionEditCopy::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -71,7 +68,7 @@ void RS_ActionEditCopy::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionEditCopy::coordinateEvent(Vector * e) +void ActionEditCopy::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -80,7 +77,7 @@ void RS_ActionEditCopy::coordinateEvent(Vector * e) trigger(); } -void RS_ActionEditCopy::updateMouseButtonHints() +void ActionEditCopy::updateMouseButtonHints() { switch (getStatus()) { @@ -95,17 +92,15 @@ void RS_ActionEditCopy::updateMouseButtonHints() } } -void RS_ActionEditCopy::updateMouseCursor() +void ActionEditCopy::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionEditCopy::updateToolBar() +void ActionEditCopy::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } - -// EOF diff --git a/src/actions/rs_actioneditcopy.h b/src/actions/actioneditcopy.h similarity index 70% rename from src/actions/rs_actioneditcopy.h rename to src/actions/actioneditcopy.h index 5f97a2f..265077c 100644 --- a/src/actions/rs_actioneditcopy.h +++ b/src/actions/actioneditcopy.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONEDITCOPY_H -#define RS_ACTIONEDITCOPY_H +#ifndef __ACTIONEDITCOPY_H__ +#define __ACTIONEDITCOPY_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events for copying or cutting entities * to the clipboard. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionEditCopy: public RS_ActionInterface +class ActionEditCopy: public ActionInterface { public: /** @@ -21,8 +22,8 @@ class RS_ActionEditCopy: public RS_ActionInterface }; public: - RS_ActionEditCopy(bool copy, RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionEditCopy(); + ActionEditCopy(bool copy, RS_EntityContainer & container, GraphicView & graphicView); + ~ActionEditCopy(); virtual void init(int status = 0); virtual void trigger(); @@ -40,4 +41,4 @@ class RS_ActionEditCopy: public RS_ActionInterface Vector referencePoint; }; -#endif +#endif // __ACTIONEDITCOPY_H__ diff --git a/src/actions/rs_actioneditpaste.cpp b/src/actions/actioneditpaste.cpp similarity index 68% rename from src/actions/rs_actioneditpaste.cpp rename to src/actions/actioneditpaste.cpp index 40f3110..7d4ac42 100644 --- a/src/actions/rs_actioneditpaste.cpp +++ b/src/actions/actioneditpaste.cpp @@ -1,4 +1,4 @@ -// rs_actioneditpaste.cpp +// actioneditpaste.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actioneditpaste.h" +#include "actioneditpaste.h" #include "rs_clipboard.h" #include "rs_dialogfactory.h" @@ -25,22 +25,22 @@ * * @param undo true for undo and false for redo. */ -RS_ActionEditPaste::RS_ActionEditPaste(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Edit Paste", +ActionEditPaste::ActionEditPaste(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Edit Paste", container, graphicView) { } -RS_ActionEditPaste::~RS_ActionEditPaste() +ActionEditPaste::~ActionEditPaste() { } -void RS_ActionEditPaste::init(int status) +void ActionEditPaste::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); //trigger(); } -void RS_ActionEditPaste::trigger() +void ActionEditPaste::trigger() { deleteSnapper(); deletePreview(); @@ -48,13 +48,12 @@ void RS_ActionEditPaste::trigger() RS_Modification m(*container, graphicView); m.paste(RS_PasteData(targetPoint, 1.0, 0.0, false, "")); - //std::cout << *RS_Clipboard::instance(); graphicView->redraw(); finish(); } -void RS_ActionEditPaste::mouseMoveEvent(QMouseEvent * e) +void ActionEditPaste::mouseMoveEvent(QMouseEvent * e) { switch (getStatus()) { @@ -63,16 +62,17 @@ void RS_ActionEditPaste::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); - preview->addAllFrom(*RS_CLIPBOARD->getGraphic()); - preview->move(targetPoint); +// preview->addAllFrom(*RS_CLIPBOARD->getGraphic()); +// preview->move(targetPoint); - if (graphic != NULL) + if (graphic) { RS2::Unit sourceUnit = RS_CLIPBOARD->getGraphic()->getUnit(); RS2::Unit targetUnit = graphic->getUnit(); double f = RS_Units::convert(1.0, sourceUnit, targetUnit); - preview->scale(targetPoint, Vector(f, f)); +// preview->scale(targetPoint, Vector(f, f)); } + drawPreview(); break; @@ -81,7 +81,7 @@ void RS_ActionEditPaste::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionEditPaste::mouseReleaseEvent(QMouseEvent * e) +void ActionEditPaste::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -95,7 +95,7 @@ void RS_ActionEditPaste::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionEditPaste::coordinateEvent(Vector * e) +void ActionEditPaste::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -104,7 +104,7 @@ void RS_ActionEditPaste::coordinateEvent(Vector * e) trigger(); } -void RS_ActionEditPaste::updateMouseButtonHints() +void ActionEditPaste::updateMouseButtonHints() { switch (getStatus()) { @@ -119,17 +119,15 @@ void RS_ActionEditPaste::updateMouseButtonHints() } } -void RS_ActionEditPaste::updateMouseCursor() +void ActionEditPaste::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionEditPaste::updateToolBar() +void ActionEditPaste::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } - -// EOF diff --git a/src/actions/rs_actioneditpaste.h b/src/actions/actioneditpaste.h similarity index 69% rename from src/actions/rs_actioneditpaste.h rename to src/actions/actioneditpaste.h index d910bf4..dd7f3e9 100644 --- a/src/actions/rs_actioneditpaste.h +++ b/src/actions/actioneditpaste.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONEDITPASTE_H -#define RS_ACTIONEDITPASTE_H +#ifndef __ACTIONEDITPASTE_H__ +#define __ACTIONEDITPASTE_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events for pasting entities from * the clipboard into the current document. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionEditPaste: public RS_PreviewActionInterface +class ActionEditPaste: public ActionInterface { public: /** @@ -21,8 +22,8 @@ class RS_ActionEditPaste: public RS_PreviewActionInterface }; public: - RS_ActionEditPaste(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionEditPaste(); + ActionEditPaste(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionEditPaste(); virtual void init(int status = 0); virtual void trigger(); @@ -37,4 +38,4 @@ class RS_ActionEditPaste: public RS_PreviewActionInterface Vector targetPoint; }; -#endif +#endif // __ACTIONEDITPASTE_H__ diff --git a/src/actions/rs_actioneditundo.cpp b/src/actions/actioneditundo.cpp similarity index 67% rename from src/actions/rs_actioneditundo.cpp rename to src/actions/actioneditundo.cpp index 5380adc..17dd207 100644 --- a/src/actions/rs_actioneditundo.cpp +++ b/src/actions/actioneditundo.cpp @@ -1,4 +1,4 @@ -// rs_actioneditundo.cpp +// actioneditundo.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actioneditundo.h" +#include "actioneditundo.h" #include "rs_dialogfactory.h" #include "graphicview.h" @@ -22,22 +22,22 @@ * * @param undo true for undo and false for redo. */ -RS_ActionEditUndo::RS_ActionEditUndo(bool undo, RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Edit Undo", container, graphicView) +ActionEditUndo::ActionEditUndo(bool undo, RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Edit Undo", container, graphicView) { this->undo = undo; } -RS_ActionEditUndo::~RS_ActionEditUndo() +ActionEditUndo::~ActionEditUndo() { } -void RS_ActionEditUndo::init(int status) +void ActionEditUndo::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } -void RS_ActionEditUndo::trigger() +void ActionEditUndo::trigger() { if (undo) document->undo(); @@ -51,4 +51,3 @@ void RS_ActionEditUndo::trigger() finish(); RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } - diff --git a/src/actions/actioneditundo.h b/src/actions/actioneditundo.h new file mode 100644 index 0000000..69633ec --- /dev/null +++ b/src/actions/actioneditundo.h @@ -0,0 +1,26 @@ +#ifndef __ACTIONEDITUNDO_H__ +#define __ACTIONEDITUNDO_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events for undo / redo. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionEditUndo: public ActionInterface +{ + public: + ActionEditUndo(bool undo, RS_EntityContainer & container, GraphicView & graphicView); + ~ActionEditUndo(); + + virtual void init(int status = 0); + virtual void trigger(); + + protected: + /** Undo (true) or redo (false) */ + bool undo; +}; + +#endif // __ACTIONEDITUNDO_H__ diff --git a/src/actions/rs_actionfilenew.cpp b/src/actions/actionfilenew.cpp similarity index 62% rename from src/actions/rs_actionfilenew.cpp rename to src/actions/actionfilenew.cpp index 6ed300a..e44f3d0 100644 --- a/src/actions/rs_actionfilenew.cpp +++ b/src/actions/actionfilenew.cpp @@ -1,4 +1,4 @@ -// rs_actionfilenew.cpp +// actionfilenew.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,24 +12,24 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionfilenew.h" +#include "actionfilenew.h" //#include "drawing.h" -RS_ActionFileNew::RS_ActionFileNew(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("File New", container, graphicView) +ActionFileNew::ActionFileNew(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("File New", container, graphicView) { } -RS_ActionFileNew::~RS_ActionFileNew() +ActionFileNew::~ActionFileNew() { } -void RS_ActionFileNew::trigger() +void ActionFileNew::trigger() { /* // Not supported currently - RS_DEBUG->print("RS_ActionFileNew::trigger"); + RS_DEBUG->print("ActionFileNew::trigger"); QString fileName; //= RS_DIALOGFACTORY->requestFileNewDialog(); if (graphic!=NULL && !fileName.isEmpty()) { @@ -39,9 +39,8 @@ void RS_ActionFileNew::trigger() finish(); } -void RS_ActionFileNew::init(int status) +void ActionFileNew::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionfilenew.h b/src/actions/actionfilenew.h new file mode 100644 index 0000000..a77e0c5 --- /dev/null +++ b/src/actions/actionfilenew.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONFILENEW_H__ +#define __ACTIONFILENEW_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to create new blank documents. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionFileNew: public ActionInterface +{ + public: + ActionFileNew(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionFileNew(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONFILENEW_H__ diff --git a/src/actions/rs_actionfileopen.cpp b/src/actions/actionfileopen.cpp similarity index 61% rename from src/actions/rs_actionfileopen.cpp rename to src/actions/actionfileopen.cpp index a8d1fa8..1a12881 100644 --- a/src/actions/rs_actionfileopen.cpp +++ b/src/actions/actionfileopen.cpp @@ -1,4 +1,4 @@ -// rs_actionfileopen.cpp +// actionfileopen.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,24 +12,24 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionfileopen.h" +#include "actionfileopen.h" //#include "drawing.h" -RS_ActionFileOpen::RS_ActionFileOpen(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("File Open", container, graphicView) +ActionFileOpen::ActionFileOpen(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("File Open", container, graphicView) { } -RS_ActionFileOpen::~RS_ActionFileOpen() +ActionFileOpen::~ActionFileOpen() { } -void RS_ActionFileOpen::trigger() +void ActionFileOpen::trigger() { /* // Not supported currently - RS_DEBUG->print("RS_ActionFileOpen::trigger"); + RS_DEBUG->print("ActionFileOpen::trigger"); QString fileName; //= RS_DIALOGFACTORY->requestFileOpenDialog(); if (graphic!=NULL && !fileName.isEmpty()) { @@ -39,9 +39,8 @@ void RS_ActionFileOpen::trigger() finish(); } -void RS_ActionFileOpen::init(int status) +void ActionFileOpen::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionfileopen.h b/src/actions/actionfileopen.h new file mode 100644 index 0000000..8fb26e1 --- /dev/null +++ b/src/actions/actionfileopen.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONFILEOPEN_H__ +#define __ACTIONFILEOPEN_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to open files. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionFileOpen: public ActionInterface +{ + public: + ActionFileOpen(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionFileOpen(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONFILEOPEN_H__ diff --git a/src/actions/rs_actionfilesave.cpp b/src/actions/actionfilesave.cpp similarity index 55% rename from src/actions/rs_actionfilesave.cpp rename to src/actions/actionfilesave.cpp index 06274c4..363f99d 100644 --- a/src/actions/rs_actionfilesave.cpp +++ b/src/actions/actionfilesave.cpp @@ -1,4 +1,4 @@ -// rs_actionfilesave.cpp +// actionfilesave.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,22 +12,22 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionfilesave.h" +#include "actionfilesave.h" #include "drawing.h" -RS_ActionFileSave::RS_ActionFileSave(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("File Save", container, graphicView) +ActionFileSave::ActionFileSave(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("File Save", container, graphicView) { } -RS_ActionFileSave::~RS_ActionFileSave() +ActionFileSave::~ActionFileSave() { } -void RS_ActionFileSave::trigger() +void ActionFileSave::trigger() { - RS_DEBUG->print("RS_ActionFileSave::trigger"); + RS_DEBUG->print("ActionFileSave::trigger"); if (graphic != NULL) graphic->save(); @@ -35,9 +35,8 @@ void RS_ActionFileSave::trigger() finish(); } -void RS_ActionFileSave::init(int status) +void ActionFileSave::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionfilesave.h b/src/actions/actionfilesave.h new file mode 100644 index 0000000..5587486 --- /dev/null +++ b/src/actions/actionfilesave.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONFILESAVE_H__ +#define __ACTIONFILESAVE_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to save the current file. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionFileSave: public ActionInterface +{ + public: + ActionFileSave(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionFileSave(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONFILESAVE_H__ diff --git a/src/actions/rs_actionfilesaveas.cpp b/src/actions/actionfilesaveas.cpp similarity index 59% rename from src/actions/rs_actionfilesaveas.cpp rename to src/actions/actionfilesaveas.cpp index 000546a..88a2a4d 100644 --- a/src/actions/rs_actionfilesaveas.cpp +++ b/src/actions/actionfilesaveas.cpp @@ -1,4 +1,4 @@ -// rs_actionfilesaveas.cpp +// actionfilesaveas.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,22 +12,22 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionfilesaveas.h" +#include "actionfilesaveas.h" #include "drawing.h" -RS_ActionFileSaveAs::RS_ActionFileSaveAs(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Add Layer", container, graphicView) +ActionFileSaveAs::ActionFileSaveAs(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Add Layer", container, graphicView) { } -RS_ActionFileSaveAs::~RS_ActionFileSaveAs() +ActionFileSaveAs::~ActionFileSaveAs() { } -void RS_ActionFileSaveAs::trigger() +void ActionFileSaveAs::trigger() { - RS_DEBUG->print("RS_ActionFileSaveAs::trigger"); + RS_DEBUG->print("ActionFileSaveAs::trigger"); QString fileName; // = RS_DIALOGFACTORY->requestFileSaveAsDialog(); if (graphic != NULL && !fileName.isEmpty()) @@ -36,9 +36,8 @@ void RS_ActionFileSaveAs::trigger() finish(); } -void RS_ActionFileSaveAs::init(int status) +void ActionFileSaveAs::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionfilesaveas.h b/src/actions/actionfilesaveas.h new file mode 100644 index 0000000..3915cbb --- /dev/null +++ b/src/actions/actionfilesaveas.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONFILESAVEAS_H__ +#define __ACTIONFILESAVEAS_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to export files in various formats. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionFileSaveAs: public ActionInterface +{ + public: + ActionFileSaveAs(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionFileSaveAs(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONFILESAVEAS_H__ diff --git a/src/actions/rs_actioninfoangle.cpp b/src/actions/actioninfoangle.cpp similarity index 76% rename from src/actions/rs_actioninfoangle.cpp rename to src/actions/actioninfoangle.cpp index 31aa8fb..d2bf0e6 100644 --- a/src/actions/rs_actioninfoangle.cpp +++ b/src/actions/actioninfoangle.cpp @@ -1,4 +1,4 @@ -// rs_actioninfoangle.cpp +// actioninfoangle.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,29 +12,29 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actioninfoangle.h" +#include "actioninfoangle.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_information.h" -RS_ActionInfoAngle::RS_ActionInfoAngle(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Info Angle", +ActionInfoAngle::ActionInfoAngle(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Info Angle", container, graphicView) { } -RS_ActionInfoAngle::~RS_ActionInfoAngle() +ActionInfoAngle::~ActionInfoAngle() { } -void RS_ActionInfoAngle::init(int status) +void ActionInfoAngle::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionInfoAngle::trigger() +void ActionInfoAngle::trigger() { - RS_DEBUG->print("RS_ActionInfoAngle::trigger()"); + RS_DEBUG->print("ActionInfoAngle::trigger()"); deleteSnapper(); if (entity1 != NULL && entity2 != NULL) @@ -61,9 +61,9 @@ void RS_ActionInfoAngle::trigger() } } -void RS_ActionInfoAngle::mouseMoveEvent(QMouseEvent * /*e*/) +void ActionInfoAngle::mouseMoveEvent(QMouseEvent * /*e*/) { - RS_DEBUG->print("RS_ActionInfoAngle::mouseMoveEvent begin"); + RS_DEBUG->print("ActionInfoAngle::mouseMoveEvent begin"); switch (getStatus()) { @@ -77,10 +77,10 @@ void RS_ActionInfoAngle::mouseMoveEvent(QMouseEvent * /*e*/) break; } - RS_DEBUG->print("RS_ActionInfoAngle::mouseMoveEvent end"); + RS_DEBUG->print("ActionInfoAngle::mouseMoveEvent end"); } -void RS_ActionInfoAngle::mouseReleaseEvent(QMouseEvent * e) +void ActionInfoAngle::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -123,7 +123,7 @@ void RS_ActionInfoAngle::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionInfoAngle::updateMouseButtonHints() +void ActionInfoAngle::updateMouseButtonHints() { switch (getStatus()) { @@ -143,12 +143,12 @@ void RS_ActionInfoAngle::updateMouseButtonHints() } } -void RS_ActionInfoAngle::updateMouseCursor() +void ActionInfoAngle::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionInfoAngle::updateToolBar() +void ActionInfoAngle::updateToolBar() { switch (getStatus()) { @@ -162,4 +162,3 @@ void RS_ActionInfoAngle::updateToolBar() break; } } - diff --git a/src/actions/rs_actioninfoangle.h b/src/actions/actioninfoangle.h similarity index 70% rename from src/actions/rs_actioninfoangle.h rename to src/actions/actioninfoangle.h index 50bff94..8c878c7 100644 --- a/src/actions/rs_actioninfoangle.h +++ b/src/actions/actioninfoangle.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONINFOANGLE_H -#define RS_ACTIONINFOANGLE_H +#ifndef __ACTIONINFOANGLE_H__ +#define __ACTIONINFOANGLE_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -9,9 +9,10 @@ class RS_Entity; /** * This action class can handle user events to measure angles. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionInfoAngle: public RS_PreviewActionInterface +class ActionInfoAngle: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionInfoAngle: public RS_PreviewActionInterface }; public: - RS_ActionInfoAngle(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionInfoAngle(); + ActionInfoAngle(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionInfoAngle(); virtual void init(int status = 0); virtual void trigger(); @@ -44,4 +45,4 @@ class RS_ActionInfoAngle: public RS_PreviewActionInterface Vector intersection; }; -#endif +#endif // __ACTIONINFOANGLE_H__ diff --git a/src/actions/rs_actioninfoarea.cpp b/src/actions/actioninfoarea.cpp similarity index 65% rename from src/actions/rs_actioninfoarea.cpp rename to src/actions/actioninfoarea.cpp index ae2c2c3..3b87740 100644 --- a/src/actions/rs_actioninfoarea.cpp +++ b/src/actions/actioninfoarea.cpp @@ -1,4 +1,4 @@ -// rs_actioninfoarea.cpp +// actioninfoarea.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,34 +12,34 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actioninfoarea.h" +#include "actioninfoarea.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionInfoArea::RS_ActionInfoArea(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Info Area", +ActionInfoArea::ActionInfoArea(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Info Area", container, graphicView) { } -RS_ActionInfoArea::~RS_ActionInfoArea() +ActionInfoArea::~ActionInfoArea() { } -void RS_ActionInfoArea::init(int status) +void ActionInfoArea::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); currentLine = NULL; closingLine = NULL; - //std::cout << "RS_ActionInfoArea::init: " << status << "\n"; + //std::cout << "ActionInfoArea::init: " << status << "\n"; } -void RS_ActionInfoArea::trigger() +void ActionInfoArea::trigger() { - RS_DEBUG->print("RS_ActionInfoArea::trigger()"); + RS_DEBUG->print("ActionInfoArea::trigger()"); if (ia.isValid()) { @@ -48,7 +48,7 @@ void RS_ActionInfoArea::trigger() double area = ia.getArea(); double circ = ia.getCircumference(); - RS_DEBUG->print("RS_ActionInfoArea::trigger: area: %f", area); + RS_DEBUG->print("ActionInfoArea::trigger: area: %f", area); RS_DIALOGFACTORY->commandMessage(tr("Area: %1").arg(area)); RS_DIALOGFACTORY->commandMessage(tr("Circumference: %1").arg(circ)); } @@ -65,9 +65,9 @@ void RS_ActionInfoArea::trigger() */ } -void RS_ActionInfoArea::mouseMoveEvent(QMouseEvent * e) +void ActionInfoArea::mouseMoveEvent(QMouseEvent * e) { - //RS_DEBUG->print("RS_ActionInfoArea::mouseMoveEvent begin"); + //RS_DEBUG->print("ActionInfoArea::mouseMoveEvent begin"); if (getStatus() == SetFirstPoint || getStatus() == SetNextPoint) @@ -85,31 +85,26 @@ void RS_ActionInfoArea::mouseMoveEvent(QMouseEvent * e) { deletePreview(); - if (currentLine != NULL) + if (currentLine) { - preview->removeEntity(currentLine); +// preview->removeEntity(currentLine); currentLine = NULL; } - if (closingLine != NULL) + if (closingLine) { - preview->removeEntity(closingLine); +// preview->removeEntity(closingLine); closingLine = NULL; } - currentLine = new RS_Line(preview, - RS_LineData(prev, - mouse)); - preview->addEntity(currentLine); +// currentLine = new RS_Line(preview, RS_LineData(prev, mouse)); +// preview->addEntity(currentLine); - if (preview->count() > 1) - { - closingLine = new RS_Line(preview, - RS_LineData(mouse, - point1)); - - preview->addEntity(closingLine); - } +// if (preview->count() > 1) +// { +// closingLine = new RS_Line(preview, RS_LineData(mouse, point1)); +// preview->addEntity(closingLine); +// } drawPreview(); } @@ -119,11 +114,9 @@ void RS_ActionInfoArea::mouseMoveEvent(QMouseEvent * e) break; } } - - //RS_DEBUG->print("RS_ActionInfoArea::mouseMoveEvent end"); } -void RS_ActionInfoArea::mouseReleaseEvent(QMouseEvent * e) +void ActionInfoArea::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -132,9 +125,6 @@ void RS_ActionInfoArea::mouseReleaseEvent(QMouseEvent * e) } else if (e->button() == Qt::RightButton) { - //deletePreview(); - //clearPreview(); - // close the polygon (preview) if (getStatus() == SetNextPoint && prev.valid) { @@ -142,22 +132,18 @@ void RS_ActionInfoArea::mouseReleaseEvent(QMouseEvent * e) if (currentLine != NULL) { - preview->removeEntity(currentLine); +// preview->removeEntity(currentLine); currentLine = NULL; } if (closingLine != NULL) { - preview->removeEntity(closingLine); +// preview->removeEntity(closingLine); closingLine = NULL; } - currentLine = new RS_Line(preview, - RS_LineData(prev, - point1)); - - preview->addEntity(currentLine); - +// currentLine = new RS_Line(preview, RS_LineData(prev, point1)); +// preview->addEntity(currentLine); drawPreview(); } @@ -167,7 +153,7 @@ void RS_ActionInfoArea::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionInfoArea::coordinateEvent(Vector * e) +void ActionInfoArea::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -195,10 +181,6 @@ void RS_ActionInfoArea::coordinateEvent(Vector * e) if (point1.valid) { - //point2 = mouse; - /*deletePreview(); - clearPreview(); - */ ia.addPoint(mouse); RS_DIALOGFACTORY->commandMessage(tr("Point: %1/%2").arg(mouse.x).arg(mouse.y)); @@ -213,8 +195,6 @@ void RS_ActionInfoArea::coordinateEvent(Vector * e) trigger(); setStatus(SetFirstPoint); } - //trigger(); - //setStatus(SetFirstPoint); } break; @@ -223,7 +203,7 @@ void RS_ActionInfoArea::coordinateEvent(Vector * e) } } -void RS_ActionInfoArea::updateMouseButtonHints() +void ActionInfoArea::updateMouseButtonHints() { switch (getStatus()) { @@ -245,12 +225,12 @@ void RS_ActionInfoArea::updateMouseButtonHints() } } -void RS_ActionInfoArea::updateMouseCursor() +void ActionInfoArea::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionInfoArea::updateToolBar() +void ActionInfoArea::updateToolBar() { switch (getStatus()) { @@ -264,5 +244,3 @@ void RS_ActionInfoArea::updateToolBar() break; } } - -// EOF diff --git a/src/actions/rs_actioninfoarea.h b/src/actions/actioninfoarea.h similarity index 74% rename from src/actions/rs_actioninfoarea.h rename to src/actions/actioninfoarea.h index 1d1bcd4..0527155 100644 --- a/src/actions/rs_actioninfoarea.h +++ b/src/actions/actioninfoarea.h @@ -1,8 +1,8 @@ -#ifndef RS_ACTIONINFOAREA_H -#define RS_ACTIONINFOAREA_H +#ifndef __ACTIONINFOAREA_H__ +#define __ACTIONINFOAREA_H__ #include "rs_infoarea.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -11,9 +11,10 @@ class RS_Entity; * This action class can handle user events to measure distances between * two points. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionInfoArea: public RS_PreviewActionInterface +class ActionInfoArea: public ActionInterface { public: /** @@ -25,8 +26,8 @@ class RS_ActionInfoArea: public RS_PreviewActionInterface }; public: - RS_ActionInfoArea(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionInfoArea(); + ActionInfoArea(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionInfoArea(); virtual void init(int status = 0); virtual void trigger(); @@ -45,4 +46,4 @@ class RS_ActionInfoArea: public RS_PreviewActionInterface RS_InfoArea ia; }; -#endif +#endif // __ACTIONINFOAREA_H__ diff --git a/src/actions/rs_actioninfodist.cpp b/src/actions/actioninfodist.cpp similarity index 71% rename from src/actions/rs_actioninfodist.cpp rename to src/actions/actioninfodist.cpp index af59d52..57c744b 100644 --- a/src/actions/rs_actioninfodist.cpp +++ b/src/actions/actioninfodist.cpp @@ -1,4 +1,4 @@ -// rs_actioninfodist.cpp +// actioninfodist.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,29 +12,29 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actioninfodist.h" +#include "actioninfodist.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionInfoDist::RS_ActionInfoDist(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Info Dist", +ActionInfoDist::ActionInfoDist(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Info Dist", container, graphicView) { } -RS_ActionInfoDist::~RS_ActionInfoDist() +ActionInfoDist::~ActionInfoDist() { } -void RS_ActionInfoDist::init(int status) +void ActionInfoDist::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionInfoDist::trigger() +void ActionInfoDist::trigger() { - RS_DEBUG->print("RS_ActionInfoDist::trigger()"); + RS_DEBUG->print("ActionInfoDist::trigger()"); if (point1.valid && point2.valid) { @@ -45,9 +45,9 @@ void RS_ActionInfoDist::trigger() } } -void RS_ActionInfoDist::mouseMoveEvent(QMouseEvent * e) +void ActionInfoDist::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionInfoDist::mouseMoveEvent begin"); + RS_DEBUG->print("ActionInfoDist::mouseMoveEvent begin"); if (getStatus() == SetPoint1 || getStatus() == SetPoint2) @@ -67,11 +67,7 @@ void RS_ActionInfoDist::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); - - preview->addEntity(new RS_Line(preview, - RS_LineData(point1, - point2))); - +// preview->addEntity(new RS_Line(preview, RS_LineData(point1, point2))); drawPreview(); } break; @@ -81,10 +77,10 @@ void RS_ActionInfoDist::mouseMoveEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionInfoDist::mouseMoveEvent end"); + RS_DEBUG->print("ActionInfoDist::mouseMoveEvent end"); } -void RS_ActionInfoDist::mouseReleaseEvent(QMouseEvent * e) +void ActionInfoDist::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -99,7 +95,7 @@ void RS_ActionInfoDist::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionInfoDist::coordinateEvent(Vector * e) +void ActionInfoDist::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -132,7 +128,7 @@ void RS_ActionInfoDist::coordinateEvent(Vector * e) } } -void RS_ActionInfoDist::updateMouseButtonHints() +void ActionInfoDist::updateMouseButtonHints() { switch (getStatus()) { @@ -154,12 +150,12 @@ void RS_ActionInfoDist::updateMouseButtonHints() } } -void RS_ActionInfoDist::updateMouseCursor() +void ActionInfoDist::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionInfoDist::updateToolBar() +void ActionInfoDist::updateToolBar() { switch (getStatus()) { @@ -173,5 +169,3 @@ void RS_ActionInfoDist::updateToolBar() break; } } - -// EOF diff --git a/src/actions/rs_actioninfodist.h b/src/actions/actioninfodist.h similarity index 71% rename from src/actions/rs_actioninfodist.h rename to src/actions/actioninfodist.h index 9209de4..1d3d01e 100644 --- a/src/actions/rs_actioninfodist.h +++ b/src/actions/actioninfodist.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONINFODIST_H -#define RS_ACTIONINFODIST_H +#ifndef __ACTIONINFODIST_H__ +#define __ACTIONINFODIST_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to measure distances between * two points. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionInfoDist: public RS_PreviewActionInterface +class ActionInfoDist: public ActionInterface { public: /** @@ -22,8 +23,8 @@ class RS_ActionInfoDist: public RS_PreviewActionInterface }; public: - RS_ActionInfoDist(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionInfoDist(); + ActionInfoDist(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionInfoDist(); virtual void init(int status = 0); virtual void trigger(); @@ -39,4 +40,4 @@ class RS_ActionInfoDist: public RS_PreviewActionInterface Vector point2; }; -#endif +#endif // __ACTIONINFODIST_H__ diff --git a/src/actions/rs_actioninfodist2.cpp b/src/actions/actioninfodist2.cpp similarity index 63% rename from src/actions/rs_actioninfodist2.cpp rename to src/actions/actioninfodist2.cpp index c8cea15..2bf0028 100644 --- a/src/actions/rs_actioninfodist2.cpp +++ b/src/actions/actioninfodist2.cpp @@ -1,4 +1,4 @@ -// rs_actioninfodist2.cpp +// actioninfodist2.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,29 +12,29 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actioninfodist2.h" +#include "actioninfodist2.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_preview.h" -RS_ActionInfoDist2::RS_ActionInfoDist2(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Info Dist2", container, graphicView) +ActionInfoDist2::ActionInfoDist2(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Info Dist2", container, graphicView) { } -RS_ActionInfoDist2::~RS_ActionInfoDist2() +ActionInfoDist2::~ActionInfoDist2() { } -void RS_ActionInfoDist2::init(int status) +void ActionInfoDist2::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionInfoDist2::trigger() +void ActionInfoDist2::trigger() { - RS_DEBUG->print("RS_ActionInfoDist2::trigger()"); + RS_DEBUG->print("ActionInfoDist2::trigger()"); deleteSnapper(); if (point.valid && entity != NULL) @@ -46,9 +46,9 @@ void RS_ActionInfoDist2::trigger() } } -void RS_ActionInfoDist2::mouseMoveEvent(QMouseEvent * e) +void ActionInfoDist2::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionInfoDist2::mouseMoveEvent begin"); + RS_DEBUG->print("ActionInfoDist2::mouseMoveEvent begin"); switch (getStatus()) { @@ -57,19 +57,19 @@ void RS_ActionInfoDist2::mouseMoveEvent(QMouseEvent * e) break; case SetPoint: - if (entity != NULL) point = snapPoint(e); + break; default: break; } - RS_DEBUG->print("RS_ActionInfoDist2::mouseMoveEvent end"); + RS_DEBUG->print("ActionInfoDist2::mouseMoveEvent end"); } -void RS_ActionInfoDist2::mouseReleaseEvent(QMouseEvent * e) +void ActionInfoDist2::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -82,11 +82,12 @@ void RS_ActionInfoDist2::mouseReleaseEvent(QMouseEvent * e) setStatus(SetPoint); break; - case SetPoint: { + case SetPoint: + { Vector ce(snapPoint(e)); coordinateEvent(&ce); } - break; + break; default: break; @@ -100,7 +101,7 @@ void RS_ActionInfoDist2::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionInfoDist2::coordinateEvent(Vector * e) +void ActionInfoDist2::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -114,20 +115,16 @@ void RS_ActionInfoDist2::coordinateEvent(Vector * e) } } -void RS_ActionInfoDist2::updateMouseButtonHints() +void ActionInfoDist2::updateMouseButtonHints() { switch (getStatus()) { case SetEntity: - RS_DIALOGFACTORY->updateMouseWidget( - tr("Specify entity"), - tr("Cancel")); + RS_DIALOGFACTORY->updateMouseWidget(tr("Specify entity"), tr("Cancel")); break; case SetPoint: - RS_DIALOGFACTORY->updateMouseWidget( - tr("Specify point"), - tr("Back")); + RS_DIALOGFACTORY->updateMouseWidget(tr("Specify point"), tr("Back")); break; default: @@ -136,12 +133,12 @@ void RS_ActionInfoDist2::updateMouseButtonHints() } } -void RS_ActionInfoDist2::updateMouseCursor() +void ActionInfoDist2::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionInfoDist2::updateToolBar() +void ActionInfoDist2::updateToolBar() { switch (getStatus()) { @@ -155,5 +152,3 @@ void RS_ActionInfoDist2::updateToolBar() break; } } - -// EOF diff --git a/src/actions/rs_actioninfodist2.h b/src/actions/actioninfodist2.h similarity index 71% rename from src/actions/rs_actioninfodist2.h rename to src/actions/actioninfodist2.h index c33dfe5..4af31e4 100644 --- a/src/actions/rs_actioninfodist2.h +++ b/src/actions/actioninfodist2.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONINFODIST2_H -#define RS_ACTIONINFODIST2_H +#ifndef __ACTIONINFODIST2_H__ +#define __ACTIONINFODIST2_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -10,9 +10,10 @@ class RS_Entity; * This action class can handle user events to measure distances between * entities and points. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionInfoDist2: public RS_PreviewActionInterface +class ActionInfoDist2: public ActionInterface { public: /** @@ -24,8 +25,8 @@ class RS_ActionInfoDist2: public RS_PreviewActionInterface }; public: - RS_ActionInfoDist2(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionInfoDist2(); + ActionInfoDist2(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionInfoDist2(); virtual void init(int status = 0); virtual void trigger(); @@ -41,4 +42,4 @@ class RS_ActionInfoDist2: public RS_PreviewActionInterface Vector point; }; -#endif +#endif // __ACTIONINFODIST2_H__ diff --git a/src/actions/rs_actioninfoinside.cpp b/src/actions/actioninfoinside.cpp similarity index 67% rename from src/actions/rs_actioninfoinside.cpp rename to src/actions/actioninfoinside.cpp index 5edbf63..7beeaa1 100644 --- a/src/actions/rs_actioninfoinside.cpp +++ b/src/actions/actioninfoinside.cpp @@ -1,4 +1,4 @@ -// rs_actioninfoinside.cpp +// actioninfoinside.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,14 +12,14 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actioninfoinside.h" +#include "actioninfoinside.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_information.h" -RS_ActionInfoInside::RS_ActionInfoInside(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Info Inside", container, graphicView) +ActionInfoInside::ActionInfoInside(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Info Inside", container, graphicView) { contour = new RS_EntityContainer(NULL, false); @@ -28,12 +28,12 @@ RS_ActionInfoInside::RS_ActionInfoInside(RS_EntityContainer & container, Graphic contour->addEntity(e); } -RS_ActionInfoInside::~RS_ActionInfoInside() +ActionInfoInside::~ActionInfoInside() { delete contour; } -void RS_ActionInfoInside::trigger() +void ActionInfoInside::trigger() { deleteSnapper(); bool onContour = false; @@ -46,16 +46,11 @@ void RS_ActionInfoInside::trigger() finish(); } -void RS_ActionInfoInside::mouseMoveEvent(QMouseEvent * /*e*/) +void ActionInfoInside::mouseMoveEvent(QMouseEvent * /*e*/) { - //Vector mouse = snapPoint(e); - //bool onContour = false; - /*if (RS_Information::isPointInsideContour(mouse, contour, &onContour)) { - } else { - }*/ } -void RS_ActionInfoInside::mouseReleaseEvent(QMouseEvent * e) +void ActionInfoInside::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) { @@ -69,7 +64,7 @@ void RS_ActionInfoInside::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionInfoInside::updateMouseButtonHints() +void ActionInfoInside::updateMouseButtonHints() { switch (getStatus()) { @@ -83,16 +78,15 @@ void RS_ActionInfoInside::updateMouseButtonHints() } } -void RS_ActionInfoInside::updateMouseCursor() +void ActionInfoInside::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionInfoInside::updateToolBar() +void ActionInfoInside::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarInfo); } - diff --git a/src/actions/actioninfoinside.h b/src/actions/actioninfoinside.h new file mode 100644 index 0000000..e660683 --- /dev/null +++ b/src/actions/actioninfoinside.h @@ -0,0 +1,32 @@ +#ifndef __ACTIONINFOINSIDE_H__ +#define __ACTIONINFOINSIDE_H__ + +#include "actioninterface.h" +#include "vector.h" + +/** + * This action class can handle user events for checking if a given point is + * inside or outside the selected contour. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionInfoInside: public ActionInterface +{ + public: + ActionInfoInside(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionInfoInside(); + + virtual void trigger(); + virtual void mouseMoveEvent(QMouseEvent * e); + virtual void mouseReleaseEvent(QMouseEvent * e); + virtual void updateMouseButtonHints(); + virtual void updateMouseCursor(); + virtual void updateToolBar(); + + private: + Vector pt; + RS_EntityContainer * contour; +}; + +#endif // __ACTIONINFOINSIDE_H__ diff --git a/src/actions/rs_actioninfototallength.cpp b/src/actions/actioninfototallength.cpp similarity index 62% rename from src/actions/rs_actioninfototallength.cpp rename to src/actions/actioninfototallength.cpp index 40b2605..ae58f00 100644 --- a/src/actions/rs_actioninfototallength.cpp +++ b/src/actions/actioninfototallength.cpp @@ -1,4 +1,4 @@ -// rs_actioninfototallength.cpp +// actioninfototallength.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,35 +12,34 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actioninfototallength.h" +#include "actioninfototallength.h" #include "rs_dialogfactory.h" -RS_ActionInfoTotalLength::RS_ActionInfoTotalLength(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Info Total Length", +ActionInfoTotalLength::ActionInfoTotalLength(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Info Total Length", container, graphicView) { } -RS_ActionInfoTotalLength::~RS_ActionInfoTotalLength() +ActionInfoTotalLength::~ActionInfoTotalLength() { } -void RS_ActionInfoTotalLength::init(int status) +void ActionInfoTotalLength::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } -void RS_ActionInfoTotalLength::trigger() +void ActionInfoTotalLength::trigger() { - RS_DEBUG->print("RS_ActionInfoTotalLength::trigger()"); + RS_DEBUG->print("ActionInfoTotalLength::trigger()"); double len = 0.0; - for (RS_Entity * e = container->firstEntity(RS2::ResolveNone); - e != NULL; - e = container->nextEntity(RS2::ResolveNone)) - + for(RS_Entity * e=container->firstEntity(RS2::ResolveNone); e!=NULL; + e=container->nextEntity(RS2::ResolveNone)) + { if (e->isVisible() && e->isSelected()) { double l = e->getLength(); @@ -53,6 +52,7 @@ void RS_ActionInfoTotalLength::trigger() else len += l; } + } if (len > 0.0) RS_DIALOGFACTORY->commandMessage( @@ -64,7 +64,7 @@ void RS_ActionInfoTotalLength::trigger() finish(); } -void RS_ActionInfoTotalLength::updateToolBar() +void ActionInfoTotalLength::updateToolBar() { if (RS_DIALOGFACTORY != NULL) { @@ -74,5 +74,3 @@ void RS_ActionInfoTotalLength::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } } - -// EOF diff --git a/src/actions/actioninfototallength.h b/src/actions/actioninfototallength.h new file mode 100644 index 0000000..c6ed621 --- /dev/null +++ b/src/actions/actioninfototallength.h @@ -0,0 +1,31 @@ +#ifndef __ACTIONINFOTOTALLENGTH_H__ +#define __ACTIONINFOTOTALLENGTH_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to delete entities. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionInfoTotalLength: public ActionInterface +{ + public: + /** + * Action States. + */ + enum Status { + Acknowledge /**< Acknowledge or cancel. */ + }; + + public: + ActionInfoTotalLength(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionInfoTotalLength(); + + virtual void init(int status = 0); + virtual void trigger(); + virtual void updateToolBar(); +}; + +#endif // __ACTIONINFOTOTALLENGTH_H__ diff --git a/src/actions/rs_actionlayersadd.cpp b/src/actions/actionlayersadd.cpp similarity index 65% rename from src/actions/rs_actionlayersadd.cpp rename to src/actions/actionlayersadd.cpp index 4919653..670731d 100644 --- a/src/actions/rs_actionlayersadd.cpp +++ b/src/actions/actionlayersadd.cpp @@ -1,4 +1,4 @@ -// rs_actionlayersadd.cpp +// actionlayersadd.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,21 +12,21 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionlayersadd.h" +#include "actionlayersadd.h" #include "rs_dialogfactory.h" #include "drawing.h" -RS_ActionLayersAdd::RS_ActionLayersAdd(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Add Layer", container, graphicView) +ActionLayersAdd::ActionLayersAdd(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Add Layer", container, graphicView) { } -RS_ActionLayersAdd::~RS_ActionLayersAdd() +ActionLayersAdd::~ActionLayersAdd() { } -void RS_ActionLayersAdd::trigger() +void ActionLayersAdd::trigger() { RS_DEBUG->print("add layer"); @@ -41,9 +41,8 @@ void RS_ActionLayersAdd::trigger() finish(); } -void RS_ActionLayersAdd::init(int status) +void ActionLayersAdd::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionlayersadd.h b/src/actions/actionlayersadd.h new file mode 100644 index 0000000..b5791c6 --- /dev/null +++ b/src/actions/actionlayersadd.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONLAYERSADD_H__ +#define __ACTIONLAYERSADD_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to add layers. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionLayersAdd: public ActionInterface +{ + public: + ActionLayersAdd(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionLayersAdd(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONLAYERSADD_H__ diff --git a/src/actions/rs_actionlayersedit.cpp b/src/actions/actionlayersedit.cpp similarity index 56% rename from src/actions/rs_actionlayersedit.cpp rename to src/actions/actionlayersedit.cpp index 85ebe06..187fb75 100644 --- a/src/actions/rs_actionlayersedit.cpp +++ b/src/actions/actionlayersedit.cpp @@ -1,4 +1,4 @@ -// rs_actionlayersedit.cpp +// actionlayersedit.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,41 +12,41 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionlayersedit.h" +#include "actionlayersedit.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "drawing.h" -RS_ActionLayersEdit::RS_ActionLayersEdit(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Edit Layer", container, graphicView) +ActionLayersEdit::ActionLayersEdit(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Edit Layer", container, graphicView) { } -RS_ActionLayersEdit::~RS_ActionLayersEdit() +ActionLayersEdit::~ActionLayersEdit() { } -void RS_ActionLayersEdit::trigger() +void ActionLayersEdit::trigger() { - RS_DEBUG->print("RS_ActionLayersEdit::trigger"); + RS_DEBUG->print("ActionLayersEdit::trigger"); RS_Layer * layer = NULL; - if (graphic != NULL) + if (graphic) { layer = RS_DIALOGFACTORY->requestEditLayerDialog(graphic->getLayerList()); - if (layer != NULL) + if (layer) { graphic->editLayer(graphic->getActiveLayer(), *layer); // update updateable entities on the layer that has changed - for (RS_Entity * e = graphic->firstEntity(RS2::ResolveNone); - e != NULL; e = graphic->nextEntity(RS2::ResolveNone)) + for(RS_Entity * e=graphic->firstEntity(RS2::ResolveNone); + e!=NULL; e=graphic->nextEntity(RS2::ResolveNone)) { RS_Layer * l = e->getLayer(); - if (l != NULL && l->getName() == layer->getName()) + if (l && l->getName() == layer->getName()) e->update(); } } @@ -56,10 +56,8 @@ void RS_ActionLayersEdit::trigger() graphicView->redraw(); } -void RS_ActionLayersEdit::init(int status) +void ActionLayersEdit::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - -// EOF diff --git a/src/actions/actionlayersedit.h b/src/actions/actionlayersedit.h new file mode 100644 index 0000000..ccf6c24 --- /dev/null +++ b/src/actions/actionlayersedit.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONLAYERSEDIT_H__ +#define __ACTIONLAYERSEDIT_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to edit layers. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionLayersEdit: public ActionInterface +{ + public: + ActionLayersEdit(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionLayersEdit(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONLAYERSEDIT_H__ diff --git a/src/actions/actionlayersfreezeall.cpp b/src/actions/actionlayersfreezeall.cpp new file mode 100644 index 0000000..13ebe1c --- /dev/null +++ b/src/actions/actionlayersfreezeall.cpp @@ -0,0 +1,44 @@ +// actionlayersfreezeall.cpp +// +// Part of the Architektonas Project +// Originally part of QCad Community Edition by Andrew Mustun +// Extensively rewritten and refactored by James L. Hammons +// (C) 2010 Underground Software +// +// JLH = James L. Hammons +// +// Who When What +// --- ---------- ----------------------------------------------------------- +// JLH 05/22/2010 Added this text. :-) +// + +#include "actionlayersfreezeall.h" + +#include "drawing.h" + +ActionLayersFreezeAll::ActionLayersFreezeAll(bool freeze, + RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Freeze all Layers", container, graphicView) +{ + this->freeze = freeze; +} + +ActionLayersFreezeAll::~ActionLayersFreezeAll() +{ +} + +void ActionLayersFreezeAll::trigger() +{ + RS_DEBUG->print("ActionLayersFreezeAll::trigger"); + + if (graphic) + graphic->freezeAllLayers(freeze); + + finish(); +} + +void ActionLayersFreezeAll::init(int status) +{ + ActionInterface::init(status); + trigger(); +} diff --git a/src/actions/actionlayersfreezeall.h b/src/actions/actionlayersfreezeall.h new file mode 100644 index 0000000..cad0b41 --- /dev/null +++ b/src/actions/actionlayersfreezeall.h @@ -0,0 +1,25 @@ +#ifndef __ACTIONLAYERSFREEZEALL_H__ +#define __ACTIONLAYERSFREEZEALL_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to edit layers. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionLayersFreezeAll: public ActionInterface +{ + public: + ActionLayersFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView); + ~ActionLayersFreezeAll(); + + virtual void init(int status = 0); + virtual void trigger(); + + private: + bool freeze; +}; + +#endif // __ACTIONLAYERSFREEZEALL_H__ diff --git a/src/actions/actionlayersremove.cpp b/src/actions/actionlayersremove.cpp new file mode 100644 index 0000000..ac6bd42 --- /dev/null +++ b/src/actions/actionlayersremove.cpp @@ -0,0 +1,51 @@ +// actionlayersedit.cpp +// +// Part of the Architektonas Project +// Originally part of QCad Community Edition by Andrew Mustun +// Extensively rewritten and refactored by James L. Hammons +// (C) 2010 Underground Software +// +// JLH = James L. Hammons +// +// Who When What +// --- ---------- ----------------------------------------------------------- +// JLH 06/04/2010 Added this text. :-) +// + +#include "actionlayersremove.h" + +#include "rs_dialogfactory.h" +#include "drawing.h" + +ActionLayersRemove::ActionLayersRemove(RS_EntityContainer & container, + GraphicView & graphicView): + ActionInterface("Remove Layer", container, graphicView) +{ +} + +ActionLayersRemove::~ActionLayersRemove() +{ +} + +void ActionLayersRemove::trigger() +{ + RS_DEBUG->print("ActionLayersRemove::trigger"); + + if (graphic) + { + RS_Layer * layer = + RS_DIALOGFACTORY->requestLayerRemovalDialog(graphic->getLayerList()); + + // Now remove the layer from the layer list: + graphic->removeLayer(layer); + } + + finish(); + RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); +} + +void ActionLayersRemove::init(int status) +{ + ActionInterface::init(status); + trigger(); +} diff --git a/src/actions/actionlayersremove.h b/src/actions/actionlayersremove.h new file mode 100644 index 0000000..b48779a --- /dev/null +++ b/src/actions/actionlayersremove.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONLAYERSREMOVE_H__ +#define __ACTIONLAYERSREMOVE_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to remove layers. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionLayersRemove: public ActionInterface +{ + public: + ActionLayersRemove(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionLayersRemove(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONLAYERSREMOVE_H__ diff --git a/src/actions/rs_actionlayerstogglelock.cpp b/src/actions/actionlayerstogglelock.cpp similarity index 72% rename from src/actions/rs_actionlayerstogglelock.cpp rename to src/actions/actionlayerstogglelock.cpp index 578be16..3743f78 100644 --- a/src/actions/rs_actionlayerstogglelock.cpp +++ b/src/actions/actionlayerstogglelock.cpp @@ -1,4 +1,4 @@ -// rs_actionlayerstogglelock.cpp +// actionlayerstogglelock.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,21 +12,21 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionlayerstogglelock.h" +#include "actionlayerstogglelock.h" #include "graphicview.h" #include "drawing.h" -RS_ActionLayersToggleLock::RS_ActionLayersToggleLock(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Toggle Layer Visibility", +ActionLayersToggleLock::ActionLayersToggleLock(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Toggle Layer Visibility", container, graphicView) { } -RS_ActionLayersToggleLock::~RS_ActionLayersToggleLock() +ActionLayersToggleLock::~ActionLayersToggleLock() { } -void RS_ActionLayersToggleLock::trigger() +void ActionLayersToggleLock::trigger() { RS_DEBUG->print("toggle layer"); @@ -58,9 +58,8 @@ void RS_ActionLayersToggleLock::trigger() finish(); } -void RS_ActionLayersToggleLock::init(int status) +void ActionLayersToggleLock::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionlayerstogglelock.h b/src/actions/actionlayerstogglelock.h new file mode 100644 index 0000000..a0cfafa --- /dev/null +++ b/src/actions/actionlayerstogglelock.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONLAYERSTOGGLELOCK_H__ +#define __ACTIONLAYERSTOGGLELOCK_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to edit layers. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionLayersToggleLock: public ActionInterface +{ + public: + ActionLayersToggleLock(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionLayersToggleLock(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONLAYERSTOGGLELOCK_H__ diff --git a/src/actions/rs_actionlayerstoggleview.cpp b/src/actions/actionlayerstoggleview.cpp similarity index 60% rename from src/actions/rs_actionlayerstoggleview.cpp rename to src/actions/actionlayerstoggleview.cpp index 1e824d6..6a1d851 100644 --- a/src/actions/rs_actionlayerstoggleview.cpp +++ b/src/actions/actionlayerstoggleview.cpp @@ -1,4 +1,4 @@ -// rs_actionlayerstoggleview.cpp +// actionlayerstoggleview.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,20 +12,20 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionlayerstoggleview.h" +#include "actionlayerstoggleview.h" #include "drawing.h" -RS_ActionLayersToggleView::RS_ActionLayersToggleView(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Toggle Layer Visibility", +ActionLayersToggleView::ActionLayersToggleView(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Toggle Layer Visibility", container, graphicView) { } -RS_ActionLayersToggleView::~RS_ActionLayersToggleView() +ActionLayersToggleView::~ActionLayersToggleView() { } -void RS_ActionLayersToggleView::trigger() +void ActionLayersToggleView::trigger() { RS_DEBUG->print("toggle layer"); @@ -38,9 +38,8 @@ void RS_ActionLayersToggleView::trigger() finish(); } -void RS_ActionLayersToggleView::init(int status) +void ActionLayersToggleView::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } - diff --git a/src/actions/actionlayerstoggleview.h b/src/actions/actionlayerstoggleview.h new file mode 100644 index 0000000..b283018 --- /dev/null +++ b/src/actions/actionlayerstoggleview.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONLAYERSTOGGLEVIEW_H__ +#define __ACTIONLAYERSTOGGLEVIEW_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to edit layers. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionLayersToggleView: public ActionInterface +{ + public: + ActionLayersToggleView(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionLayersToggleView(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONLAYERSTOGGLEVIEW_H__ diff --git a/src/actions/rs_actionlibraryinsert.cpp b/src/actions/actionlibraryinsert.cpp similarity index 69% rename from src/actions/rs_actionlibraryinsert.cpp rename to src/actions/actionlibraryinsert.cpp index b1a5757..17d0f44 100644 --- a/src/actions/rs_actionlibraryinsert.cpp +++ b/src/actions/actionlibraryinsert.cpp @@ -1,4 +1,4 @@ -// rs_actionlibraryinsert.cpp +// actionlibraryinsert.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionlibraryinsert.h" +#include "actionlibraryinsert.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" @@ -23,23 +23,23 @@ /** * Constructor. */ -RS_ActionLibraryInsert::RS_ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Library Insert", container, graphicView) +ActionLibraryInsert::ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Library Insert", container, graphicView) { } -RS_ActionLibraryInsert::~RS_ActionLibraryInsert() +ActionLibraryInsert::~ActionLibraryInsert() { } -/*virtual*/ RS2::ActionType RS_ActionLibraryInsert::rtti() +/*virtual*/ RS2::ActionType ActionLibraryInsert::rtti() { return RS2::ActionLibraryInsert; } -void RS_ActionLibraryInsert::init(int status) +void ActionLibraryInsert::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); reset(); @@ -52,7 +52,7 @@ void RS_ActionLibraryInsert::init(int status) //trigger(); } -void RS_ActionLibraryInsert::setFile(const QString & file) +void ActionLibraryInsert::setFile(const QString & file) { data.file = file; @@ -60,7 +60,7 @@ void RS_ActionLibraryInsert::setFile(const QString & file) RS_DIALOGFACTORY->commandMessage(tr("Cannot open file '%1'").arg(file)); } -void RS_ActionLibraryInsert::reset() +void ActionLibraryInsert::reset() { /*data = RS_InsertData("", Vector(0.0,0.0), @@ -76,7 +76,7 @@ void RS_ActionLibraryInsert::reset() data.angle = 0.0; } -void RS_ActionLibraryInsert::trigger() +void ActionLibraryInsert::trigger() { deleteSnapper(); deletePreview(); @@ -88,34 +88,28 @@ void RS_ActionLibraryInsert::trigger() graphicView->redraw(); } -void RS_ActionLibraryInsert::mouseMoveEvent(QMouseEvent * e) +void ActionLibraryInsert::mouseMoveEvent(QMouseEvent * e) { switch (getStatus()) { case SetTargetPoint: data.insertionPoint = snapPoint(e); - //if (block!=NULL) { deletePreview(); clearPreview(); - preview->addAllFrom(prev); - preview->move(data.insertionPoint); - preview->scale(data.insertionPoint, - Vector(data.factor, data.factor)); +// preview->addAllFrom(prev); +// preview->move(data.insertionPoint); +// preview->scale(data.insertionPoint, Vector(data.factor, data.factor)); // unit conversion: - if (graphic != NULL) + if (graphic) { double uf = RS_Units::convert(1.0, prev.getUnit(), graphic->getUnit()); - preview->scale(data.insertionPoint, Vector(uf, uf)); +// preview->scale(data.insertionPoint, Vector(uf, uf)); } - preview->rotate(data.insertionPoint, data.angle); - // too slow: - //RS_Creation creation(preview, NULL, false); - //creation.createInsert(data); +// preview->rotate(data.insertionPoint, data.angle); drawPreview(); - //} break; default: @@ -123,7 +117,7 @@ void RS_ActionLibraryInsert::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e) +void ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -137,7 +131,7 @@ void RS_ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionLibraryInsert::coordinateEvent(Vector * e) +void ActionLibraryInsert::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -146,7 +140,7 @@ void RS_ActionLibraryInsert::coordinateEvent(Vector * e) trigger(); } -void RS_ActionLibraryInsert::commandEvent(RS_CommandEvent * e) +void ActionLibraryInsert::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -213,7 +207,7 @@ void RS_ActionLibraryInsert::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionLibraryInsert::getAvailableCommands() +QStringList ActionLibraryInsert::getAvailableCommands() { QStringList cmd; @@ -231,21 +225,21 @@ QStringList RS_ActionLibraryInsert::getAvailableCommands() return cmd; } -void RS_ActionLibraryInsert::showOptions() +void ActionLibraryInsert::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionLibraryInsert::hideOptions() +void ActionLibraryInsert::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionLibraryInsert::updateMouseButtonHints() +void ActionLibraryInsert::updateMouseButtonHints() { switch (getStatus()) { @@ -267,12 +261,12 @@ void RS_ActionLibraryInsert::updateMouseButtonHints() } } -void RS_ActionLibraryInsert::updateMouseCursor() +void ActionLibraryInsert::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionLibraryInsert::updateToolBar() +void ActionLibraryInsert::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -280,23 +274,22 @@ void RS_ActionLibraryInsert::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } -double RS_ActionLibraryInsert::getAngle() +double ActionLibraryInsert::getAngle() { return data.angle; } -void RS_ActionLibraryInsert::setAngle(double a) +void ActionLibraryInsert::setAngle(double a) { data.angle = a; } -double RS_ActionLibraryInsert::getFactor() +double ActionLibraryInsert::getFactor() { return data.factor; } -void RS_ActionLibraryInsert::setFactor(double f) +void ActionLibraryInsert::setFactor(double f) { data.factor = f; } - diff --git a/src/actions/rs_actionlibraryinsert.h b/src/actions/actionlibraryinsert.h similarity index 82% rename from src/actions/rs_actionlibraryinsert.h rename to src/actions/actionlibraryinsert.h index 51e3e44..f69576d 100644 --- a/src/actions/rs_actionlibraryinsert.h +++ b/src/actions/actionlibraryinsert.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONLIBRARYINSERT_H -#define RS_ACTIONLIBRARYINSERT_H +#ifndef __ACTIONLIBRARYINSERT_H__ +#define __ACTIONLIBRARYINSERT_H__ #include "rs_creation.h" #include "drawing.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" /** * This action class can handle user events for inserting library items * (or any other DXF files) into the current drawing (as block/insert). * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionLibraryInsert: public RS_PreviewActionInterface +class ActionLibraryInsert: public ActionInterface { public: /** @@ -28,8 +29,8 @@ class RS_ActionLibraryInsert: public RS_PreviewActionInterface }; public: - RS_ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView); - virtual ~RS_ActionLibraryInsert(); + ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView); + virtual ~ActionLibraryInsert(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -59,4 +60,4 @@ class RS_ActionLibraryInsert: public RS_PreviewActionInterface Status lastStatus; }; -#endif +#endif // __ACTIONLIBRARYINSERT_H__ diff --git a/src/actions/rs_actionlockrelativezero.cpp b/src/actions/actionlockrelativezero.cpp similarity index 60% rename from src/actions/rs_actionlockrelativezero.cpp rename to src/actions/actionlockrelativezero.cpp index 68ccada..944c7e9 100644 --- a/src/actions/rs_actionlockrelativezero.cpp +++ b/src/actions/actionlockrelativezero.cpp @@ -1,4 +1,4 @@ -// rs_actionlockrelativezero.cpp +// actionlockrelativezero.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,30 +12,29 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionlockrelativezero.h" +#include "actionlockrelativezero.h" #include "graphicview.h" -RS_ActionLockRelativeZero::RS_ActionLockRelativeZero( +ActionLockRelativeZero::ActionLockRelativeZero( RS_EntityContainer & container, GraphicView & graphicView, bool on): - RS_ActionInterface("(Un-)lock the relative Zero", container, graphicView) + ActionInterface("(Un-)lock the relative Zero", container, graphicView) { this->on = on; } -RS_ActionLockRelativeZero::~RS_ActionLockRelativeZero() +ActionLockRelativeZero::~ActionLockRelativeZero() { } -void RS_ActionLockRelativeZero::init(int status) +void ActionLockRelativeZero::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); finish(); } -void RS_ActionLockRelativeZero::trigger() +void ActionLockRelativeZero::trigger() { graphicView->lockRelativeZero(on); } - diff --git a/src/actions/actionlockrelativezero.h b/src/actions/actionlockrelativezero.h new file mode 100644 index 0000000..59e1d08 --- /dev/null +++ b/src/actions/actionlockrelativezero.h @@ -0,0 +1,27 @@ +#ifndef __ACTIONLOCKRELATIVEZERO_H__ +#define __ACTIONLOCKRELATIVEZERO_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to lock or unlock + * the relative Zero point. + * It overrides but retains the locking of the relative Zero. + * + * @author James Hammons + * @author Ulf Lehnert + */ +class ActionLockRelativeZero: public ActionInterface +{ + public: + ActionLockRelativeZero(RS_EntityContainer & container, GraphicView & graphicView, bool on); + ~ActionLockRelativeZero(); + + virtual void init(int status = 0); + virtual void trigger(); + + private: + bool on; +}; + +#endif // __ACTIONLOCKRELATIVEZERO_H__ diff --git a/src/actions/rs_actionmodifyattributes.cpp b/src/actions/actionmodifyattributes.cpp similarity index 71% rename from src/actions/rs_actionmodifyattributes.cpp rename to src/actions/actionmodifyattributes.cpp index ee84685..e66d3d4 100644 --- a/src/actions/rs_actionmodifyattributes.cpp +++ b/src/actions/actionmodifyattributes.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifyattributes.cpp +// actionmodifyattributes.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,32 +12,32 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifyattributes.h" +#include "actionmodifyattributes.h" #include "rs_dialogfactory.h" #include "drawing.h" #include "graphicview.h" #include "rs_modification.h" -RS_ActionModifyAttributes::RS_ActionModifyAttributes( +ActionModifyAttributes::ActionModifyAttributes( RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Change Attributes", container, graphicView) + ActionInterface("Change Attributes", container, graphicView) { } -RS_ActionModifyAttributes::~RS_ActionModifyAttributes() +ActionModifyAttributes::~ActionModifyAttributes() { } -void RS_ActionModifyAttributes::init(int status) +void ActionModifyAttributes::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } -void RS_ActionModifyAttributes::trigger() +void ActionModifyAttributes::trigger() { - RS_DEBUG->print("RS_ActionModifyAttributes::trigger()"); + RS_DEBUG->print("ActionModifyAttributes::trigger()"); RS_AttributesData data; data.pen = RS_Pen(); @@ -61,7 +61,7 @@ void RS_ActionModifyAttributes::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionModifyAttributes::updateMouseButtonHints() +void ActionModifyAttributes::updateMouseButtonHints() { switch (getStatus()) { @@ -74,16 +74,15 @@ void RS_ActionModifyAttributes::updateMouseButtonHints() } } -void RS_ActionModifyAttributes::updateMouseCursor() +void ActionModifyAttributes::updateMouseCursor() { graphicView->setMouseCursor(RS2::DelCursor); } -void RS_ActionModifyAttributes::updateToolBar() +void ActionModifyAttributes::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } - diff --git a/src/actions/rs_actionmodifyattributes.h b/src/actions/actionmodifyattributes.h similarity index 55% rename from src/actions/rs_actionmodifyattributes.h rename to src/actions/actionmodifyattributes.h index 6337e0e..58423fd 100644 --- a/src/actions/rs_actionmodifyattributes.h +++ b/src/actions/actionmodifyattributes.h @@ -1,15 +1,16 @@ -#ifndef RS_ACTIONMODIFYATTRIBUTES_H -#define RS_ACTIONMODIFYATTRIBUTES_H +#ifndef __ACTIONMODIFYATTRIBUTES_H__ +#define __ACTIONMODIFYATTRIBUTES_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" /** * This action class can handle user events to change the attributes of * entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyAttributes: public RS_ActionInterface +class ActionModifyAttributes: public ActionInterface { public: /** @@ -20,8 +21,8 @@ class RS_ActionModifyAttributes: public RS_ActionInterface }; public: - RS_ActionModifyAttributes(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyAttributes(); + ActionModifyAttributes(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyAttributes(); virtual void init(int status = 0); virtual void trigger(); @@ -30,4 +31,4 @@ class RS_ActionModifyAttributes: public RS_ActionInterface virtual void updateToolBar(); }; -#endif +#endif // __ACTIONMODIFYATTRIBUTES_H__ diff --git a/src/actions/rs_actionmodifybevel.cpp b/src/actions/actionmodifybevel.cpp similarity index 74% rename from src/actions/rs_actionmodifybevel.cpp rename to src/actions/actionmodifybevel.cpp index 1949c81..0b4ffd2 100644 --- a/src/actions/rs_actionmodifybevel.cpp +++ b/src/actions/actionmodifybevel.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifybevel.cpp +// actionmodifybevel.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,13 +12,13 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifybevel.h" +#include "actionmodifybevel.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "rs_information.h" -RS_ActionModifyBevel::RS_ActionModifyBevel(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Bevel Entities", +ActionModifyBevel::ActionModifyBevel(RS_EntityContainer & container, GraphicView & graphicView): ActionInterface("Bevel Entities", container, graphicView) { entity1 = NULL; @@ -27,34 +27,32 @@ RS_ActionModifyBevel::RS_ActionModifyBevel(RS_EntityContainer & container, Graph coord2 = Vector(false); } -RS_ActionModifyBevel::~RS_ActionModifyBevel() +ActionModifyBevel::~ActionModifyBevel() { } -/*virtual*/ RS2::ActionType RS_ActionModifyBevel::rtti() +/*virtual*/ RS2::ActionType ActionModifyBevel::rtti() { return RS2::ActionModifyBevel; } -void RS_ActionModifyBevel::init(int status) +void ActionModifyBevel::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; +/* snapMode = RS2::SnapFree; + snapRes = RS2::RestrictNothing;*/ } -void RS_ActionModifyBevel::trigger() +void ActionModifyBevel::trigger() { - RS_DEBUG->print("RS_ActionModifyBevel::trigger()"); + RS_DEBUG->print("ActionModifyBevel::trigger()"); - if (entity1 != NULL && entity1->isAtomic() - && entity2 != NULL && entity2->isAtomic()) + if (entity1 && entity1->isAtomic() + && entity2 && entity2->isAtomic()) { RS_Modification m(*container, graphicView); - m.bevel(coord1, (RS_AtomicEntity *)entity1, - coord2, (RS_AtomicEntity *)entity2, - data); + m.bevel(coord1, (RS_AtomicEntity *)entity1, coord2, (RS_AtomicEntity *)entity2, data); entity1 = NULL; entity2 = NULL; @@ -64,9 +62,9 @@ void RS_ActionModifyBevel::trigger() } } -void RS_ActionModifyBevel::mouseMoveEvent(QMouseEvent * e) +void ActionModifyBevel::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyBevel::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyBevel::mouseMoveEvent begin"); Vector mouse = graphicView->toGraph(e->x(), e->y()); RS_Entity * se = catchEntity(e, RS2::ResolveAll); @@ -91,10 +89,10 @@ void RS_ActionModifyBevel::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionModifyBevel::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyBevel::mouseMoveEvent end"); } -void RS_ActionModifyBevel::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyBevel::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -125,7 +123,7 @@ void RS_ActionModifyBevel::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyBevel::commandEvent(RS_CommandEvent * e) +void ActionModifyBevel::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -214,7 +212,7 @@ void RS_ActionModifyBevel::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionModifyBevel::getAvailableCommands() +QStringList ActionModifyBevel::getAvailableCommands() { QStringList cmd; @@ -233,21 +231,21 @@ QStringList RS_ActionModifyBevel::getAvailableCommands() return cmd; } -void RS_ActionModifyBevel::showOptions() +void ActionModifyBevel::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionModifyBevel::hideOptions() +void ActionModifyBevel::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionModifyBevel::updateMouseButtonHints() +void ActionModifyBevel::updateMouseButtonHints() { switch (getStatus()) { @@ -281,43 +279,42 @@ void RS_ActionModifyBevel::updateMouseButtonHints() } } -void RS_ActionModifyBevel::updateMouseCursor() +void ActionModifyBevel::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyBevel::updateToolBar() +void ActionModifyBevel::updateToolBar() { RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify); } -void RS_ActionModifyBevel::setLength1(double l1) +void ActionModifyBevel::setLength1(double l1) { data.length1 = l1; } -double RS_ActionModifyBevel::getLength1() +double ActionModifyBevel::getLength1() { return data.length1; } -void RS_ActionModifyBevel::setLength2(double l2) +void ActionModifyBevel::setLength2(double l2) { data.length2 = l2; } -double RS_ActionModifyBevel::getLength2() +double ActionModifyBevel::getLength2() { return data.length2; } -void RS_ActionModifyBevel::setTrim(bool t) +void ActionModifyBevel::setTrim(bool t) { data.trim = t; } -bool RS_ActionModifyBevel::isTrimOn() +bool ActionModifyBevel::isTrimOn() { return data.trim; } - diff --git a/src/actions/rs_actionmodifybevel.h b/src/actions/actionmodifybevel.h similarity index 80% rename from src/actions/rs_actionmodifybevel.h rename to src/actions/actionmodifybevel.h index 997993d..2718dfd 100644 --- a/src/actions/rs_actionmodifybevel.h +++ b/src/actions/actionmodifybevel.h @@ -1,15 +1,16 @@ -#ifndef RS_ACTIONMODIFYBEVEL_H -#define RS_ACTIONMODIFYBEVEL_H +#ifndef __ACTIONMODIFYBEVEL_H__ +#define __ACTIONMODIFYBEVEL_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "rs_modification.h" /** * This action class can handle user events to bevel corners. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyBevel: public RS_PreviewActionInterface +class ActionModifyBevel: public ActionInterface { public: /** @@ -24,8 +25,8 @@ class RS_ActionModifyBevel: public RS_PreviewActionInterface }; public: - RS_ActionModifyBevel(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyBevel(); + ActionModifyBevel(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyBevel(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -56,4 +57,4 @@ class RS_ActionModifyBevel: public RS_PreviewActionInterface Status lastStatus; }; -#endif +#endif // __ACTIONMODIFYBEVEL_H__ diff --git a/src/actions/rs_actionmodifycut.cpp b/src/actions/actionmodifycut.cpp similarity index 79% rename from src/actions/rs_actionmodifycut.cpp rename to src/actions/actionmodifycut.cpp index 1fa53a6..b9c35f0 100644 --- a/src/actions/rs_actionmodifycut.cpp +++ b/src/actions/actionmodifycut.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifycut.cpp +// actionmodifycut.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,32 +12,32 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifycut.h" +#include "actionmodifycut.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_modification.h" -RS_ActionModifyCut::RS_ActionModifyCut(RS_EntityContainer & container, - GraphicView & graphicView): RS_ActionInterface("Cut Entity", +ActionModifyCut::ActionModifyCut(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Cut Entity", container, graphicView) { cutEntity = NULL; cutCoord = Vector(false); } -RS_ActionModifyCut::~RS_ActionModifyCut() +ActionModifyCut::~ActionModifyCut() { } -void RS_ActionModifyCut::init(int status) +void ActionModifyCut::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionModifyCut::trigger() +void ActionModifyCut::trigger() { - RS_DEBUG->print("RS_ActionModifyCut::trigger()"); + RS_DEBUG->print("ActionModifyCut::trigger()"); if (cutEntity != NULL && cutEntity->isAtomic() && cutCoord.valid && cutEntity->isPointOnEntity(cutCoord)) @@ -56,9 +56,9 @@ void RS_ActionModifyCut::trigger() } } -void RS_ActionModifyCut::mouseMoveEvent(QMouseEvent * e) +void ActionModifyCut::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyCut::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyCut::mouseMoveEvent begin"); switch (getStatus()) { @@ -73,10 +73,10 @@ void RS_ActionModifyCut::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionModifyTrim::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyTrim::mouseMoveEvent end"); } -void RS_ActionModifyCut::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyCut::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -136,7 +136,7 @@ void RS_ActionModifyCut::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyCut::updateMouseButtonHints() +void ActionModifyCut::updateMouseButtonHints() { switch (getStatus()) { @@ -156,12 +156,12 @@ void RS_ActionModifyCut::updateMouseButtonHints() } } -void RS_ActionModifyCut::updateMouseCursor() +void ActionModifyCut::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyCut::updateToolBar() +void ActionModifyCut::updateToolBar() { switch (getStatus()) { diff --git a/src/actions/rs_actionmodifycut.h b/src/actions/actionmodifycut.h similarity index 69% rename from src/actions/rs_actionmodifycut.h rename to src/actions/actionmodifycut.h index 61c73b1..e38ada2 100644 --- a/src/actions/rs_actionmodifycut.h +++ b/src/actions/actionmodifycut.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONMODIFYCUT_H -#define RS_ACTIONMODIFYCUT_H +#ifndef __ACTIONMODIFYCUT_H__ +#define __ACTIONMODIFYCUT_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -9,9 +9,10 @@ class RS_Entity; /** * This action class can handle user events to divide entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyCut: public RS_ActionInterface +class ActionModifyCut: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionModifyCut: public RS_ActionInterface }; public: - RS_ActionModifyCut(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyCut(); + ActionModifyCut(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyCut(); virtual void init(int status = 0); virtual void trigger(); @@ -39,4 +40,4 @@ class RS_ActionModifyCut: public RS_ActionInterface Vector cutCoord; }; -#endif +#endif // __ACTIONMODIFYCUT_H__ diff --git a/src/actions/rs_actionmodifydelete.cpp b/src/actions/actionmodifydelete.cpp similarity index 67% rename from src/actions/rs_actionmodifydelete.cpp rename to src/actions/actionmodifydelete.cpp index abfd500..7c5cc9f 100644 --- a/src/actions/rs_actionmodifydelete.cpp +++ b/src/actions/actionmodifydelete.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifydelete.cpp +// actionmodifydelete.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,31 +12,31 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifydelete.h" +#include "actionmodifydelete.h" #include "rs_dialogfactory.h" #include "graphicview.h" #include "rs_modification.h" -RS_ActionModifyDelete::RS_ActionModifyDelete(RS_EntityContainer & container, - GraphicView & graphicView): RS_ActionInterface("Delete Entities", +ActionModifyDelete::ActionModifyDelete(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Delete Entities", container, graphicView) { } -RS_ActionModifyDelete::~RS_ActionModifyDelete() +ActionModifyDelete::~ActionModifyDelete() { } -void RS_ActionModifyDelete::init(int status) +void ActionModifyDelete::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } -void RS_ActionModifyDelete::trigger() +void ActionModifyDelete::trigger() { - RS_DEBUG->print("RS_ActionModifyDelete::trigger()"); + RS_DEBUG->print("ActionModifyDelete::trigger()"); RS_Modification m(*container, graphicView); m.remove(); finish(); @@ -45,7 +45,7 @@ void RS_ActionModifyDelete::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionModifyDelete::updateMouseButtonHints() +void ActionModifyDelete::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -62,12 +62,12 @@ void RS_ActionModifyDelete::updateMouseButtonHints() } } -void RS_ActionModifyDelete::updateMouseCursor() +void ActionModifyDelete::updateMouseCursor() { graphicView->setMouseCursor(RS2::DelCursor); } -void RS_ActionModifyDelete::updateToolBar() +void ActionModifyDelete::updateToolBar() { if (RS_DIALOGFACTORY != NULL) { @@ -77,4 +77,3 @@ void RS_ActionModifyDelete::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } } - diff --git a/src/actions/rs_actionmodifydelete.h b/src/actions/actionmodifydelete.h similarity index 56% rename from src/actions/rs_actionmodifydelete.h rename to src/actions/actionmodifydelete.h index 49c388a..9c51dd1 100644 --- a/src/actions/rs_actionmodifydelete.h +++ b/src/actions/actionmodifydelete.h @@ -1,14 +1,15 @@ -#ifndef RS_ACTIONMODIFYDELETE_H -#define RS_ACTIONMODIFYDELETE_H +#ifndef __ACTIONMODIFYDELETE_H__ +#define __ACTIONMODIFYDELETE_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" /** * This action class can handle user events to delete entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyDelete: public RS_ActionInterface +class ActionModifyDelete: public ActionInterface { public: /** @@ -19,8 +20,8 @@ class RS_ActionModifyDelete: public RS_ActionInterface }; public: - RS_ActionModifyDelete(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyDelete(); + ActionModifyDelete(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyDelete(); virtual void init(int status = 0); virtual void trigger(); @@ -29,4 +30,4 @@ class RS_ActionModifyDelete: public RS_ActionInterface virtual void updateToolBar(); }; -#endif +#endif // __ACTIONMODIFYDELETE_H__ diff --git a/src/actions/rs_actionmodifydeletefree.cpp b/src/actions/actionmodifydeletefree.cpp similarity index 75% rename from src/actions/rs_actionmodifydeletefree.cpp rename to src/actions/actionmodifydeletefree.cpp index 2a4c8bb..12cc39d 100644 --- a/src/actions/rs_actionmodifydeletefree.cpp +++ b/src/actions/actionmodifydeletefree.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifydeletefree.cpp +// actionmodifydeletefree.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifydeletefree.h" +#include "actionmodifydeletefree.h" #include "rs_dialogfactory.h" #include "graphicview.h" @@ -20,33 +20,32 @@ #include "rs_polyline.h" #include "rs_undo.h" -RS_ActionModifyDeleteFree::RS_ActionModifyDeleteFree( - RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Delete Entities Freehand", - container, graphicView) +ActionModifyDeleteFree::ActionModifyDeleteFree(RS_EntityContainer & container, + GraphicView & graphicView): + ActionInterface("Delete Entities Freehand", container, graphicView) { } -RS_ActionModifyDeleteFree::~RS_ActionModifyDeleteFree() +ActionModifyDeleteFree::~ActionModifyDeleteFree() { } -void RS_ActionModifyDeleteFree::init(int status) +void ActionModifyDeleteFree::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); polyline = NULL; e1 = e2 = NULL; v1 = v2 = Vector(false); - setSnapMode(RS2::SnapOnEntity); +// setSnapMode(RS2::SnapOnEntity); } -void RS_ActionModifyDeleteFree::trigger() +void ActionModifyDeleteFree::trigger() { - if (e1 != NULL && e2 != NULL) + if (e1 && e2) { RS_EntityContainer * parent = e2->getParent(); - if (parent != NULL) + if (parent) { if (parent->rtti() == RS2::EntityPolyline) { @@ -59,10 +58,7 @@ void RS_ActionModifyDeleteFree::trigger() RS_Polyline * pl1; RS_Polyline * pl2; RS_Modification m(*container); - m.splitPolyline(*polyline, - *e1, v1, - *e2, v2, - &pl1, &pl2); + m.splitPolyline(*polyline, *e1, v1, *e2, v2, &pl1, &pl2); if (document) { @@ -95,7 +91,7 @@ void RS_ActionModifyDeleteFree::trigger() RS_DIALOGFACTORY->commandMessage(tr("One of the chosen entities is NULL")); } -void RS_ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) init(getStatus() - 1); @@ -105,13 +101,14 @@ void RS_ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) { case 0: v1 = snapPoint(e); - e1 = getKeyEntity(); +// e1 = getKeyEntity(); + e1 = graphicView->snapper.getKeyEntity(); - if (e1 != NULL) + if (e1) { RS_EntityContainer * parent = e1->getParent(); - if (parent != NULL) + if (parent) { if (parent->rtti() == RS2::EntityPolyline) { @@ -134,9 +131,10 @@ void RS_ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) case 1: v2 = snapPoint(e); - e2 = getKeyEntity(); +// e2 = getKeyEntity(); + e2 = graphicView->snapper.getKeyEntity(); - if (e2 != NULL) + if (e2) trigger(); else RS_DIALOGFACTORY->commandMessage(tr("Second entity is NULL")); @@ -146,19 +144,18 @@ void RS_ActionModifyDeleteFree::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyDeleteFree::updateMouseButtonHints() +void ActionModifyDeleteFree::updateMouseButtonHints() { switch (getStatus()) { case 0: RS_DIALOGFACTORY->updateMouseWidget(tr("Specify first break point " - "on a polyline"), tr("Cancel")); + "on a polyline"), tr("Cancel")); break; case 1: RS_DIALOGFACTORY->updateMouseWidget(tr("Specify second break point " - "on the same polyline"), - tr("Back")); + "on the same polyline"), tr("Back")); break; default: @@ -166,4 +163,3 @@ void RS_ActionModifyDeleteFree::updateMouseButtonHints() break; } } - diff --git a/src/actions/rs_actionmodifydeletefree.h b/src/actions/actionmodifydeletefree.h similarity index 56% rename from src/actions/rs_actionmodifydeletefree.h rename to src/actions/actionmodifydeletefree.h index c88c6ee..694639d 100644 --- a/src/actions/rs_actionmodifydeletefree.h +++ b/src/actions/actionmodifydeletefree.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONMODIFYDELETEFREE_H -#define RS_ACTIONMODIFYDELETEFREE_H +#ifndef __ACTIONMODIFYDELETEFREE_H__ +#define __ACTIONMODIFYDELETEFREE_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -10,13 +10,14 @@ class RS_Polyline; /** * This action class can handle user events to delete entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyDeleteFree: public RS_ActionInterface +class ActionModifyDeleteFree: public ActionInterface { public: - RS_ActionModifyDeleteFree(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyDeleteFree(); + ActionModifyDeleteFree(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyDeleteFree(); virtual void init(int status = 0); virtual void trigger(); @@ -31,4 +32,4 @@ class RS_ActionModifyDeleteFree: public RS_ActionInterface Vector v2; }; -#endif +#endif // __ACTIONMODIFYDELETEFREE_H__ diff --git a/src/actions/rs_actionmodifydeletequick.cpp b/src/actions/actionmodifydeletequick.cpp similarity index 69% rename from src/actions/rs_actionmodifydeletequick.cpp rename to src/actions/actionmodifydeletequick.cpp index 737c30a..6ec8ddd 100644 --- a/src/actions/rs_actionmodifydeletequick.cpp +++ b/src/actions/actionmodifydeletequick.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifydeletequick.cpp +// actionmodifydeletequick.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,28 +12,28 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifydeletequick.h" +#include "actionmodifydeletequick.h" #include "rs_dialogfactory.h" #include "graphicview.h" -RS_ActionModifyDeleteQuick::RS_ActionModifyDeleteQuick( +ActionModifyDeleteQuick::ActionModifyDeleteQuick( RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Quick Delete Entities", container, graphicView) + ActionInterface("Quick Delete Entities", container, graphicView) { en = NULL; } -RS_ActionModifyDeleteQuick::~RS_ActionModifyDeleteQuick() +ActionModifyDeleteQuick::~ActionModifyDeleteQuick() { } /** * Deletes all entities that were selected. */ -void RS_ActionModifyDeleteQuick::trigger() +void ActionModifyDeleteQuick::trigger() { - RS_DEBUG->print("RS_ActionModifyDeleteQuick::trigger()"); + RS_DEBUG->print("ActionModifyDeleteQuick::trigger()"); if (en != NULL) { @@ -57,11 +57,11 @@ void RS_ActionModifyDeleteQuick::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } else - RS_DEBUG->print("RS_ActionModifyDeleteQuick::mousePressEvent:" + RS_DEBUG->print("ActionModifyDeleteQuick::mousePressEvent:" " Entity is NULL\n"); } -void RS_ActionModifyDeleteQuick::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyDeleteQuick::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) init(getStatus() - 1); @@ -72,7 +72,7 @@ void RS_ActionModifyDeleteQuick::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyDeleteQuick::updateMouseButtonHints() +void ActionModifyDeleteQuick::updateMouseButtonHints() { switch (getStatus()) { @@ -87,9 +87,7 @@ void RS_ActionModifyDeleteQuick::updateMouseButtonHints() } } -void RS_ActionModifyDeleteQuick::updateMouseCursor() +void ActionModifyDeleteQuick::updateMouseCursor() { graphicView->setMouseCursor(RS2::DelCursor); } - -// EOF diff --git a/src/actions/rs_actionmodifydeletequick.h b/src/actions/actionmodifydeletequick.h similarity index 51% rename from src/actions/rs_actionmodifydeletequick.h rename to src/actions/actionmodifydeletequick.h index b97efd9..981b54a 100644 --- a/src/actions/rs_actionmodifydeletequick.h +++ b/src/actions/actionmodifydeletequick.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONMODIFYDELETEQUICK_H -#define RS_ACTIONMODIFYDELETEQUICK_H +#ifndef __ACTIONMODIFYDELETEQUICK_H__ +#define __ACTIONMODIFYDELETEQUICK_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" class RS_Entity; @@ -9,13 +9,14 @@ class RS_Entity; * This action class can handle user events to delete entities * directly (every click removes an entity). * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyDeleteQuick: public RS_ActionInterface +class ActionModifyDeleteQuick: public ActionInterface { public: - RS_ActionModifyDeleteQuick(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyDeleteQuick(); + ActionModifyDeleteQuick(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyDeleteQuick(); virtual void trigger(); virtual void mouseReleaseEvent(QMouseEvent * e); @@ -26,4 +27,4 @@ class RS_ActionModifyDeleteQuick: public RS_ActionInterface RS_Entity * en; }; -#endif +#endif // __ACTIONMODIFYDELETEQUICK_H__ diff --git a/src/actions/rs_actionmodifyentity.cpp b/src/actions/actionmodifyentity.cpp similarity index 72% rename from src/actions/rs_actionmodifyentity.cpp rename to src/actions/actionmodifyentity.cpp index 7aaaae4..f491f56 100644 --- a/src/actions/rs_actionmodifyentity.cpp +++ b/src/actions/actionmodifyentity.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifyentity.cpp +// actionmodifyentity.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,23 +12,23 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifyentity.h" +#include "actionmodifyentity.h" #include "rs_dialogfactory.h" #include "graphicview.h" -RS_ActionModifyEntity::RS_ActionModifyEntity(RS_EntityContainer & container, +ActionModifyEntity::ActionModifyEntity(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Modify Entity", container, graphicView) + ActionInterface("Modify Entity", container, graphicView) { en = NULL; } -RS_ActionModifyEntity::~RS_ActionModifyEntity() +ActionModifyEntity::~ActionModifyEntity() { } -void RS_ActionModifyEntity::trigger() +void ActionModifyEntity::trigger() { if (en != NULL) { @@ -61,10 +61,10 @@ void RS_ActionModifyEntity::trigger() } else - RS_DEBUG->print("RS_ActionModifyEntity::trigger: Entity is NULL\n"); + RS_DEBUG->print("ActionModifyEntity::trigger: Entity is NULL\n"); } -void RS_ActionModifyEntity::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyEntity::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) init(getStatus() - 1); @@ -75,9 +75,9 @@ void RS_ActionModifyEntity::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyEntity::updateMouseCursor() +void ActionModifyEntity::updateMouseCursor() { graphicView->setMouseCursor(RS2::SelectCursor); } -// EOF + diff --git a/src/actions/actionmodifyentity.h b/src/actions/actionmodifyentity.h new file mode 100644 index 0000000..991730c --- /dev/null +++ b/src/actions/actionmodifyentity.h @@ -0,0 +1,28 @@ +#ifndef __ACTIONMODIFYENTITY_H__ +#define __ACTIONMODIFYENTITY_H__ + +#include "actioninterface.h" + +class RS_Entity; + +/** + * This action class can handle user events to select entities. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionModifyEntity: public ActionInterface +{ + public: + ActionModifyEntity(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyEntity(); + + virtual void trigger(); + virtual void mouseReleaseEvent(QMouseEvent * e); + virtual void updateMouseCursor(); + + private: + RS_Entity * en; +}; + +#endif // __ACTIONMODIFYENTITY_H__ diff --git a/src/actions/rs_actionmodifyexplodetext.cpp b/src/actions/actionmodifyexplodetext.cpp similarity index 56% rename from src/actions/rs_actionmodifyexplodetext.cpp rename to src/actions/actionmodifyexplodetext.cpp index 62a263c..ee2efcc 100644 --- a/src/actions/rs_actionmodifyexplodetext.cpp +++ b/src/actions/actionmodifyexplodetext.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifyexplodetext.cpp +// actionmodifyexplodetext.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,37 +12,37 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifyexplodetext.h" +#include "actionmodifyexplodetext.h" #include "rs_modification.h" /** * Constructor. */ -RS_ActionModifyExplodeText::RS_ActionModifyExplodeText(RS_EntityContainer & container, - GraphicView & graphicView): RS_PreviewActionInterface("Blocks Explode", +ActionModifyExplodeText::ActionModifyExplodeText(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Blocks Explode", container, graphicView) { } -RS_ActionModifyExplodeText::~RS_ActionModifyExplodeText() +ActionModifyExplodeText::~ActionModifyExplodeText() { } -/*virtual*/ RS2::ActionType RS_ActionModifyExplodeText::rtti() +/*virtual*/ RS2::ActionType ActionModifyExplodeText::rtti() { return RS2::ActionModifyExplodeText; } -void RS_ActionModifyExplodeText::init(int status) +void ActionModifyExplodeText::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); trigger(); finish(); } -void RS_ActionModifyExplodeText::trigger() +void ActionModifyExplodeText::trigger() { RS_Modification m(*container, graphicView); m.explodeTextIntoLetters(); diff --git a/src/actions/actionmodifyexplodetext.h b/src/actions/actionmodifyexplodetext.h new file mode 100644 index 0000000..ee496ed --- /dev/null +++ b/src/actions/actionmodifyexplodetext.h @@ -0,0 +1,24 @@ +#ifndef __ACTIONMODIFYEXPLODETEXT_H__ +#define __ACTIONMODIFYEXPLODETEXT_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events for exploding blocks and + * other entity containers into single entities. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionModifyExplodeText: public ActionInterface +{ + public: + ActionModifyExplodeText(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyExplodeText(); + + virtual RS2::ActionType rtti(); + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONMODIFYEXPLODETEXT_H__ diff --git a/src/actions/rs_actionmodifymirror.cpp b/src/actions/actionmodifymirror.cpp similarity index 73% rename from src/actions/rs_actionmodifymirror.cpp rename to src/actions/actionmodifymirror.cpp index 215a10e..f0f0373 100644 --- a/src/actions/rs_actionmodifymirror.cpp +++ b/src/actions/actionmodifymirror.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifymirror.cpp +// actionmodifymirror.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,28 +12,28 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifymirror.h" +#include "actionmodifymirror.h" #include "rs_dialogfactory.h" #include "rs_preview.h" -RS_ActionModifyMirror::RS_ActionModifyMirror(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Mirror Entities", container, graphicView) +ActionModifyMirror::ActionModifyMirror(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Mirror Entities", container, graphicView) { } -RS_ActionModifyMirror::~RS_ActionModifyMirror() +ActionModifyMirror::~ActionModifyMirror() { } -void RS_ActionModifyMirror::init(int status) +void ActionModifyMirror::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionModifyMirror::trigger() +void ActionModifyMirror::trigger() { - RS_DEBUG->print("RS_ActionModifyMirror::trigger()"); + RS_DEBUG->print("ActionModifyMirror::trigger()"); RS_Modification m(*container, graphicView); m.mirror(data); @@ -42,9 +42,9 @@ void RS_ActionModifyMirror::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionModifyMirror::mouseMoveEvent(QMouseEvent * e) +void ActionModifyMirror::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyMirror::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyMirror::mouseMoveEvent begin"); if (getStatus() == SetAxisPoint1 || getStatus() == SetAxisPoint2) { @@ -64,10 +64,9 @@ void RS_ActionModifyMirror::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); - preview->addSelectionFrom(*container); +/* preview->addSelectionFrom(*container); preview->mirror(axisPoint1, axisPoint2); - preview->addEntity(new RS_Line(preview,RS_LineData(axisPoint1, - axisPoint2))); + preview->addEntity(new RS_Line(preview,RS_LineData(axisPoint1, axisPoint2)));*/ drawPreview(); } break; @@ -77,10 +76,10 @@ void RS_ActionModifyMirror::mouseMoveEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionModifyMirror::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyMirror::mouseMoveEvent end"); } -void RS_ActionModifyMirror::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyMirror::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -95,7 +94,7 @@ void RS_ActionModifyMirror::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyMirror::coordinateEvent(Vector * e) +void ActionModifyMirror::coordinateEvent(Vector * e) { if (!e) return; @@ -134,7 +133,7 @@ void RS_ActionModifyMirror::coordinateEvent(Vector * e) } } -void RS_ActionModifyMirror::updateMouseButtonHints() +void ActionModifyMirror::updateMouseButtonHints() { if (RS_DIALOGFACTORY) { @@ -163,12 +162,12 @@ void RS_ActionModifyMirror::updateMouseButtonHints() } } -void RS_ActionModifyMirror::updateMouseCursor() +void ActionModifyMirror::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyMirror::updateToolBar() +void ActionModifyMirror::updateToolBar() { if (RS_DIALOGFACTORY != NULL) { diff --git a/src/actions/rs_actionmodifymirror.h b/src/actions/actionmodifymirror.h similarity index 71% rename from src/actions/rs_actionmodifymirror.h rename to src/actions/actionmodifymirror.h index feb5398..4c74872 100644 --- a/src/actions/rs_actionmodifymirror.h +++ b/src/actions/actionmodifymirror.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONMODIFYMIRROR_H -#define RS_ACTIONMODIFYMIRROR_H +#ifndef __ACTIONMODIFYMIRROR_H__ +#define __ACTIONMODIFYMIRROR_H__ #include "rs_modification.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to mirror entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyMirror: public RS_PreviewActionInterface +class ActionModifyMirror: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionModifyMirror: public RS_PreviewActionInterface }; public: - RS_ActionModifyMirror(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyMirror(); + ActionModifyMirror(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyMirror(); virtual void init(int status = 0); virtual void trigger(); @@ -41,4 +42,4 @@ class RS_ActionModifyMirror: public RS_PreviewActionInterface Vector axisPoint2; }; -#endif +#endif // __ACTIONMODIFYMIRROR_H__ diff --git a/src/actions/rs_actionmodifymove.cpp b/src/actions/actionmodifymove.cpp similarity index 73% rename from src/actions/rs_actionmodifymove.cpp rename to src/actions/actionmodifymove.cpp index 5a966f7..b0df304 100644 --- a/src/actions/rs_actionmodifymove.cpp +++ b/src/actions/actionmodifymove.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifymove.cpp +// actionmodifymove.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,29 +12,29 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifymove.h" +#include "actionmodifymove.h" #include "rs_dialogfactory.h" #include "rs_preview.h" -RS_ActionModifyMove::RS_ActionModifyMove(RS_EntityContainer & container, +ActionModifyMove::ActionModifyMove(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Move Entities", container, graphicView) + ActionInterface("Move Entities", container, graphicView) { } -RS_ActionModifyMove::~RS_ActionModifyMove() +ActionModifyMove::~ActionModifyMove() { } -void RS_ActionModifyMove::init(int status) +void ActionModifyMove::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionModifyMove::trigger() +void ActionModifyMove::trigger() { - RS_DEBUG->print("RS_ActionModifyMove::trigger()"); + RS_DEBUG->print("ActionModifyMove::trigger()"); RS_Modification m(*container, graphicView); m.move(data); @@ -42,9 +42,9 @@ void RS_ActionModifyMove::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionModifyMove::mouseMoveEvent(QMouseEvent * e) +void ActionModifyMove::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyMove::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyMove::mouseMoveEvent begin"); if (getStatus() == SetReferencePoint || getStatus() == SetTargetPoint) @@ -65,8 +65,8 @@ void RS_ActionModifyMove::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); - preview->addSelectionFrom(*container); - preview->move(targetPoint - referencePoint); +/* preview->addSelectionFrom(*container); + preview->move(targetPoint - referencePoint);*/ drawPreview(); } break; @@ -76,10 +76,10 @@ void RS_ActionModifyMove::mouseMoveEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionModifyMove::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyMove::mouseMoveEvent end"); } -void RS_ActionModifyMove::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyMove::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -94,7 +94,7 @@ void RS_ActionModifyMove::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyMove::coordinateEvent(Vector * e) +void ActionModifyMove::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -127,7 +127,7 @@ void RS_ActionModifyMove::coordinateEvent(Vector * e) } } -void RS_ActionModifyMove::updateMouseButtonHints() +void ActionModifyMove::updateMouseButtonHints() { switch (getStatus()) { @@ -151,12 +151,12 @@ void RS_ActionModifyMove::updateMouseButtonHints() } } -void RS_ActionModifyMove::updateMouseCursor() +void ActionModifyMove::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyMove::updateToolBar() +void ActionModifyMove::updateToolBar() { switch (getStatus()) { @@ -174,4 +174,4 @@ void RS_ActionModifyMove::updateToolBar() } } -// EOF + diff --git a/src/actions/rs_actionmodifymove.h b/src/actions/actionmodifymove.h similarity index 72% rename from src/actions/rs_actionmodifymove.h rename to src/actions/actionmodifymove.h index ebdda4c..7f93a39 100644 --- a/src/actions/rs_actionmodifymove.h +++ b/src/actions/actionmodifymove.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONMODIFYMOVE_H -#define RS_ACTIONMODIFYMOVE_H +#ifndef __ACTIONMODIFYMOVE_H__ +#define __ACTIONMODIFYMOVE_H__ #include "rs_modification.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to move entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyMove: public RS_PreviewActionInterface +class ActionModifyMove: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionModifyMove: public RS_PreviewActionInterface }; public: - RS_ActionModifyMove(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyMove(); + ActionModifyMove(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyMove(); virtual void init(int status = 0); virtual void trigger(); @@ -41,4 +42,4 @@ class RS_ActionModifyMove: public RS_PreviewActionInterface Vector targetPoint; }; -#endif +#endif // __ACTIONMODIFYMOVE_H__ diff --git a/src/actions/rs_actionmodifymoverotate.cpp b/src/actions/actionmodifymoverotate.cpp similarity index 70% rename from src/actions/rs_actionmodifymoverotate.cpp rename to src/actions/actionmodifymoverotate.cpp index 706c9d2..0eec89f 100644 --- a/src/actions/rs_actionmodifymoverotate.cpp +++ b/src/actions/actionmodifymoverotate.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifymoverotate.cpp +// actionmodifymoverotate.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,35 +12,35 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifymoverotate.h" +#include "actionmodifymoverotate.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "rs_preview.h" -RS_ActionModifyMoveRotate::RS_ActionModifyMoveRotate( +ActionModifyMoveRotate::ActionModifyMoveRotate( RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Move and Rotate Entities", container, graphicView) + ActionInterface("Move and Rotate Entities", container, graphicView) { } -RS_ActionModifyMoveRotate::~RS_ActionModifyMoveRotate() +ActionModifyMoveRotate::~ActionModifyMoveRotate() { } -/*virtual*/ RS2::ActionType RS_ActionModifyMoveRotate::rtti() +/*virtual*/ RS2::ActionType ActionModifyMoveRotate::rtti() { return RS2::ActionModifyMoveRotate; } -void RS_ActionModifyMoveRotate::init(int status) +void ActionModifyMoveRotate::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionModifyMoveRotate::trigger() +void ActionModifyMoveRotate::trigger() { - RS_DEBUG->print("RS_ActionModifyMoveRotate::trigger()"); + RS_DEBUG->print("ActionModifyMoveRotate::trigger()"); RS_Modification m(*container, graphicView); m.moveRotate(data); @@ -50,9 +50,9 @@ void RS_ActionModifyMoveRotate::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionModifyMoveRotate::mouseMoveEvent(QMouseEvent * e) +void ActionModifyMoveRotate::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyMoveRotate::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyMoveRotate::mouseMoveEvent begin"); if (getStatus() == SetReferencePoint || getStatus() == SetTargetPoint) { @@ -73,9 +73,9 @@ void RS_ActionModifyMoveRotate::mouseMoveEvent(QMouseEvent * e) deletePreview(); clearPreview(); - preview->addSelectionFrom(*container); +/* preview->addSelectionFrom(*container); preview->rotate(data.referencePoint, data.angle); - preview->move(data.offset); + preview->move(data.offset);*/ drawPreview(); } break; @@ -85,10 +85,10 @@ void RS_ActionModifyMoveRotate::mouseMoveEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionModifyMoveRotate::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyMoveRotate::mouseMoveEvent end"); } -void RS_ActionModifyMoveRotate::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyMoveRotate::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -103,7 +103,7 @@ void RS_ActionModifyMoveRotate::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyMoveRotate::coordinateEvent(Vector * e) +void ActionModifyMoveRotate::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -133,7 +133,7 @@ void RS_ActionModifyMoveRotate::coordinateEvent(Vector * e) } } -void RS_ActionModifyMoveRotate::commandEvent(RS_CommandEvent * e) +void ActionModifyMoveRotate::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -177,7 +177,7 @@ void RS_ActionModifyMoveRotate::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionModifyMoveRotate::getAvailableCommands() +QStringList ActionModifyMoveRotate::getAvailableCommands() { QStringList cmd; @@ -195,25 +195,25 @@ QStringList RS_ActionModifyMoveRotate::getAvailableCommands() return cmd; } -void RS_ActionModifyMoveRotate::showOptions() +void ActionModifyMoveRotate::showOptions() { - //std::cout << "RS_ActionModifyMoveRotate::showOptions()\n"; + //std::cout << "ActionModifyMoveRotate::showOptions()\n"; - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionModifyMoveRotate::hideOptions() +void ActionModifyMoveRotate::hideOptions() { - //std::cout << "RS_ActionModifyMoveRotate::hideOptions()\n"; + //std::cout << "ActionModifyMoveRotate::hideOptions()\n"; - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionModifyMoveRotate::updateMouseButtonHints() +void ActionModifyMoveRotate::updateMouseButtonHints() { switch (getStatus()) { @@ -235,12 +235,12 @@ void RS_ActionModifyMoveRotate::updateMouseButtonHints() } } -void RS_ActionModifyMoveRotate::updateMouseCursor() +void ActionModifyMoveRotate::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyMoveRotate::updateToolBar() +void ActionModifyMoveRotate::updateToolBar() { switch (getStatus()) { @@ -255,12 +255,12 @@ void RS_ActionModifyMoveRotate::updateToolBar() } } -void RS_ActionModifyMoveRotate::setAngle(double a) +void ActionModifyMoveRotate::setAngle(double a) { data.angle = a; } -double RS_ActionModifyMoveRotate::getAngle() +double ActionModifyMoveRotate::getAngle() { return data.angle; } diff --git a/src/actions/rs_actionmodifymoverotate.h b/src/actions/actionmodifymoverotate.h similarity index 78% rename from src/actions/rs_actionmodifymoverotate.h rename to src/actions/actionmodifymoverotate.h index ad09386..ca9c67a 100644 --- a/src/actions/rs_actionmodifymoverotate.h +++ b/src/actions/actionmodifymoverotate.h @@ -1,17 +1,18 @@ -#ifndef RS_ACTIONMODIFYMOVEROTATE_H -#define RS_ACTIONMODIFYMOVEROTATE_H +#ifndef __ACTIONMODIFYMOVEROTATE_H__ +#define __ACTIONMODIFYMOVEROTATE_H__ #include "rs_modification.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to move and at the same * time rotate entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyMoveRotate: public RS_PreviewActionInterface +class ActionModifyMoveRotate: public ActionInterface { public: /** @@ -25,8 +26,8 @@ class RS_ActionModifyMoveRotate: public RS_PreviewActionInterface }; public: - RS_ActionModifyMoveRotate(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyMoveRotate(); + ActionModifyMoveRotate(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyMoveRotate(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -58,4 +59,4 @@ class RS_ActionModifyMoveRotate: public RS_PreviewActionInterface QString cmdAngle3; }; -#endif +#endif // __ACTIONMODIFYMOVEROTATE_H__ diff --git a/src/actions/rs_actionmodifyrotate.cpp b/src/actions/actionmodifyrotate.cpp similarity index 66% rename from src/actions/rs_actionmodifyrotate.cpp rename to src/actions/actionmodifyrotate.cpp index 41efd58..8eb13e6 100644 --- a/src/actions/rs_actionmodifyrotate.cpp +++ b/src/actions/actionmodifyrotate.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifyrotate.cpp +// actionmodifyrotate.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,28 +12,28 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifyrotate.h" +#include "actionmodifyrotate.h" #include "rs_dialogfactory.h" -RS_ActionModifyRotate::RS_ActionModifyRotate(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Rotate Entities", +ActionModifyRotate::ActionModifyRotate(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Rotate Entities", container, graphicView) { } -RS_ActionModifyRotate::~RS_ActionModifyRotate() +ActionModifyRotate::~ActionModifyRotate() { } -void RS_ActionModifyRotate::init(int status) +void ActionModifyRotate::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionModifyRotate::trigger() +void ActionModifyRotate::trigger() { - RS_DEBUG->print("RS_ActionModifyRotate::trigger()"); + RS_DEBUG->print("ActionModifyRotate::trigger()"); RS_Modification m(*container, graphicView); m.rotate(data); @@ -41,9 +41,9 @@ void RS_ActionModifyRotate::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionModifyRotate::mouseMoveEvent(QMouseEvent * e) +void ActionModifyRotate::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyRotate::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyRotate::mouseMoveEvent begin"); if (getStatus() == SetReferencePoint) { @@ -60,10 +60,10 @@ void RS_ActionModifyRotate::mouseMoveEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionModifyRotate::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyRotate::mouseMoveEvent end"); } -void RS_ActionModifyRotate::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyRotate::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -78,7 +78,7 @@ void RS_ActionModifyRotate::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyRotate::coordinateEvent(Vector * e) +void ActionModifyRotate::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -104,7 +104,7 @@ void RS_ActionModifyRotate::coordinateEvent(Vector * e) } } -void RS_ActionModifyRotate::updateMouseButtonHints() +void ActionModifyRotate::updateMouseButtonHints() { switch (getStatus()) { @@ -119,12 +119,12 @@ void RS_ActionModifyRotate::updateMouseButtonHints() } } -void RS_ActionModifyRotate::updateMouseCursor() +void ActionModifyRotate::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyRotate::updateToolBar() +void ActionModifyRotate::updateToolBar() { switch (getStatus()) { @@ -137,5 +137,3 @@ void RS_ActionModifyRotate::updateToolBar() break; } } - -// EOF diff --git a/src/actions/rs_actionmodifyrotate.h b/src/actions/actionmodifyrotate.h similarity index 70% rename from src/actions/rs_actionmodifyrotate.h rename to src/actions/actionmodifyrotate.h index 1569dc2..be88a0e 100644 --- a/src/actions/rs_actionmodifyrotate.h +++ b/src/actions/actionmodifyrotate.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONMODIFYROTATE_H -#define RS_ACTIONMODIFYROTATE_H +#ifndef __ACTIONMODIFYROTATE_H__ +#define __ACTIONMODIFYROTATE_H__ #include "rs_modification.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to move entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyRotate: public RS_PreviewActionInterface +class ActionModifyRotate: public ActionInterface { public: /** @@ -22,8 +23,8 @@ class RS_ActionModifyRotate: public RS_PreviewActionInterface }; public: - RS_ActionModifyRotate(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyRotate(); + ActionModifyRotate(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyRotate(); virtual void init(int status = 0); virtual void trigger(); @@ -40,4 +41,4 @@ class RS_ActionModifyRotate: public RS_PreviewActionInterface Vector targetPoint; }; -#endif +#endif // __ACTIONMODIFYROTATE_H__ diff --git a/src/actions/rs_actionmodifyrotate2.cpp b/src/actions/actionmodifyrotate2.cpp similarity index 61% rename from src/actions/rs_actionmodifyrotate2.cpp rename to src/actions/actionmodifyrotate2.cpp index 0bdabab..b5d6baa 100644 --- a/src/actions/rs_actionmodifyrotate2.cpp +++ b/src/actions/actionmodifyrotate2.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifyrotate2.cpp +// actionmodifyrotate2.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,28 +12,28 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifyrotate2.h" +#include "actionmodifyrotate2.h" #include "rs_dialogfactory.h" -RS_ActionModifyRotate2::RS_ActionModifyRotate2( +ActionModifyRotate2::ActionModifyRotate2( RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Rotate Entities around two centers", container, graphicView) + ActionInterface("Rotate Entities around two centers", container, graphicView) { } -RS_ActionModifyRotate2::~RS_ActionModifyRotate2() +ActionModifyRotate2::~ActionModifyRotate2() { } -void RS_ActionModifyRotate2::init(int status) +void ActionModifyRotate2::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionModifyRotate2::trigger() +void ActionModifyRotate2::trigger() { - RS_DEBUG->print("RS_ActionModifyRotate2::trigger()"); + RS_DEBUG->print("ActionModifyRotate2::trigger()"); RS_Modification m(*container, graphicView); m.rotate2(data); @@ -43,12 +43,11 @@ void RS_ActionModifyRotate2::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionModifyRotate2::mouseMoveEvent(QMouseEvent * e) +void ActionModifyRotate2::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyRotate2::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyRotate2::mouseMoveEvent begin"); - if (getStatus() == SetReferencePoint1 - || getStatus() == SetReferencePoint2) + if (getStatus() == SetReferencePoint1 || getStatus() == SetReferencePoint2) { Vector mouse = snapPoint(e); @@ -62,15 +61,7 @@ void RS_ActionModifyRotate2::mouseMoveEvent(QMouseEvent * e) if (data.center1.valid) data.center2 = mouse; - //data.offset = data.center2-data.center1; - - /*deletePreview(); - clearPreview(); - preview->addSelectionFrom(*container); - preview->rotate(data.center1, data.angle); - preview->move(data.offset); - drawPreview(); - */ + break; default: @@ -78,10 +69,10 @@ void RS_ActionModifyRotate2::mouseMoveEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionModifyRotate2::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyRotate2::mouseMoveEvent end"); } -void RS_ActionModifyRotate2::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyRotate2::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -96,7 +87,7 @@ void RS_ActionModifyRotate2::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyRotate2::coordinateEvent(Vector * e) +void ActionModifyRotate2::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -124,17 +115,17 @@ void RS_ActionModifyRotate2::coordinateEvent(Vector * e) } } -void RS_ActionModifyRotate2::commandEvent(RS_CommandEvent * /*e*/) +void ActionModifyRotate2::commandEvent(RS_CommandEvent * /*e*/) { } -QStringList RS_ActionModifyRotate2::getAvailableCommands() +QStringList ActionModifyRotate2::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionModifyRotate2::updateMouseButtonHints() +void ActionModifyRotate2::updateMouseButtonHints() { switch (getStatus()) { @@ -154,12 +145,12 @@ void RS_ActionModifyRotate2::updateMouseButtonHints() } } -void RS_ActionModifyRotate2::updateMouseCursor() +void ActionModifyRotate2::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyRotate2::updateToolBar() +void ActionModifyRotate2::updateToolBar() { switch (getStatus()) { @@ -173,5 +164,3 @@ void RS_ActionModifyRotate2::updateToolBar() break; } } - -// EOF diff --git a/src/actions/rs_actionmodifyrotate2.h b/src/actions/actionmodifyrotate2.h similarity index 72% rename from src/actions/rs_actionmodifyrotate2.h rename to src/actions/actionmodifyrotate2.h index c74074a..673f255 100644 --- a/src/actions/rs_actionmodifyrotate2.h +++ b/src/actions/actionmodifyrotate2.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONMODIFYROTATE2_H -#define RS_ACTIONMODIFYROTATE2_H +#ifndef __ACTIONMODIFYROTATE2_H__ +#define __ACTIONMODIFYROTATE2_H__ #include "rs_modification.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" /** * This action class can handle user events to rotate entities around * two entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyRotate2: public RS_PreviewActionInterface +class ActionModifyRotate2: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionModifyRotate2: public RS_PreviewActionInterface }; public: - RS_ActionModifyRotate2(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyRotate2(); + ActionModifyRotate2(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyRotate2(); virtual void init(int status = 0); virtual void trigger(); @@ -41,4 +42,4 @@ class RS_ActionModifyRotate2: public RS_PreviewActionInterface RS_Rotate2Data data; }; -#endif +#endif // __ACTIONMODIFYROTATE2_H__ diff --git a/src/actions/rs_actionmodifyround.cpp b/src/actions/actionmodifyround.cpp similarity index 71% rename from src/actions/rs_actionmodifyround.cpp rename to src/actions/actionmodifyround.cpp index 530ddfa..4eb96d4 100644 --- a/src/actions/rs_actionmodifyround.cpp +++ b/src/actions/actionmodifyround.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifyround.cpp +// actionmodifyround.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,15 +12,15 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifyround.h" +#include "actionmodifyround.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "rs_information.h" #include "rs_preview.h" -RS_ActionModifyRound::RS_ActionModifyRound(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Round Entities", container, graphicView) +ActionModifyRound::ActionModifyRound(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Round Entities", container, graphicView) { entity1 = NULL; entity2 = NULL; @@ -28,26 +28,26 @@ RS_ActionModifyRound::RS_ActionModifyRound(RS_EntityContainer & container, Graph coord2 = Vector(false); } -RS_ActionModifyRound::~RS_ActionModifyRound() +ActionModifyRound::~ActionModifyRound() { } -/*virtual*/ RS2::ActionType RS_ActionModifyRound::rtti() +/*virtual*/ RS2::ActionType ActionModifyRound::rtti() { return RS2::ActionModifyRound; } -void RS_ActionModifyRound::init(int status) +void ActionModifyRound::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; +/* snapMode = RS2::SnapFree; + snapRes = RS2::RestrictNothing;*/ } -void RS_ActionModifyRound::trigger() +void ActionModifyRound::trigger() { - RS_DEBUG->print("RS_ActionModifyRound::trigger()"); + RS_DEBUG->print("ActionModifyRound::trigger()"); if (entity1 != NULL && entity1->isAtomic() && entity2 != NULL && entity2->isAtomic()) @@ -55,14 +55,9 @@ void RS_ActionModifyRound::trigger() deletePreview(); RS_Modification m(*container, graphicView); - m.round(coord2, - coord1, - (RS_AtomicEntity *)entity1, - coord2, - (RS_AtomicEntity *)entity2, - data); - - //coord = Vector(false); + m.round(coord2, coord1, (RS_AtomicEntity *)entity1, coord2, + (RS_AtomicEntity *)entity2, data); + coord1 = Vector(false); entity1 = NULL; coord2 = Vector(false); @@ -76,9 +71,9 @@ void RS_ActionModifyRound::trigger() } } -void RS_ActionModifyRound::mouseMoveEvent(QMouseEvent * e) +void ActionModifyRound::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyRound::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyRound::mouseMoveEvent begin"); Vector mouse = graphicView->toGraph(e->x(), e->y()); RS_Entity * se = catchEntity(e, RS2::ResolveAll); @@ -99,28 +94,22 @@ void RS_ActionModifyRound::mouseMoveEvent(QMouseEvent * e) { deletePreview(); clearPreview(); - //preview->addSelectionFrom(*container); - //preview->move(targetPoint-referencePoint); - RS_Entity * tmp1 = entity1->clone(); - RS_Entity * tmp2 = entity2->clone(); - tmp1->reparent(preview); - tmp2->reparent(preview); - preview->addEntity(tmp1); - preview->addEntity(tmp2); - - bool trim = data.trim; +/* RS_Entity * tmp1 = entity1->clone(); + RS_Entity * tmp2 = entity2->clone();*/ +// tmp1->reparent(preview); +// tmp2->reparent(preview); +// preview->addEntity(tmp1); +// preview->addEntity(tmp2); + +/* bool trim = data.trim; data.trim = false; RS_Modification m(*preview, NULL, false); - m.round(coord2, - coord1, - (RS_AtomicEntity *)tmp1, - coord2, - (RS_AtomicEntity *)tmp2, - data); + m.round(coord2, coord1, (RS_AtomicEntity *)tmp1, coord2, + (RS_AtomicEntity *)tmp2, data); data.trim = trim; preview->removeEntity(tmp1); - preview->removeEntity(tmp2); + preview->removeEntity(tmp2);*/ drawPreview(); } break; @@ -129,10 +118,10 @@ void RS_ActionModifyRound::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionModifyRound::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyRound::mouseMoveEvent end"); } -void RS_ActionModifyRound::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyRound::mouseReleaseEvent(QMouseEvent * e) { Vector mouse = graphicView->toGraph(e->x(), e->y()); RS_Entity * se = catchEntity(e, RS2::ResolveAll); @@ -172,7 +161,7 @@ void RS_ActionModifyRound::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyRound::commandEvent(RS_CommandEvent * e) +void ActionModifyRound::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -246,7 +235,7 @@ void RS_ActionModifyRound::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionModifyRound::getAvailableCommands() +QStringList ActionModifyRound::getAvailableCommands() { QStringList cmd; @@ -264,23 +253,23 @@ QStringList RS_ActionModifyRound::getAvailableCommands() return cmd; } -void RS_ActionModifyRound::showOptions() +void ActionModifyRound::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionModifyRound::hideOptions() +void ActionModifyRound::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionModifyRound::updateMouseButtonHints() +void ActionModifyRound::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -312,33 +301,33 @@ void RS_ActionModifyRound::updateMouseButtonHints() } } -void RS_ActionModifyRound::updateMouseCursor() +void ActionModifyRound::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyRound::updateToolBar() +void ActionModifyRound::updateToolBar() { if (RS_DIALOGFACTORY != NULL) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify); } -void RS_ActionModifyRound::setRadius(double r) +void ActionModifyRound::setRadius(double r) { data.radius = r; } -double RS_ActionModifyRound::getRadius() +double ActionModifyRound::getRadius() { return data.radius; } -void RS_ActionModifyRound::setTrim(bool t) +void ActionModifyRound::setTrim(bool t) { data.trim = t; } -bool RS_ActionModifyRound::isTrimOn() +bool ActionModifyRound::isTrimOn() { return data.trim; } diff --git a/src/actions/rs_actionmodifyround.h b/src/actions/actionmodifyround.h similarity index 79% rename from src/actions/rs_actionmodifyround.h rename to src/actions/actionmodifyround.h index 27efe84..fab4bed 100644 --- a/src/actions/rs_actionmodifyround.h +++ b/src/actions/actionmodifyround.h @@ -1,8 +1,8 @@ -#ifndef RS_ACTIONMODIFYROUND_H -#define RS_ACTIONMODIFYROUND_H +#ifndef __ACTIONMODIFYROUND_H__ +#define __ACTIONMODIFYROUND_H__ #include "rs_modification.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -10,9 +10,10 @@ class RS_Entity; /** * This action class can handle user events to round corners. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyRound: public RS_PreviewActionInterface +class ActionModifyRound: public ActionInterface { public: /** @@ -26,8 +27,8 @@ class RS_ActionModifyRound: public RS_PreviewActionInterface }; public: - RS_ActionModifyRound(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyRound(); + ActionModifyRound(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyRound(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -56,4 +57,4 @@ class RS_ActionModifyRound: public RS_PreviewActionInterface Status lastStatus; }; -#endif +#endif // __ACTIONMODIFYROUND_H__ diff --git a/src/actions/rs_actionmodifyscale.cpp b/src/actions/actionmodifyscale.cpp similarity index 59% rename from src/actions/rs_actionmodifyscale.cpp rename to src/actions/actionmodifyscale.cpp index c8168f6..4b6b482 100644 --- a/src/actions/rs_actionmodifyscale.cpp +++ b/src/actions/actionmodifyscale.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifyscale.cpp +// actionmodifyscale.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,28 +12,27 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifyscale.h" +#include "actionmodifyscale.h" #include "rs_dialogfactory.h" -RS_ActionModifyScale::RS_ActionModifyScale(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Scale Entities", - container, graphicView) +ActionModifyScale::ActionModifyScale(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Scale Entities", container, graphicView) { } -RS_ActionModifyScale::~RS_ActionModifyScale() +ActionModifyScale::~ActionModifyScale() { } -void RS_ActionModifyScale::init(int status) +void ActionModifyScale::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionModifyScale::trigger() +void ActionModifyScale::trigger() { - RS_DEBUG->print("RS_ActionModifyScale::trigger()"); + RS_DEBUG->print("ActionModifyScale::trigger()"); RS_Modification m(*container, graphicView); m.scale(data); @@ -41,9 +40,9 @@ void RS_ActionModifyScale::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionModifyScale::mouseMoveEvent(QMouseEvent * e) +void ActionModifyScale::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyScale::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyScale::mouseMoveEvent begin"); if (getStatus() == SetReferencePoint) { @@ -60,10 +59,10 @@ void RS_ActionModifyScale::mouseMoveEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionModifyScale::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyScale::mouseMoveEvent end"); } -void RS_ActionModifyScale::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyScale::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -94,17 +93,12 @@ void RS_ActionModifyScale::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyScale::updateMouseButtonHints() +void ActionModifyScale::updateMouseButtonHints() { switch (getStatus()) { - /*case Select: - RS_DIALOGFACTORY->updateMouseWidget(tr("Pick entities to scale"), - tr("Cancel")); - break;*/ case SetReferencePoint: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), - tr("Cancel")); + RS_DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel")); break; default: @@ -113,18 +107,15 @@ void RS_ActionModifyScale::updateMouseButtonHints() } } -void RS_ActionModifyScale::updateMouseCursor() +void ActionModifyScale::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyScale::updateToolBar() +void ActionModifyScale::updateToolBar() { switch (getStatus()) { - /*case Select: - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect); - break;*/ case SetReferencePoint: RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); break; @@ -134,5 +125,3 @@ void RS_ActionModifyScale::updateToolBar() break; } } - -// EOF diff --git a/src/actions/rs_actionmodifyscale.h b/src/actions/actionmodifyscale.h similarity index 69% rename from src/actions/rs_actionmodifyscale.h rename to src/actions/actionmodifyscale.h index 099672e..3a070cb 100644 --- a/src/actions/rs_actionmodifyscale.h +++ b/src/actions/actionmodifyscale.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONMODIFYSCALE_H -#define RS_ACTIONMODIFYSCALE_H +#ifndef __ACTIONMODIFYSCALE_H__ +#define __ACTIONMODIFYSCALE_H__ #include "rs_modification.h" -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to move entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyScale: public RS_PreviewActionInterface +class ActionModifyScale: public ActionInterface { public: /** @@ -22,8 +23,8 @@ class RS_ActionModifyScale: public RS_PreviewActionInterface }; public: - RS_ActionModifyScale(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyScale(); + ActionModifyScale(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyScale(); virtual void init(int status = 0); virtual void trigger(); @@ -39,4 +40,4 @@ class RS_ActionModifyScale: public RS_PreviewActionInterface Vector targetPoint; }; -#endif +#endif // __ACTIONMODIFYSCALE_H__ diff --git a/src/actions/rs_actionmodifystretch.cpp b/src/actions/actionmodifystretch.cpp similarity index 63% rename from src/actions/rs_actionmodifystretch.cpp rename to src/actions/actionmodifystretch.cpp index df7c9ae..d9568af 100644 --- a/src/actions/rs_actionmodifystretch.cpp +++ b/src/actions/actionmodifystretch.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifystretch.cpp +// actionmodifystretch.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,14 +12,14 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifystretch.h" +#include "actionmodifystretch.h" #include "rs_dialogfactory.h" #include "rs_modification.h" #include "rs_preview.h" -RS_ActionModifyStretch::RS_ActionModifyStretch(RS_EntityContainer & container, - GraphicView & graphicView): RS_PreviewActionInterface("Stretch Entities", +ActionModifyStretch::ActionModifyStretch(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Stretch Entities", container, graphicView) { firstCorner = Vector(false); @@ -28,18 +28,18 @@ RS_ActionModifyStretch::RS_ActionModifyStretch(RS_EntityContainer & container, targetPoint = Vector(false); } -RS_ActionModifyStretch::~RS_ActionModifyStretch() +ActionModifyStretch::~ActionModifyStretch() { } -void RS_ActionModifyStretch::init(int status) +void ActionModifyStretch::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); } -void RS_ActionModifyStretch::trigger() +void ActionModifyStretch::trigger() { - RS_DEBUG->print("RS_ActionModifyStretch::trigger()"); + RS_DEBUG->print("ActionModifyStretch::trigger()"); deletePreview(); clearPreview(); @@ -56,9 +56,9 @@ void RS_ActionModifyStretch::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } -void RS_ActionModifyStretch::mouseMoveEvent(QMouseEvent * e) +void ActionModifyStretch::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyStretch::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyStretch::mouseMoveEvent begin"); Vector mouse = snapPoint(e); @@ -68,67 +68,53 @@ void RS_ActionModifyStretch::mouseMoveEvent(QMouseEvent * e) break; case SetSecondCorner: - if (firstCorner.valid) { secondCorner = snapPoint(e); deletePreview(); clearPreview(); +/* preview->addEntity( + new RS_Line(preview, RS_LineData(Vector(firstCorner.x, firstCorner.y), + Vector(secondCorner.x, firstCorner.y)))); preview->addEntity( - new RS_Line(preview, - RS_LineData(Vector(firstCorner.x, - firstCorner.y), - Vector(secondCorner.x, - firstCorner.y)))); - preview->addEntity( - new RS_Line(preview, - RS_LineData(Vector(secondCorner.x, - firstCorner.y), - Vector(secondCorner.x, - secondCorner.y)))); + new RS_Line(preview, RS_LineData(Vector(secondCorner.x, firstCorner.y), + Vector(secondCorner.x, secondCorner.y)))); preview->addEntity( - new RS_Line(preview, - RS_LineData(Vector(secondCorner.x, - secondCorner.y), - Vector(firstCorner.x, - secondCorner.y)))); + new RS_Line(preview, RS_LineData(Vector(secondCorner.x, secondCorner.y), + Vector(firstCorner.x, secondCorner.y)))); preview->addEntity( - new RS_Line(preview, - RS_LineData(Vector(firstCorner.x, - secondCorner.y), - Vector(firstCorner.x, - firstCorner.y)))); + new RS_Line(preview, RS_LineData(Vector(firstCorner.x, secondCorner.y), + Vector(firstCorner.x, firstCorner.y))));*/ drawPreview(); } + break; case SetReferencePoint: break; case SetTargetPoint: - if (referencePoint.valid) { targetPoint = mouse; deletePreview(); clearPreview(); - preview->addStretchablesFrom(*container, firstCorner, secondCorner); - //preview->move(targetPoint-referencePoint); - preview->stretch(firstCorner, secondCorner, - targetPoint - referencePoint); +/* preview->addStretchablesFrom(*container, firstCorner, secondCorner); + preview->stretch(firstCorner, secondCorner, targetPoint - referencePoint);*/ drawPreview(); } + break; default: break; } - RS_DEBUG->print("RS_ActionModifyStretch::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyStretch::mouseMoveEvent end"); } -void RS_ActionModifyStretch::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyStretch::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -143,7 +129,7 @@ void RS_ActionModifyStretch::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyStretch::coordinateEvent(Vector * e) +void ActionModifyStretch::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -182,7 +168,7 @@ void RS_ActionModifyStretch::coordinateEvent(Vector * e) } } -void RS_ActionModifyStretch::updateMouseButtonHints() +void ActionModifyStretch::updateMouseButtonHints() { switch (getStatus()) { @@ -212,12 +198,12 @@ void RS_ActionModifyStretch::updateMouseButtonHints() } } -void RS_ActionModifyStretch::updateMouseCursor() +void ActionModifyStretch::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyStretch::updateToolBar() +void ActionModifyStretch::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -225,4 +211,4 @@ void RS_ActionModifyStretch::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify); } -// EOF + diff --git a/src/actions/rs_actionmodifystretch.h b/src/actions/actionmodifystretch.h similarity index 72% rename from src/actions/rs_actionmodifystretch.h rename to src/actions/actionmodifystretch.h index a6cd584..6b96d28 100644 --- a/src/actions/rs_actionmodifystretch.h +++ b/src/actions/actionmodifystretch.h @@ -1,17 +1,17 @@ -#ifndef RS_ACTIONMODIFYSTRETCH_H -#define RS_ACTIONMODIFYSTRETCH_H +#ifndef __ACTIONMODIFYSTRETCH_H__ +#define __ACTIONMODIFYSTRETCH_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to move entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyStretch: public RS_PreviewActionInterface +class ActionModifyStretch: public ActionInterface { - //Q_OBJECT public: /** * Action States. @@ -24,8 +24,8 @@ class RS_ActionModifyStretch: public RS_PreviewActionInterface }; public: - RS_ActionModifyStretch(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyStretch(); + ActionModifyStretch(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyStretch(); virtual void init(int status = 0); virtual void trigger(); @@ -43,4 +43,4 @@ class RS_ActionModifyStretch: public RS_PreviewActionInterface Vector targetPoint; }; -#endif +#endif // __ACTIONMODIFYSTRETCH_H__ diff --git a/src/actions/rs_actionmodifytrim.cpp b/src/actions/actionmodifytrim.cpp similarity index 71% rename from src/actions/rs_actionmodifytrim.cpp rename to src/actions/actionmodifytrim.cpp index 6ba19ea..4cb2389 100644 --- a/src/actions/rs_actionmodifytrim.cpp +++ b/src/actions/actionmodifytrim.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifytrim.cpp +// actionmodifytrim.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actionmodifytrim.h" +#include "actionmodifytrim.h" #include "rs_dialogfactory.h" #include "rs_modification.h" @@ -20,8 +20,8 @@ /** * @param both Trim both entities. */ -RS_ActionModifyTrim::RS_ActionModifyTrim(RS_EntityContainer & container, - GraphicView & graphicView, bool both): RS_PreviewActionInterface("Trim Entity", +ActionModifyTrim::ActionModifyTrim(RS_EntityContainer & container, + GraphicView & graphicView, bool both): ActionInterface("Trim Entity", container, graphicView) { trimEntity = NULL; @@ -31,29 +31,27 @@ RS_ActionModifyTrim::RS_ActionModifyTrim(RS_EntityContainer & container, this->both = both; } -RS_ActionModifyTrim::~RS_ActionModifyTrim() +ActionModifyTrim::~ActionModifyTrim() { } -void RS_ActionModifyTrim::init(int status) +void ActionModifyTrim::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; +/* snapMode = RS2::SnapFree; + snapRes = RS2::RestrictNothing;*/ } -void RS_ActionModifyTrim::trigger() +void ActionModifyTrim::trigger() { - RS_DEBUG->print("RS_ActionModifyTrim::trigger()"); + RS_DEBUG->print("ActionModifyTrim::trigger()"); - if (trimEntity != NULL && trimEntity->isAtomic() - && limitEntity != NULL /* && limitEntity->isAtomic()*/) + if (trimEntity && trimEntity->isAtomic() && limitEntity) { RS_Modification m(*container, graphicView); m.trim(trimCoord, (RS_AtomicEntity *)trimEntity, - limitCoord, /*(RS_AtomicEntity*)*/ limitEntity, - both); + limitCoord, limitEntity, both); trimEntity = NULL; @@ -70,9 +68,9 @@ void RS_ActionModifyTrim::trigger() } } -void RS_ActionModifyTrim::mouseMoveEvent(QMouseEvent * e) +void ActionModifyTrim::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionModifyTrim::mouseMoveEvent begin"); + RS_DEBUG->print("ActionModifyTrim::mouseMoveEvent begin"); Vector mouse = graphicView->toGraph(e->x(), e->y()); RS_Entity * se = catchEntity(e); @@ -93,10 +91,10 @@ void RS_ActionModifyTrim::mouseMoveEvent(QMouseEvent * e) break; } - RS_DEBUG->print("RS_ActionModifyTrim::mouseMoveEvent end"); + RS_DEBUG->print("ActionModifyTrim::mouseMoveEvent end"); } -void RS_ActionModifyTrim::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyTrim::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -109,7 +107,7 @@ void RS_ActionModifyTrim::mouseReleaseEvent(QMouseEvent * e) limitCoord = mouse; limitEntity = se; - if (limitEntity != NULL /*&& limitEntity->isAtomic()*/) + if (limitEntity) { limitEntity->setHighlighted(true); graphicView->drawEntity(limitEntity); @@ -143,7 +141,7 @@ void RS_ActionModifyTrim::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyTrim::updateMouseButtonHints() +void ActionModifyTrim::updateMouseButtonHints() { switch (getStatus()) { @@ -173,12 +171,12 @@ void RS_ActionModifyTrim::updateMouseButtonHints() } } -void RS_ActionModifyTrim::updateMouseCursor() +void ActionModifyTrim::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyTrim::updateToolBar() +void ActionModifyTrim::updateToolBar() { RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify); } diff --git a/src/actions/rs_actionmodifytrim.h b/src/actions/actionmodifytrim.h similarity index 69% rename from src/actions/rs_actionmodifytrim.h rename to src/actions/actionmodifytrim.h index f88156d..e91af17 100644 --- a/src/actions/rs_actionmodifytrim.h +++ b/src/actions/actionmodifytrim.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONMODIFYTRIM_H -#define RS_ACTIONMODIFYTRIM_H +#ifndef __ACTIONMODIFYTRIM_H__ +#define __ACTIONMODIFYTRIM_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -9,9 +9,10 @@ class RS_Entity; /** * This action class can handle user events to trim entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyTrim: public RS_PreviewActionInterface +class ActionModifyTrim: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionModifyTrim: public RS_PreviewActionInterface }; public: - RS_ActionModifyTrim(RS_EntityContainer & container, GraphicView & graphicView, bool both = false); - ~RS_ActionModifyTrim(); + ActionModifyTrim(RS_EntityContainer & container, GraphicView & graphicView, bool both = false); + ~ActionModifyTrim(); virtual void init(int status = 0); virtual void trigger(); @@ -42,4 +43,4 @@ class RS_ActionModifyTrim: public RS_PreviewActionInterface bool both; }; -#endif +#endif // __ACTIONMODIFYTRIM_H__ diff --git a/src/actions/rs_actionmodifytrimamount.cpp b/src/actions/actionmodifytrimamount.cpp similarity index 70% rename from src/actions/rs_actionmodifytrimamount.cpp rename to src/actions/actionmodifytrimamount.cpp index 94a3ad8..41a25df 100644 --- a/src/actions/rs_actionmodifytrimamount.cpp +++ b/src/actions/actionmodifytrimamount.cpp @@ -1,4 +1,4 @@ -// rs_actionmodifytrimamount.cpp +// actionmodifytrimamount.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,15 +12,15 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionmodifytrimamount.h" +#include "actionmodifytrimamount.h" #include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "rs_modification.h" -RS_ActionModifyTrimAmount::RS_ActionModifyTrimAmount( +ActionModifyTrimAmount::ActionModifyTrimAmount( RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Trim Entity by a given amount", + ActionInterface("Trim Entity by a given amount", container, graphicView) { trimEntity = NULL; @@ -28,26 +28,26 @@ RS_ActionModifyTrimAmount::RS_ActionModifyTrimAmount( distance = 0.0; } -RS_ActionModifyTrimAmount::~RS_ActionModifyTrimAmount() +ActionModifyTrimAmount::~ActionModifyTrimAmount() { } -/*virtual*/ RS2::ActionType RS_ActionModifyTrimAmount::rtti() +/*virtual*/ RS2::ActionType ActionModifyTrimAmount::rtti() { return RS2::ActionModifyTrimAmount; } -void RS_ActionModifyTrimAmount::init(int status) +void ActionModifyTrimAmount::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; +/* snapMode = RS2::SnapFree; + snapRes = RS2::RestrictNothing;*/ } -void RS_ActionModifyTrimAmount::trigger() +void ActionModifyTrimAmount::trigger() { - RS_DEBUG->print("RS_ActionModifyTrimAmount::trigger()"); + RS_DEBUG->print("ActionModifyTrimAmount::trigger()"); if (trimEntity != NULL && trimEntity->isAtomic()) { @@ -61,7 +61,7 @@ void RS_ActionModifyTrimAmount::trigger() } } -void RS_ActionModifyTrimAmount::mouseReleaseEvent(QMouseEvent * e) +void ActionModifyTrimAmount::mouseReleaseEvent(QMouseEvent * e) { trimCoord = graphicView->toGraph(e->x(), e->y()); trimEntity = catchEntity(e); @@ -101,7 +101,7 @@ void RS_ActionModifyTrimAmount::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionModifyTrimAmount::commandEvent(RS_CommandEvent * e) +void ActionModifyTrimAmount::commandEvent(RS_CommandEvent * e) { QString c = e->getCommand().toLower(); @@ -132,7 +132,7 @@ void RS_ActionModifyTrimAmount::commandEvent(RS_CommandEvent * e) } } -QStringList RS_ActionModifyTrimAmount::getAvailableCommands() +QStringList ActionModifyTrimAmount::getAvailableCommands() { QStringList cmd; @@ -148,28 +148,27 @@ QStringList RS_ActionModifyTrimAmount::getAvailableCommands() return cmd; } -void RS_ActionModifyTrimAmount::showOptions() +void ActionModifyTrimAmount::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionModifyTrimAmount::hideOptions() +void ActionModifyTrimAmount::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionModifyTrimAmount::updateMouseButtonHints() +void ActionModifyTrimAmount::updateMouseButtonHints() { switch (getStatus()) { case ChooseTrimEntity: RS_DIALOGFACTORY->updateMouseWidget( - tr("Select entity to trim or enter distance:"), - tr("Back")); + tr("Select entity to trim or enter distance:"), tr("Back")); break; default: @@ -178,22 +177,22 @@ void RS_ActionModifyTrimAmount::updateMouseButtonHints() } } -void RS_ActionModifyTrimAmount::updateMouseCursor() +void ActionModifyTrimAmount::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionModifyTrimAmount::updateToolBar() +void ActionModifyTrimAmount::updateToolBar() { RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify); } -double RS_ActionModifyTrimAmount::getDistance() +double ActionModifyTrimAmount::getDistance() { return distance; } -void RS_ActionModifyTrimAmount::setDistance(double d) +void ActionModifyTrimAmount::setDistance(double d) { distance = d; } diff --git a/src/actions/rs_actionmodifytrimamount.h b/src/actions/actionmodifytrimamount.h similarity index 72% rename from src/actions/rs_actionmodifytrimamount.h rename to src/actions/actionmodifytrimamount.h index e77df4f..0f3db59 100644 --- a/src/actions/rs_actionmodifytrimamount.h +++ b/src/actions/actionmodifytrimamount.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONMODIFYTRIMAMOUNT_H -#define RS_ACTIONMODIFYTRIMAMOUNT_H +#ifndef __ACTIONMODIFYTRIMAMOUNT_H__ +#define __ACTIONMODIFYTRIMAMOUNT_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -10,9 +10,10 @@ class RS_Entity; * This action class can handle user events to trim entities by a given * amount. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionModifyTrimAmount: public RS_ActionInterface +class ActionModifyTrimAmount: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionModifyTrimAmount: public RS_ActionInterface }; public: - RS_ActionModifyTrimAmount(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyTrimAmount(); + ActionModifyTrimAmount(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionModifyTrimAmount(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -47,4 +48,4 @@ class RS_ActionModifyTrimAmount: public RS_ActionInterface double distance; }; -#endif +#endif // __ACTIONMODIFYTRIMAMOUNT_H__ diff --git a/src/actions/rs_actionoptionsdrawing.cpp b/src/actions/actionoptionsdrawing.cpp similarity index 52% rename from src/actions/rs_actionoptionsdrawing.cpp rename to src/actions/actionoptionsdrawing.cpp index 7e84868..8869c7a 100644 --- a/src/actions/rs_actionoptionsdrawing.cpp +++ b/src/actions/actionoptionsdrawing.cpp @@ -1,4 +1,4 @@ -// rs_actionoptionsdrawing.cpp +// actionoptionsdrawing.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,44 +12,39 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionoptionsdrawing.h" +#include "actionoptionsdrawing.h" #include "rs_dialogfactory.h" #include "graphicview.h" -RS_ActionOptionsDrawing::RS_ActionOptionsDrawing(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Drawing Options", container, graphicView) +ActionOptionsDrawing::ActionOptionsDrawing(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Drawing Options", container, graphicView) { } -RS_ActionOptionsDrawing::~RS_ActionOptionsDrawing() +ActionOptionsDrawing::~ActionOptionsDrawing() { } -/*virtual*/ RS2::ActionType RS_ActionOptionsDrawing::rtti() +/*virtual*/ RS2::ActionType ActionOptionsDrawing::rtti() { return RS2::ActionOptionsDrawing; } -void RS_ActionOptionsDrawing::init(int status) +void ActionOptionsDrawing::init(int status) { - RS_ActionInterface::init(status); - + ActionInterface::init(status); trigger(); } -void RS_ActionOptionsDrawing::trigger() +void ActionOptionsDrawing::trigger() { - if (graphic != NULL) + if (graphic) { RS_DIALOGFACTORY->requestOptionsDrawingDialog(*graphic); - RS_DIALOGFACTORY->updateCoordinateWidget(Vector(0.0, 0.0), - Vector(0.0, 0.0), - true); + RS_DIALOGFACTORY->updateCoordinateWidget(Vector(0.0, 0.0), Vector(0.0, 0.0), true); graphicView->updateGrid(); graphicView->redraw(); } finish(); } - -// EOF diff --git a/src/actions/actionoptionsdrawing.h b/src/actions/actionoptionsdrawing.h new file mode 100644 index 0000000..f068db3 --- /dev/null +++ b/src/actions/actionoptionsdrawing.h @@ -0,0 +1,24 @@ +#ifndef __ACTIONOPTIONSDRAWING_H__ +#define __ACTIONOPTIONSDRAWING_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to change general + * application options. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionOptionsDrawing: public ActionInterface +{ + public: + ActionOptionsDrawing(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionOptionsDrawing(); + + virtual RS2::ActionType rtti(); + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONOPTIONSDRAWING_H__ diff --git a/src/actions/rs_actionprintpreview.cpp b/src/actions/actionprintpreview.cpp similarity index 55% rename from src/actions/rs_actionprintpreview.cpp rename to src/actions/actionprintpreview.cpp index c3f274c..d1c5fd1 100644 --- a/src/actions/rs_actionprintpreview.cpp +++ b/src/actions/actionprintpreview.cpp @@ -1,4 +1,4 @@ -// rs_actionprintpreview.cpp +// actionprintpreview.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionprintpreview.h" +#include "actionprintpreview.h" #include "rs_dialogfactory.h" #include "drawing.h" @@ -21,47 +21,45 @@ /** * Constructor. */ -RS_ActionPrintPreview::RS_ActionPrintPreview(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Print Preview", - container, graphicView) +ActionPrintPreview::ActionPrintPreview(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Print Preview", container, graphicView) { showOptions(); } -RS_ActionPrintPreview::~RS_ActionPrintPreview() +ActionPrintPreview::~ActionPrintPreview() { } -/*virtual*/ RS2::ActionType RS_ActionPrintPreview::rtti() +/*virtual*/ RS2::ActionType ActionPrintPreview::rtti() { return RS2::ActionPrintPreview; } -void RS_ActionPrintPreview::init(int status) +void ActionPrintPreview::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); showOptions(); } -void RS_ActionPrintPreview::trigger() +void ActionPrintPreview::trigger() { } -void RS_ActionPrintPreview::mouseMoveEvent(QMouseEvent * e) +void ActionPrintPreview::mouseMoveEvent(QMouseEvent * e) { switch (getStatus()) { case Moving: v2 = graphicView->toGraph(e->x(), e->y()); - if (graphic != NULL) + if (graphic) { Vector pinsbase = graphic->getPaperInsertionBase(); - double scale = graphic->getPaperScale(); - graphic->setPaperInsertionBase(pinsbase - v2 * scale + v1 * scale); } + v1 = v2; graphicView->redraw(); break; @@ -71,7 +69,7 @@ void RS_ActionPrintPreview::mouseMoveEvent(QMouseEvent * e) } } -void RS_ActionPrintPreview::mousePressEvent(QMouseEvent * e) +void ActionPrintPreview::mousePressEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -88,7 +86,7 @@ void RS_ActionPrintPreview::mousePressEvent(QMouseEvent * e) } } -void RS_ActionPrintPreview::mouseReleaseEvent(QMouseEvent * e) +void ActionPrintPreview::mouseReleaseEvent(QMouseEvent * e) { switch (getStatus()) { @@ -97,105 +95,104 @@ void RS_ActionPrintPreview::mouseReleaseEvent(QMouseEvent * e) break; default: - //deleteSnapper(); RS_DIALOGFACTORY->requestPreviousMenu(); e->accept(); break; } } -void RS_ActionPrintPreview::coordinateEvent(Vector *) +void ActionPrintPreview::coordinateEvent(Vector *) { } -void RS_ActionPrintPreview::commandEvent(RS_CommandEvent *) +void ActionPrintPreview::commandEvent(RS_CommandEvent *) { } -QStringList RS_ActionPrintPreview::getAvailableCommands() +QStringList ActionPrintPreview::getAvailableCommands() { QStringList cmd; return cmd; } -void RS_ActionPrintPreview::showOptions() +void ActionPrintPreview::showOptions() { - RS_ActionInterface::showOptions(); + ActionInterface::showOptions(); RS_DIALOGFACTORY->requestOptions(this, true); } -void RS_ActionPrintPreview::hideOptions() +void ActionPrintPreview::hideOptions() { - RS_ActionInterface::hideOptions(); + ActionInterface::hideOptions(); RS_DIALOGFACTORY->requestOptions(this, false); } -void RS_ActionPrintPreview::updateMouseButtonHints() +void ActionPrintPreview::updateMouseButtonHints() { } -void RS_ActionPrintPreview::updateMouseCursor() +void ActionPrintPreview::updateMouseCursor() { graphicView->setMouseCursor(RS2::MovingHandCursor); } -void RS_ActionPrintPreview::updateToolBar() +void ActionPrintPreview::updateToolBar() { } -void RS_ActionPrintPreview::center() +void ActionPrintPreview::center() { - if (graphic != NULL) + if (graphic) { graphic->centerToPage(); graphicView->redraw(); } } -void RS_ActionPrintPreview::fit() +void ActionPrintPreview::fit() { - if (graphic != NULL) + if (graphic) { graphic->fitToPage(); graphicView->redraw(); } } -void RS_ActionPrintPreview::setScale(double f) +void ActionPrintPreview::setScale(double f) { - if (graphic != NULL) + if (graphic) { graphic->setPaperScale(f); graphicView->redraw(); } } -double RS_ActionPrintPreview::getScale() +double ActionPrintPreview::getScale() { double ret = 1.0; - if (graphic != NULL) + if (graphic) ret = graphic->getPaperScale(); + return ret; } -void RS_ActionPrintPreview::setBlackWhite(bool bw) +void ActionPrintPreview::setBlackWhite(bool bw) { if (bw) graphicView->setDrawingMode(RS2::ModeBW); else graphicView->setDrawingMode(RS2::ModeFull); + graphicView->redraw(); } -RS2::Unit RS_ActionPrintPreview::getUnit() +RS2::Unit ActionPrintPreview::getUnit() { - if (graphic != NULL) + if (graphic) return graphic->getUnit(); - else - return RS2::None; -} -// EOF + return RS2::None; +} diff --git a/src/actions/rs_actionprintpreview.h b/src/actions/actionprintpreview.h similarity index 75% rename from src/actions/rs_actionprintpreview.h rename to src/actions/actionprintpreview.h index eb20194..435e849 100644 --- a/src/actions/rs_actionprintpreview.h +++ b/src/actions/actionprintpreview.h @@ -1,16 +1,17 @@ -#ifndef RS_ACTIONPRINTPREVIEW_H -#define RS_ACTIONPRINTPREVIEW_H +#ifndef __ACTIONPRINTPREVIEW_H__ +#define __ACTIONPRINTPREVIEW_H__ #include "rs.h" -#include "rs_actioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * Default action for print preview. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionPrintPreview: public RS_ActionInterface +class ActionPrintPreview: public ActionInterface { public: /** @@ -22,8 +23,8 @@ class RS_ActionPrintPreview: public RS_ActionInterface }; public: - RS_ActionPrintPreview(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionPrintPreview(); + ActionPrintPreview(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionPrintPreview(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -51,4 +52,4 @@ class RS_ActionPrintPreview: public RS_ActionInterface Vector v2; }; -#endif +#endif // __ACTIONPRINTPREVIEW_H__ diff --git a/src/actions/rs_actionselect.cpp b/src/actions/actionselect.cpp similarity index 59% rename from src/actions/rs_actionselect.cpp rename to src/actions/actionselect.cpp index 83077c7..ab19e14 100644 --- a/src/actions/rs_actionselect.cpp +++ b/src/actions/actionselect.cpp @@ -1,4 +1,4 @@ -// rs_actionselect.cpp +// actionselect.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,36 +12,36 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionselect.h" +#include "actionselect.h" -#include "rs_actionselectsingle.h" +#include "actionselectsingle.h" #include "rs_dialogfactory.h" #include "graphicview.h" -RS_ActionSelect::RS_ActionSelect(RS_EntityContainer & container, GraphicView & graphicView, +ActionSelect::ActionSelect(RS_EntityContainer & container, GraphicView & graphicView, RS2::ActionType nextAction): - RS_ActionInterface("Select Entities", container, graphicView) + ActionInterface("Select Entities", container, graphicView) { this->nextAction = nextAction; } -RS_ActionSelect::~RS_ActionSelect() +ActionSelect::~ActionSelect() { } -void RS_ActionSelect::init(int status) +void ActionSelect::init(int status) { - RS_ActionInterface::init(status); - graphicView->setCurrentAction(new RS_ActionSelectSingle(*container, *graphicView)); + ActionInterface::init(status); + graphicView->setCurrentAction(new ActionSelectSingle(*container, *graphicView)); } -void RS_ActionSelect::mouseReleaseEvent(QMouseEvent * e) +void ActionSelect::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) init(getStatus() - 1); } -void RS_ActionSelect::updateToolBar() +void ActionSelect::updateToolBar() { if (RS_DIALOGFACTORY) { diff --git a/src/actions/actionselect.h b/src/actions/actionselect.h new file mode 100644 index 0000000..f90b261 --- /dev/null +++ b/src/actions/actionselect.h @@ -0,0 +1,26 @@ +#ifndef __ACTIONSELECT_H__ +#define __ACTIONSELECT_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to select entities. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionSelect: public ActionInterface +{ + public: + ActionSelect(RS_EntityContainer & container, GraphicView & graphicView, RS2::ActionType nextAction); + ~ActionSelect(); + + void init(int status); + void mouseReleaseEvent(QMouseEvent * e); + void updateToolBar(); + + private: + RS2::ActionType nextAction; +}; + +#endif // __ACTIONSELECT_H__ diff --git a/src/actions/rs_actionselectall.cpp b/src/actions/actionselectall.cpp similarity index 64% rename from src/actions/rs_actionselectall.cpp rename to src/actions/actionselectall.cpp index 912dce5..4abe163 100644 --- a/src/actions/rs_actionselectall.cpp +++ b/src/actions/actionselectall.cpp @@ -1,4 +1,4 @@ -// rs_actionselectall.cpp +// actionselectall.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,35 +12,35 @@ // JLH 06/22/2010 Added this text. :-) // -#include "rs_actionselectall.h" +#include "actionselectall.h" #include "rs_dialogfactory.h" #include "rs_selection.h" -RS_ActionSelectAll::RS_ActionSelectAll(RS_EntityContainer & container, +ActionSelectAll::ActionSelectAll(RS_EntityContainer & container, GraphicView & graphicView, bool select): - RS_ActionInterface("Select All Entities", container, graphicView) + ActionInterface("Select All Entities", container, graphicView) { this->select = select; } -RS_ActionSelectAll::~RS_ActionSelectAll() +ActionSelectAll::~ActionSelectAll() { } -/*virtual*/ RS2::ActionType RS_ActionSelectAll::rtti() +/*virtual*/ RS2::ActionType ActionSelectAll::rtti() { return RS2::ActionSelectAll; } -void RS_ActionSelectAll::init(int status) +void ActionSelectAll::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); finish(); } -void RS_ActionSelectAll::trigger() +void ActionSelectAll::trigger() { RS_Selection s(*container, graphicView); s.selectAll(select); diff --git a/src/actions/actionselectall.h b/src/actions/actionselectall.h new file mode 100644 index 0000000..8cce0c3 --- /dev/null +++ b/src/actions/actionselectall.h @@ -0,0 +1,26 @@ +#ifndef __ACTIONSELECTALL_H__ +#define __ACTIONSELECTALL_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to select all entities. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionSelectAll: public ActionInterface +{ + public: + ActionSelectAll(RS_EntityContainer & container, GraphicView & graphicView, bool select); + ~ActionSelectAll(); + + virtual RS2::ActionType rtti(); + void init(int status); + virtual void trigger(); + + protected: + bool select; +}; + +#endif // __ACTIONSELECTALL_H__ diff --git a/src/actions/rs_actionselectbase.cpp b/src/actions/actionselectbase.cpp similarity index 65% rename from src/actions/rs_actionselectbase.cpp rename to src/actions/actionselectbase.cpp index d1bfb1e..cefd57e 100644 --- a/src/actions/rs_actionselectbase.cpp +++ b/src/actions/actionselectbase.cpp @@ -1,4 +1,4 @@ -// rs_actionselectbase.cpp +// actionselectbase.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,17 +12,17 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionselectbase.h" +#include "actionselectbase.h" #include "graphicview.h" -RS_ActionSelectBase::RS_ActionSelectBase(const char * name, +ActionSelectBase::ActionSelectBase(const char * name, RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface(name, container, graphicView) + ActionInterface(name, container, graphicView) { } -RS_ActionSelectBase::~RS_ActionSelectBase() +ActionSelectBase::~ActionSelectBase() { } @@ -30,13 +30,13 @@ RS_ActionSelectBase::~RS_ActionSelectBase() * Default behaviour of this method is triggering the predecesing * action and finishing this one when the enter key is pressed. */ -void RS_ActionSelectBase::keyReleaseEvent(QKeyEvent * e) +void ActionSelectBase::keyReleaseEvent(QKeyEvent * e) { - if (e->key() == Qt::Key_Return && predecessor != NULL) + if (e->key() == Qt::Key_Return && predecessor) finish(); } -void RS_ActionSelectBase::updateMouseCursor() +void ActionSelectBase::updateMouseCursor() { graphicView->setMouseCursor(RS2::SelectCursor); } diff --git a/src/actions/actionselectbase.h b/src/actions/actionselectbase.h new file mode 100644 index 0000000..374ec71 --- /dev/null +++ b/src/actions/actionselectbase.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONSELECTBASE_H__ +#define __ACTIONSELECTBASE_H__ + +#include "actioninterface.h" + +/** + * This class is the base class to all select actions. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionSelectBase: public ActionInterface +{ + public: + ActionSelectBase(const char * name, RS_EntityContainer & container, GraphicView & graphicView); + ~ActionSelectBase(); + + virtual void keyReleaseEvent(QKeyEvent * e); + virtual void updateMouseCursor(); +}; + +#endif // __ACTIONSELECTBASE_H__ diff --git a/src/actions/rs_actionselectcontour.cpp b/src/actions/actionselectcontour.cpp similarity index 55% rename from src/actions/rs_actionselectcontour.cpp rename to src/actions/actionselectcontour.cpp index 9924747..0c01854 100644 --- a/src/actions/rs_actionselectcontour.cpp +++ b/src/actions/actionselectcontour.cpp @@ -1,4 +1,4 @@ -// rs_actionselectcontour.cpp +// actionselectcontour.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,49 +12,47 @@ // JLH 06/04/2010 Added this text. :-) // -#include "rs_actionselectcontour.h" +#include "actionselectcontour.h" #include "rs_dialogfactory.h" #include "rs_selection.h" -RS_ActionSelectContour::RS_ActionSelectContour(RS_EntityContainer & container, +ActionSelectContour::ActionSelectContour(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Select Contours", container, graphicView) + ActionInterface("Select Contours", container, graphicView) { en = NULL; } -RS_ActionSelectContour::~RS_ActionSelectContour() +ActionSelectContour::~ActionSelectContour() { } -/*virtual*/ RS2::ActionType RS_ActionSelectContour::rtti() +/*virtual*/ RS2::ActionType ActionSelectContour::rtti() { return RS2::ActionSelectContour; } -void RS_ActionSelectContour::trigger() +void ActionSelectContour::trigger() { - if (en != NULL) + if (en) { if (en->isAtomic()) { RS_Selection s(*container, graphicView); s.selectContour(en); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } - else if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->commandMessage( - tr("Entity must be an Atomic Entity.")); - + else if (RS_DIALOGFACTORY) + RS_DIALOGFACTORY->commandMessage(tr("Entity must be an Atomic Entity.")); } else - RS_DEBUG->print("RS_ActionSelectContour::trigger: Entity is NULL\n"); + RS_DEBUG->print("ActionSelectContour::trigger: Entity is NULL\n"); } -void RS_ActionSelectContour::mouseReleaseEvent(QMouseEvent * e) +void ActionSelectContour::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) init(getStatus() - 1); @@ -65,9 +63,7 @@ void RS_ActionSelectContour::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionSelectContour::updateMouseCursor() +void ActionSelectContour::updateMouseCursor() { graphicView->setMouseCursor(RS2::SelectCursor); } - -// EOF diff --git a/src/actions/actionselectcontour.h b/src/actions/actionselectcontour.h new file mode 100644 index 0000000..309b81b --- /dev/null +++ b/src/actions/actionselectcontour.h @@ -0,0 +1,29 @@ +#ifndef __ACTIONSELECTCONTOURS_H__ +#define __ACTIONSELECTCONTOURS_H__ + +#include "actioninterface.h" + +class RS_Entity; + +/** + * This action class can handle user events to select contours. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionSelectContour: public ActionInterface +{ + public: + ActionSelectContour(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionSelectContour(); + + virtual RS2::ActionType rtti(); + virtual void trigger(); + virtual void mouseReleaseEvent(QMouseEvent * e); + virtual void updateMouseCursor(); + + private: + RS_Entity * en; +}; + +#endif // __ACTIONSELECTCONTOURS_H__ diff --git a/src/actions/rs_actionselectintersected.cpp b/src/actions/actionselectintersected.cpp similarity index 64% rename from src/actions/rs_actionselectintersected.cpp rename to src/actions/actionselectintersected.cpp index 240c4da..08b8092 100644 --- a/src/actions/rs_actionselectintersected.cpp +++ b/src/actions/actionselectintersected.cpp @@ -1,4 +1,4 @@ -// rs_actionselectintersected.cpp +// actionselectintersected.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actionselectintersected.h" +#include "actionselectintersected.h" #include "rs_dialogfactory.h" #include "rs_selection.h" @@ -23,65 +23,63 @@ * * @param select true: select window. false: deselect window */ -RS_ActionSelectIntersected::RS_ActionSelectIntersected( +ActionSelectIntersected::ActionSelectIntersected( RS_EntityContainer & container, GraphicView & graphicView, bool select): - RS_PreviewActionInterface("Select Intersected", container, graphicView) + ActionInterface("Select Intersected", container, graphicView) { this->select = select; } -RS_ActionSelectIntersected::~RS_ActionSelectIntersected() +ActionSelectIntersected::~ActionSelectIntersected() { } -/*virtual*/ RS2::ActionType RS_ActionSelectIntersected::rtti() +/*virtual*/ RS2::ActionType ActionSelectIntersected::rtti() { return RS2::ActionSelectIntersected; } -void RS_ActionSelectIntersected::init(int status) +void ActionSelectIntersected::init(int status) { - RS_PreviewActionInterface::init(status); - + ActionInterface::init(status); v1 = v2 = Vector(false); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; +/* snapMode = RS2::SnapFree; + snapRes = RS2::RestrictNothing;*/ } -void RS_ActionSelectIntersected::trigger() +void ActionSelectIntersected::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); if (v1.valid && v2.valid) + { if (graphicView->toGuiDX(v1.distanceTo(v2)) > 10) { deleteSnapper(); - RS_Selection s(*container, graphicView); s.selectIntersected(v1, v2, select); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); init(); } + } } -void RS_ActionSelectIntersected::mouseMoveEvent(QMouseEvent * e) +void ActionSelectIntersected::mouseMoveEvent(QMouseEvent * e) { if (getStatus() == SetPoint2 && v1.valid) { v2 = snapPoint(e); deletePreview(); clearPreview(); - preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v1.x, v1.y), - Vector(v2.x, v2.y)))); +// preview->addEntity(new RS_Line(preview, RS_LineData(Vector(v1.x, v1.y), Vector(v2.x, v2.y)))); drawPreview(); } } -void RS_ActionSelectIntersected::mousePressEvent(QMouseEvent * e) +void ActionSelectIntersected::mousePressEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -97,30 +95,33 @@ void RS_ActionSelectIntersected::mousePressEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionSelectIntersected::mousePressEvent(): %f %f", + RS_DEBUG->print("ActionSelectIntersected::mousePressEvent(): %f %f", v1.x, v1.y); } -void RS_ActionSelectIntersected::mouseReleaseEvent(QMouseEvent * e) +void ActionSelectIntersected::mouseReleaseEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionSelectIntersected::mouseReleaseEvent()"); + RS_DEBUG->print("ActionSelectIntersected::mouseReleaseEvent()"); if (e->button() == Qt::RightButton) { if (getStatus() == SetPoint2) deletePreview(); + deleteSnapper(); init(getStatus() - 1); } else if (e->button() == Qt::LeftButton) + { if (getStatus() == SetPoint2) { v2 = snapPoint(e); trigger(); } + } } -void RS_ActionSelectIntersected::updateMouseButtonHints() +void ActionSelectIntersected::updateMouseButtonHints() { if (RS_DIALOGFACTORY != NULL) { @@ -141,21 +142,20 @@ void RS_ActionSelectIntersected::updateMouseButtonHints() } } -void RS_ActionSelectIntersected::updateMouseCursor() +void ActionSelectIntersected::updateMouseCursor() { graphicView->setMouseCursor(RS2::SelectCursor); } -void RS_ActionSelectIntersected::updateToolBar() +void ActionSelectIntersected::updateToolBar() { if (RS_DIALOGFACTORY != NULL) { if (!isFinished()) - //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect); } } -// EOF + diff --git a/src/actions/rs_actionselectintersected.h b/src/actions/actionselectintersected.h similarity index 67% rename from src/actions/rs_actionselectintersected.h rename to src/actions/actionselectintersected.h index 6dceec7..2487afc 100644 --- a/src/actions/rs_actionselectintersected.h +++ b/src/actions/actionselectintersected.h @@ -1,15 +1,16 @@ -#ifndef RS_ACTIONSELECTINTERSECTED_H -#define RS_ACTIONSELECTINTERSECTED_H +#ifndef __ACTIONSELECTINTERSECTED_H__ +#define __ACTIONSELECTINTERSECTED_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to select all entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionSelectIntersected: public RS_PreviewActionInterface +class ActionSelectIntersected: public ActionInterface { public: /** @@ -21,8 +22,8 @@ class RS_ActionSelectIntersected: public RS_PreviewActionInterface }; public: - RS_ActionSelectIntersected(RS_EntityContainer & container, GraphicView & graphicView, bool select); - ~RS_ActionSelectIntersected(); + ActionSelectIntersected(RS_EntityContainer & container, GraphicView & graphicView, bool select); + ~ActionSelectIntersected(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -41,4 +42,4 @@ class RS_ActionSelectIntersected: public RS_PreviewActionInterface bool select; }; -#endif +#endif // __ACTIONSELECTINTERSECTED_H__ diff --git a/src/actions/rs_actionselectinvert.cpp b/src/actions/actionselectinvert.cpp similarity index 61% rename from src/actions/rs_actionselectinvert.cpp rename to src/actions/actionselectinvert.cpp index b285426..ef1e6c2 100644 --- a/src/actions/rs_actionselectinvert.cpp +++ b/src/actions/actionselectinvert.cpp @@ -1,4 +1,4 @@ -// rs_actionselectinvert.cpp +// actionselectinvert.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,34 +12,34 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionselectinvert.h" +#include "actionselectinvert.h" #include "rs_dialogfactory.h" #include "rs_selection.h" -RS_ActionSelectInvert::RS_ActionSelectInvert(RS_EntityContainer & container, - GraphicView & graphicView): RS_ActionInterface("Invert Selection", +ActionSelectInvert::ActionSelectInvert(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Invert Selection", container, graphicView) { } -RS_ActionSelectInvert::~RS_ActionSelectInvert() +ActionSelectInvert::~ActionSelectInvert() { } -/*virtual*/ RS2::ActionType RS_ActionSelectInvert::rtti() +/*virtual*/ RS2::ActionType ActionSelectInvert::rtti() { return RS2::ActionSelectInvert; } -void RS_ActionSelectInvert::init(int status) +void ActionSelectInvert::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); finish(); } -void RS_ActionSelectInvert::trigger() +void ActionSelectInvert::trigger() { RS_Selection s(*container, graphicView); s.invertSelection(); diff --git a/src/actions/actionselectinvert.h b/src/actions/actionselectinvert.h new file mode 100644 index 0000000..2726975 --- /dev/null +++ b/src/actions/actionselectinvert.h @@ -0,0 +1,23 @@ +#ifndef __ACTIONSELECTINVERT_H__ +#define __ACTIONSELECTINVERT_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to select all entities. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionSelectInvert: public ActionInterface +{ + public: + ActionSelectInvert(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionSelectInvert(); + + virtual RS2::ActionType rtti(); + void init(int status); + virtual void trigger(); +}; + +#endif // __ACTIONSELECTINVERT_H__ diff --git a/src/actions/rs_actionselectlayer.cpp b/src/actions/actionselectlayer.cpp similarity index 58% rename from src/actions/rs_actionselectlayer.cpp rename to src/actions/actionselectlayer.cpp index 788e403..3bd9132 100644 --- a/src/actions/rs_actionselectlayer.cpp +++ b/src/actions/actionselectlayer.cpp @@ -1,4 +1,4 @@ -// rs_actionselectlayer.cpp +// actionselectlayer.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,41 +12,41 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionselectlayer.h" +#include "actionselectlayer.h" #include "rs_dialogfactory.h" #include "rs_selection.h" -RS_ActionSelectLayer::RS_ActionSelectLayer(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Select Layers", container, graphicView) +ActionSelectLayer::ActionSelectLayer(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Select Layers", container, graphicView) { en = NULL; } -RS_ActionSelectLayer::~RS_ActionSelectLayer() +ActionSelectLayer::~ActionSelectLayer() { } -/*virtual*/ RS2::ActionType RS_ActionSelectLayer::rtti() +/*virtual*/ RS2::ActionType ActionSelectLayer::rtti() { return RS2::ActionSelectLayer; } -void RS_ActionSelectLayer::trigger() +void ActionSelectLayer::trigger() { - if (en != NULL) + if (en) { RS_Selection s(*container, graphicView); s.selectLayer(en); - if (RS_DIALOGFACTORY != NULL) + if (RS_DIALOGFACTORY) RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } else - RS_DEBUG->print("RS_ActionSelectLayer::trigger: Entity is NULL\n"); + RS_DEBUG->print("ActionSelectLayer::trigger: Entity is NULL\n"); } -void RS_ActionSelectLayer::mouseReleaseEvent(QMouseEvent * e) +void ActionSelectLayer::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) init(getStatus() - 1); @@ -57,9 +57,7 @@ void RS_ActionSelectLayer::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionSelectLayer::updateMouseCursor() +void ActionSelectLayer::updateMouseCursor() { graphicView->setMouseCursor(RS2::SelectCursor); } - -// EOF diff --git a/src/actions/rs_actionselectlayer.h b/src/actions/actionselectlayer.h similarity index 50% rename from src/actions/rs_actionselectlayer.h rename to src/actions/actionselectlayer.h index 743c997..f3bccc6 100644 --- a/src/actions/rs_actionselectlayer.h +++ b/src/actions/actionselectlayer.h @@ -1,20 +1,21 @@ -#ifndef RS_ACTIONSELECTLAYER_H -#define RS_ACTIONSELECTLAYER_H +#ifndef __ACTIONSELECTLAYER_H__ +#define __ACTIONSELECTLAYER_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" class RS_Entity; /** * This action class can handle user events to select contours. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionSelectLayer: public RS_ActionInterface +class ActionSelectLayer: public ActionInterface { public: - RS_ActionSelectLayer(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionSelectLayer(); + ActionSelectLayer(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionSelectLayer(); virtual RS2::ActionType rtti(); virtual void trigger(); @@ -25,4 +26,4 @@ class RS_ActionSelectLayer: public RS_ActionInterface RS_Entity * en; }; -#endif +#endif // __ACTIONSELECTLAYER_H__ diff --git a/src/actions/rs_actionselectsingle.cpp b/src/actions/actionselectsingle.cpp similarity index 59% rename from src/actions/rs_actionselectsingle.cpp rename to src/actions/actionselectsingle.cpp index 28f966a..1c6843b 100644 --- a/src/actions/rs_actionselectsingle.cpp +++ b/src/actions/actionselectsingle.cpp @@ -1,4 +1,4 @@ -// rs_actionselectsingle.cpp +// actionselectsingle.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,27 +12,27 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionselectsingle.h" +#include "actionselectsingle.h" #include "rs_dialogfactory.h" #include "rs_selection.h" -RS_ActionSelectSingle::RS_ActionSelectSingle(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Select Entities", container, graphicView) +ActionSelectSingle::ActionSelectSingle(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Select Entities", container, graphicView) { en = NULL; } -RS_ActionSelectSingle::~RS_ActionSelectSingle() +ActionSelectSingle::~ActionSelectSingle() { } -/*virtual*/ RS2::ActionType RS_ActionSelectSingle::rtti() +/*virtual*/ RS2::ActionType ActionSelectSingle::rtti() { return RS2::ActionSelectSingle; } -void RS_ActionSelectSingle::trigger() +void ActionSelectSingle::trigger() { if (en != NULL) { @@ -42,16 +42,16 @@ void RS_ActionSelectSingle::trigger() RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); } else - RS_DEBUG->print("RS_ActionSelectSingle::trigger: Entity is NULL\n"); + RS_DEBUG->print("ActionSelectSingle::trigger: Entity is NULL\n"); } -void RS_ActionSelectSingle::keyPressEvent(QKeyEvent * e) +void ActionSelectSingle::keyPressEvent(QKeyEvent * e) { if (e->key() == Qt::Key_Enter) finish(); } -void RS_ActionSelectSingle::mouseReleaseEvent(QMouseEvent * e) +void ActionSelectSingle::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) init(getStatus() - 1); @@ -62,9 +62,9 @@ void RS_ActionSelectSingle::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionSelectSingle::updateMouseCursor() +void ActionSelectSingle::updateMouseCursor() { graphicView->setMouseCursor(RS2::SelectCursor); } -// EOF + diff --git a/src/actions/rs_actionselectsingle.h b/src/actions/actionselectsingle.h similarity index 53% rename from src/actions/rs_actionselectsingle.h rename to src/actions/actionselectsingle.h index bb003b6..20d0c95 100644 --- a/src/actions/rs_actionselectsingle.h +++ b/src/actions/actionselectsingle.h @@ -1,20 +1,21 @@ -#ifndef RS_ACTIONSELECTSINGLE_H -#define RS_ACTIONSELECTSINGLE_H +#ifndef __ACTIONSELECTSINGLE_H__ +#define __ACTIONSELECTSINGLE_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" class RS_Entity; /** * This action class can handle user events to select entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionSelectSingle: public RS_ActionInterface +class ActionSelectSingle: public ActionInterface { public: - RS_ActionSelectSingle(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionSelectSingle(); + ActionSelectSingle(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionSelectSingle(); virtual RS2::ActionType rtti(); virtual void trigger(); @@ -26,4 +27,4 @@ class RS_ActionSelectSingle: public RS_ActionInterface RS_Entity * en; }; -#endif +#endif // __ACTIONSELECTSINGLE_H__ diff --git a/src/actions/rs_actionselectwindow.cpp b/src/actions/actionselectwindow.cpp similarity index 62% rename from src/actions/rs_actionselectwindow.cpp rename to src/actions/actionselectwindow.cpp index 293ac98..5685214 100644 --- a/src/actions/rs_actionselectwindow.cpp +++ b/src/actions/actionselectwindow.cpp @@ -1,4 +1,4 @@ -// rs_actionselectwindow.cpp +// actionselectwindow.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actionselectwindow.h" +#include "actionselectwindow.h" #include "rs_dialogfactory.h" #include "rs_selection.h" @@ -23,76 +23,68 @@ * * @param select true: select window. false: deselect window */ -RS_ActionSelectWindow::RS_ActionSelectWindow(RS_EntityContainer & container, +ActionSelectWindow::ActionSelectWindow(RS_EntityContainer & container, GraphicView & graphicView, bool select): - RS_PreviewActionInterface("Select Window", container, graphicView) + ActionInterface("Select Window", container, graphicView) { this->select = select; } -RS_ActionSelectWindow::~RS_ActionSelectWindow() +ActionSelectWindow::~ActionSelectWindow() { } -/*virtual*/ RS2::ActionType RS_ActionSelectWindow::rtti() +/*virtual*/ RS2::ActionType ActionSelectWindow::rtti() { return RS2::ActionSelectWindow; } -void RS_ActionSelectWindow::init(int status) +void ActionSelectWindow::init(int status) { - RS_PreviewActionInterface::init(status); + ActionInterface::init(status); v1 = v2 = Vector(false); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; +/* snapMode = RS2::SnapFree; + snapRes = RS2::RestrictNothing;*/ } -void RS_ActionSelectWindow::trigger() +void ActionSelectWindow::trigger() { - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); if (v1.valid && v2.valid) { if (graphicView->toGuiDX(v1.distanceTo(v2)) > 10) { deleteSnapper(); - bool cross = (v2.y > v1.y); - RS_Selection s(*container, graphicView); s.selectWindow(v1, v2, select, cross); - RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); - init(); } } } -void RS_ActionSelectWindow::mouseMoveEvent(QMouseEvent * e) +void ActionSelectWindow::mouseMoveEvent(QMouseEvent * e) { if (getStatus() == SetCorner2 && v1.valid) { v2 = snapPoint(e); deletePreview(); clearPreview(); +/* preview->addEntity(new RS_Line(preview, + RS_LineData(Vector(v1.x, v1.y), Vector(v2.x, v1.y)))); preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v1.x, v1.y), - Vector(v2.x, v1.y)))); + RS_LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y)))); preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v2.x, v1.y), - Vector(v2.x, v2.y)))); + RS_LineData(Vector(v2.x, v2.y), Vector(v1.x, v2.y)))); preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v2.x, v2.y), - Vector(v1.x, v2.y)))); - preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v1.x, v2.y), - Vector(v1.x, v1.y)))); + RS_LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y))));*/ drawPreview(); } } -void RS_ActionSelectWindow::mousePressEvent(QMouseEvent * e) +void ActionSelectWindow::mousePressEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -108,13 +100,13 @@ void RS_ActionSelectWindow::mousePressEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionSelectWindow::mousePressEvent(): %f %f", + RS_DEBUG->print("ActionSelectWindow::mousePressEvent(): %f %f", v1.x, v1.y); } -void RS_ActionSelectWindow::mouseReleaseEvent(QMouseEvent * e) +void ActionSelectWindow::mouseReleaseEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionSelectWindow::mouseReleaseEvent()"); + RS_DEBUG->print("ActionSelectWindow::mouseReleaseEvent()"); if (e->button() == Qt::LeftButton) { @@ -128,12 +120,13 @@ void RS_ActionSelectWindow::mouseReleaseEvent(QMouseEvent * e) { if (getStatus() == SetCorner2) deletePreview(); + deleteSnapper(); init(getStatus() - 1); } } -void RS_ActionSelectWindow::updateMouseButtonHints() +void ActionSelectWindow::updateMouseButtonHints() { switch (getStatus()) { @@ -151,18 +144,15 @@ void RS_ActionSelectWindow::updateMouseButtonHints() } } -void RS_ActionSelectWindow::updateMouseCursor() +void ActionSelectWindow::updateMouseCursor() { graphicView->setMouseCursor(RS2::SelectCursor); } -void RS_ActionSelectWindow::updateToolBar() +void ActionSelectWindow::updateToolBar() { if (!isFinished()) - //RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect); else RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSelect); } - -// EOF diff --git a/src/actions/rs_actionselectwindow.h b/src/actions/actionselectwindow.h similarity index 69% rename from src/actions/rs_actionselectwindow.h rename to src/actions/actionselectwindow.h index 62aafc7..f96bbff 100644 --- a/src/actions/rs_actionselectwindow.h +++ b/src/actions/actionselectwindow.h @@ -1,15 +1,16 @@ -#ifndef RS_ACTIONSELECTWINDOW_H -#define RS_ACTIONSELECTWINDOW_H +#ifndef __ACTIONSELECTWINDOW_H__ +#define __ACTIONSELECTWINDOW_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to select all entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionSelectWindow: public RS_PreviewActionInterface +class ActionSelectWindow: public ActionInterface { public: /** @@ -21,8 +22,8 @@ class RS_ActionSelectWindow: public RS_PreviewActionInterface }; public: - RS_ActionSelectWindow(RS_EntityContainer & container, GraphicView & graphicView, bool select); - ~RS_ActionSelectWindow(); + ActionSelectWindow(RS_EntityContainer & container, GraphicView & graphicView, bool select); + ~ActionSelectWindow(); virtual RS2::ActionType rtti(); virtual void init(int status = 0); @@ -41,4 +42,4 @@ class RS_ActionSelectWindow: public RS_PreviewActionInterface bool select; }; -#endif +#endif // __ACTIONSELECTWINDOW_H__ diff --git a/src/actions/rs_actionsetrelativezero.cpp b/src/actions/actionsetrelativezero.cpp similarity index 64% rename from src/actions/rs_actionsetrelativezero.cpp rename to src/actions/actionsetrelativezero.cpp index fc7484d..b77d510 100644 --- a/src/actions/rs_actionsetrelativezero.cpp +++ b/src/actions/actionsetrelativezero.cpp @@ -1,4 +1,4 @@ -// rs_actionsetrelativezero.cpp +// actionsetrelativezero.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,27 +12,27 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionsetrelativezero.h" +#include "actionsetrelativezero.h" #include "rs_dialogfactory.h" #include "graphicview.h" -RS_ActionSetRelativeZero::RS_ActionSetRelativeZero(RS_EntityContainer & container, - GraphicView & graphicView): RS_PreviewActionInterface("Set the relative Zero", +ActionSetRelativeZero::ActionSetRelativeZero(RS_EntityContainer & container, + GraphicView & graphicView): ActionInterface("Set the relative Zero", container, graphicView) { } -RS_ActionSetRelativeZero::~RS_ActionSetRelativeZero() +ActionSetRelativeZero::~ActionSetRelativeZero() { } -/*virtual*/ RS2::ActionType RS_ActionSetRelativeZero::rtti() +/*virtual*/ RS2::ActionType ActionSetRelativeZero::rtti() { return RS2::ActionSetRelativeZero; } -void RS_ActionSetRelativeZero::trigger() +void ActionSetRelativeZero::trigger() { bool wasLocked = graphicView->isRelativeZeroLocked(); @@ -45,12 +45,12 @@ void RS_ActionSetRelativeZero::trigger() finish(); } -void RS_ActionSetRelativeZero::mouseMoveEvent(QMouseEvent * e) +void ActionSetRelativeZero::mouseMoveEvent(QMouseEvent * e) { snapPoint(e); } -void RS_ActionSetRelativeZero::mouseReleaseEvent(QMouseEvent * e) +void ActionSetRelativeZero::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) { @@ -64,7 +64,7 @@ void RS_ActionSetRelativeZero::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionSetRelativeZero::coordinateEvent(Vector * e) +void ActionSetRelativeZero::coordinateEvent(Vector * e) { if (e == NULL) return; @@ -73,7 +73,7 @@ void RS_ActionSetRelativeZero::coordinateEvent(Vector * e) trigger(); } -void RS_ActionSetRelativeZero::updateMouseButtonHints() +void ActionSetRelativeZero::updateMouseButtonHints() { switch (getStatus()) { @@ -87,12 +87,12 @@ void RS_ActionSetRelativeZero::updateMouseButtonHints() } } -void RS_ActionSetRelativeZero::updateMouseCursor() +void ActionSetRelativeZero::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionSetRelativeZero::updateToolBar() +void ActionSetRelativeZero::updateToolBar() { if (!isFinished()) RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); @@ -100,4 +100,4 @@ void RS_ActionSetRelativeZero::updateToolBar() RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); } -// EOF + diff --git a/src/actions/actionsetrelativezero.h b/src/actions/actionsetrelativezero.h new file mode 100644 index 0000000..a199f2c --- /dev/null +++ b/src/actions/actionsetrelativezero.h @@ -0,0 +1,33 @@ +#ifndef __ACTIONSETRELATIVEZERO_H__ +#define __ACTIONSETRELATIVEZERO_H__ + +#include "actioninterface.h" +#include "vector.h" + +/** + * This action class can handle user events to set the relative Zero point. It + * overrides but retains the locking of the relative Zero. + * + * @author James Hammons + * @author Ulf Lehnert + */ +class ActionSetRelativeZero: public ActionInterface +{ + public: + ActionSetRelativeZero(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionSetRelativeZero(); + + virtual RS2::ActionType rtti(); + virtual void trigger(); + virtual void mouseMoveEvent(QMouseEvent * e); + virtual void mouseReleaseEvent(QMouseEvent * e); + virtual void coordinateEvent(Vector * e); + virtual void updateMouseButtonHints(); + virtual void updateMouseCursor(); + virtual void updateToolBar(); + + private: + Vector pt; +}; + +#endif // __ACTIONSETRELATIVEZERO_H__ diff --git a/src/actions/rs_actionsetsnapmode.cpp b/src/actions/actionsetsnapmode.cpp similarity index 59% rename from src/actions/rs_actionsetsnapmode.cpp rename to src/actions/actionsetsnapmode.cpp index 49ddf88..9b91279 100644 --- a/src/actions/rs_actionsetsnapmode.cpp +++ b/src/actions/actionsetsnapmode.cpp @@ -1,4 +1,4 @@ -// rs_actionsetsnapmode.cpp +// actionsetsnapmode.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionsetsnapmode.h" +#include "actionsetsnapmode.h" #include "graphicview.h" @@ -21,24 +21,24 @@ * * @param snapMode The new snap mode used from now on. */ -RS_ActionSetSnapMode::RS_ActionSetSnapMode(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapMode snapMode): - RS_ActionInterface("Set Snap Mode", container, graphicView) +ActionSetSnapMode::ActionSetSnapMode(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapMode snapMode): + ActionInterface("Set Snap Mode", container, graphicView) { this->snapMode = snapMode; } -RS_ActionSetSnapMode::~RS_ActionSetSnapMode() +ActionSetSnapMode::~ActionSetSnapMode() { } -void RS_ActionSetSnapMode::trigger() +void ActionSetSnapMode::trigger() { graphicView->setDefaultSnapMode(snapMode); finish(); } -void RS_ActionSetSnapMode::init(int status) +void ActionSetSnapMode::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } diff --git a/src/actions/actionsetsnapmode.h b/src/actions/actionsetsnapmode.h new file mode 100644 index 0000000..713d4f6 --- /dev/null +++ b/src/actions/actionsetsnapmode.h @@ -0,0 +1,26 @@ +#ifndef __ACTIONSETSNAPMODE_H__ +#define __ACTIONSETSNAPMODE_H__ + +#include "rs.h" +#include "actioninterface.h" + +/** + * This action changes the current snap mode. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionSetSnapMode: public ActionInterface +{ + public: + ActionSetSnapMode(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapMode snapMode); + ~ActionSetSnapMode(); + + virtual void init(int status = 0); + virtual void trigger(); + + protected: + RS2::SnapMode snapMode; +}; + +#endif // __ACTIONSETSNAPMODE_H__ diff --git a/src/actions/rs_actionsetsnaprestriction.cpp b/src/actions/actionsetsnaprestriction.cpp similarity index 65% rename from src/actions/rs_actionsetsnaprestriction.cpp rename to src/actions/actionsetsnaprestriction.cpp index d4805d0..8789424 100644 --- a/src/actions/rs_actionsetsnaprestriction.cpp +++ b/src/actions/actionsetsnaprestriction.cpp @@ -1,4 +1,4 @@ -// rs_actionsetsnaprestriction.cpp +// actionsetsnaprestriction.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionsetsnaprestriction.h" +#include "actionsetsnaprestriction.h" #include "graphicview.h" @@ -22,25 +22,25 @@ * @param snapRes The new snap mode used from now on. * @param set true: set additional snap mode / false: unset */ -RS_ActionSetSnapRestriction::RS_ActionSetSnapRestriction( +ActionSetSnapRestriction::ActionSetSnapRestriction( RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapRestriction snapRes): - RS_ActionInterface("Set Additional Snap Mode", container, graphicView) + ActionInterface("Set Additional Snap Mode", container, graphicView) { this->snapRes = snapRes; } -RS_ActionSetSnapRestriction::~RS_ActionSetSnapRestriction() +ActionSetSnapRestriction::~ActionSetSnapRestriction() { } -void RS_ActionSetSnapRestriction::trigger() +void ActionSetSnapRestriction::trigger() { graphicView->setSnapRestriction(snapRes); finish(); } -void RS_ActionSetSnapRestriction::init(int status) +void ActionSetSnapRestriction::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } diff --git a/src/actions/actionsetsnaprestriction.h b/src/actions/actionsetsnaprestriction.h new file mode 100644 index 0000000..8bbca94 --- /dev/null +++ b/src/actions/actionsetsnaprestriction.h @@ -0,0 +1,26 @@ +#ifndef __ACTIONSETSNAPRESTRICTION_H__ +#define __ACTIONSETSNAPRESTRICTION_H__ + +#include "rs.h" +#include "actioninterface.h" + +/** + * This action changes the current additional snap mode. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionSetSnapRestriction: public ActionInterface +{ + public: + ActionSetSnapRestriction(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapRestriction snapRes); + ~ActionSetSnapRestriction(); + + virtual void init(int status = 0); + virtual void trigger(); + + protected: + RS2::SnapRestriction snapRes; +}; + +#endif // __ACTIONSETSNAPRESTRICTION_H__ diff --git a/src/actions/rs_actionsnapintersectionmanual.cpp b/src/actions/actionsnapintersectionmanual.cpp similarity index 62% rename from src/actions/rs_actionsnapintersectionmanual.cpp rename to src/actions/actionsnapintersectionmanual.cpp index d10c830..e8a27a7 100644 --- a/src/actions/rs_actionsnapintersectionmanual.cpp +++ b/src/actions/actionsnapintersectionmanual.cpp @@ -1,4 +1,4 @@ -// rs_actionsetsnapintersectionmanual.cpp +// actionsetsnapintersectionmanual.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionsnapintersectionmanual.h" +#include "actionsnapintersectionmanual.h" #include "rs_dialogfactory.h" #include "graphicview.h" @@ -22,30 +22,30 @@ /** * @param both Trim both entities. */ -RS_ActionSnapIntersectionManual::RS_ActionSnapIntersectionManual( +ActionSnapIntersectionManual::ActionSnapIntersectionManual( RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Trim Entity", container, graphicView) + ActionInterface("Trim Entity", container, graphicView) { entity2 = NULL; entity1 = NULL; coord = Vector(false); } -RS_ActionSnapIntersectionManual::~RS_ActionSnapIntersectionManual() +ActionSnapIntersectionManual::~ActionSnapIntersectionManual() { } -void RS_ActionSnapIntersectionManual::init(int status) +void ActionSnapIntersectionManual::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; +/* snapMode = RS2::SnapFree; + snapRes = RS2::RestrictNothing;*/ } -void RS_ActionSnapIntersectionManual::trigger() +void ActionSnapIntersectionManual::trigger() { - RS_DEBUG->print("RS_ActionSnapIntersectionManual::trigger()"); + RS_DEBUG->print("ActionSnapIntersectionManual::trigger()"); if (entity2 != NULL && entity2->isAtomic() && entity1 != NULL && entity1->isAtomic()) @@ -69,9 +69,9 @@ void RS_ActionSnapIntersectionManual::trigger() } } -void RS_ActionSnapIntersectionManual::mouseMoveEvent(QMouseEvent * e) +void ActionSnapIntersectionManual::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionSnapIntersectionManual::mouseMoveEvent begin"); + RS_DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent begin"); RS_Entity * se = catchEntity(e); Vector mouse = graphicView->toGraph(e->x(), e->y()); @@ -82,45 +82,34 @@ void RS_ActionSnapIntersectionManual::mouseMoveEvent(QMouseEvent * e) entity1 = se; break; - case ChooseEntity2: { + case ChooseEntity2: + { entity2 = se; coord = mouse; - VectorSolutions sol = - RS_Information::getIntersection(entity1, entity2, false); - - //for (int i=0; iaddEntity( - new RS_Circle(preview, - RS_CircleData( - ip, - graphicView->toGraphDX(4)))); +// preview->addEntity(new RS_Circle(preview, RS_CircleData(ip, graphicView->toGraphDX(4)))); drawPreview(); - RS_DIALOGFACTORY->updateCoordinateWidget(ip, - ip - graphicView->getRelativeZero()); + RS_DIALOGFACTORY->updateCoordinateWidget(ip, ip - graphicView->getRelativeZero()); } } - break; + break; default: break; } - RS_DEBUG->print("RS_ActionSnapIntersectionManual::mouseMoveEvent end"); + RS_DEBUG->print("ActionSnapIntersectionManual::mouseMoveEvent end"); } -void RS_ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e) +void ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -134,6 +123,7 @@ void RS_ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e) if (entity1 != NULL && entity1->isAtomic()) setStatus(ChooseEntity2); + break; case ChooseEntity2: @@ -156,7 +146,7 @@ void RS_ActionSnapIntersectionManual::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionSnapIntersectionManual::updateMouseButtonHints() +void ActionSnapIntersectionManual::updateMouseButtonHints() { switch (getStatus()) { @@ -176,14 +166,14 @@ void RS_ActionSnapIntersectionManual::updateMouseButtonHints() } } -void RS_ActionSnapIntersectionManual::updateMouseCursor() +void ActionSnapIntersectionManual::updateMouseCursor() { graphicView->setMouseCursor(RS2::CadCursor); } -void RS_ActionSnapIntersectionManual::updateToolBar() +void ActionSnapIntersectionManual::updateToolBar() { RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); } -// EOF + diff --git a/src/actions/rs_actionsnapintersectionmanual.h b/src/actions/actionsnapintersectionmanual.h similarity index 64% rename from src/actions/rs_actionsnapintersectionmanual.h rename to src/actions/actionsnapintersectionmanual.h index 10e6b3f..b119c50 100644 --- a/src/actions/rs_actionsnapintersectionmanual.h +++ b/src/actions/actionsnapintersectionmanual.h @@ -1,7 +1,7 @@ -#ifndef RS_ACTIONSNAPINTERSECTIONMANUAL_H -#define RS_ACTIONSNAPINTERSECTIONMANUAL_H +#ifndef __ACTIONSNAPINTERSECTIONMANUAL_H__ +#define __ACTIONSNAPINTERSECTIONMANUAL_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" class RS_Entity; @@ -9,9 +9,10 @@ class RS_Entity; /** * This action class can handle user events to trim entities. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionSnapIntersectionManual: public RS_PreviewActionInterface +class ActionSnapIntersectionManual: public ActionInterface { public: /** @@ -23,8 +24,8 @@ class RS_ActionSnapIntersectionManual: public RS_PreviewActionInterface }; public: - RS_ActionSnapIntersectionManual(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionSnapIntersectionManual(); + ActionSnapIntersectionManual(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionSnapIntersectionManual(); virtual void init(int status = 0); virtual void trigger(); @@ -40,4 +41,4 @@ class RS_ActionSnapIntersectionManual: public RS_PreviewActionInterface Vector coord; }; -#endif +#endif // __ACTIONSNAPINTERSECTIONMANUAL_H__ diff --git a/src/actions/rs_actiontoolregeneratedimensions.cpp b/src/actions/actiontoolregeneratedimensions.cpp similarity index 66% rename from src/actions/rs_actiontoolregeneratedimensions.cpp rename to src/actions/actiontoolregeneratedimensions.cpp index 04827e6..e8cc180 100644 --- a/src/actions/rs_actiontoolregeneratedimensions.cpp +++ b/src/actions/actiontoolregeneratedimensions.cpp @@ -1,4 +1,4 @@ -// rs_actiontoolregeneratedimensions.cpp +// actiontoolregeneratedimensions.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,31 +12,31 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actiontoolregeneratedimensions.h" +#include "actiontoolregeneratedimensions.h" #include "rs_dialogfactory.h" #include "rs_dimension.h" #include "graphicview.h" #include "rs_information.h" -RS_ActionToolRegenerateDimensions::RS_ActionToolRegenerateDimensions(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Tool Regen Dim", container, graphicView) +ActionToolRegenerateDimensions::ActionToolRegenerateDimensions(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Tool Regen Dim", container, graphicView) { } -RS_ActionToolRegenerateDimensions::~RS_ActionToolRegenerateDimensions() +ActionToolRegenerateDimensions::~ActionToolRegenerateDimensions() { } -void RS_ActionToolRegenerateDimensions::init(int status) +void ActionToolRegenerateDimensions::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } -void RS_ActionToolRegenerateDimensions::trigger() +void ActionToolRegenerateDimensions::trigger() { - RS_DEBUG->print("RS_ActionToolRegenerateDimensions::trigger()"); + RS_DEBUG->print("ActionToolRegenerateDimensions::trigger()"); int num = 0; @@ -65,4 +65,4 @@ void RS_ActionToolRegenerateDimensions::trigger() finish(); } -// EOF + diff --git a/src/actions/actiontoolregeneratedimensions.h b/src/actions/actiontoolregeneratedimensions.h new file mode 100644 index 0000000..9ca8d95 --- /dev/null +++ b/src/actions/actiontoolregeneratedimensions.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONTOOLREGENERATEDIMENSIONS_H__ +#define __ACTIONTOOLREGENERATEDIMENSIONS_H__ + +#include "actioninterface.h" + +/** + * This action class can handle user events to regenerate dimensions. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionToolRegenerateDimensions: public ActionInterface +{ + public: + ActionToolRegenerateDimensions(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionToolRegenerateDimensions(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONTOOLREGENERATEDIMENSIONS_H__ diff --git a/src/actions/rs_actionzoomauto.cpp b/src/actions/actionzoomauto.cpp similarity index 69% rename from src/actions/rs_actionzoomauto.cpp rename to src/actions/actionzoomauto.cpp index 1d57827..bc0ee2b 100644 --- a/src/actions/rs_actionzoomauto.cpp +++ b/src/actions/actionzoomauto.cpp @@ -1,4 +1,4 @@ -// rs_actionzoomauto.cpp +// actionzoomauto.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionzoomauto.h" +#include "actionzoomauto.h" #include "graphicview.h" @@ -22,24 +22,24 @@ * @param keepAspectRatio true: keep same zoom value for x/y. * false: adjust both x and y individually */ -RS_ActionZoomAuto::RS_ActionZoomAuto(RS_EntityContainer & container, +ActionZoomAuto::ActionZoomAuto(RS_EntityContainer & container, GraphicView & graphicView, bool keepAspectRatio): - RS_ActionInterface("Auto zoom", container, graphicView) + ActionInterface("Auto zoom", container, graphicView) { this->keepAspectRatio = keepAspectRatio; } -RS_ActionZoomAuto::~RS_ActionZoomAuto() +ActionZoomAuto::~ActionZoomAuto() { } -void RS_ActionZoomAuto::init(int status) +void ActionZoomAuto::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } -void RS_ActionZoomAuto::trigger() +void ActionZoomAuto::trigger() { graphicView->zoomAuto(false, keepAspectRatio); finish(); diff --git a/src/actions/actionzoomauto.h b/src/actions/actionzoomauto.h new file mode 100644 index 0000000..d9c7cba --- /dev/null +++ b/src/actions/actionzoomauto.h @@ -0,0 +1,25 @@ +#ifndef __ACTIONZOOMAUTO_H__ +#define __ACTIONZOOMAUTO_H__ + +#include "actioninterface.h" + +/** + * This action triggers an auto zoom. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionZoomAuto: public ActionInterface +{ + public: + ActionZoomAuto(RS_EntityContainer & container, GraphicView & graphicView, bool keepAspectRatio = true); + ~ActionZoomAuto(); + + virtual void init(int status = 0); + virtual void trigger(); + + protected: + bool keepAspectRatio; +}; + +#endif // __ACTIONZOOMAUTO_H__ diff --git a/src/actions/rs_actionzoomautoy.cpp b/src/actions/actionzoomautoy.cpp similarity index 57% rename from src/actions/rs_actionzoomautoy.cpp rename to src/actions/actionzoomautoy.cpp index 1705ff6..a083255 100644 --- a/src/actions/rs_actionzoomautoy.cpp +++ b/src/actions/actionzoomautoy.cpp @@ -1,4 +1,4 @@ -// rs_actionzoomautoy.cpp +// actionzoomautoy.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,27 +12,27 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionzoomautoy.h" +#include "actionzoomautoy.h" #include "graphicview.h" -RS_ActionZoomAutoY::RS_ActionZoomAutoY(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Auto zoom Y", container, graphicView) +ActionZoomAutoY::ActionZoomAutoY(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Auto zoom Y", container, graphicView) { } -RS_ActionZoomAutoY::~RS_ActionZoomAutoY() +ActionZoomAutoY::~ActionZoomAutoY() { } -void RS_ActionZoomAutoY::trigger() +void ActionZoomAutoY::trigger() { graphicView->zoomAutoY(false); finish(); } -void RS_ActionZoomAutoY::init(int status) +void ActionZoomAutoY::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } diff --git a/src/actions/actionzoomautoy.h b/src/actions/actionzoomautoy.h new file mode 100644 index 0000000..2857670 --- /dev/null +++ b/src/actions/actionzoomautoy.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONZOOMAUTOY_H__ +#define __ACTIONZOOMAUTOY_H__ + +#include "actioninterface.h" + +/** + * This action triggers an auto zoom in Y only. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionZoomAutoY: public ActionInterface +{ + public: + ActionZoomAutoY(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionZoomAutoY(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONZOOMAUTOY_H__ diff --git a/src/actions/rs_actionzoomin.cpp b/src/actions/actionzoomin.cpp similarity index 72% rename from src/actions/rs_actionzoomin.cpp rename to src/actions/actionzoomin.cpp index dd37159..03147b4 100644 --- a/src/actions/rs_actionzoomin.cpp +++ b/src/actions/actionzoomin.cpp @@ -1,4 +1,4 @@ -// rs_actionzoomin.cpp +// actionzoomin.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/28/2010 Added this text. :-) // -#include "rs_actionzoomin.h" +#include "actionzoomin.h" #include "graphicview.h" @@ -22,25 +22,25 @@ * @param direction In for zooming in, Out for zooming out. * @param axis Axis that are affected by the zoom (OnlyX, OnlyY or Both) */ -RS_ActionZoomIn::RS_ActionZoomIn(RS_EntityContainer & container, GraphicView & graphicView, RS2::ZoomDirection direction, RS2::Axis axis, const Vector & center): - RS_ActionInterface("Zoom in", container, graphicView) +ActionZoomIn::ActionZoomIn(RS_EntityContainer & container, GraphicView & graphicView, RS2::ZoomDirection direction, RS2::Axis axis, const Vector & center): + ActionInterface("Zoom in", container, graphicView) { this->direction = direction; this->axis = axis; this->center = center; } -RS_ActionZoomIn::~RS_ActionZoomIn() +ActionZoomIn::~ActionZoomIn() { } -void RS_ActionZoomIn::init(int status) +void ActionZoomIn::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } -void RS_ActionZoomIn::trigger() +void ActionZoomIn::trigger() { switch (axis) { @@ -72,4 +72,4 @@ void RS_ActionZoomIn::trigger() finish(); } -// EOF + diff --git a/src/actions/actionzoomin.h b/src/actions/actionzoomin.h new file mode 100644 index 0000000..23de8d7 --- /dev/null +++ b/src/actions/actionzoomin.h @@ -0,0 +1,29 @@ +#ifndef __ACTIONZOOMIN_H__ +#define __ACTIONZOOMIN_H__ + +#include "rs.h" +#include "actioninterface.h" +#include "vector.h" + +/** + * This action triggers zoom increase. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionZoomIn: public ActionInterface +{ + public: + ActionZoomIn(RS_EntityContainer & container, GraphicView & graphicView, RS2::ZoomDirection direction = RS2::In, RS2::Axis axis = RS2::Both, const Vector & center = Vector(false)); + ~ActionZoomIn(); + + virtual void init(int status = 0); + virtual void trigger(); + + protected: + RS2::ZoomDirection direction; + RS2::Axis axis; + Vector center; +}; + +#endif // __ACTIONZOOMIN_H__ diff --git a/src/actions/rs_actionzoompan.cpp b/src/actions/actionzoompan.cpp similarity index 64% rename from src/actions/rs_actionzoompan.cpp rename to src/actions/actionzoompan.cpp index e4ce07a..0425f60 100644 --- a/src/actions/rs_actionzoompan.cpp +++ b/src/actions/actionzoompan.cpp @@ -1,4 +1,4 @@ -// rs_actionzoompan.cpp +// actionzoompan.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,28 +12,28 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionzoompan.h" +#include "actionzoompan.h" #include "graphicview.h" -RS_ActionZoomPan::RS_ActionZoomPan(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Zoom Pan", container, graphicView) +ActionZoomPan::ActionZoomPan(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Zoom Pan", container, graphicView) { } -RS_ActionZoomPan::~RS_ActionZoomPan() +ActionZoomPan::~ActionZoomPan() { } -void RS_ActionZoomPan::init(int status) +void ActionZoomPan::init(int status) { - RS_ActionInterface::init(status); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; + ActionInterface::init(status); +/* snapMode = RS2::SnapFree; + snapRes = RS2::RestrictNothing;*/ x1 = y1 = x2 = y2 = -1; } -void RS_ActionZoomPan::trigger() +void ActionZoomPan::trigger() { if (x1 >= 0) { @@ -44,7 +44,7 @@ void RS_ActionZoomPan::trigger() } #define SCROLL_DELTA 4 -void RS_ActionZoomPan::mouseMoveEvent(QMouseEvent * e) +void ActionZoomPan::mouseMoveEvent(QMouseEvent * e) { x2 = e->x(); y2 = e->y(); @@ -57,7 +57,7 @@ void RS_ActionZoomPan::mouseMoveEvent(QMouseEvent * e) trigger(); } -void RS_ActionZoomPan::mousePressEvent(QMouseEvent * e) +void ActionZoomPan::mousePressEvent(QMouseEvent * e) { if (e->button() == Qt::MidButton || e->button() == Qt::LeftButton) { @@ -67,7 +67,7 @@ void RS_ActionZoomPan::mousePressEvent(QMouseEvent * e) } } -void RS_ActionZoomPan::mouseReleaseEvent(QMouseEvent * e) +void ActionZoomPan::mouseReleaseEvent(QMouseEvent * e) { if (e->button() == Qt::RightButton) init(getStatus() - 1); @@ -75,11 +75,9 @@ void RS_ActionZoomPan::mouseReleaseEvent(QMouseEvent * e) init(-1); else setStatus(0); - - //RS_DEBUG->print("RS_ActionZoomPan::mousePressEvent(): %f %f", v1.x, v1.y); } -void RS_ActionZoomPan::updateMouseCursor() +void ActionZoomPan::updateMouseCursor() { #ifndef __APPLE__ graphicView->setMouseCursor(RS2::SizeAllCursor); diff --git a/src/actions/rs_actionzoompan.h b/src/actions/actionzoompan.h similarity index 59% rename from src/actions/rs_actionzoompan.h rename to src/actions/actionzoompan.h index a2cc839..526ab56 100644 --- a/src/actions/rs_actionzoompan.h +++ b/src/actions/actionzoompan.h @@ -1,18 +1,19 @@ -#ifndef RS_ACTIONZOOMPAN_H -#define RS_ACTIONZOOMPAN_H +#ifndef __ACTIONZOOMPAN_H__ +#define __ACTIONZOOMPAN_H__ -#include "rs_actioninterface.h" +#include "actioninterface.h" /** * This action class can handle user events to zoom in a window. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionZoomPan: public RS_ActionInterface +class ActionZoomPan: public ActionInterface { public: - RS_ActionZoomPan(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionZoomPan(); + ActionZoomPan(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionZoomPan(); virtual void init(int status = 0); virtual void trigger(); @@ -28,4 +29,4 @@ class RS_ActionZoomPan: public RS_ActionInterface int y2; }; -#endif +#endif // __ACTIONZOOMPAN_H__ diff --git a/src/actions/rs_actionzoomprevious.cpp b/src/actions/actionzoomprevious.cpp similarity index 56% rename from src/actions/rs_actionzoomprevious.cpp rename to src/actions/actionzoomprevious.cpp index eb0642b..de28379 100644 --- a/src/actions/rs_actionzoomprevious.cpp +++ b/src/actions/actionzoomprevious.cpp @@ -1,4 +1,4 @@ -// rs_actionzoomprevious.cpp +// actionzoomprevious.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,29 +12,29 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionzoomprevious.h" +#include "actionzoomprevious.h" #include "graphicview.h" /** * Constructor. */ -RS_ActionZoomPrevious::RS_ActionZoomPrevious(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Previous zoom", container, graphicView) +ActionZoomPrevious::ActionZoomPrevious(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Previous zoom", container, graphicView) { } -RS_ActionZoomPrevious::~RS_ActionZoomPrevious() +ActionZoomPrevious::~ActionZoomPrevious() { } -void RS_ActionZoomPrevious::init(int status) +void ActionZoomPrevious::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } -void RS_ActionZoomPrevious::trigger() +void ActionZoomPrevious::trigger() { graphicView->zoomPrevious(); finish(); diff --git a/src/actions/actionzoomprevious.h b/src/actions/actionzoomprevious.h new file mode 100644 index 0000000..9604664 --- /dev/null +++ b/src/actions/actionzoomprevious.h @@ -0,0 +1,24 @@ +#ifndef __ACTIONZOOMPREVIOUS_H__ +#define __ACTIONZOOMPREVIOUS_H__ + +#include "actioninterface.h" + +/** + * This action switches back to the previously used view.. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionZoomPrevious: public ActionInterface +{ + public: + ActionZoomPrevious(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionZoomPrevious(); + + virtual void init(int status = 0); + virtual void trigger(); + + protected: +}; + +#endif // __ACTIONZOOMPREVIOUS_H__ diff --git a/src/actions/rs_actionzoomredraw.cpp b/src/actions/actionzoomredraw.cpp similarity index 63% rename from src/actions/rs_actionzoomredraw.cpp rename to src/actions/actionzoomredraw.cpp index 3cd34d3..eeaaa08 100644 --- a/src/actions/rs_actionzoomredraw.cpp +++ b/src/actions/actionzoomredraw.cpp @@ -1,4 +1,4 @@ -// rs_actionzoomredraw.cpp +// actionzoomredraw.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionzoomredraw.h" +#include "actionzoomredraw.h" #include "graphicview.h" @@ -22,22 +22,22 @@ * @param keepAspectRatio true: keep same zoom value for x/y. * false: adjust both x and y individually */ -RS_ActionZoomRedraw::RS_ActionZoomRedraw(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Redraw", container, graphicView) +ActionZoomRedraw::ActionZoomRedraw(RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Redraw", container, graphicView) { } -RS_ActionZoomRedraw::~RS_ActionZoomRedraw() +ActionZoomRedraw::~ActionZoomRedraw() { } -void RS_ActionZoomRedraw::init(int status) +void ActionZoomRedraw::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } -void RS_ActionZoomRedraw::trigger() +void ActionZoomRedraw::trigger() { graphicView->redraw(); finish(); diff --git a/src/actions/actionzoomredraw.h b/src/actions/actionzoomredraw.h new file mode 100644 index 0000000..4cdf6e5 --- /dev/null +++ b/src/actions/actionzoomredraw.h @@ -0,0 +1,22 @@ +#ifndef __ACTIONZOOMREDRAW_H__ +#define __ACTIONZOOMREDRAW_H__ + +#include "actioninterface.h" + +/** + * This action triggers an auto zoom. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionZoomRedraw: public ActionInterface +{ + public: + ActionZoomRedraw(RS_EntityContainer & container, GraphicView & graphicView); + ~ActionZoomRedraw(); + + virtual void init(int status = 0); + virtual void trigger(); +}; + +#endif // __ACTIONZOOMREDRAW_H__ diff --git a/src/actions/rs_actionzoomscroll.cpp b/src/actions/actionzoomscroll.cpp similarity index 56% rename from src/actions/rs_actionzoomscroll.cpp rename to src/actions/actionzoomscroll.cpp index 50779c4..f5ac790 100644 --- a/src/actions/rs_actionzoomscroll.cpp +++ b/src/actions/actionzoomscroll.cpp @@ -1,4 +1,4 @@ -// rs_actionzoomscroll.cpp +// actionzoomscroll.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,28 +12,28 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionzoomscroll.h" +#include "actionzoomscroll.h" #include "graphicview.h" -RS_ActionZoomScroll::RS_ActionZoomScroll(RS2::Direction direction, RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Zoom scroll", container, graphicView) +ActionZoomScroll::ActionZoomScroll(RS2::Direction direction, RS_EntityContainer & container, GraphicView & graphicView): + ActionInterface("Zoom scroll", container, graphicView) { this->direction = direction; } -RS_ActionZoomScroll::~RS_ActionZoomScroll() +ActionZoomScroll::~ActionZoomScroll() { } -void RS_ActionZoomScroll::trigger() +void ActionZoomScroll::trigger() { graphicView->zoomScroll(direction); finish(); } -void RS_ActionZoomScroll::init(int status) +void ActionZoomScroll::init(int status) { - RS_ActionInterface::init(status); + ActionInterface::init(status); trigger(); } diff --git a/src/actions/actionzoomscroll.h b/src/actions/actionzoomscroll.h new file mode 100644 index 0000000..cbe683a --- /dev/null +++ b/src/actions/actionzoomscroll.h @@ -0,0 +1,25 @@ +#ifndef __ACTIONZOOMSCROLL_H__ +#define __ACTIONZOOMSCROLL_H__ + +#include "actioninterface.h" + +/** + * This action triggers a scrolling. + * + * @author James Hammons + * @author Andrew Mustun + */ +class ActionZoomScroll: public ActionInterface +{ + public: + ActionZoomScroll(RS2::Direction direction, RS_EntityContainer & container, GraphicView & graphicView); + ~ActionZoomScroll(); + + virtual void init(int status = 0); + virtual void trigger(); + + protected: + RS2::Direction direction; +}; + +#endif // __ACTIONZOOMSCROLL_H__ diff --git a/src/actions/rs_actionzoomwindow.cpp b/src/actions/actionzoomwindow.cpp similarity index 65% rename from src/actions/rs_actionzoomwindow.cpp rename to src/actions/actionzoomwindow.cpp index 1c53bbb..e16c7ae 100644 --- a/src/actions/rs_actionzoomwindow.cpp +++ b/src/actions/actionzoomwindow.cpp @@ -1,4 +1,4 @@ -// rs_actionzoomwindow.cpp +// actionzoomwindow.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 06/05/2010 Added this text. :-) // -#include "rs_actionzoomwindow.h" +#include "actionzoomwindow.h" #include "rs_dialogfactory.h" #include "graphicview.h" @@ -25,32 +25,31 @@ * in x and y will stay the same. false Exactly the chosen * area will be fit to the viewport. */ -RS_ActionZoomWindow::RS_ActionZoomWindow(RS_EntityContainer & container, +ActionZoomWindow::ActionZoomWindow(RS_EntityContainer & container, GraphicView & graphicView, bool keepAspectRatio): - RS_PreviewActionInterface("Zoom Window", container, graphicView) + ActionInterface("Zoom Window", container, graphicView) { this->keepAspectRatio = keepAspectRatio; } -RS_ActionZoomWindow::~RS_ActionZoomWindow() +ActionZoomWindow::~ActionZoomWindow() { } -void RS_ActionZoomWindow::init(int status) +void ActionZoomWindow::init(int status) { - RS_DEBUG->print("RS_ActionZoomWindow::init()"); - - RS_PreviewActionInterface::init(status); + RS_DEBUG->print("ActionZoomWindow::init()"); + ActionInterface::init(status); v1 = v2 = Vector(false); - snapMode = RS2::SnapFree; - snapRes = RS2::RestrictNothing; +/* snapMode = RS2::SnapFree; + snapRes = RS2::RestrictNothing;*/ } -void RS_ActionZoomWindow::trigger() +void ActionZoomWindow::trigger() { - RS_DEBUG->print("RS_ActionZoomWindow::trigger()"); + RS_DEBUG->print("ActionZoomWindow::trigger()"); - RS_PreviewActionInterface::trigger(); + ActionInterface::trigger(); if (v1.valid && v2.valid) { @@ -65,26 +64,26 @@ void RS_ActionZoomWindow::trigger() } } -void RS_ActionZoomWindow::mouseMoveEvent(QMouseEvent * e) +void ActionZoomWindow::mouseMoveEvent(QMouseEvent * e) { if (getStatus() == 1 && v1.valid) { v2 = snapPoint(e); deletePreview(); clearPreview(); - preview->addEntity(new RS_Line(preview, +/* preview->addEntity(new RS_Line(preview, RS_LineData(Vector(v1.x, v1.y), Vector(v2.x, v1.y)))); preview->addEntity(new RS_Line(preview, RS_LineData(Vector(v2.x, v1.y), Vector(v2.x, v2.y)))); preview->addEntity(new RS_Line(preview, RS_LineData(Vector(v2.x, v2.y), Vector(v1.x, v2.y)))); preview->addEntity(new RS_Line(preview, - RS_LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y)))); + RS_LineData(Vector(v1.x, v2.y), Vector(v1.x, v1.y))));*/ drawPreview(); } } -void RS_ActionZoomWindow::mousePressEvent(QMouseEvent * e) +void ActionZoomWindow::mousePressEvent(QMouseEvent * e) { if (e->button() == Qt::LeftButton) { @@ -100,12 +99,12 @@ void RS_ActionZoomWindow::mousePressEvent(QMouseEvent * e) } } - RS_DEBUG->print("RS_ActionZoomWindow::mousePressEvent(): %f %f", v1.x, v1.y); + RS_DEBUG->print("ActionZoomWindow::mousePressEvent(): %f %f", v1.x, v1.y); } -void RS_ActionZoomWindow::mouseReleaseEvent(QMouseEvent * e) +void ActionZoomWindow::mouseReleaseEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_ActionZoomWindow::mouseReleaseEvent()"); + RS_DEBUG->print("ActionZoomWindow::mouseReleaseEvent()"); if (e->button() == Qt::RightButton) { @@ -122,9 +121,9 @@ void RS_ActionZoomWindow::mouseReleaseEvent(QMouseEvent * e) } } -void RS_ActionZoomWindow::updateMouseButtonHints() +void ActionZoomWindow::updateMouseButtonHints() { - RS_DEBUG->print("RS_ActionZoomWindow::updateMouseButtonHints()"); + RS_DEBUG->print("ActionZoomWindow::updateMouseButtonHints()"); switch (getStatus()) { @@ -142,9 +141,9 @@ void RS_ActionZoomWindow::updateMouseButtonHints() } } -void RS_ActionZoomWindow::updateMouseCursor() +void ActionZoomWindow::updateMouseCursor() { graphicView->setMouseCursor(RS2::MagnifierCursor); } -// EOF + diff --git a/src/actions/rs_actionzoomwindow.h b/src/actions/actionzoomwindow.h similarity index 60% rename from src/actions/rs_actionzoomwindow.h rename to src/actions/actionzoomwindow.h index f1f8165..628da6f 100644 --- a/src/actions/rs_actionzoomwindow.h +++ b/src/actions/actionzoomwindow.h @@ -1,19 +1,20 @@ -#ifndef RS_ACTIONZOOMWINDOW_H -#define RS_ACTIONZOOMWINDOW_H +#ifndef __ACTIONZOOMWINDOW_H__ +#define __ACTIONZOOMWINDOW_H__ -#include "rs_previewactioninterface.h" +#include "actioninterface.h" #include "vector.h" /** * This action class can handle user events to zoom in a window. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionZoomWindow: public RS_PreviewActionInterface +class ActionZoomWindow: public ActionInterface { public: - RS_ActionZoomWindow(RS_EntityContainer & container, GraphicView & graphicView, bool keepAspectRatio = true); - ~RS_ActionZoomWindow(); + ActionZoomWindow(RS_EntityContainer & container, GraphicView & graphicView, bool keepAspectRatio = true); + ~ActionZoomWindow(); virtual void init(int status = 0); virtual void trigger(); @@ -30,4 +31,4 @@ class RS_ActionZoomWindow: public RS_PreviewActionInterface bool keepAspectRatio; }; -#endif +#endif // __ACTIONZOOMWINDOW_H__ diff --git a/src/actions/rs_actionblocksadd.cpp b/src/actions/rs_actionblocksadd.cpp deleted file mode 100644 index d8b197f..0000000 --- a/src/actions/rs_actionblocksadd.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** $Id: rs_actionblocksadd.cpp 1062 2004-01-16 21:51:20Z andrew $ -** -** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. -** -** This file is part of the qcadlib Library project. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid qcadlib Professional Edition licenses may use -** this file in accordance with the qcadlib Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.ribbonsoft.com for further details. -** -** Contact info@ribbonsoft.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "rs_actionblocksadd.h" - -#include "drawing.h" -#include "rs_dialogfactory.h" - -RS_ActionBlocksAdd::RS_ActionBlocksAdd(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Add Block", container, graphicView) -{ -} - -QAction * RS_ActionBlocksAdd::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/) -{ -//OLD: Descr, Menu text, Key sequ., QObject * parent, ... -// QAction * action = new QAction(tr("Add Block"), tr("&Add Block"), -// QKeySequence(), NULL); - QAction * action = new QAction(tr("&Add Block"), 0); - action->setStatusTip(tr("Add Block")); - return action; -} - -void RS_ActionBlocksAdd::trigger() -{ - RS_DEBUG->print("adding block"); - //RS_Block* block = new RS_Block(container, "", Vector(0.0,0.0)); - - if (graphic != NULL) - { - RS_BlockList * blockList = graphic->getBlockList(); - - if (blockList != NULL) - { - RS_BlockData d = RS_DIALOGFACTORY->requestNewBlockDialog(blockList); - - if (d.isValid()) - graphic->addBlock(new RS_Block(container, d)); - } - } - - finish(); -} - -void RS_ActionBlocksAdd::init(int status) -{ - RS_ActionInterface::init(status); - trigger(); -} - -// EOF diff --git a/src/actions/rs_actionblocksadd.h b/src/actions/rs_actionblocksadd.h deleted file mode 100644 index 5bb31b9..0000000 --- a/src/actions/rs_actionblocksadd.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** $Id: rs_actionblocksadd.h 1062 2004-01-16 21:51:20Z andrew $ -** -** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. -** -** This file is part of the qcadlib Library project. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid qcadlib Professional Edition licenses may use -** this file in accordance with the qcadlib Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.ribbonsoft.com for further details. -** -** Contact info@ribbonsoft.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef RS_ACTIONBLOCKSADD_H -#define RS_ACTIONBLOCKSADD_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to edit blocks. - * - * @author Andrew Mustun - */ -class RS_ActionBlocksAdd: public RS_ActionInterface -{ - //Q_OBJECT - public: - RS_ActionBlocksAdd(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionBlocksAdd() - { - } - - static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionblocksattributes.cpp b/src/actions/rs_actionblocksattributes.cpp deleted file mode 100644 index a4e084b..0000000 --- a/src/actions/rs_actionblocksattributes.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** $Id: rs_actionblocksattributes.cpp 1062 2004-01-16 21:51:20Z andrew $ -** -** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. -** -** This file is part of the qcadlib Library project. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid qcadlib Professional Edition licenses may use -** this file in accordance with the qcadlib Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.ribbonsoft.com for further details. -** -** Contact info@ribbonsoft.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "rs_actionblocksattributes.h" - -#include "drawing.h" -#include "rs_dialogfactory.h" - -RS_ActionBlocksAttributes::RS_ActionBlocksAttributes( - RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Edit Block Attributes", container, graphicView) -{ -} - -QAction * RS_ActionBlocksAttributes::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/) -{ - QAction * action = new QAction(tr("&Rename Block"), 0); -// QAction* action = new QAction(tr("Rename Block"), -// tr("&Rename Block"), -// QKeySequence(), NULL); - action->setStatusTip(tr("Rename Block and all Inserts")); - return action; -} - -void RS_ActionBlocksAttributes::trigger() -{ - RS_DEBUG->print("editing block attributes"); - - if (graphic != NULL && RS_DIALOGFACTORY != NULL) - { - RS_Block * block = graphic->getActiveBlock(); - RS_BlockList * blockList = graphic->getBlockList(); - - if (blockList != NULL && block != NULL) - { - QString oldName = block->getName(); - - RS_BlockData d; - d = RS_DIALOGFACTORY->requestBlockAttributesDialog( - blockList); - - if (d.isValid()) - { - QString newName = d.name; - blockList->rename(block, newName); - - // update the name of all inserts: - graphic->renameInserts(oldName, newName); - - graphic->addBlockNotification(); - } - } - } - finish(); -} - -void RS_ActionBlocksAttributes::init(int status) -{ - RS_ActionInterface::init(status); - trigger(); -} - -// EOF diff --git a/src/actions/rs_actionblocksattributes.h b/src/actions/rs_actionblocksattributes.h deleted file mode 100644 index 5945bde..0000000 --- a/src/actions/rs_actionblocksattributes.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** $Id: rs_actionblocksattributes.h 1062 2004-01-16 21:51:20Z andrew $ -** -** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. -** -** This file is part of the qcadlib Library project. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid qcadlib Professional Edition licenses may use -** this file in accordance with the qcadlib Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.ribbonsoft.com for further details. -** -** Contact info@ribbonsoft.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef RS_ACTIONBLOCKSATTRIBUTES_H -#define RS_ACTIONBLOCKSATTRIBUTES_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to edit block attributes. - * - * @author Andrew Mustun - */ -class RS_ActionBlocksAttributes: public RS_ActionInterface -{ - //Q_OBJECT - public: - RS_ActionBlocksAttributes(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionBlocksAttributes() - { - } - - static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionblocksedit.cpp b/src/actions/rs_actionblocksedit.cpp deleted file mode 100644 index 3383648..0000000 --- a/src/actions/rs_actionblocksedit.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** $Id: rs_actionblocksedit.cpp 1161 2004-12-09 23:10:09Z andrew $ -** -** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. -** -** This file is part of the qcadlib Library project. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid qcadlib Professional Edition licenses may use -** this file in accordance with the qcadlib Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.ribbonsoft.com for further details. -** -** Contact info@ribbonsoft.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "rs_actionblocksedit.h" - -#include "drawing.h" -#include "rs_dialogfactory.h" - -RS_ActionBlocksEdit::RS_ActionBlocksEdit(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Edit Block", container, graphicView) -{ -} - -QAction * RS_ActionBlocksEdit::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/) -{ - QAction * action = new QAction(tr("&Edit Block"), 0); -// QAction* action = new QAction(tr("Edit Block"), tr("&Edit Block"), -// QKeySequence(), NULL); - action->setStatusTip(tr("Edit Block")); - return action; -} - -void RS_ActionBlocksEdit::trigger() -{ - RS_DEBUG->print("edit block"); - - if (graphic != NULL) - { - if (RS_DIALOGFACTORY != NULL) - RS_DIALOGFACTORY->requestEditBlockWindow(graphic->getBlockList()); - } - else - RS_DEBUG->print(RS_Debug::D_WARNING, - "RS_ActionBlocksEdit::trigger(): graphic is NULL"); - finish(); -} - -void RS_ActionBlocksEdit::init(int status) -{ - RS_ActionInterface::init(status); - trigger(); -} - diff --git a/src/actions/rs_actionblocksedit.h b/src/actions/rs_actionblocksedit.h deleted file mode 100644 index 0a0780e..0000000 --- a/src/actions/rs_actionblocksedit.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** $Id: rs_actionblocksedit.h 1062 2004-01-16 21:51:20Z andrew $ -** -** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. -** -** This file is part of the qcadlib Library project. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid qcadlib Professional Edition licenses may use -** this file in accordance with the qcadlib Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.ribbonsoft.com for further details. -** -** Contact info@ribbonsoft.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef RS_ACTIONBLOCKSEDIT_H -#define RS_ACTIONBLOCKSEDIT_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to edit blocks. - * - * @author Andrew Mustun - */ -class RS_ActionBlocksEdit: public RS_ActionInterface -{ - //Q_OBJECT - public: - RS_ActionBlocksEdit(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionBlocksEdit() - { - } - - static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionblocksexplode.cpp b/src/actions/rs_actionblocksexplode.cpp deleted file mode 100644 index a868083..0000000 --- a/src/actions/rs_actionblocksexplode.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** $Id: rs_actionblocksexplode.cpp 1062 2004-01-16 21:51:20Z andrew $ -** -** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. -** -** This file is part of the qcadlib Library project. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid qcadlib Professional Edition licenses may use -** this file in accordance with the qcadlib Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.ribbonsoft.com for further details. -** -** Contact info@ribbonsoft.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "rs_actionblocksexplode.h" - -#include "rs_modification.h" - -/** - * Constructor. - */ -RS_ActionBlocksExplode::RS_ActionBlocksExplode(RS_EntityContainer & container, GraphicView & graphicView): - RS_PreviewActionInterface("Blocks Explode", - container, graphicView) -{ -} - -RS_ActionBlocksExplode::~RS_ActionBlocksExplode() -{ -} - -QAction * RS_ActionBlocksExplode::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/) -{ - QAction * action = new QAction(tr("&Explode"), 0); -// QAction* action = new QAction(tr("Explode"), -// tr("&Explode"), -// QKeySequence(), NULL); - action->setStatusTip(tr("Explode Blocks and other Entity Groups")); - - return action; -} - -void RS_ActionBlocksExplode::init(int status) -{ - RS_PreviewActionInterface::init(status); - - trigger(); - finish(); -} - -void RS_ActionBlocksExplode::trigger() -{ - RS_Modification m(*container, graphicView); - m.explode(); -} - -// EOF diff --git a/src/actions/rs_actionblocksexplode.h b/src/actions/rs_actionblocksexplode.h deleted file mode 100644 index d5fae51..0000000 --- a/src/actions/rs_actionblocksexplode.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** $Id: rs_actionblocksexplode.h 1062 2004-01-16 21:51:20Z andrew $ -** -** Copyright (C) 2001-2003 RibbonSoft. All rights reserved. -** -** This file is part of the qcadlib Library project. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** Licensees holding valid qcadlib Professional Edition licenses may use -** this file in accordance with the qcadlib Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.ribbonsoft.com for further details. -** -** Contact info@ribbonsoft.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef RS_ACTIONBLOCKSEXPLODE_H -#define RS_ACTIONBLOCKSEXPLODE_H - -#include "rs_previewactioninterface.h" -#include "rs_insert.h" - -/** - * This action class can handle user events for exploding blocks and - * other entity containers into single entities. - * - * @author Andrew Mustun - */ -class RS_ActionBlocksExplode: public RS_PreviewActionInterface -{ - //Q_OBJECT - public: - RS_ActionBlocksExplode(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionBlocksExplode(); - - static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); - - virtual RS2::ActionType rtti() - { - return RS2::ActionBlocksExplode; - } - - virtual void init(int status = 0); - - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionblocksfreezeall.h b/src/actions/rs_actionblocksfreezeall.h deleted file mode 100644 index 6f75d9e..0000000 --- a/src/actions/rs_actionblocksfreezeall.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef RS_ACTIONBLOCKSFREEZEALL_H -#define RS_ACTIONBLOCKSFREEZEALL_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to edit layers. - * - * @author Andrew Mustun - */ -class RS_ActionBlocksFreezeAll: public RS_ActionInterface -{ - public: - RS_ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionBlocksFreezeAll(); - - virtual void init(int status = 0); - virtual void trigger(); - - private: - bool freeze; -}; - -#endif diff --git a/src/actions/rs_actionblocksremove.h b/src/actions/rs_actionblocksremove.h deleted file mode 100644 index ed0faf8..0000000 --- a/src/actions/rs_actionblocksremove.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONBLOCKSREMOVE_H -#define RS_ACTIONBLOCKSREMOVE_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to remove blocks. - * - * @author Andrew Mustun - */ -class RS_ActionBlocksRemove: public RS_ActionInterface -{ - public: - RS_ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionBlocksRemove(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionblockstoggleview.h b/src/actions/rs_actionblockstoggleview.h deleted file mode 100644 index f48d90d..0000000 --- a/src/actions/rs_actionblockstoggleview.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONBLOCKSTOGGLEVIEW_H -#define RS_ACTIONBLOCKSTOGGLEVIEW_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to edit layers. - * - * @author Andrew Mustun - */ -class RS_ActionBlocksToggleView: public RS_ActionInterface -{ - public: - RS_ActionBlocksToggleView(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionBlocksToggleView(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actioneditundo.h b/src/actions/rs_actioneditundo.h deleted file mode 100644 index 9b9720a..0000000 --- a/src/actions/rs_actioneditundo.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef RS_ACTIONEDITUNDO_H -#define RS_ACTIONEDITUNDO_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events for undo / redo. - * - * @author Andrew Mustun - */ -class RS_ActionEditUndo: public RS_ActionInterface -{ - public: - RS_ActionEditUndo(bool undo, RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionEditUndo(); - - virtual void init(int status = 0); - virtual void trigger(); - - protected: - /** Undo (true) or redo (false) */ - bool undo; -}; - -#endif diff --git a/src/actions/rs_actionfilenew.h b/src/actions/rs_actionfilenew.h deleted file mode 100644 index 43ecc2e..0000000 --- a/src/actions/rs_actionfilenew.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONFILENEW_H -#define RS_ACTIONFILENEW_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to create new blank documents. - * - * @author Andrew Mustun - */ -class RS_ActionFileNew: public RS_ActionInterface -{ - public: - RS_ActionFileNew(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionFileNew(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionfileopen.h b/src/actions/rs_actionfileopen.h deleted file mode 100644 index eb478b1..0000000 --- a/src/actions/rs_actionfileopen.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONFILEOPEN_H -#define RS_ACTIONFILEOPEN_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to open files. - * - * @author Andrew Mustun - */ -class RS_ActionFileOpen: public RS_ActionInterface -{ - public: - RS_ActionFileOpen(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionFileOpen(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionfilesave.h b/src/actions/rs_actionfilesave.h deleted file mode 100644 index a2a119d..0000000 --- a/src/actions/rs_actionfilesave.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONFILESAVE_H -#define RS_ACTIONFILESAVE_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to save the current file. - * - * @author Andrew Mustun - */ -class RS_ActionFileSave: public RS_ActionInterface -{ - public: - RS_ActionFileSave(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionFileSave(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionfilesaveas.h b/src/actions/rs_actionfilesaveas.h deleted file mode 100644 index 33a609d..0000000 --- a/src/actions/rs_actionfilesaveas.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef RS_ACTIONFILESAVEAS_H -#define RS_ACTIONFILESAVEAS_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to export files - * in various formats. - * - * @author Andrew Mustun - */ -class RS_ActionFileSaveAs: public RS_ActionInterface -{ - public: - RS_ActionFileSaveAs(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionFileSaveAs(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actioninfoinside.h b/src/actions/rs_actioninfoinside.h deleted file mode 100644 index eaa7bfc..0000000 --- a/src/actions/rs_actioninfoinside.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef RS_ACTIONINFOINSIDE_H -#define RS_ACTIONINFOINSIDE_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events for checking if - * a given point is inside or outside the selected contour. - * - * @author Andrew Mustun - */ -class RS_ActionInfoInside: public RS_ActionInterface -{ - public: - RS_ActionInfoInside(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionInfoInside(); - - virtual void trigger(); - virtual void mouseMoveEvent(QMouseEvent * e); - virtual void mouseReleaseEvent(QMouseEvent * e); - virtual void updateMouseButtonHints(); - virtual void updateMouseCursor(); - virtual void updateToolBar(); - - private: - Vector pt; - RS_EntityContainer * contour; -}; - -#endif diff --git a/src/actions/rs_actioninfototallength.h b/src/actions/rs_actioninfototallength.h deleted file mode 100644 index 8225cb9..0000000 --- a/src/actions/rs_actioninfototallength.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef RS_ACTIONINFOTOTALLENGTH_H -#define RS_ACTIONINFOTOTALLENGTH_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to delete entities. - * - * @author Andrew Mustun - */ -class RS_ActionInfoTotalLength: public RS_ActionInterface -{ - public: - /** - * Action States. - */ - enum Status { - Acknowledge /**< Acknowledge or cancel. */ - }; - - public: - RS_ActionInfoTotalLength(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionInfoTotalLength(); - - virtual void init(int status = 0); - virtual void trigger(); - virtual void updateToolBar(); -}; - -#endif diff --git a/src/actions/rs_actionlayersadd.h b/src/actions/rs_actionlayersadd.h deleted file mode 100644 index 0c1b37e..0000000 --- a/src/actions/rs_actionlayersadd.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONLAYERSADD_H -#define RS_ACTIONLAYERSADD_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to add layers. - * - * @author Andrew Mustun - */ -class RS_ActionLayersAdd: public RS_ActionInterface -{ - public: - RS_ActionLayersAdd(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionLayersAdd(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionlayersedit.h b/src/actions/rs_actionlayersedit.h deleted file mode 100644 index 86f9adc..0000000 --- a/src/actions/rs_actionlayersedit.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONLAYERSEDIT_H -#define RS_ACTIONLAYERSEDIT_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to edit layers. - * - * @author Andrew Mustun - */ -class RS_ActionLayersEdit: public RS_ActionInterface -{ - public: - RS_ActionLayersEdit(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionLayersEdit(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionlayersfreezeall.cpp b/src/actions/rs_actionlayersfreezeall.cpp deleted file mode 100644 index 62308d0..0000000 --- a/src/actions/rs_actionlayersfreezeall.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// rs_actionlayersfreezeall.cpp -// -// Part of the Architektonas Project -// Originally part of QCad Community Edition by Andrew Mustun -// Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software -// -// JLH = James L. Hammons -// -// Who When What -// --- ---------- ----------------------------------------------------------- -// JLH 05/22/2010 Added this text. :-) -// - -#include "rs_actionlayersfreezeall.h" - -#include "drawing.h" - -RS_ActionLayersFreezeAll::RS_ActionLayersFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Freeze all Layers", container, graphicView) -{ - this->freeze = freeze; -} - -RS_ActionLayersFreezeAll::~RS_ActionLayersFreezeAll() -{ -} - -void RS_ActionLayersFreezeAll::trigger() -{ - RS_DEBUG->print("RS_ActionLayersFreezeAll::trigger"); - - if (graphic != NULL) - //RS_Layer* layer = graphic->getActiveLayer(); - graphic->freezeAllLayers(freeze); - - finish(); -} - -void RS_ActionLayersFreezeAll::init(int status) -{ - RS_ActionInterface::init(status); - trigger(); -} - diff --git a/src/actions/rs_actionlayersfreezeall.h b/src/actions/rs_actionlayersfreezeall.h deleted file mode 100644 index 11b9290..0000000 --- a/src/actions/rs_actionlayersfreezeall.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef RS_ACTIONLAYERSFREEZEALL_H -#define RS_ACTIONLAYERSFREEZEALL_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to edit layers. - * - * @author Andrew Mustun - */ -class RS_ActionLayersFreezeAll: public RS_ActionInterface -{ - public: - RS_ActionLayersFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionLayersFreezeAll(); - - virtual void init(int status = 0); - virtual void trigger(); - - private: - bool freeze; -}; - -#endif diff --git a/src/actions/rs_actionlayersremove.cpp b/src/actions/rs_actionlayersremove.cpp deleted file mode 100644 index ba4daef..0000000 --- a/src/actions/rs_actionlayersremove.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// rs_actionlayersedit.cpp -// -// Part of the Architektonas Project -// Originally part of QCad Community Edition by Andrew Mustun -// Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software -// -// JLH = James L. Hammons -// -// Who When What -// --- ---------- ----------------------------------------------------------- -// JLH 06/04/2010 Added this text. :-) -// - -#include "rs_actionlayersremove.h" - -#include "rs_dialogfactory.h" -#include "drawing.h" - -RS_ActionLayersRemove::RS_ActionLayersRemove(RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface("Remove Layer", container, graphicView) -{ -} - -RS_ActionLayersRemove::~RS_ActionLayersRemove() -{ -} - -void RS_ActionLayersRemove::trigger() -{ - RS_DEBUG->print("RS_ActionLayersRemove::trigger"); - - if (graphic != NULL) - { - RS_Layer * layer = - RS_DIALOGFACTORY->requestLayerRemovalDialog(graphic->getLayerList()); - - /* - if (layer!=NULL && layer->getName()!="0") { - - graphic->startUndoCycle(); - for (RS_Entity* e=graphic->firstEntity(RS2::ResolveNone); - e!=NULL; - e=graphic->nextEntity(RS2::ResolveNone)) { - - if (e->getLayer()!=NULL && - e->getLayer()->getName()==layer->getName()) { - - e->setUndoState(true); - e->setLayer("0"); - graphic->addUndoable(e); - } - } - - - graphic->endUndoCycle(); - */ - - // Now remove the layer from the layer list: - graphic->removeLayer(layer); - } - finish(); - RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected()); -} - -void RS_ActionLayersRemove::init(int status) -{ - RS_ActionInterface::init(status); - trigger(); -} - -// EOF diff --git a/src/actions/rs_actionlayersremove.h b/src/actions/rs_actionlayersremove.h deleted file mode 100644 index f0be5ca..0000000 --- a/src/actions/rs_actionlayersremove.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONLAYERSREMOVE_H -#define RS_ACTIONLAYERSREMOVE_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to remove layers. - * - * @author Andrew Mustun - */ -class RS_ActionLayersRemove: public RS_ActionInterface -{ - public: - RS_ActionLayersRemove(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionLayersRemove(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionlayerstogglelock.h b/src/actions/rs_actionlayerstogglelock.h deleted file mode 100644 index 80f60b0..0000000 --- a/src/actions/rs_actionlayerstogglelock.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONLAYERSTOGGLELOCK_H -#define RS_ACTIONLAYERSTOGGLELOCK_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to edit layers. - * - * @author Andrew Mustun - */ -class RS_ActionLayersToggleLock: public RS_ActionInterface -{ - public: - RS_ActionLayersToggleLock(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionLayersToggleLock(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionlayerstoggleview.h b/src/actions/rs_actionlayerstoggleview.h deleted file mode 100644 index 95e737d..0000000 --- a/src/actions/rs_actionlayerstoggleview.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONLAYERSTOGGLEVIEW_H -#define RS_ACTIONLAYERSTOGGLEVIEW_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to edit layers. - * - * @author Andrew Mustun - */ -class RS_ActionLayersToggleView: public RS_ActionInterface -{ - public: - RS_ActionLayersToggleView(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionLayersToggleView(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionlockrelativezero.h b/src/actions/rs_actionlockrelativezero.h deleted file mode 100644 index 36bc65c..0000000 --- a/src/actions/rs_actionlockrelativezero.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef RS_ACTIONLOCKRELATIVEZERO_H -#define RS_ACTIONLOCKRELATIVEZERO_H - -#include "rs_previewactioninterface.h" - -/** - * This action class can handle user events to lock or unlock - * the relative Zero point. - * It overrides but retains the locking of the relative Zero. - * - * @author Ulf Lehnert - */ -class RS_ActionLockRelativeZero: public RS_ActionInterface -{ - public: - RS_ActionLockRelativeZero(RS_EntityContainer & container, GraphicView & graphicView, bool on); - ~RS_ActionLockRelativeZero(); - - virtual void init(int status = 0); - virtual void trigger(); - - private: - bool on; -}; - -#endif diff --git a/src/actions/rs_actionmodifyentity.h b/src/actions/rs_actionmodifyentity.h deleted file mode 100644 index c38477b..0000000 --- a/src/actions/rs_actionmodifyentity.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef RS_ACTIONMODIFYENTITY_H -#define RS_ACTIONMODIFYENTITY_H - -#include "rs_actioninterface.h" - -class RS_Entity; - -/** - * This action class can handle user events to select entities. - * - * @author Andrew Mustun - */ -class RS_ActionModifyEntity: public RS_ActionInterface -{ - //Q_OBJECT - public: - RS_ActionModifyEntity(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyEntity(); - - virtual void trigger(); - virtual void mouseReleaseEvent(QMouseEvent * e); - virtual void updateMouseCursor(); - - private: - RS_Entity * en; -}; - -#endif diff --git a/src/actions/rs_actionmodifyexplodetext.h b/src/actions/rs_actionmodifyexplodetext.h deleted file mode 100644 index f4e7c71..0000000 --- a/src/actions/rs_actionmodifyexplodetext.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef RS_ACTIONMODIFYEXPLODETEXT_H -#define RS_ACTIONMODIFYEXPLODETEXT_H - -#include "rs_previewactioninterface.h" - -/** - * This action class can handle user events for exploding blocks and - * other entity containers into single entities. - * - * @author Andrew Mustun - */ -class RS_ActionModifyExplodeText: public RS_PreviewActionInterface -{ - public: - RS_ActionModifyExplodeText(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionModifyExplodeText(); - - virtual RS2::ActionType rtti(); - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionoptionsdrawing.h b/src/actions/rs_actionoptionsdrawing.h deleted file mode 100644 index 27b5f7c..0000000 --- a/src/actions/rs_actionoptionsdrawing.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef RS_ACTIONOPTIONSDRAWING_H -#define RS_ACTIONOPTIONSDRAWING_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to change general - * application options. - * - * @author Andrew Mustun - */ -class RS_ActionOptionsDrawing: public RS_ActionInterface -{ - public: - RS_ActionOptionsDrawing(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionOptionsDrawing(); - - virtual RS2::ActionType rtti(); - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionselect.h b/src/actions/rs_actionselect.h deleted file mode 100644 index c4fb4c3..0000000 --- a/src/actions/rs_actionselect.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef RS_ACTIONSELECT_H -#define RS_ACTIONSELECT_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to select entities. - * - * @author Andrew Mustun - */ -class RS_ActionSelect: public RS_ActionInterface -{ - public: - RS_ActionSelect(RS_EntityContainer & container, GraphicView & graphicView, RS2::ActionType nextAction); - ~RS_ActionSelect(); - - void init(int status); - void mouseReleaseEvent(QMouseEvent * e); - void updateToolBar(); - - private: - RS2::ActionType nextAction; -}; - -#endif diff --git a/src/actions/rs_actionselectall.h b/src/actions/rs_actionselectall.h deleted file mode 100644 index daef00f..0000000 --- a/src/actions/rs_actionselectall.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef RS_ACTIONSELECTALL_H -#define RS_ACTIONSELECTALL_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to select all entities. - * - * @author Andrew Mustun - */ -class RS_ActionSelectAll: public RS_ActionInterface -{ - public: - RS_ActionSelectAll(RS_EntityContainer & container, GraphicView & graphicView, bool select); - ~RS_ActionSelectAll(); - - virtual RS2::ActionType rtti(); - void init(int status); - virtual void trigger(); - - protected: - bool select; -}; - -#endif diff --git a/src/actions/rs_actionselectbase.h b/src/actions/rs_actionselectbase.h deleted file mode 100644 index 6af7a6b..0000000 --- a/src/actions/rs_actionselectbase.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONSELECTBASE_H -#define RS_ACTIONSELECTBASE_H - -#include "rs_actioninterface.h" - -/** - * This class is the base class to all select actions. - * - * @author Andrew Mustun - */ -class RS_ActionSelectBase: public RS_ActionInterface -{ - public: - RS_ActionSelectBase(const char * name, RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionSelectBase(); - - virtual void keyReleaseEvent(QKeyEvent * e); - virtual void updateMouseCursor(); -}; - -#endif diff --git a/src/actions/rs_actionselectcontour.h b/src/actions/rs_actionselectcontour.h deleted file mode 100644 index 8ef6b53..0000000 --- a/src/actions/rs_actionselectcontour.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef RS_ACTIONSELECTCONTOURS_H -#define RS_ACTIONSELECTCONTOURS_H - -#include "rs_actioninterface.h" - -class RS_Entity; - -/** - * This action class can handle user events to select contours. - * - * @author Andrew Mustun - */ -class RS_ActionSelectContour: public RS_ActionInterface -{ - public: - RS_ActionSelectContour(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionSelectContour(); - - virtual RS2::ActionType rtti(); - virtual void trigger(); - virtual void mouseReleaseEvent(QMouseEvent * e); - virtual void updateMouseCursor(); - - private: - RS_Entity * en; -}; - -#endif diff --git a/src/actions/rs_actionselectinvert.h b/src/actions/rs_actionselectinvert.h deleted file mode 100644 index bcf7f82..0000000 --- a/src/actions/rs_actionselectinvert.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef RS_ACTIONSELECTINVERT_H -#define RS_ACTIONSELECTINVERT_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to select all entities. - * - * @author Andrew Mustun - */ -class RS_ActionSelectInvert: public RS_ActionInterface -{ - public: - RS_ActionSelectInvert(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionSelectInvert(); - - virtual RS2::ActionType rtti(); - void init(int status); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionsetrelativezero.h b/src/actions/rs_actionsetrelativezero.h deleted file mode 100644 index 801df0f..0000000 --- a/src/actions/rs_actionsetrelativezero.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef RS_ACTIONSETRELATIVEZERO_H -#define RS_ACTIONSETRELATIVEZERO_H - -#include "rs_previewactioninterface.h" -#include "vector.h" - -/** - * This action class can handle user events to set - * the relative Zero point. - * It overrides but retains the locking of the relative Zero. - * - * @author Ulf Lehnert - */ -class RS_ActionSetRelativeZero: public RS_PreviewActionInterface -{ - public: - RS_ActionSetRelativeZero(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionSetRelativeZero(); - - virtual RS2::ActionType rtti(); - virtual void trigger(); - virtual void mouseMoveEvent(QMouseEvent * e); - virtual void mouseReleaseEvent(QMouseEvent * e); - virtual void coordinateEvent(Vector * e); - virtual void updateMouseButtonHints(); - virtual void updateMouseCursor(); - virtual void updateToolBar(); - - private: - Vector pt; -}; - -#endif diff --git a/src/actions/rs_actionsetsnapmode.h b/src/actions/rs_actionsetsnapmode.h deleted file mode 100644 index f9315b1..0000000 --- a/src/actions/rs_actionsetsnapmode.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef RS_ACTIONSETSNAPMODE_H -#define RS_ACTIONSETSNAPMODE_H - -#include "rs.h" -#include "rs_actioninterface.h" - -/** - * This action changes the current snap mode. - * - * @author Andrew Mustun - */ -class RS_ActionSetSnapMode: public RS_ActionInterface -{ - public: - RS_ActionSetSnapMode(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapMode snapMode); - ~RS_ActionSetSnapMode(); - - virtual void init(int status = 0); - virtual void trigger(); - - protected: - RS2::SnapMode snapMode; -}; - -#endif diff --git a/src/actions/rs_actionsetsnaprestriction.h b/src/actions/rs_actionsetsnaprestriction.h deleted file mode 100644 index dc2a92e..0000000 --- a/src/actions/rs_actionsetsnaprestriction.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef RS_ACTIONSETSNAPRESTRICTION_H -#define RS_ACTIONSETSNAPRESTRICTION_H - -#include "rs.h" -#include "rs_actioninterface.h" - -/** - * This action changes the current additional snap mode. - * - * @author Andrew Mustun - */ -class RS_ActionSetSnapRestriction: public RS_ActionInterface -{ - public: - RS_ActionSetSnapRestriction(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapRestriction snapRes); - ~RS_ActionSetSnapRestriction(); - - virtual void init(int status = 0); - virtual void trigger(); - - protected: - RS2::SnapRestriction snapRes; -}; - -#endif diff --git a/src/actions/rs_actiontoolregeneratedimensions.h b/src/actions/rs_actiontoolregeneratedimensions.h deleted file mode 100644 index 905a855..0000000 --- a/src/actions/rs_actiontoolregeneratedimensions.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONTOOLREGENERATEDIMENSIONS_H -#define RS_ACTIONTOOLREGENERATEDIMENSIONS_H - -#include "rs_actioninterface.h" - -/** - * This action class can handle user events to regenerate dimensions. - * - * @author Andrew Mustun - */ -class RS_ActionToolRegenerateDimensions: public RS_ActionInterface -{ - public: - RS_ActionToolRegenerateDimensions(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionToolRegenerateDimensions(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionzoomauto.h b/src/actions/rs_actionzoomauto.h deleted file mode 100644 index 2f7411a..0000000 --- a/src/actions/rs_actionzoomauto.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef RS_ACTIONZOOMAUTO_H -#define RS_ACTIONZOOMAUTO_H - -#include "rs_actioninterface.h" - -/** - * This action triggers an auto zoom. - * - * @author Andrew Mustun - */ -class RS_ActionZoomAuto: public RS_ActionInterface -{ - public: - RS_ActionZoomAuto(RS_EntityContainer & container, GraphicView & graphicView, bool keepAspectRatio = true); - ~RS_ActionZoomAuto(); - - virtual void init(int status = 0); - virtual void trigger(); - - protected: - bool keepAspectRatio; -}; - -#endif diff --git a/src/actions/rs_actionzoomautoy.h b/src/actions/rs_actionzoomautoy.h deleted file mode 100644 index 7c85883..0000000 --- a/src/actions/rs_actionzoomautoy.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONZOOMAUTOY_H -#define RS_ACTIONZOOMAUTOY_H - -#include "rs_actioninterface.h" - -/** - * This action triggers an auto zoom in Y only. - * - * @author Andrew Mustun - */ -class RS_ActionZoomAutoY: public RS_ActionInterface -{ - public: - RS_ActionZoomAutoY(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionZoomAutoY(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionzoomin.h b/src/actions/rs_actionzoomin.h deleted file mode 100644 index 4dbd693..0000000 --- a/src/actions/rs_actionzoomin.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef RS_ACTIONZOOMIN_H -#define RS_ACTIONZOOMIN_H - -#include "rs.h" -#include "rs_actioninterface.h" -#include "vector.h" - -/** - * This action triggers zoom increase. - * - * @author Andrew Mustun - */ -class RS_ActionZoomIn: public RS_ActionInterface -{ - public: - RS_ActionZoomIn(RS_EntityContainer & container, GraphicView & graphicView, RS2::ZoomDirection direction = RS2::In, RS2::Axis axis = RS2::Both, const Vector & center = Vector(false)); - ~RS_ActionZoomIn(); - - virtual void init(int status = 0); - virtual void trigger(); - - protected: - RS2::ZoomDirection direction; - RS2::Axis axis; - Vector center; -}; - -#endif diff --git a/src/actions/rs_actionzoomprevious.h b/src/actions/rs_actionzoomprevious.h deleted file mode 100644 index ef82c90..0000000 --- a/src/actions/rs_actionzoomprevious.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef RS_ACTIONZOOMPREVIOUS_H -#define RS_ACTIONZOOMPREVIOUS_H - -#include "rs_actioninterface.h" - -/** - * This action switches back to the previously used view.. - * - * @author Andrew Mustun - */ -class RS_ActionZoomPrevious: public RS_ActionInterface -{ - public: - RS_ActionZoomPrevious(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionZoomPrevious(); - - virtual void init(int status = 0); - virtual void trigger(); - - protected: -}; - -#endif diff --git a/src/actions/rs_actionzoomredraw.h b/src/actions/rs_actionzoomredraw.h deleted file mode 100644 index 33b8c01..0000000 --- a/src/actions/rs_actionzoomredraw.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef RS_ACTIONZOOMREDRAW_H -#define RS_ACTIONZOOMREDRAW_H - -#include "rs_actioninterface.h" - -/** - * This action triggers an auto zoom. - * - * @author Andrew Mustun - */ -class RS_ActionZoomRedraw: public RS_ActionInterface -{ - public: - RS_ActionZoomRedraw(RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionZoomRedraw(); - - virtual void init(int status = 0); - virtual void trigger(); -}; - -#endif diff --git a/src/actions/rs_actionzoomscroll.h b/src/actions/rs_actionzoomscroll.h deleted file mode 100644 index 2832bc9..0000000 --- a/src/actions/rs_actionzoomscroll.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef RS_ACTIONZOOMSCROLL_H -#define RS_ACTIONZOOMSCROLL_H - -#include "rs_actioninterface.h" - -/** - * This action triggers a scrolling. - * - * @author Andrew Mustun - */ -class RS_ActionZoomScroll: public RS_ActionInterface -{ - public: - RS_ActionZoomScroll(RS2::Direction direction, RS_EntityContainer & container, GraphicView & graphicView); - ~RS_ActionZoomScroll(); - - virtual void init(int status = 0); - virtual void trigger(); - - protected: - RS2::Direction direction; -}; - -#endif diff --git a/src/base/rs_actioninterface.cpp b/src/base/actioninterface.cpp similarity index 65% rename from src/base/rs_actioninterface.cpp rename to src/base/actioninterface.cpp index e679028..4280b5c 100644 --- a/src/base/rs_actioninterface.cpp +++ b/src/base/actioninterface.cpp @@ -1,4 +1,4 @@ -// rs_actioninterface.cpp +// actioninterface.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,7 +12,7 @@ // JLH 05/22/2010 Added this text. :-) // -#include "rs_actioninterface.h" +#include "actioninterface.h" #include "commands.h" #include "rs_debug.h" @@ -35,35 +35,33 @@ * is suspended and resumed again the cursor will always * be reset to the one given here. */ -RS_ActionInterface::RS_ActionInterface(const char * name, - RS_EntityContainer & container, GraphicView & graphicView): - RS_Snapper(container, graphicView) +ActionInterface::ActionInterface(const char * name, RS_EntityContainer & c, + GraphicView & v): graphicView(&v), container(&c) { - RS_DEBUG->print("RS_ActionInterface::RS_ActionInterface: Setting up action: \"%s\"", name); + RS_DEBUG->print("ActionInterface::ActionInterface: Setting up action: \"%s\"", name); this->name = name; status = 0; finished = false; //triggerOnResume = false; - // graphic provides a pointer to the graphic if the - // entity container is a graphic (i.e. can also hold - // layers). - graphic = container.getGraphic(); + // Graphic provides a pointer to the graphic if the entity container is a + //graphic (i.e. can also hold layers). + graphic = c.getGraphic(); - // document pointer will be used for undo / redo - document = container.getDocument(); + // Document pointer will be used for undo / redo + document = c.getDocument(); //this->cursor = cursor; //setSnapMode(graphicView.getDefaultSnapMode()); - RS_DEBUG->print("RS_ActionInterface::RS_ActionInterface: Setting up action: \"%s\": OK", name); + RS_DEBUG->print("ActionInterface::ActionInterface: Setting up action: \"%s\": OK", name); } /** * Destructor. */ -RS_ActionInterface::~RS_ActionInterface() +ActionInterface::~ActionInterface() { // would be pure virtual now: // hideOptions(); @@ -75,7 +73,7 @@ RS_ActionInterface::~RS_ActionInterface() * * @todo no default implementation */ -RS2::ActionType RS_ActionInterface::rtti() +RS2::ActionType ActionInterface::rtti() { return RS2::ActionNone; } @@ -83,7 +81,7 @@ RS2::ActionType RS_ActionInterface::rtti() /** * @return name of this action */ -QString RS_ActionInterface::getName() +QString ActionInterface::getName() { return name; } @@ -95,9 +93,9 @@ QString RS_ActionInterface::getName() * @param status The status on which to initiate this action. * default is 0 to begin the action. */ -void RS_ActionInterface::init(int status/*= 0*/) +void ActionInterface::init(int status/*= 0*/) { - RS_Snapper::init(); +// RS_Snapper::init(); setStatus(status); if (status >= 0) @@ -114,7 +112,7 @@ void RS_ActionInterface::init(int status/*= 0*/) * This function can be overwritten by the implementing action. * The default implementation keeps track of the mouse position. */ -void RS_ActionInterface::mouseMoveEvent(QMouseEvent *) +void ActionInterface::mouseMoveEvent(QMouseEvent *) { } @@ -124,7 +122,7 @@ void RS_ActionInterface::mouseMoveEvent(QMouseEvent *) * This function can be overwritten by the implementing action. * The default implementation does nothing. */ -void RS_ActionInterface::mousePressEvent(QMouseEvent *) +void ActionInterface::mousePressEvent(QMouseEvent *) { } @@ -134,7 +132,7 @@ void RS_ActionInterface::mousePressEvent(QMouseEvent *) * This function can be overwritten by the implementing action. * The default implementation does nothing. */ -void RS_ActionInterface::mouseReleaseEvent(QMouseEvent *) +void ActionInterface::mouseReleaseEvent(QMouseEvent *) { } @@ -143,7 +141,7 @@ void RS_ActionInterface::mouseReleaseEvent(QMouseEvent *) * This function can be overwritten by the implementing action. * The default implementation does nothing. */ -void RS_ActionInterface::keyPressEvent(QKeyEvent * e) +void ActionInterface::keyPressEvent(QKeyEvent * e) { e->ignore(); } @@ -153,7 +151,7 @@ void RS_ActionInterface::keyPressEvent(QKeyEvent * e) * This function can be overwritten by the implementing action. * The default implementation does nothing. */ -void RS_ActionInterface::keyReleaseEvent(QKeyEvent * e) +void ActionInterface::keyReleaseEvent(QKeyEvent * e) { e->ignore(); } @@ -163,8 +161,7 @@ void RS_ActionInterface::keyReleaseEvent(QKeyEvent * e) * This function can be overwritten by the implementing action. * The default implementation does nothing. */ -//void RS_ActionInterface::coordinateEvent(RS_CoordinateEvent *) -void RS_ActionInterface::coordinateEvent(Vector *) +void ActionInterface::coordinateEvent(Vector *) { } @@ -174,7 +171,7 @@ void RS_ActionInterface::coordinateEvent(Vector *) * This function can be overwritten by the implementing action. * The default implementation does nothing. */ -void RS_ActionInterface::commandEvent(RS_CommandEvent *) +void ActionInterface::commandEvent(RS_CommandEvent *) { } @@ -182,7 +179,7 @@ void RS_ActionInterface::commandEvent(RS_CommandEvent *) * Must be implemented to return the currently available commands * for the command line. */ -QStringList RS_ActionInterface::getAvailableCommands() +QStringList ActionInterface::getAvailableCommands() { QStringList l; return l; @@ -200,7 +197,7 @@ QStringList RS_ActionInterface::getAvailableCommands() * of progress and decreases when the user goes one * step back (i.e. presses the right mouse button). */ -void RS_ActionInterface::setStatus(int status) +void ActionInterface::setStatus(int status) { this->status = status; @@ -218,7 +215,7 @@ void RS_ActionInterface::setStatus(int status) /** * @return Current status of this action. */ -int RS_ActionInterface::getStatus() +int ActionInterface::getStatus() { return status; } @@ -228,7 +225,7 @@ int RS_ActionInterface::getStatus() * data needed for this action was collected / set. * The default implementation does nothing. */ -void RS_ActionInterface::trigger() +void ActionInterface::trigger() { } @@ -236,28 +233,28 @@ void RS_ActionInterface::trigger() * Should be overwritten to update the mouse button hints * wherever they might needed. */ -void RS_ActionInterface::updateMouseButtonHints() +void ActionInterface::updateMouseButtonHints() { } /** * Should be overwritten to set the mouse cursor for this action. */ -void RS_ActionInterface::updateMouseCursor() +void ActionInterface::updateMouseCursor() { } /** * Should be overwritten to set the toolbar for this action. */ -void RS_ActionInterface::updateToolBar() +void ActionInterface::updateToolBar() { } /** * @return true, if the action is finished and can be deleted. */ -bool RS_ActionInterface::isFinished() +bool ActionInterface::isFinished() { return finished; } @@ -265,7 +262,7 @@ bool RS_ActionInterface::isFinished() /** * Forces a termination of the action without any cleanup. */ -void RS_ActionInterface::setFinished() +void ActionInterface::setFinished() { status = -1; } @@ -273,72 +270,71 @@ void RS_ActionInterface::setFinished() /** * Finishes this action. */ -void RS_ActionInterface::finish() +void ActionInterface::finish() { - RS_DEBUG->print("RS_ActionInterface::finish"); + RS_DEBUG->print("ActionInterface::finish"); status = -1; - graphicView->setMouseCursor(RS2::ArrowCursor); +// graphicView->setMouseCursor(RS2::ArrowCursor); //graphicView->requestToolBar(RS2::ToolBarMain); updateToolBar(); //Maybe change this to SnapperOff()? //jlh: deleteSnapper(); hideOptions(); finished = true; - RS_Snapper::finish(); // Sets RS_Snapper::finished = true +// RS_Snapper::finish(); // Sets RS_Snapper::finished = true // I think this is where we want to update the screen... -// graphicView->update(); - graphicView->redraw(); - RS_DEBUG->print("RS_ActionInterface::finish: OK"); +// graphicView->redraw(); + RS_DEBUG->print("ActionInterface::finish: OK"); } /** * Called by the event handler to give this action a chance to * communicate with its predecessor. */ -void RS_ActionInterface::setPredecessor(RS_ActionInterface * pre) +void ActionInterface::setPredecessor(ActionInterface * p) { - predecessor = pre; + predecessor = p; } /** * Suspends this action while another action takes place. */ -void RS_ActionInterface::suspend() +void ActionInterface::suspend() { - graphicView->setMouseCursor(RS2::ArrowCursor); - RS_Snapper::suspend(); +// graphicView->setMouseCursor(RS2::ArrowCursor); +// RS_Snapper::suspend(); } /** * Resumes an action after it was suspended. */ -void RS_ActionInterface::resume() +void ActionInterface::resume() { updateMouseCursor(); updateToolBar(); - RS_Snapper::resume(); +// RS_Snapper::resume(); } /** * Hides the tool options. Default implementation does nothing. */ -void RS_ActionInterface::hideOptions() +void ActionInterface::hideOptions() { - RS_Snapper::hideOptions(); +// RS_Snapper::hideOptions(); } /** * Shows the tool options. Default implementation does nothing. */ -void RS_ActionInterface::showOptions() +void ActionInterface::showOptions() { - RS_Snapper::showOptions(); +// RS_Snapper::showOptions(); } /** * Calls checkCommand() from the RS_COMMANDS module. */ -bool RS_ActionInterface::checkCommand(const QString & cmd, const QString & str, +bool ActionInterface::checkCommand(const QString & cmd, const QString & str, RS2::ActionType action) { return RS_COMMANDS->checkCommand(cmd, str, action); @@ -347,7 +343,7 @@ bool RS_ActionInterface::checkCommand(const QString & cmd, const QString & str, /** * Calls command() from the RS_COMMANDS module. */ -QString RS_ActionInterface::command(const QString & cmd) +QString ActionInterface::command(const QString & cmd) { return RS_COMMANDS->command(cmd); } @@ -355,7 +351,45 @@ QString RS_ActionInterface::command(const QString & cmd) /** * Calls msgAvailableCommands() from the RS_COMMANDS module. */ -QString RS_ActionInterface::msgAvailableCommands() +QString ActionInterface::msgAvailableCommands() { return RS_COMMANDS->msgAvailableCommands(); } + +// This is here to save some typing in all the action* classes derived from +// this one. May go away in the future. +Vector ActionInterface::snapPoint(QMouseEvent * e) +{ + return graphicView->snapper.snapPoint(e); +} + +RS_Entity * ActionInterface::catchEntity(QMouseEvent * e, RS2::ResolveLevel level/*= RS2::ResolveNone*/) +{ + return graphicView->snapper.catchEntity(e, level); +} + +RS_Entity * ActionInterface::catchEntity(Vector v, RS2::ResolveLevel level/*= RS2::ResolveNone*/) +{ + return graphicView->snapper.catchEntity(v, level); +} + +//dummy functions, will delete later... +void ActionInterface::drawSnapper(void) +{ +} + +void ActionInterface::deleteSnapper(void) +{ +} + +void ActionInterface::drawPreview(void) +{ +} + +void ActionInterface::clearPreview(void) +{ +} + +void ActionInterface::deletePreview(void) +{ +} diff --git a/src/base/rs_actioninterface.h b/src/base/actioninterface.h similarity index 51% rename from src/base/rs_actioninterface.h rename to src/base/actioninterface.h index d9fd828..7647b20 100644 --- a/src/base/rs_actioninterface.h +++ b/src/base/actioninterface.h @@ -1,36 +1,36 @@ -#ifndef RS_ACTIONINTERFACE_H -#define RS_ACTIONINTERFACE_H +#ifndef __ACTIONINTERFACE_H__ +#define __ACTIONINTERFACE_H__ #include -#include "rs_snapper.h" +#include "rs.h" class RS_CommandEvent; class RS_Document; class Drawing; +class RS_Entity; class RS_EntityContainer; class GraphicView; class Vector; /** - * This is the interface that must be implemented for all - * action classes. Action classes handle actions such - * as drawing lines, moving entities or zooming in. + * This is the interface that must be implemented for all action classes. + * Action classes handle actions such as drawing lines, moving entities or + * zooming in. * * Inherited from QObject for Qt translation features. * + * @author James Hammons * @author Andrew Mustun */ -class RS_ActionInterface: public QObject, public RS_Snapper +class ActionInterface: public QObject { -//huh? no slots/signals here... Q_OBJECT -//WHY derive from QObject??? -//for the TR macro??? +//WHY derive from QObject??? for the TR macro??? //mebbe... Well, that's what he says above. Though it would be just as easy to //prefix a QObject::tr in front of translated strings... public: - RS_ActionInterface(const char * name, RS_EntityContainer & container, - GraphicView & graphicView); - virtual ~RS_ActionInterface(); + ActionInterface(const char * name, RS_EntityContainer &, + GraphicView &); + virtual ~ActionInterface(); virtual RS2::ActionType rtti(); QString getName(); @@ -52,7 +52,7 @@ class RS_ActionInterface: public QObject, public RS_Snapper virtual bool isFinished(); virtual void setFinished(); virtual void finish(); - virtual void setPredecessor(RS_ActionInterface * pre); + virtual void setPredecessor(ActionInterface *); virtual void suspend(); virtual void resume(); virtual void hideOptions(); @@ -61,16 +61,24 @@ class RS_ActionInterface: public QObject, public RS_Snapper RS2::ActionType action = RS2::ActionNone); QString command(const QString & cmd); QString msgAvailableCommands(); + //built-in for now, we'll see how it goes... + Vector snapPoint(QMouseEvent *); + RS_Entity * catchEntity(QMouseEvent *, RS2::ResolveLevel level = RS2::ResolveNone); + RS_Entity * catchEntity(Vector, RS2::ResolveLevel level = RS2::ResolveNone); +#warning "!!! The following functions are DEPRECATED and only in place to help with porting.. !!!" + void drawSnapper(void); + void deleteSnapper(void); + void drawPreview(void); + void clearPreview(void); + void deletePreview(void); private: /** - * Current status of the action. After an action has - * been created the action status is set to 0. Actions - * that are terminated have a status of -1. Other status - * numbers can be used to describe the stage this action - * is in. E.g. a window zoom consists of selecting the - * first corner (status 0), and selecting the second - * corner (status 1). + * Current status of the action. After an action has been created the + * action status is set to 0. Actions that are terminated have a status + * of -1. Other status numbers can be used to describe the stage this + * action is in. E.g. a window zoom consists of selecting the first + * corner (status 0), and selecting the second corner (status 1). */ int status; @@ -79,14 +87,12 @@ class RS_ActionInterface: public QObject, public RS_Snapper QString name; /** - * This flag is set when the action has terminated and - * can be deleted. + * This flag is set when the action has terminated and can be deleted. */ bool finished; /** - * Pointer to the graphic is this container is a graphic. - * NULL otherwise + * Pointer to the graphic is this container is a graphic. NULL otherwise */ Drawing * graphic; @@ -98,7 +104,10 @@ class RS_ActionInterface: public QObject, public RS_Snapper /** * Predecessor of this action or NULL. */ - RS_ActionInterface * predecessor; + ActionInterface * predecessor; + + GraphicView * graphicView; + RS_EntityContainer * container; }; -#endif +#endif // __ACTIONINTERFACE_H__ diff --git a/src/base/paintintf.cpp b/src/base/paintinterface.cpp similarity index 99% rename from src/base/paintintf.cpp rename to src/base/paintinterface.cpp index e2534f0..55da307 100644 --- a/src/base/paintintf.cpp +++ b/src/base/paintinterface.cpp @@ -1,7 +1,6 @@ -// paintintf.cpp +// paintinterface.cpp // // Part of the Architektonas Project -// Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons // (C) 2010 Underground Software // @@ -9,13 +8,13 @@ // // Who When What // --- ---------- ----------------------------------------------------------- -// JLH 05/21/2010 Added this text. :-) +// JLH 05/21/2010 Created this file. :-) // // BIG NOTE: THIS CLASS ASSUMES THAT THE PAINTER * IS VALID!!! BAD THINGS WILL // HAPPEN IF IT IS NOT!!! -#include "paintintf.h" +#include "paintinterface.h" #include "rs_debug.h" #include "rs_math.h" diff --git a/src/base/paintintf.h b/src/base/paintinterface.h similarity index 93% rename from src/base/paintintf.h rename to src/base/paintinterface.h index 242ce7f..3815dd0 100644 --- a/src/base/paintintf.h +++ b/src/base/paintinterface.h @@ -1,10 +1,5 @@ -// paintintf.h: Qt Painter interface -// -// by James L. Hammons -// (C) 2010 Underground Software - -#ifndef __PAINTINTF_H__ -#define __PAINTINTF_H__ +#ifndef __PAINTINTERFACE_H__ +#define __PAINTINTERFACE_H__ #include #include "rs.h" @@ -80,4 +75,4 @@ class PaintInterface RS_Pen lpen; }; -#endif // __PAINTINTF_H__ +#endif // __PAINTINTERFACE_H__ diff --git a/src/base/rs_arc.cpp b/src/base/rs_arc.cpp index f9bb52c..d674fcf 100644 --- a/src/base/rs_arc.cpp +++ b/src/base/rs_arc.cpp @@ -20,7 +20,7 @@ #include "rs_information.h" #include "rs_math.h" #include "graphicview.h" -#include "paintintf.h" +#include "paintinterface.h" /** * Default constructor. diff --git a/src/base/rs_circle.cpp b/src/base/rs_circle.cpp index 5eebd9a..2e9405b 100644 --- a/src/base/rs_circle.cpp +++ b/src/base/rs_circle.cpp @@ -18,7 +18,7 @@ #include "rs_information.h" #include "rs_linetypepattern.h" #include "graphicview.h" -#include "paintintf.h" +#include "paintinterface.h" /** * Default constructor. diff --git a/src/base/rs_dialogfactory.cpp b/src/base/rs_dialogfactory.cpp index bd20b7a..527ec23 100644 --- a/src/base/rs_dialogfactory.cpp +++ b/src/base/rs_dialogfactory.cpp @@ -28,6 +28,10 @@ RS_DialogFactory::RS_DialogFactory() RS_DEBUG->print("RS_DialogFacgory::RS_DialogFactory: OK"); } +/*virtual*/ RS_DialogFactory::~RS_DialogFactory() +{ +} + /** * @return Instance to the unique font list. */ diff --git a/src/base/rs_dialogfactory.h b/src/base/rs_dialogfactory.h index 19d64f4..128aa56 100644 --- a/src/base/rs_dialogfactory.h +++ b/src/base/rs_dialogfactory.h @@ -16,7 +16,7 @@ class RS_DialogFactory RS_DialogFactory(); public: - virtual ~RS_DialogFactory() {} + virtual ~RS_DialogFactory(); static RS_DialogFactory * instance(); diff --git a/src/base/rs_dialogfactoryadapter.h b/src/base/rs_dialogfactoryadapter.h index af67162..8ddb17f 100644 --- a/src/base/rs_dialogfactoryadapter.h +++ b/src/base/rs_dialogfactoryadapter.h @@ -12,7 +12,7 @@ class RS_LayerList; * Adapter for dialog factory interface. * Used when no factory object was set. */ -class RS_DialogFactoryAdapter : public RS_DialogFactoryInterface +class RS_DialogFactoryAdapter: public RS_DialogFactoryInterface { public: RS_DialogFactoryAdapter() {} @@ -31,7 +31,7 @@ class RS_DialogFactoryAdapter : public RS_DialogFactoryInterface virtual void requestEditBlockWindow(RS_BlockList *) {} virtual void closeEditBlockWindow(RS_Block *) {} virtual QString requestImageOpenDialog() { return ""; } - virtual void requestOptions(RS_ActionInterface *, bool, bool = false) {} + virtual void requestOptions(ActionInterface *, bool, bool = false) {} virtual void requestSnapDistOptions(double &, bool) {} virtual bool requestAttributesDialog(RS_AttributesData &, RS_LayerList &) { return false; } virtual bool requestMoveDialog(RS_MoveData &) { return false; } @@ -41,7 +41,7 @@ class RS_DialogFactoryAdapter : public RS_DialogFactoryInterface virtual bool requestMoveRotateDialog(RS_MoveRotateData &) { return false; } virtual bool requestRotate2Dialog(RS_Rotate2Data &) { return false; } virtual void requestToolBar(RS2::ToolBarId) {} - virtual void requestToolBarSelect(RS_ActionInterface *, RS2::ActionType) {} + virtual void requestToolBarSelect(ActionInterface *, RS2::ActionType) {} virtual bool requestModifyEntityDialog(RS_Entity *) { return false; } virtual bool requestTextDialog(RS_Text *) { return false; } virtual bool requestHatchDialog(RS_Hatch *) { return false; } diff --git a/src/base/rs_dialogfactoryinterface.h b/src/base/rs_dialogfactoryinterface.h index 2ea6011..9df40de 100644 --- a/src/base/rs_dialogfactoryinterface.h +++ b/src/base/rs_dialogfactoryinterface.h @@ -4,7 +4,7 @@ #include #include "rs.h" -class RS_ActionInterface; +class ActionInterface; class RS_ArcData; class RS_AttributesData; class RS_BevelData; @@ -195,7 +195,7 @@ public: * @param update true: widget gets data from the action, false: * widget gets data from config file. */ - virtual void requestOptions(RS_ActionInterface * action, bool on, bool update = false) = 0; + virtual void requestOptions(ActionInterface * action, bool on, bool update = false) = 0; /** * This virtual method must be overwritten and must present @@ -286,7 +286,7 @@ public: * * @param nextAction ID of next action to create after selecting was done. */ - virtual void requestToolBarSelect(RS_ActionInterface * selectAction, RS2::ActionType nextAction) = 0; + virtual void requestToolBarSelect(ActionInterface * selectAction, RS2::ActionType nextAction) = 0; /** * This virtual method must be overwritten and must present diff --git a/src/base/rs_dimaligned.h b/src/base/rs_dimaligned.h index 2f5deda..c7a260b 100644 --- a/src/base/rs_dimaligned.h +++ b/src/base/rs_dimaligned.h @@ -29,7 +29,7 @@ class RS_DimAlignedData } friend class RS_DimAligned; - friend class RS_ActionDimAligned; + friend class ActionDimAligned; friend std::ostream & operator<<(std::ostream & os, const RS_DimAlignedData & dd) { diff --git a/src/base/rs_ellipse.cpp b/src/base/rs_ellipse.cpp index 380df86..7ec0eed 100644 --- a/src/base/rs_ellipse.cpp +++ b/src/base/rs_ellipse.cpp @@ -18,7 +18,7 @@ #include "graphicview.h" #include "rs_information.h" #include "rs_linetypepattern.h" -#include "paintintf.h" +#include "paintinterface.h" /** * Constructor. diff --git a/src/base/rs_entitycontainer.cpp b/src/base/rs_entitycontainer.cpp index a13c0d6..94f3a4c 100644 --- a/src/base/rs_entitycontainer.cpp +++ b/src/base/rs_entitycontainer.cpp @@ -25,7 +25,7 @@ #include "rs_spline.h" #include "rs_information.h" #include "graphicview.h" -#include "paintintf.h" +#include "paintinterface.h" bool RS_EntityContainer::autoUpdateBorders = true; diff --git a/src/base/rs_eventhandler.cpp b/src/base/rs_eventhandler.cpp index a92775c..3484ca9 100644 --- a/src/base/rs_eventhandler.cpp +++ b/src/base/rs_eventhandler.cpp @@ -14,8 +14,7 @@ #include "rs_eventhandler.h" -#include -#include "rs_actioninterface.h" +#include "actioninterface.h" #include "rs_commandevent.h" #include "rs_debug.h" #include "rs_dialogfactory.h" @@ -168,14 +167,14 @@ void RS_EventHandler::mouseMoveEvent(QMouseEvent * e) */ void RS_EventHandler::mouseLeaveEvent() { - if (actionIndex >= 0 && currentActions[actionIndex] != NULL + if (actionIndex >= 0 && currentActions[actionIndex] && !currentActions[actionIndex]->isFinished()) { currentActions[actionIndex]->suspend(); } else { - if (defaultAction != NULL) + if (defaultAction) defaultAction->suspend(); //RS_DEBUG->print("currently no action defined"); } @@ -186,14 +185,14 @@ void RS_EventHandler::mouseLeaveEvent() */ void RS_EventHandler::mouseEnterEvent() { - if (actionIndex >= 0 && currentActions[actionIndex] != NULL + if (actionIndex >= 0 && currentActions[actionIndex] && !currentActions[actionIndex]->isFinished()) { currentActions[actionIndex]->resume(); } else { - if (defaultAction != NULL) + if (defaultAction) defaultAction->resume(); } } @@ -203,14 +202,14 @@ void RS_EventHandler::mouseEnterEvent() */ void RS_EventHandler::keyPressEvent(QKeyEvent * e) { - if (actionIndex >= 0 && currentActions[actionIndex] != NULL + if (actionIndex >= 0 && currentActions[actionIndex] && !currentActions[actionIndex]->isFinished()) { currentActions[actionIndex]->keyPressEvent(e); } else { - if (defaultAction != NULL) + if (defaultAction) defaultAction->keyPressEvent(e); else e->ignore(); @@ -224,14 +223,14 @@ void RS_EventHandler::keyPressEvent(QKeyEvent * e) */ void RS_EventHandler::keyReleaseEvent(QKeyEvent * e) { - if (actionIndex >= 0 && currentActions[actionIndex] != NULL + if (actionIndex >= 0 && currentActions[actionIndex] && !currentActions[actionIndex]->isFinished()) { currentActions[actionIndex]->keyReleaseEvent(e); } else { - if (defaultAction != NULL) + if (defaultAction) defaultAction->keyReleaseEvent(e); else e->ignore(); @@ -423,9 +422,9 @@ void RS_EventHandler::disableCoordinateInput() /** * @return Current action. */ -RS_ActionInterface * RS_EventHandler::getCurrentAction() +ActionInterface * RS_EventHandler::getCurrentAction() { - if (actionIndex >= 0 && currentActions[actionIndex] != NULL + if (actionIndex >= 0 && currentActions[actionIndex] && !currentActions[actionIndex]->isFinished()) return currentActions[actionIndex]; @@ -435,7 +434,7 @@ RS_ActionInterface * RS_EventHandler::getCurrentAction() /** * @return The current default action. */ -RS_ActionInterface * RS_EventHandler::getDefaultAction() +ActionInterface * RS_EventHandler::getDefaultAction() { return defaultAction; } @@ -443,9 +442,9 @@ RS_ActionInterface * RS_EventHandler::getDefaultAction() /** * Sets the default action. */ -void RS_EventHandler::setDefaultAction(RS_ActionInterface * action) +void RS_EventHandler::setDefaultAction(ActionInterface * action) { - if (defaultAction != NULL) + if (defaultAction) { defaultAction->finish(); delete defaultAction; @@ -458,7 +457,7 @@ void RS_EventHandler::setDefaultAction(RS_ActionInterface * action) /** * Sets the current action. */ -void RS_EventHandler::setCurrentAction(RS_ActionInterface * action) +void RS_EventHandler::setCurrentAction(ActionInterface * action) { RS_DEBUG->print("RS_EventHandler::setCurrentAction"); @@ -466,7 +465,7 @@ void RS_EventHandler::setCurrentAction(RS_ActionInterface * action) return; // Predecessor of the new action or NULL: - RS_ActionInterface * predecessor = NULL; + ActionInterface * predecessor = NULL; // Suspend current action: if (actionIndex >= 0 && currentActions[actionIndex] @@ -490,7 +489,7 @@ void RS_EventHandler::setCurrentAction(RS_ActionInterface * action) if (actionIndex == RS_MAXACTIONS - 1) { // delete oldest action if necessary (usually never happens): - if (currentActions[0] != NULL) + if (currentActions[0]) { currentActions[0]->finish(); delete currentActions[0]; @@ -538,7 +537,7 @@ void RS_EventHandler::killSelectActions() { for(int c=0; crtti() == RS2::ActionSelectSingle || currentActions[c]->rtti() == RS2::ActionSelectContour @@ -657,12 +656,17 @@ void RS_EventHandler::cleanUp() */ void RS_EventHandler::setSnapMode(RS2::SnapMode sm) { +#if 0 for(int c=0; csetSnapMode(sm); if (defaultAction) defaultAction->setSnapMode(sm); +#else +#warning "!!! Not sure if this is going to work correctly..." + graphicView->snapper.setSnapMode(sm); +#endif } /** @@ -670,12 +674,17 @@ void RS_EventHandler::setSnapMode(RS2::SnapMode sm) */ void RS_EventHandler::setSnapRestriction(RS2::SnapRestriction sr) { +#if 0 for(int c=0; csetSnapRestriction(sr); if (defaultAction) defaultAction->setSnapRestriction(sr); +#else +#warning "!!! Not sure if this is going to work correctly..." + graphicView->snapper.setSnapRestriction(sr); +#endif } void RS_EventHandler::debugActions() @@ -687,7 +696,7 @@ void RS_EventHandler::debugActions() if (c == actionIndex) RS_DEBUG->print("Current"); - if (currentActions[c] != NULL) + if (currentActions[c]) RS_DEBUG->print("Action %03d: %s [%s]", c, currentActions[c]->getName().toLatin1().data(), currentActions[c]->isFinished() ? "finished" : "active"); diff --git a/src/base/rs_eventhandler.h b/src/base/rs_eventhandler.h index 601bba7..55e0dc7 100644 --- a/src/base/rs_eventhandler.h +++ b/src/base/rs_eventhandler.h @@ -1,11 +1,13 @@ #ifndef RS_EVENTHANDLER_H #define RS_EVENTHANDLER_H -#include "rs_actioninterface.h" +#include +#include "rs.h" #define RS_MAXACTIONS 16 -class RS_ActionInterface; +class ActionInterface; +class RS_CommandEvent; class GraphicView; /** @@ -21,29 +23,22 @@ class RS_EventHandler void back(); void enter(); - void mousePressEvent(QMouseEvent * e); void mouseReleaseEvent(QMouseEvent * e); void mouseMoveEvent(QMouseEvent * e); void mouseLeaveEvent(); void mouseEnterEvent(); - void keyPressEvent(QKeyEvent * e); void keyReleaseEvent(QKeyEvent * e); - void commandEvent(RS_CommandEvent * e); void enableCoordinateInput(); void disableCoordinateInput(); - - void setDefaultAction(RS_ActionInterface * action); - RS_ActionInterface * getDefaultAction(); - - void setCurrentAction(RS_ActionInterface * action); - RS_ActionInterface * getCurrentAction(); - + void setDefaultAction(ActionInterface * action); + ActionInterface * getDefaultAction(); + void setCurrentAction(ActionInterface * action); + ActionInterface * getCurrentAction(); void killSelectActions(); void killAllActions(); - bool hasAction(); void cleanUp(); void debugActions(); @@ -52,8 +47,8 @@ class RS_EventHandler protected: GraphicView * graphicView; - RS_ActionInterface * defaultAction; - RS_ActionInterface * currentActions[RS_MAXACTIONS]; + ActionInterface * defaultAction; + ActionInterface * currentActions[RS_MAXACTIONS]; int actionIndex; bool coordinateInputEnabled; }; diff --git a/src/base/rs_hatch.cpp b/src/base/rs_hatch.cpp index 2a7b5a7..56e4f1e 100644 --- a/src/base/rs_hatch.cpp +++ b/src/base/rs_hatch.cpp @@ -18,7 +18,7 @@ #include "drawing.h" #include "graphicview.h" #include "rs_information.h" -#include "paintintf.h" +#include "paintinterface.h" #include "rs_pattern.h" #include "rs_patternlist.h" diff --git a/src/base/rs_image.cpp b/src/base/rs_image.cpp index a92297f..91816b2 100644 --- a/src/base/rs_image.cpp +++ b/src/base/rs_image.cpp @@ -18,7 +18,7 @@ #include "rs_debug.h" #include "graphicview.h" #include "rs_line.h" -#include "paintintf.h" +#include "paintinterface.h" /** * Constructor. diff --git a/src/base/rs_line.cpp b/src/base/rs_line.cpp index 224d170..32254bd 100644 --- a/src/base/rs_line.cpp +++ b/src/base/rs_line.cpp @@ -18,7 +18,7 @@ #include "drawing.h" #include "graphicview.h" #include "rs_linetypepattern.h" -#include "paintintf.h" +#include "paintinterface.h" /** * Constructor. diff --git a/src/base/rs_point.cpp b/src/base/rs_point.cpp index de32daa..6475bd3 100644 --- a/src/base/rs_point.cpp +++ b/src/base/rs_point.cpp @@ -15,7 +15,7 @@ #include "rs_point.h" #include "graphicview.h" -#include "paintintf.h" +#include "paintinterface.h" /** * Default constructor. diff --git a/src/base/rs_polyline.cpp b/src/base/rs_polyline.cpp index c0ca2e5..6fd34c6 100644 --- a/src/base/rs_polyline.cpp +++ b/src/base/rs_polyline.cpp @@ -18,7 +18,7 @@ #include "rs_line.h" #include "rs_arc.h" #include "graphicview.h" -#include "paintintf.h" +#include "paintinterface.h" /** * Constructor. diff --git a/src/base/rs_preview.cpp b/src/base/rs_preview.cpp index 1de0166..841841b 100644 --- a/src/base/rs_preview.cpp +++ b/src/base/rs_preview.cpp @@ -17,7 +17,7 @@ #include "rs_entitycontainer.h" #include "graphicview.h" #include "rs_information.h" -#include "paintintf.h" +#include "paintinterface.h" #include "settings.h" /** @@ -200,8 +200,13 @@ void RS_Preview::Draw(GraphicView * view, PaintInterface * painter) if (isEmpty()) return; -// painter->setPreviewMode(); + painter->setPen(RS_Pen(RS_Color(60, 255, 80), RS2::Width00, RS2::SolidLine)); painter->setOffset(offset); - view->drawEntity(this, false); + + // We have to traverse the container ourselves, because RS_Container::draw() + // uses drawEntity() instead of drawEntityPlain()... + for(RS_Entity * e=firstEntity(RS2::ResolveNone); e!=NULL; e=nextEntity(RS2::ResolveNone)) + view->drawEntityPlain(e); + painter->setOffset(Vector(0, 0)); } diff --git a/src/base/rs_previewactioninterface.cpp b/src/base/rs_previewactioninterface.cpp deleted file mode 100644 index e25a4e6..0000000 --- a/src/base/rs_previewactioninterface.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// rs_previewactioninterface.cpp -// -// Part of the Architektonas Project -// Originally part of QCad Community Edition by Andrew Mustun -// Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software -// -// JLH = James L. Hammons -// -// Who When What -// --- ---------- ----------------------------------------------------------- -// JLH 06/02/2010 Added this text. :-) -// - -#include "rs_previewactioninterface.h" - -#include "rs_debug.h" -#include "graphicview.h" -#include "rs_preview.h" - -/** - * Constructor. - * - * Sets the entity container on which the action class inherited - * from this interface operates. - */ -RS_PreviewActionInterface::RS_PreviewActionInterface(const char * name, - RS_EntityContainer & container, GraphicView & graphicView): - RS_ActionInterface(name, container, graphicView) -{ - RS_DEBUG->print("RS_PreviewActionInterface::RS_PreviewActionInterface: Setting up action with preview: \"%s\"", name); - - // Preview is linked to the container for getting access to document - // settings / dictionary variables - preview = new RS_Preview(&container); - visible = false; - - RS_DEBUG->print("RS_PreviewActionInterface::RS_PreviewActionInterface: Setting up action with preview: \"%s\": OK", name); -} - -/** Destructor */ -RS_PreviewActionInterface::~RS_PreviewActionInterface() -{ - delete preview; -} - -void RS_PreviewActionInterface::init(int status) -{ - RS_ActionInterface::init(status); - clearPreview(); -} - -void RS_PreviewActionInterface::finish() -{ - RS_ActionInterface::finish(); - deletePreview(); - clearPreview(); -} - -void RS_PreviewActionInterface::suspend() -{ - RS_ActionInterface::suspend(); - deletePreview(); -} - -void RS_PreviewActionInterface::resume() -{ - RS_ActionInterface::resume(); - drawPreview(); -} - -void RS_PreviewActionInterface::trigger() -{ - RS_ActionInterface::trigger(); - deletePreview(); - clearPreview(); -} - -/** - * Clears the preview by removing all entities in it. - */ -void RS_PreviewActionInterface::clearPreview() -{ - preview->clear(); -} - -/** - * Draws the preview on the screen. - */ -void RS_PreviewActionInterface::drawPreview() -{ - if (!visible) - xorPreview(); -} - -/** - * Deletes the preview from the screen. - */ -void RS_PreviewActionInterface::deletePreview() -{ - if (visible) - xorPreview(); -} - -/** - * Draws / deletes the current preview. - */ -void RS_PreviewActionInterface::xorPreview() -{ -#warning "!!! RS_PreviewActionInterface::xorPreview() is DEPRECATED !!!" -//not true anymore.. -//#warning "!!! xorPreview() not working AT ALL !!!" -#if 0 - if (!preview->isEmpty()) - { - RS_Painter * painter = graphicView->createDirectPainter(); - painter->setPreviewMode(); - painter->setOffset(offset); - graphicView->drawEntity(preview, false); - graphicView->destroyPainter(); - } - - visible = !visible; -#else - // OK, we need a new approach here--direct painting is NOT acceptable anymore! - // So, something like this: - /* - In graphicView->drawEntity(preview, false); we set the pointer to an entity - in the GV. We set a flag telling paintEvent that this is a preview, and then - call update() in the view. *That* should do it... - */ -//This doesn't work, causes the thing to crash... -//Now it works, just need to upgrade the rendering paths so that they aren't all -//fucked up like QCad was... - if (!preview->isEmpty()) - { - graphicView->SetPreviewMode(); - graphicView->SetPreviewEntity(preview); - graphicView->SetPreviewOffset(offset); - graphicView->redraw(); - } - - visible = !visible; -#endif -} diff --git a/src/base/rs_previewactioninterface.h b/src/base/rs_previewactioninterface.h deleted file mode 100644 index a8f6780..0000000 --- a/src/base/rs_previewactioninterface.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef RS_PREVIEWACTIONINTERFACE_H -#define RS_PREVIEWACTIONINTERFACE_H - -#include "rs_actioninterface.h" -#include "vector.h" - -class RS_Preview; - -/** - * This is the interface that must be implemented for all - * action classes which need a preview. - * - * @author Andrew Mustun - */ -class RS_PreviewActionInterface: public RS_ActionInterface -{ - public: - RS_PreviewActionInterface(const char * name, - RS_EntityContainer & container, GraphicView & graphicView); - virtual ~RS_PreviewActionInterface(); - - virtual void init(int status = 0); - virtual void finish(); - virtual void suspend(); - virtual void resume(); - virtual void trigger(); - void clearPreview(); - void drawPreview(); - void deletePreview(); - -// private: - protected: - void xorPreview(); - - protected: - /** - * Preview that holds the entities to be previewed. - */ - RS_Preview * preview; - /** - * Keeps track of the drawings in XOR mode. - */ - bool visible; - /** - * Current offset of the preview. - */ - Vector offset; -}; - -#endif diff --git a/src/base/rs_snapper.cpp b/src/base/rs_snapper.cpp index 0767b6e..bbc306c 100644 --- a/src/base/rs_snapper.cpp +++ b/src/base/rs_snapper.cpp @@ -20,7 +20,7 @@ #include "graphicview.h" #include "rs_grid.h" #include "rs_information.h" -#include "paintintf.h" +#include "paintinterface.h" #include "settings.h" /** @@ -92,11 +92,10 @@ void RS_Snapper::SetGraphicView(GraphicView * v) } /** - * @return Pointer to the entity which was the key entity for the - * last successful snapping action. If the snap mode is "end point" - * the key entity is the entity whos end point was caught. - * If the snap mode didn't require an entity (e.g. free, grid) this - * method will return NULL. + * @return Pointer to the entity which was the key entity for the last + * successful snapping action. If the snap mode is "end point" the key entity + * is the entity whos end point was caught. If the snap mode didn't require an + * entity (e.g. free, grid) this method will return NULL. */ RS_Entity * RS_Snapper::getKeyEntity() { diff --git a/src/base/rs_solid.cpp b/src/base/rs_solid.cpp index 100dcc0..31600ec 100644 --- a/src/base/rs_solid.cpp +++ b/src/base/rs_solid.cpp @@ -15,7 +15,7 @@ #include "rs_solid.h" #include "graphicview.h" -#include "paintintf.h" +#include "paintinterface.h" /** * Default constructor. diff --git a/src/base/rs_spline.cpp b/src/base/rs_spline.cpp index 27ede78..ccb77a5 100644 --- a/src/base/rs_spline.cpp +++ b/src/base/rs_spline.cpp @@ -17,7 +17,7 @@ #include "rs_debug.h" #include "graphicview.h" #include "drawing.h" -#include "paintintf.h" +#include "paintinterface.h" /** * Constructor. diff --git a/src/forms/arcoptions.cpp b/src/forms/arcoptions.cpp index 2f95fb9..9b09080 100644 --- a/src/forms/arcoptions.cpp +++ b/src/forms/arcoptions.cpp @@ -15,8 +15,8 @@ #include "arcoptions.h" -#include "rs_actiondrawarc.h" -#include "rs_actioninterface.h" +#include "actiondrawarc.h" +#include "actioninterface.h" #include "settings.h" ArcOptions::ArcOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -49,11 +49,11 @@ ArcOptions::~ArcOptions() settings.endGroup(); } -void ArcOptions::setAction(RS_ActionInterface * a, bool update) +void ArcOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawArc) { - action = (RS_ActionDrawArc *)a; + action = (ActionDrawArc *)a; bool reversed; diff --git a/src/forms/arcoptions.h b/src/forms/arcoptions.h index 66f2eda..d6ddd6d 100644 --- a/src/forms/arcoptions.h +++ b/src/forms/arcoptions.h @@ -4,8 +4,8 @@ //#include "ui_arcoptions.h" #include -class RS_ActionDrawArc; -class RS_ActionInterface; +class ActionDrawArc; +class ActionInterface; class ArcOptions: public QWidget { @@ -16,11 +16,11 @@ class ArcOptions: public QWidget ~ArcOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateDirection(bool); protected: - RS_ActionDrawArc * action; + ActionDrawArc * action; QRadioButton * rbPos; QRadioButton * rbNeg; diff --git a/src/forms/arctangentialoptions.cpp b/src/forms/arctangentialoptions.cpp index afce7fa..db203a7 100644 --- a/src/forms/arctangentialoptions.cpp +++ b/src/forms/arctangentialoptions.cpp @@ -14,7 +14,7 @@ #include "arctangentialoptions.h" -#include "rs_actiondrawarctangential.h" +#include "actiondrawarctangential.h" #include "settings.h" ArcTangentialOptions::ArcTangentialOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -45,11 +45,11 @@ ArcTangentialOptions::~ArcTangentialOptions() settings.endGroup(); } -void ArcTangentialOptions::setAction(RS_ActionInterface * a, bool update) +void ArcTangentialOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawArcTangential) { - action = (RS_ActionDrawArcTangential *)a; + action = (ActionDrawArcTangential *)a; QString sr; diff --git a/src/forms/arctangentialoptions.h b/src/forms/arctangentialoptions.h index 813116f..7fbe7e6 100644 --- a/src/forms/arctangentialoptions.h +++ b/src/forms/arctangentialoptions.h @@ -4,8 +4,8 @@ //#include "ui_arctangentialoptions.h" #include -class RS_ActionDrawArcTangential; -class RS_ActionInterface; +class ActionDrawArcTangential; +class ActionInterface; class ArcTangentialOptions: public QWidget { @@ -16,11 +16,11 @@ class ArcTangentialOptions: public QWidget ~ArcTangentialOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateRadius(const QString & s); protected: - RS_ActionDrawArcTangential * action; + ActionDrawArcTangential * action; QLabel * lRadius; QLineEdit * leRadius; QFrame * sep1; diff --git a/src/forms/beveloptions.cpp b/src/forms/beveloptions.cpp index 94887b4..a464f10 100644 --- a/src/forms/beveloptions.cpp +++ b/src/forms/beveloptions.cpp @@ -15,8 +15,8 @@ #include "beveloptions.h" #include "rs.h" -#include "rs_actioninterface.h" -#include "rs_actionmodifybevel.h" +#include "actioninterface.h" +#include "actionmodifybevel.h" #include "settings.h" BevelOptions::BevelOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -62,11 +62,11 @@ BevelOptions::~BevelOptions() settings.endGroup(); } -void BevelOptions::setAction(RS_ActionInterface * a, bool update) +void BevelOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionModifyBevel) { - action = (RS_ActionModifyBevel *)a; + action = (ActionModifyBevel *)a; QString sd1; QString sd2; diff --git a/src/forms/beveloptions.h b/src/forms/beveloptions.h index f98ead0..88b26c7 100644 --- a/src/forms/beveloptions.h +++ b/src/forms/beveloptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionInterface; -class RS_ActionModifyBevel; +class ActionInterface; +class ActionModifyBevel; class BevelOptions: public QWidget { @@ -15,11 +15,11 @@ class BevelOptions: public QWidget ~BevelOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateData(); protected: - RS_ActionModifyBevel * action; + ActionModifyBevel * action; private: QCheckBox * cbTrim; diff --git a/src/forms/cadtoolbar.cpp b/src/forms/cadtoolbar.cpp index 8a09e77..d988c7c 100644 --- a/src/forms/cadtoolbar.cpp +++ b/src/forms/cadtoolbar.cpp @@ -256,7 +256,7 @@ void CadToolBar::showToolBarSelect() showToolBarSelect(NULL, -1); } -void CadToolBar::showToolBarSelect(RS_ActionInterface * selectAction, int nextAction) +void CadToolBar::showToolBarSelect(ActionInterface * selectAction, int nextAction) { tbSelect->setNextAction(nextAction); tbSelect->setSelectAction(selectAction); diff --git a/src/forms/cadtoolbar.h b/src/forms/cadtoolbar.h index eb72869..dcf03f8 100644 --- a/src/forms/cadtoolbar.h +++ b/src/forms/cadtoolbar.h @@ -3,7 +3,7 @@ #include -class RS_ActionInterface; +class ActionInterface; class QG_ActionHandler; class CadToolBarSplines; class CadToolBarInfo; @@ -49,7 +49,7 @@ class CadToolBar: public QWidget void showToolBarSnap(); void showToolBarDim(); void showToolBarSelect(); - void showToolBarSelect(RS_ActionInterface * selectAction, int nextAction); + void showToolBarSelect(ActionInterface * selectAction, int nextAction); QToolButton * CreateBackButton(QWidget *); QToolButton * CreateToolButton(QAction * action); diff --git a/src/forms/cadtoolbarselect.cpp b/src/forms/cadtoolbarselect.cpp index 235d306..6a70cec 100644 --- a/src/forms/cadtoolbarselect.cpp +++ b/src/forms/cadtoolbarselect.cpp @@ -15,7 +15,7 @@ #include "cadtoolbarselect.h" #include "qg_actionhandler.h" -#include "rs_actioninterface.h" +#include "actioninterface.h" #include "cadtoolbar.h" #include "createqtactions.h" @@ -56,7 +56,7 @@ CadToolBarSelect::~CadToolBarSelect() } //hmm, should these three funcs be here??? -void CadToolBarSelect::setSelectAction(RS_ActionInterface * selectAction) +void CadToolBarSelect::setSelectAction(ActionInterface * selectAction) { this->selectAction = selectAction; } diff --git a/src/forms/cadtoolbarselect.h b/src/forms/cadtoolbarselect.h index 03a157d..4ba9aa1 100644 --- a/src/forms/cadtoolbarselect.h +++ b/src/forms/cadtoolbarselect.h @@ -5,7 +5,7 @@ class CadToolBar; class QG_ActionHandler; -class RS_ActionInterface; +class ActionInterface; class CadToolBarSelect: public QWidget { @@ -15,7 +15,7 @@ class CadToolBarSelect: public QWidget CadToolBarSelect(CadToolBar * parent, Qt::WindowFlags flags = 0); ~CadToolBarSelect(); - void setSelectAction(RS_ActionInterface * selectAction); + void setSelectAction(ActionInterface * selectAction); void setNextAction(int nextAction); public slots: @@ -24,7 +24,7 @@ class CadToolBarSelect: public QWidget private: QToolButton * doit; QG_ActionHandler * actionHandler; - RS_ActionInterface * selectAction; + ActionInterface * selectAction; int nextAction; }; diff --git a/src/forms/circleoptions.cpp b/src/forms/circleoptions.cpp index 9a0f65e..ceef550 100644 --- a/src/forms/circleoptions.cpp +++ b/src/forms/circleoptions.cpp @@ -15,8 +15,8 @@ #include "circleoptions.h" #include "rs.h" -#include "rs_actioninterface.h" -#include "rs_actiondrawcirclecr.h" +#include "actioninterface.h" +#include "actiondrawcirclecr.h" #include "settings.h" CircleOptions::CircleOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -47,11 +47,11 @@ CircleOptions::~CircleOptions() settings.endGroup(); } -void CircleOptions::setAction(RS_ActionInterface * a, bool update) +void CircleOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawCircleCR) { - action = (RS_ActionDrawCircleCR *)a; + action = (ActionDrawCircleCR *)a; QString sr; diff --git a/src/forms/circleoptions.h b/src/forms/circleoptions.h index 3af5d51..48356d1 100644 --- a/src/forms/circleoptions.h +++ b/src/forms/circleoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionInterface; -class RS_ActionDrawCircleCR; +class ActionInterface; +class ActionDrawCircleCR; class CircleOptions: public QWidget { @@ -15,11 +15,11 @@ class CircleOptions: public QWidget ~CircleOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateRadius(const QString & r); protected: - RS_ActionDrawCircleCR * action; + ActionDrawCircleCR * action; private: QLabel * lRadius; diff --git a/src/forms/dimlinearoptions.cpp b/src/forms/dimlinearoptions.cpp index b221d11..7263afa 100644 --- a/src/forms/dimlinearoptions.cpp +++ b/src/forms/dimlinearoptions.cpp @@ -14,8 +14,8 @@ #include "dimlinearoptions.h" -#include "rs_actiondimlinear.h" -#include "rs_actioninterface.h" +#include "actiondimlinear.h" +#include "actioninterface.h" #include "settings.h" DimLinearOptions::DimLinearOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -56,11 +56,11 @@ DimLinearOptions::~DimLinearOptions() settings.endGroup(); } -void DimLinearOptions::setAction(RS_ActionInterface * a, bool update) +void DimLinearOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDimLinear) { - action = (RS_ActionDimLinear *)a; + action = (ActionDimLinear *)a; QString sa; diff --git a/src/forms/dimlinearoptions.h b/src/forms/dimlinearoptions.h index e4e74ba..debef00 100644 --- a/src/forms/dimlinearoptions.h +++ b/src/forms/dimlinearoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDimLinear; -class RS_ActionInterface; +class ActionDimLinear; +class ActionInterface; class DimLinearOptions: public QWidget { @@ -15,13 +15,13 @@ class DimLinearOptions: public QWidget ~DimLinearOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateAngle(const QString & a); void setHor(); void setVer(); protected: - RS_ActionDimLinear * action; + ActionDimLinear * action; private: QLabel * lAngle; diff --git a/src/forms/dimoptions.cpp b/src/forms/dimoptions.cpp index 6255912..905a262 100644 --- a/src/forms/dimoptions.cpp +++ b/src/forms/dimoptions.cpp @@ -14,8 +14,8 @@ #include "dimoptions.h" -#include "rs_actiondimension.h" -#include "rs_actioninterface.h" +#include "actiondimension.h" +#include "actioninterface.h" #include "settings.h" DimOptions::DimOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -80,11 +80,11 @@ DimOptions::~DimOptions() settings.endGroup(); } -void DimOptions::setAction(RS_ActionInterface * a, bool update) +void DimOptions::setAction(ActionInterface * a, bool update) { - if (a != NULL && RS_ActionDimension::isDimensionAction(a->rtti())) + if (a != NULL && ActionDimension::isDimensionAction(a->rtti())) { - action = (RS_ActionDimension *)a; + action = (ActionDimension *)a; QString st; QString stol1; diff --git a/src/forms/dimoptions.h b/src/forms/dimoptions.h index c588693..28f61b2 100644 --- a/src/forms/dimoptions.h +++ b/src/forms/dimoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDimension; -class RS_ActionInterface; +class ActionDimension; +class ActionInterface; class DimOptions: public QWidget { @@ -15,12 +15,12 @@ class DimOptions: public QWidget ~DimOptions(); public slots: - virtual void setAction(RS_ActionInterface * a, bool update); + virtual void setAction(ActionInterface * a, bool update); virtual void updateLabel(); virtual void insertSign(const QString & c); protected: - RS_ActionDimension * action; + ActionDimension * action; private: QLabel * lLabel; diff --git a/src/forms/imageoptions.cpp b/src/forms/imageoptions.cpp index 8577613..267837f 100644 --- a/src/forms/imageoptions.cpp +++ b/src/forms/imageoptions.cpp @@ -16,8 +16,8 @@ #include "rs.h" #include "settings.h" -#include "rs_actiondrawimage.h" -#include "rs_actioninterface.h" +#include "actiondrawimage.h" +#include "actioninterface.h" ImageOptions::ImageOptions(QWidget * parent/*= NULL*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags) @@ -33,11 +33,11 @@ ImageOptions::~ImageOptions() settings.endGroup(); } -void ImageOptions::setAction(RS_ActionInterface * a, bool update) +void ImageOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawImage) { - action = (RS_ActionDrawImage *)a; + action = (ActionDrawImage *)a; QString sAngle; QString sFactor; diff --git a/src/forms/imageoptions.h b/src/forms/imageoptions.h index 11e40ca..08b5d9e 100644 --- a/src/forms/imageoptions.h +++ b/src/forms/imageoptions.h @@ -3,8 +3,8 @@ #include "ui_imageoptions.h" -class RS_ActionDrawImage; -class RS_ActionInterface; +class ActionDrawImage; +class ActionInterface; class ImageOptions: public QWidget { @@ -15,11 +15,11 @@ class ImageOptions: public QWidget ~ImageOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateData(); protected: - RS_ActionDrawImage * action; + ActionDrawImage * action; private: Ui::ImageOptions ui; diff --git a/src/forms/insertoptions.cpp b/src/forms/insertoptions.cpp index f1f6172..9e30e11 100644 --- a/src/forms/insertoptions.cpp +++ b/src/forms/insertoptions.cpp @@ -14,7 +14,7 @@ #include "insertoptions.h" -#include "rs_actionblocksinsert.h" +#include "actionblocksinsert.h" #include "settings.h" InsertOptions::InsertOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -78,11 +78,11 @@ InsertOptions::~InsertOptions() settings.endGroup(); } -void InsertOptions::setAction(RS_ActionInterface * a, bool update) +void InsertOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionBlocksInsert) { - action = (RS_ActionBlocksInsert *)a; + action = (ActionBlocksInsert *)a; QString sAngle; QString sFactor; diff --git a/src/forms/insertoptions.h b/src/forms/insertoptions.h index 522046a..6d80642 100644 --- a/src/forms/insertoptions.h +++ b/src/forms/insertoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionBlocksInsert; -class RS_ActionInterface; +class ActionBlocksInsert; +class ActionInterface; class InsertOptions: public QWidget { @@ -15,11 +15,11 @@ class InsertOptions: public QWidget ~InsertOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateData(); protected: - RS_ActionBlocksInsert * action; + ActionBlocksInsert * action; private: QLabel * lAngle; diff --git a/src/forms/libraryinsertoptions.cpp b/src/forms/libraryinsertoptions.cpp index e19a7d9..3be169b 100644 --- a/src/forms/libraryinsertoptions.cpp +++ b/src/forms/libraryinsertoptions.cpp @@ -14,7 +14,7 @@ #include "libraryinsertoptions.h" -#include "rs_actionlibraryinsert.h" +#include "actionlibraryinsert.h" #include "settings.h" LibraryInsertOptions::LibraryInsertOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -52,11 +52,11 @@ LibraryInsertOptions::~LibraryInsertOptions() settings.endGroup(); } -void LibraryInsertOptions::setAction(RS_ActionInterface * a, bool update) +void LibraryInsertOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionLibraryInsert) { - action = (RS_ActionLibraryInsert *)a; + action = (ActionLibraryInsert *)a; QString sAngle; QString sFactor; diff --git a/src/forms/libraryinsertoptions.h b/src/forms/libraryinsertoptions.h index 2cbe83c..7d89685 100644 --- a/src/forms/libraryinsertoptions.h +++ b/src/forms/libraryinsertoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionInterface; -class RS_ActionLibraryInsert; +class ActionInterface; +class ActionLibraryInsert; class LibraryInsertOptions: public QWidget { @@ -15,11 +15,11 @@ class LibraryInsertOptions: public QWidget ~LibraryInsertOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateData(); protected: - RS_ActionLibraryInsert * action; + ActionLibraryInsert * action; private: QLabel * lAngle; diff --git a/src/forms/librarywidget.cpp b/src/forms/librarywidget.cpp index 77f2b78..7657a5d 100644 --- a/src/forms/librarywidget.cpp +++ b/src/forms/librarywidget.cpp @@ -17,7 +17,7 @@ #include "drawing.h" #include "rs_staticgraphicview.h" #include "rs_system.h" -#include "paintintf.h" +#include "paintinterface.h" LibraryWidget::LibraryWidget(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL) @@ -70,17 +70,17 @@ void LibraryWidget::insert() { if (actionHandler != NULL) { - RS_ActionInterface * a = actionHandler->setCurrentAction(RS2::ActionLibraryInsert); + ActionInterface * a = actionHandler->setCurrentAction(RS2::ActionLibraryInsert); if (a != NULL) { - RS_ActionLibraryInsert * action = (RS_ActionLibraryInsert *)a; + ActionLibraryInsert * action = (ActionLibraryInsert *)a; action->setFile(dxfPath); } else { RS_DEBUG->print(RS_Debug::D_ERROR, "LibraryWidget::insert:" - "Cannot create action RS_ActionLibraryInsert"); + "Cannot create action ActionLibraryInsert"); } } } diff --git a/src/forms/lineangleoptions.cpp b/src/forms/lineangleoptions.cpp index 3695d98..43775e4 100644 --- a/src/forms/lineangleoptions.cpp +++ b/src/forms/lineangleoptions.cpp @@ -14,7 +14,7 @@ #include "lineangleoptions.h" -#include "rs_actiondrawlineangle.h" +#include "actiondrawlineangle.h" #include "settings.h" LineAngleOptions::LineAngleOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -68,11 +68,11 @@ LineAngleOptions::~LineAngleOptions() } } -void LineAngleOptions::setAction(RS_ActionInterface * a, bool update) +void LineAngleOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawLineAngle) { - action = (RS_ActionDrawLineAngle *)a; + action = (ActionDrawLineAngle *)a; if (action->hasFixedAngle()) { diff --git a/src/forms/lineangleoptions.h b/src/forms/lineangleoptions.h index a7b0978..67c76dc 100644 --- a/src/forms/lineangleoptions.h +++ b/src/forms/lineangleoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDrawLineAngle; -class RS_ActionInterface; +class ActionDrawLineAngle; +class ActionInterface; class LineAngleOptions: public QWidget { @@ -15,13 +15,13 @@ class LineAngleOptions: public QWidget ~LineAngleOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateAngle(const QString & a); void updateLength(const QString & l); void updateSnapPoint(int sp); protected: - RS_ActionDrawLineAngle * action; + ActionDrawLineAngle * action; private: QLabel * lAngle; diff --git a/src/forms/linebisectoroptions.cpp b/src/forms/linebisectoroptions.cpp index ac7a8db..515c166 100644 --- a/src/forms/linebisectoroptions.cpp +++ b/src/forms/linebisectoroptions.cpp @@ -14,7 +14,7 @@ #include "linebisectoroptions.h" -#include "rs_actiondrawlinebisector.h" +#include "actiondrawlinebisector.h" #include "settings.h" LineBisectorOptions::LineBisectorOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -51,11 +51,11 @@ LineBisectorOptions::~LineBisectorOptions() settings.endGroup(); } -void LineBisectorOptions::setAction(RS_ActionInterface * a, bool update) +void LineBisectorOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawLineBisector) { - action = (RS_ActionDrawLineBisector *)a; + action = (ActionDrawLineBisector *)a; QString sl; QString sn; diff --git a/src/forms/linebisectoroptions.h b/src/forms/linebisectoroptions.h index ad64347..303a0ed 100644 --- a/src/forms/linebisectoroptions.h +++ b/src/forms/linebisectoroptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDrawLineBisector; -class RS_ActionInterface; +class ActionDrawLineBisector; +class ActionInterface; class LineBisectorOptions: public QWidget { @@ -15,12 +15,12 @@ class LineBisectorOptions: public QWidget ~LineBisectorOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateLength(const QString & l); void updateNumber(int n); protected: - RS_ActionDrawLineBisector * action; + ActionDrawLineBisector * action; private: QLabel * lLength; diff --git a/src/forms/lineoptions.cpp b/src/forms/lineoptions.cpp index 0cca77d..f4e5362 100644 --- a/src/forms/lineoptions.cpp +++ b/src/forms/lineoptions.cpp @@ -15,8 +15,8 @@ #include "lineoptions.h" #include "rs.h" -#include "rs_actiondrawline.h" -#include "rs_actioninterface.h" +#include "actiondrawline.h" +#include "actioninterface.h" LineOptions::LineOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), action(NULL), @@ -45,11 +45,12 @@ LineOptions::~LineOptions() { } -void LineOptions::setAction(RS_ActionInterface * a) +//void LineOptions::setAction(ActionInterface * a) +void LineOptions::setAction(ActionInterface * a) { if (a != NULL && a->rtti() == RS2::ActionDrawLine) { - action = (RS_ActionDrawLine *)a; + action = (ActionDrawLine *)a; } else { diff --git a/src/forms/lineoptions.h b/src/forms/lineoptions.h index a1fab0c..4a2046b 100644 --- a/src/forms/lineoptions.h +++ b/src/forms/lineoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDrawLine; -class RS_ActionInterface; +class ActionDrawLine; +class ActionInterface; class LineOptions: public QWidget { @@ -15,12 +15,12 @@ class LineOptions: public QWidget ~LineOptions(); public slots: - void setAction(RS_ActionInterface * a); + void setAction(ActionInterface * a); void close(); void undo(); protected: - RS_ActionDrawLine * action; + ActionDrawLine * action; private: QToolButton * bClose; diff --git a/src/forms/lineparalleloptions.cpp b/src/forms/lineparalleloptions.cpp index f55bf96..5879357 100644 --- a/src/forms/lineparalleloptions.cpp +++ b/src/forms/lineparalleloptions.cpp @@ -14,7 +14,7 @@ #include "lineparalleloptions.h" -#include "rs_actiondrawlineparallel.h" +#include "actiondrawlineparallel.h" #include "settings.h" LineParallelOptions::LineParallelOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -51,11 +51,11 @@ LineParallelOptions::~LineParallelOptions() settings.endGroup(); } -void LineParallelOptions::setAction(RS_ActionInterface * a, bool update) +void LineParallelOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawLineParallel) { - action = (RS_ActionDrawLineParallel *)a; + action = (ActionDrawLineParallel *)a; QString sd; QString sn; diff --git a/src/forms/lineparalleloptions.h b/src/forms/lineparalleloptions.h index cac77f5..1b701fd 100644 --- a/src/forms/lineparalleloptions.h +++ b/src/forms/lineparalleloptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDrawLineParallel; -class RS_ActionInterface; +class ActionDrawLineParallel; +class ActionInterface; class LineParallelOptions: public QWidget { @@ -15,12 +15,12 @@ class LineParallelOptions: public QWidget ~LineParallelOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateDist(const QString & d); void updateNumber(int n); protected: - RS_ActionDrawLineParallel * action; + ActionDrawLineParallel * action; private: QLabel * lDist; diff --git a/src/forms/lineparallelthroughoptions.cpp b/src/forms/lineparallelthroughoptions.cpp index d5f994e..b1f66ea 100644 --- a/src/forms/lineparallelthroughoptions.cpp +++ b/src/forms/lineparallelthroughoptions.cpp @@ -14,7 +14,7 @@ #include "lineparallelthroughoptions.h" -#include "rs_actiondrawlineparallelthrough.h" +#include "actiondrawlineparallelthrough.h" #include "settings.h" LineParallelThroughOptions::LineParallelThroughOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -45,11 +45,11 @@ LineParallelThroughOptions::~LineParallelThroughOptions() settings.endGroup(); } -void LineParallelThroughOptions::setAction(RS_ActionInterface * a, bool update) +void LineParallelThroughOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawLineParallelThrough) { - action = (RS_ActionDrawLineParallelThrough *)a; + action = (ActionDrawLineParallelThrough *)a; QString sn; diff --git a/src/forms/lineparallelthroughoptions.h b/src/forms/lineparallelthroughoptions.h index 925cd3d..506453b 100644 --- a/src/forms/lineparallelthroughoptions.h +++ b/src/forms/lineparallelthroughoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDrawLineParallelThrough; -class RS_ActionInterface; +class ActionDrawLineParallelThrough; +class ActionInterface; class LineParallelThroughOptions: public QWidget { @@ -15,11 +15,11 @@ class LineParallelThroughOptions: public QWidget ~LineParallelThroughOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateNumber(int n); protected: - RS_ActionDrawLineParallelThrough * action; + ActionDrawLineParallelThrough * action; private: QLabel * lNumber; diff --git a/src/forms/linepolygon2options.cpp b/src/forms/linepolygon2options.cpp index 1468a1c..894bc08 100644 --- a/src/forms/linepolygon2options.cpp +++ b/src/forms/linepolygon2options.cpp @@ -14,7 +14,7 @@ #include "linepolygon2options.h" -#include "rs_actiondrawlinepolygon2.h" +#include "actiondrawlinepolygon2.h" #include "rs_debug.h" #include "settings.h" @@ -46,11 +46,11 @@ LinePolygon2Options::~LinePolygon2Options() settings.endGroup(); } -void LinePolygon2Options::setAction(RS_ActionInterface * a, bool update) +void LinePolygon2Options::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawLinePolygon2) { - action = (RS_ActionDrawLinePolygon2 *)a; + action = (ActionDrawLinePolygon2 *)a; QString sn; diff --git a/src/forms/linepolygon2options.h b/src/forms/linepolygon2options.h index 968ced2..f9f4fa0 100644 --- a/src/forms/linepolygon2options.h +++ b/src/forms/linepolygon2options.h @@ -3,8 +3,8 @@ #include -class RS_ActionDrawLinePolygon2; -class RS_ActionInterface; +class ActionDrawLinePolygon2; +class ActionInterface; class LinePolygon2Options: public QWidget { @@ -15,11 +15,11 @@ class LinePolygon2Options: public QWidget ~LinePolygon2Options(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateNumber(int n); protected: - RS_ActionDrawLinePolygon2 * action; + ActionDrawLinePolygon2 * action; private: QLabel * lNumber; diff --git a/src/forms/linepolygonoptions.cpp b/src/forms/linepolygonoptions.cpp index c0b42cd..1a0b695 100644 --- a/src/forms/linepolygonoptions.cpp +++ b/src/forms/linepolygonoptions.cpp @@ -14,7 +14,7 @@ #include "linepolygonoptions.h" -#include "rs_actiondrawlinepolygon.h" +#include "actiondrawlinepolygon.h" #include "rs_debug.h" #include "settings.h" @@ -46,11 +46,11 @@ LinePolygonOptions::~LinePolygonOptions() settings.endGroup(); } -void LinePolygonOptions::setAction(RS_ActionInterface * a, bool update) +void LinePolygonOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawLinePolygon) { - action = (RS_ActionDrawLinePolygon *)a; + action = (ActionDrawLinePolygon *)a; QString sn; diff --git a/src/forms/linepolygonoptions.h b/src/forms/linepolygonoptions.h index 8a0672b..59600cd 100644 --- a/src/forms/linepolygonoptions.h +++ b/src/forms/linepolygonoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDrawLinePolygon; -class RS_ActionInterface; +class ActionDrawLinePolygon; +class ActionInterface; class LinePolygonOptions: public QWidget { @@ -15,11 +15,11 @@ class LinePolygonOptions: public QWidget ~LinePolygonOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateNumber(int n); protected: - RS_ActionDrawLinePolygon * action; + ActionDrawLinePolygon * action; private: QLabel * lNumber; diff --git a/src/forms/linerelangleoptions.cpp b/src/forms/linerelangleoptions.cpp index dc92c13..df93bb9 100644 --- a/src/forms/linerelangleoptions.cpp +++ b/src/forms/linerelangleoptions.cpp @@ -14,7 +14,7 @@ #include "linerelangleoptions.h" -#include "rs_actiondrawlinerelangle.h" +#include "actiondrawlinerelangle.h" #include "settings.h" LineRelAngleOptions::LineRelAngleOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -58,11 +58,11 @@ LineRelAngleOptions::~LineRelAngleOptions() } } -void LineRelAngleOptions::setAction(RS_ActionInterface * a, bool update) +void LineRelAngleOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawLineRelAngle) { - action = (RS_ActionDrawLineRelAngle *)a; + action = (ActionDrawLineRelAngle *)a; if (action->hasFixedAngle()) { diff --git a/src/forms/linerelangleoptions.h b/src/forms/linerelangleoptions.h index 7623de6..dfece27 100644 --- a/src/forms/linerelangleoptions.h +++ b/src/forms/linerelangleoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDrawLineRelAngle; -class RS_ActionInterface; +class ActionDrawLineRelAngle; +class ActionInterface; class LineRelAngleOptions: public QWidget { @@ -15,12 +15,12 @@ class LineRelAngleOptions: public QWidget ~LineRelAngleOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateAngle(const QString & a); void updateLength(const QString & l); protected: - RS_ActionDrawLineRelAngle * action; + ActionDrawLineRelAngle * action; private: QLabel * lAngle; diff --git a/src/forms/moverotateoptions.cpp b/src/forms/moverotateoptions.cpp index 4a257e7..a38d4ad 100644 --- a/src/forms/moverotateoptions.cpp +++ b/src/forms/moverotateoptions.cpp @@ -14,7 +14,7 @@ #include "moverotateoptions.h" -#include "rs_actionmodifymoverotate.h" +#include "actionmodifymoverotate.h" #include "settings.h" MoveRotateOptions::MoveRotateOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -45,11 +45,11 @@ MoveRotateOptions::~MoveRotateOptions() settings.endGroup(); } -void MoveRotateOptions::setAction(RS_ActionInterface * a, bool update) +void MoveRotateOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionModifyMoveRotate) { - action = (RS_ActionModifyMoveRotate *)a; + action = (ActionModifyMoveRotate *)a; QString sa; diff --git a/src/forms/moverotateoptions.h b/src/forms/moverotateoptions.h index e26dfd1..82c868b 100644 --- a/src/forms/moverotateoptions.h +++ b/src/forms/moverotateoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionInterface; -class RS_ActionModifyMoveRotate; +class ActionInterface; +class ActionModifyMoveRotate; class MoveRotateOptions: public QWidget { @@ -15,11 +15,11 @@ class MoveRotateOptions: public QWidget ~MoveRotateOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateAngle(const QString & a); protected: - RS_ActionModifyMoveRotate * action; + ActionModifyMoveRotate * action; private: QLabel * lAngle; diff --git a/src/forms/printpreviewoptions.cpp b/src/forms/printpreviewoptions.cpp index a88bbf2..42d0463 100644 --- a/src/forms/printpreviewoptions.cpp +++ b/src/forms/printpreviewoptions.cpp @@ -14,8 +14,8 @@ #include "printpreviewoptions.h" #include "rs.h" -#include "rs_actioninterface.h" -#include "rs_actionprintpreview.h" +#include "actioninterface.h" +#include "actionprintpreview.h" #include "rs_debug.h" #include "rs_math.h" @@ -64,11 +64,11 @@ PrintPreviewOptions::~PrintPreviewOptions() */ } -void PrintPreviewOptions::setAction(RS_ActionInterface * a, bool/*update*/) +void PrintPreviewOptions::setAction(ActionInterface * a, bool/*update*/) { if (a != NULL && a->rtti() == RS2::ActionPrintPreview) { - action = (RS_ActionPrintPreview *)a; + action = (ActionPrintPreview *)a; updateDisabled = true; RS2::Unit u = action->getUnit(); diff --git a/src/forms/printpreviewoptions.h b/src/forms/printpreviewoptions.h index 3e9dd34..5ae45dd 100644 --- a/src/forms/printpreviewoptions.h +++ b/src/forms/printpreviewoptions.h @@ -3,8 +3,8 @@ #include "ui_printpreviewoptions.h" -class RS_ActionInterface; -class RS_ActionPrintPreview; +class ActionInterface; +class ActionPrintPreview; class QToolBar; class PrintPreviewOptions: public QWidget @@ -17,7 +17,7 @@ class PrintPreviewOptions: public QWidget ~PrintPreviewOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateData(); void center(); void setBlackWhite(bool on); @@ -25,7 +25,7 @@ class PrintPreviewOptions: public QWidget void scale(const QString & s); protected: - RS_ActionPrintPreview * action; + ActionPrintPreview * action; private: QStringList imperialScales; diff --git a/src/forms/roundoptions.cpp b/src/forms/roundoptions.cpp index 8c72258..7f439b4 100644 --- a/src/forms/roundoptions.cpp +++ b/src/forms/roundoptions.cpp @@ -14,7 +14,7 @@ #include "roundoptions.h" -#include "rs_actionmodifyround.h" +#include "actionmodifyround.h" #include "settings.h" RoundOptions::RoundOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -53,11 +53,11 @@ RoundOptions::~RoundOptions() settings.endGroup(); } -void RoundOptions::setAction(RS_ActionInterface * a, bool update) +void RoundOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionModifyRound) { - action = (RS_ActionModifyRound *)a; + action = (ActionModifyRound *)a; QString sr; bool st; diff --git a/src/forms/roundoptions.h b/src/forms/roundoptions.h index f261c83..ce49952 100644 --- a/src/forms/roundoptions.h +++ b/src/forms/roundoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionInterface; -class RS_ActionModifyRound; +class ActionInterface; +class ActionModifyRound; class RoundOptions: public QWidget { @@ -15,11 +15,11 @@ class RoundOptions: public QWidget ~RoundOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateData(); protected: - RS_ActionModifyRound * action; + ActionModifyRound * action; private: QCheckBox * cbTrim; diff --git a/src/forms/snapdistoptions.cpp b/src/forms/snapdistoptions.cpp index 7355ace..056b365 100644 --- a/src/forms/snapdistoptions.cpp +++ b/src/forms/snapdistoptions.cpp @@ -14,8 +14,8 @@ #include "snapdistoptions.h" -//#include "rs_actionmodifytrimamount.h" -//#include "rs_actioninterface.h" +//#include "actionmodifytrimamount.h" +//#include "actioninterface.h" //#include "rs_debug.h" #include "rs_math.h" #include "settings.h" diff --git a/src/forms/splineoptions.cpp b/src/forms/splineoptions.cpp index 2d16301..be7e220 100644 --- a/src/forms/splineoptions.cpp +++ b/src/forms/splineoptions.cpp @@ -14,8 +14,8 @@ #include "splineoptions.h" -#include "rs_actiondrawspline.h" -#include "rs_actioninterface.h" +#include "actiondrawspline.h" +#include "actioninterface.h" #include "settings.h" SplineOptions::SplineOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): @@ -57,11 +57,11 @@ SplineOptions::~SplineOptions() settings.endGroup(); } -void SplineOptions::setAction(RS_ActionInterface * a, bool update) +void SplineOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawSpline) { - action = (RS_ActionDrawSpline *)a; + action = (ActionDrawSpline *)a; int degree; bool closed; diff --git a/src/forms/splineoptions.h b/src/forms/splineoptions.h index 77a4a4e..9ab115e 100644 --- a/src/forms/splineoptions.h +++ b/src/forms/splineoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionDrawSpline; -class RS_ActionInterface; +class ActionDrawSpline; +class ActionInterface; class SplineOptions: public QWidget { @@ -15,13 +15,13 @@ class SplineOptions: public QWidget ~SplineOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void setClosed(bool c); void undo(); void setDegree(const QString & deg); protected: - RS_ActionDrawSpline * action; + ActionDrawSpline * action; private: QLabel * lDegree; diff --git a/src/forms/textoptions.cpp b/src/forms/textoptions.cpp index 2190360..789eaf0 100644 --- a/src/forms/textoptions.cpp +++ b/src/forms/textoptions.cpp @@ -14,8 +14,8 @@ #include "textoptions.h" -#include "rs_actiondrawtext.h" -#include "rs_actioninterface.h" +#include "actiondrawtext.h" +#include "actioninterface.h" TextOptions::TextOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags) @@ -32,11 +32,11 @@ TextOptions::~TextOptions() { } -void TextOptions::setAction(RS_ActionInterface * a, bool update) +void TextOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionDrawText) { - action = (RS_ActionDrawText *)a; + action = (ActionDrawText *)a; QString st; QString sa; diff --git a/src/forms/textoptions.h b/src/forms/textoptions.h index c701fd5..fd84514 100644 --- a/src/forms/textoptions.h +++ b/src/forms/textoptions.h @@ -3,8 +3,8 @@ #include "ui_textoptions.h" -class RS_ActionInterface; -class RS_ActionDrawText; +class ActionInterface; +class ActionDrawText; class QToolBar; class TextOptions: public QWidget @@ -16,12 +16,12 @@ class TextOptions: public QWidget ~TextOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateText(); void updateAngle(); protected: - RS_ActionDrawText * action; + ActionDrawText * action; private: Ui::TextOptions ui; diff --git a/src/forms/trimamountoptions.cpp b/src/forms/trimamountoptions.cpp index c48283d..dde6476 100644 --- a/src/forms/trimamountoptions.cpp +++ b/src/forms/trimamountoptions.cpp @@ -14,8 +14,8 @@ #include "trimamountoptions.h" -#include "rs_actionmodifytrimamount.h" -#include "rs_actioninterface.h" +#include "actionmodifytrimamount.h" +#include "actioninterface.h" #include "rs_debug.h" #include "rs_math.h" #include "settings.h" @@ -48,11 +48,11 @@ TrimAmountOptions::~TrimAmountOptions() settings.endGroup(); } -void TrimAmountOptions::setAction(RS_ActionInterface * a, bool update) +void TrimAmountOptions::setAction(ActionInterface * a, bool update) { if (a != NULL && a->rtti() == RS2::ActionModifyTrimAmount) { - action = (RS_ActionModifyTrimAmount *)a; + action = (ActionModifyTrimAmount *)a; QString sd; diff --git a/src/forms/trimamountoptions.h b/src/forms/trimamountoptions.h index a118fe9..7ce2920 100644 --- a/src/forms/trimamountoptions.h +++ b/src/forms/trimamountoptions.h @@ -3,8 +3,8 @@ #include -class RS_ActionModifyTrimAmount; -class RS_ActionInterface; +class ActionModifyTrimAmount; +class ActionInterface; class TrimAmountOptions: public QWidget { @@ -15,11 +15,11 @@ class TrimAmountOptions: public QWidget ~TrimAmountOptions(); public slots: - void setAction(RS_ActionInterface * a, bool update); + void setAction(ActionInterface * a, bool update); void updateDist(const QString & d); protected: - RS_ActionModifyTrimAmount * action; + ActionModifyTrimAmount * action; private: QLabel * lDist; diff --git a/src/mainapp/applicationwindow.cpp b/src/mainapp/applicationwindow.cpp index 7e3e989..c0da383 100644 --- a/src/mainapp/applicationwindow.cpp +++ b/src/mainapp/applicationwindow.cpp @@ -17,9 +17,9 @@ #include "applicationwindow.h" #include -#include "rs_actiondrawlinefree.h" -#include "rs_actionlibraryinsert.h" -#include "rs_actionprintpreview.h" +#include "actiondrawlinefree.h" +#include "actionlibraryinsert.h" +#include "actionprintpreview.h" #include "rs_creation.h" #include "rs_dialogfactory.h" #include "rs_dimaligned.h" @@ -30,7 +30,7 @@ #include "rs_hatch.h" #include "rs_insert.h" #include "rs_image.h" -#include "paintintf.h" +#include "paintinterface.h" #include "rs_script.h" #include "rs_scriptlist.h" #include "settings.h" @@ -259,7 +259,7 @@ void ApplicationWindow::slotInsertBlock(const QString & name) if (graphicView && document) { - RS_ActionLibraryInsert * action = new RS_ActionLibraryInsert(*document, *graphicView); + ActionLibraryInsert * action = new ActionLibraryInsert(*document, *graphicView); action->setFile(name); graphicView->setCurrentAction(action); } @@ -2595,7 +2595,7 @@ void ApplicationWindow::slotFilePrintPreview(bool on) w->setWindowIcon(QIcon(":/res/document.png")); w->getGraphicView()->setPrintPreview(true); w->getGraphicView()->setBackground(RS_Color(255, 255, 255)); - w->getGraphicView()->setDefaultAction(new RS_ActionPrintPreview(*w->getDocument(), *w->getGraphicView())); + w->getGraphicView()->setDefaultAction(new ActionPrintPreview(*w->getDocument(), *w->getGraphicView())); // only graphics offer block lists, blocks don't RS_DEBUG->print(" adding listeners"); @@ -3338,8 +3338,8 @@ void ApplicationWindow::slotTestDrawFreehand() //Drawing* g = document->getMarking(); /* - RS_ActionDrawLineFree* action = - new RS_ActionDrawLineFree(*document->getGraphic(), + ActionDrawLineFree* action = + new ActionDrawLineFree(*document->getGraphic(), *graphicView); for (int i=0; i<100; ++i) { diff --git a/src/mainapp/applicationwindow.h b/src/mainapp/applicationwindow.h index abb835f..a8834af 100644 --- a/src/mainapp/applicationwindow.h +++ b/src/mainapp/applicationwindow.h @@ -5,7 +5,6 @@ #include "rs_document.h" #include "qc_dialogfactory.h" -//#include "qc_graphicview.h" #include "mdiwindow.h" #include "qg_actionhandler.h" #include "qg_blockwidget.h" @@ -30,7 +29,7 @@ class RecentFiles; /** * Main application window. Hold together document, view and controls. * - * @author James L. Hammons + * @author James Hammons * @author Andrew Mustun */ class ApplicationWindow: public QMainWindow, public QG_MainWindowInterface diff --git a/src/mainapp/graphicview.cpp b/src/mainapp/graphicview.cpp index a79ce63..5475dfd 100644 --- a/src/mainapp/graphicview.cpp +++ b/src/mainapp/graphicview.cpp @@ -19,7 +19,7 @@ #include "rs_eventhandler.h" #include "rs_grid.h" #include "rs_linetypepattern.h" -#include "paintintf.h" +#include "paintinterface.h" #include "settings.h" #include "rs_text.h" #include "rs_units.h" @@ -27,8 +27,7 @@ /** * Constructor. */ -GraphicView::GraphicView(): background(), foreground(), previewMode(false), - previewOffset(Vector(0, 0))//, snapperDraw(false) +GraphicView::GraphicView(): background(), foreground() { drawingMode = RS2::ModeFull; printing = false; @@ -46,10 +45,8 @@ GraphicView::GraphicView(): background(), foreground(), previewMode(false), grid = new RS_Grid(this); updateEnabled = 0; zoomFrozen = false; - //gridVisible = true; draftMode = false; painter = NULL; - //drawRecursion = 0; borderLeft = 0; borderTop = 0; @@ -78,8 +75,6 @@ GraphicView::GraphicView(): background(), foreground(), previewMode(false), simulationSmooth = false; simulationRapid = false; simulationRunning = false; - - //currentInsert = NULL; } /** @@ -87,10 +82,6 @@ GraphicView::GraphicView(): background(), foreground(), previewMode(false), */ GraphicView::~GraphicView() { - //delete eventHandler; - if (painter) - delete painter; - delete grid; } @@ -160,17 +151,6 @@ void GraphicView::adjustZoomControls() { } -#if 0 -/** - * Sets an external painter device. - */ -//void GraphicView::setPainter(RS_Painter * p) -void GraphicView::setPainter(PaintInterface * p) -{ - painter = p; -} -#endif - /** * Sets the background color. Note that applying the background * color for the widget is up to the implementing class. @@ -354,7 +334,6 @@ bool GraphicView::isZoomFrozen() void GraphicView::setContainer(RS_EntityContainer * container) { this->container = container; - //adjustOffsetControls(); } /** @@ -380,11 +359,11 @@ void GraphicView::setFactorY(double f) */ bool GraphicView::isGridOn() { - if (container != NULL) + if (container) { Drawing * g = container->getGraphic(); - if (g != NULL) + if (g) return g->isGridOn(); } @@ -451,7 +430,7 @@ void GraphicView::updateView() /** * @return Current action or NULL. */ -RS_ActionInterface * GraphicView::getDefaultAction() +ActionInterface * GraphicView::getDefaultAction() { if (eventHandler != NULL) return eventHandler->getDefaultAction(); @@ -462,18 +441,18 @@ RS_ActionInterface * GraphicView::getDefaultAction() /** * Sets the default action of the event handler. */ -void GraphicView::setDefaultAction(RS_ActionInterface * action) +void GraphicView::setDefaultAction(ActionInterface * action) { - if (eventHandler != NULL) + if (eventHandler) eventHandler->setDefaultAction(action); } /** * @return Current action or NULL. */ -RS_ActionInterface * GraphicView::getCurrentAction() +ActionInterface * GraphicView::getCurrentAction() { - if (eventHandler != NULL) + if (eventHandler) return eventHandler->getCurrentAction(); else return NULL; @@ -482,11 +461,11 @@ RS_ActionInterface * GraphicView::getCurrentAction() /** * Sets the current action of the event handler. */ -void GraphicView::setCurrentAction(RS_ActionInterface * action) +void GraphicView::setCurrentAction(ActionInterface * action) { RS_DEBUG->print("GraphicView::setCurrentAction"); - if (eventHandler != NULL) + if (eventHandler) eventHandler->setCurrentAction(action); RS_DEBUG->print("GraphicView::setCurrentAction: OK"); @@ -555,7 +534,6 @@ void GraphicView::mouseReleaseEvent(QMouseEvent * e) if (e->button() != Qt::RightButton || eventHandler->hasAction()) { eventHandler->mouseReleaseEvent(e); - //e->accept(); } else { @@ -691,14 +669,8 @@ void GraphicView::zoomIn(double f, const Vector & center) if (c.valid == false) c = toGraph(Vector(getWidth() / 2, getHeight() / 2)); - zoomWindow( - toGraph(Vector(0, 0)).scale(c, Vector(1.0 / f, 1.0 / f)), + zoomWindow(toGraph(Vector(0, 0)).scale(c, Vector(1.0 / f, 1.0 / f)), toGraph(Vector(getWidth(), getHeight())).scale(c, Vector(1.0 / f, 1.0 / f))); - - //adjustOffsetControls(); - //adjustZoomControls(); - //updateGrid(); - //redraw(); } /** @@ -1079,8 +1051,6 @@ void GraphicView::zoomWindow(Vector v1, Vector v2, bool keepAspectRatio) */ void GraphicView::zoomPan(int dx, int dy) { - //offsetX+=(int)toGuiDX(v1.x); - //offsetY+=(int)toGuiDY(v1.y); if (simulationRunning) return; @@ -1089,7 +1059,6 @@ void GraphicView::zoomPan(int dx, int dy) disableUpdate(); adjustOffsetControls(); - //adjustZoomControls(); updateGrid(); enableUpdate(); redraw(); @@ -1481,8 +1450,6 @@ void GraphicView::simulateIt() simulationRunning = true; simulationLast = Vector(0.0, 0.0); -//jlh destroyPainter(); - painter->erase(); // drawing paper border: @@ -1497,18 +1464,10 @@ void GraphicView::simulateIt() if (!isPrintPreview()) drawGrid(); - //if (draftMode) { - //painter->setPen(RS_Pen(foreground, - // RS2::Width00, RS2::SolidLine)); - //} - // drawing entities: RS_Pen pen(foreground, RS2::Width00, RS2::SolidLine); simulateEntity(container, pen); - //RS_DEBUG->timestamp(); - //RS_DEBUG->print(" draw zero.."); - // drawing zero points: if (!isPrintPreview()) { @@ -1516,14 +1475,6 @@ void GraphicView::simulateIt() drawRelativeZero(); } - //RS_DEBUG->timestamp(); - //RS_DEBUG->print(" draw grid.."); - - //RS_DEBUG->timestamp(); - //RS_DEBUG->print("GraphicView::drawIt() end"); - //if (painterCreated==true) { -//jlh destroyPainter(); - //} simulationRunning = false; } @@ -1553,9 +1504,7 @@ void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen) if (sp.distanceTo(simulationLast) > 1.0e-4) { -//jlh createDirectPainter(); RS_Pen rpen(RS_Color(0, 0, 255), RS2::Width00, RS2::SolidLine); - //painter->setPen(pen); RS_Line rapidLine(NULL, RS_LineData(simulationLast, sp)); simulateEntity(&rapidLine, rpen); } @@ -1613,8 +1562,6 @@ void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen) } else { -//jlh createDirectPainter(); - //RS_Pen pen(foreground, RS2::Width00, RS2::SolidLine); painter->setPen(pen); drawEntityPlain(e); } @@ -1723,15 +1670,11 @@ void GraphicView::drawLineSmooth(const Vector & p1, const Vector & p2, const RS_ double lx = p1.x; double ly = p1.y; - //RS_Pen pen(foreground, RS2::Width00, RS2::SolidLine); do { if (lx >= 0.0 && lx <= (double)getWidth() && ly >= 0.0 && ly <= (double)getHeight()) { - //if (painter==NULL) { -//jlh createDirectPainter(); - //} painter->setPen(pen); painter->drawGridPoint(Vector(lx, ly)); @@ -1749,13 +1692,8 @@ void GraphicView::drawLineSmooth(const Vector & p1, const Vector & p2, const RS_ void GraphicView::drawArcSmooth(const Vector & center, double radius, double a1, double a2, bool rev, const RS_Pen & pen) { - //int icx = graphic->realToScreenX(cx); - //int icy = graphic->realToScreenY(cy); - //RS_Pen pen(foreground, RS2::Width00, RS2::SolidLine); - if (radius <= 1.4) { -//jlh createDirectPainter(); painter->setPen(pen); painter->drawGridPoint(center); } @@ -1788,42 +1726,27 @@ void GraphicView::drawArcSmooth(const Vector & center, double radius, double a1, if (a1 > a2cp - 0.01) a2cp += 2 * M_PI; - //if (painter==NULL) { - //painter->setPen(pen); - //createDirectPainter(); - //} - //painter->moveTo(ix1, iy1); - for(a=a1+aStep; a<=a2cp; a+=aStep) { k2x = RS_Math::round(center.x+cos(a)*radius); k2y = RS_Math::round(center.y-sin(a)*radius); - //if(graphic->isPointOnScreen(k2x, k2y) || - // graphic->isPointOnScreen(k1x, k1y) ) { -//jlh createDirectPainter(); painter->setPen(pen); + if ((k2x >= 0 && k2x <= painter->getWidth() && k2y >= 0 && k2y <= painter->getHeight()) || (k1x >= 0 && k1x <= painter->getWidth() && k1y >= 0 && k1y <= painter->getHeight())) { - //painter->lineTo(k2x, k2y); painter->drawLine(Vector(k1x, k1y), Vector(k2x, k2y)); simulationDelay(); - //graphic->simulationDelay(); } - //createDirectPainter(); - //painter->setPen(pen); - //painter->moveTo(k2x, k2y); k1x = k2x; k1y = k2y; } -//jlh createDirectPainter(); painter->setPen(pen); painter->drawLine(Vector(k2x, k2y), Vector(ix2, iy2)); - //painter->lineTo(ix2, iy2); } else { @@ -1832,36 +1755,26 @@ void GraphicView::drawArcSmooth(const Vector & center, double radius, double a1, if (a1 < a2cp + 0.01) a2cp -= 2 * M_PI; - //createDirectPainter(); - //painter->setPen(pen); - //painter->moveTo(ix1, iy1); for(a=a1-aStep; a>=a2cp; a-=aStep) { k2x = RS_Math::round(center.x + cos(a) * radius); k2y = RS_Math::round(center.y - sin(a) * radius); - //if(graphic->isPointOnScreen(k2x, k2y) || - // graphic->isPointOnScreen(k1x, k1y) ) { -//jlh createDirectPainter(); painter->setPen(pen); + if ((k2x >=0 && k2x <= painter->getWidth() && k2y >= 0 && k2y <= painter->getHeight()) || (k1x >= 0 && k1x <= painter->getWidth() && k1y >= 0 && k1y <= painter->getHeight())) { - //painter->lineTo(k2x, k2y); painter->drawLine(Vector(k1x, k1y), Vector(k2x, k2y)); simulationDelay(); } - //createDirectPainter(); - //painter->setPen(pen); - //painter->moveTo(k2x, k2y); + k1x = k2x; k1y = k2y; } -//jlh createDirectPainter(); painter->setPen(pen); - //painter->lineTo(ix2, iy2); painter->drawLine(Vector(k2x, k2y), Vector(ix2, iy2)); } } @@ -1970,8 +1883,6 @@ void GraphicView::drawAbsoluteZero() int zr = 20; -// RS_Pen pen(metaGridColor, RS2::Width00, RS2::SolidLine); -// painter->setPen(pen); // RS_Pen p(Qt::red, RS2::Width00, RS2::SolidLine); //Using Qt::red doesn't seem to work here... //It's because Qt colors and RS_Color are not 100% compatible... @@ -1994,7 +1905,6 @@ void GraphicView::drawAbsoluteZero() */ void GraphicView::drawRelativeZero() { -// PROBLEM: relativeZero IS NOT VALID!!! if (!relativeZero.valid || !painter) #if 1 return; @@ -2010,8 +1920,6 @@ void GraphicView::drawRelativeZero() } #endif -// RS_Pen p(Qt::red, RS2::Width00, RS2::SolidLine); -// p.setScreenWidth(0); //Using Qt::red doesn't seem to work here... RS_Pen p(RS_Color(255, 0, 0), RS2::Width00, RS2::SolidLine); painter->setPen(p); @@ -2115,7 +2023,7 @@ void GraphicView::drawGrid() */ void GraphicView::drawMetaGrid() { - if (!grid || isGridOn() == false /*|| grid->getMetaSpacing()<0.0*/) + if (!grid || isGridOn() == false) return; if (!painter) @@ -2340,15 +2248,7 @@ void GraphicView::setRelativeZero(const Vector & pos) */ void GraphicView::moveRelativeZero(const Vector & pos) { -//this is crap. we're taking this shit out. -//#warning "!!! GraphicView::moveRelativeZero(): Bad render path !!!" -// if (!painter) -// return; - - //painter->setXORMode(); -// drawRelativeZero(); setRelativeZero(pos); -// drawRelativeZero(); } RS_EventHandler * GraphicView::getEventHandler() @@ -2437,35 +2337,3 @@ bool GraphicView::getSimulationRapid() { return simulationRapid; } - -// These functions are here because of the focacta way that this -// program set up its rendering... -void GraphicView::SetPreviewMode(bool mode/*= true*/) -{ - previewMode = mode; -} - -void GraphicView::SetPreviewEntity(RS_Preview * p) -{ - previewEntity = p; -} - -void GraphicView::SetPreviewOffset(Vector o) -{ - previewOffset = o; -} - -//Don't need this no more... -#if 0 -void GraphicView::SetSnapperDraw(bool mode) -{ - snapperDraw = mode; -} - -void GraphicView::SetSnapperVars(Vector snapSpot, Vector snapCoord, bool showCrosshairs) -{ - snapSpot1 = snapSpot; - snapCoord1 = snapCoord; - showCrosshairs1 = showCrosshairs; -} -#endif diff --git a/src/mainapp/graphicview.h b/src/mainapp/graphicview.h index 94e5be2..6e2ec15 100644 --- a/src/mainapp/graphicview.h +++ b/src/mainapp/graphicview.h @@ -8,18 +8,16 @@ #include "rs_snapper.h" #include "vector.h" +class ActionInterface; +class RS_CommandEvent; class Drawing; class PaintInterface; -class RS_EntityContainer; -class RS_ActionInterface; class RS_Entity; -class RS_LineTypePattern; -class RS_CommandEvent; -class Vector; -class RS_Preview; +class RS_EntityContainer; +class RS_EventHandler; class RS_Grid; +class RS_LineTypePattern; class RS_Pen; -class RS_EventHandler; class GraphicView { @@ -87,10 +85,10 @@ class GraphicView void freezeZoom(bool freeze); bool isZoomFrozen(); - void setDefaultAction(RS_ActionInterface * action); - RS_ActionInterface * getDefaultAction(); - void setCurrentAction(RS_ActionInterface * action); - RS_ActionInterface * getCurrentAction(); + void setDefaultAction(ActionInterface * action); + ActionInterface * getDefaultAction(); + void setCurrentAction(ActionInterface * action); + ActionInterface * getCurrentAction(); void killSelectActions(); void killAllActions(); @@ -196,14 +194,6 @@ class GraphicView void setSimulationRapid(bool r); bool getSimulationRapid(); - //this is here because of crappy braindead infrastructure - void SetPreviewMode(bool mode = true); - void SetPreviewEntity(RS_Preview *); - void SetPreviewOffset(Vector); -//We can remove this now... -// void SetSnapperDraw(bool); -// void SetSnapperVars(Vector snapSpot, Vector snapCoord, bool showCrosshairs); - protected: RS_EntityContainer * container; RS_EventHandler * eventHandler; @@ -287,16 +277,6 @@ class GraphicView RS_Snapper snapper; RS_Preview preview; - protected: - // crap to make painting with update() possible - RS_Preview * previewEntity; - bool previewMode; - Vector previewOffset; -// bool snapperDraw; -// Vector snapSpot1; -// Vector snapCoord1; -// bool showCrosshairs1; - //QG protected: int lastWidth; @@ -305,8 +285,6 @@ class GraphicView QScrollBar * hScrollBar; //! Vertical scrollbar. QScrollBar * vScrollBar; -// //! Layout used to fit in the view and the scrollbars. -// QGridLayout * layout; //! Label for grid spacing. QLabel * gridStatus; //! CAD mouse cursor @@ -320,7 +298,7 @@ class GraphicView //! Hand mouse cursor QCursor * curHand; -//QC +//QC was merged with QG }; #endif // __GRAPHICVIEW_H__ diff --git a/src/widgets/qg_actionhandler.cpp b/src/widgets/qg_actionhandler.cpp index 2ddc8eb..de23f92 100644 --- a/src/widgets/qg_actionhandler.cpp +++ b/src/widgets/qg_actionhandler.cpp @@ -16,114 +16,114 @@ #include "rs_commandevent.h" #include "commands.h" -#include "rs_actionblocksadd.h" -#include "rs_actionblocksattributes.h" -#include "rs_actionblockscreate.h" -#include "rs_actionblocksedit.h" -#include "rs_actionblocksexplode.h" -#include "rs_actionblocksfreezeall.h" -#include "rs_actionblocksinsert.h" -#include "rs_actionblocksremove.h" -#include "rs_actionblockstoggleview.h" -#include "rs_actiondimaligned.h" -#include "rs_actiondimangular.h" -#include "rs_actiondimdiametric.h" -#include "rs_actiondimleader.h" -#include "rs_actiondimlinear.h" -#include "rs_actiondimradial.h" -#include "rs_actiondrawarc.h" -#include "rs_actiondrawarc3p.h" -#include "rs_actiondrawarctangential.h" -#include "rs_actiondrawcircle.h" -#include "rs_actiondrawcircle2p.h" -#include "rs_actiondrawcircle3p.h" -#include "rs_actiondrawcirclecr.h" -#include "rs_actiondrawellipseaxis.h" -#include "rs_actiondrawhatch.h" -#include "rs_actiondrawimage.h" -#include "rs_actiondrawline.h" -#include "rs_actiondrawlineangle.h" -#include "rs_actiondrawlinebisector.h" -#include "rs_actiondrawlinefree.h" -#include "rs_actiondrawlinehorvert.h" -#include "rs_actiondrawlineparallel.h" -#include "rs_actiondrawlineparallelthrough.h" -#include "rs_actiondrawlinepolygon.h" -#include "rs_actiondrawlinepolygon2.h" -#include "rs_actiondrawlinerectangle.h" -#include "rs_actiondrawlinerelangle.h" -#include "rs_actiondrawlinetangent1.h" -#include "rs_actiondrawlinetangent2.h" -#include "rs_actiondrawpoint.h" -#include "rs_actiondrawspline.h" -#include "rs_actiondrawtext.h" -#include "rs_actioneditcopy.h" -#include "rs_actioneditpaste.h" -#include "rs_actioneditundo.h" -#include "rs_actionfileopen.h" -#include "rs_actionfilesaveas.h" -#include "rs_actioninfoangle.h" -#include "rs_actioninfoarea.h" -#include "rs_actioninfodist.h" -#include "rs_actioninfodist2.h" -#include "rs_actioninfoinside.h" -#include "rs_actioninfototallength.h" -#include "rs_actioninterface.h" -#include "rs_actionlayersadd.h" -#include "rs_actionlayersedit.h" -#include "rs_actionlayersfreezeall.h" -#include "rs_actionlayersremove.h" -#include "rs_actionlayerstogglelock.h" -#include "rs_actionlayerstoggleview.h" -#include "rs_actionlibraryinsert.h" -#include "rs_actionlockrelativezero.h" -#include "rs_actionmodifyattributes.h" -#include "rs_actionmodifybevel.h" -#include "rs_actionmodifycut.h" -#include "rs_actionmodifydelete.h" -#include "rs_actionmodifydeletefree.h" -#include "rs_actionmodifydeletequick.h" -#include "rs_actionmodifyentity.h" -#include "rs_actionmodifyexplodetext.h" -#include "rs_actionmodifymirror.h" -#include "rs_actionmodifymove.h" -#include "rs_actionmodifymoverotate.h" -#include "rs_actionmodifyrotate.h" -#include "rs_actionmodifyrotate2.h" -#include "rs_actionmodifyround.h" -#include "rs_actionmodifyscale.h" -#include "rs_actionmodifystretch.h" -#include "rs_actionmodifytrim.h" -#include "rs_actionmodifytrimamount.h" -#include "rs_actionoptionsdrawing.h" -#include "rs_actionselect.h" -#include "rs_actionselectall.h" -#include "rs_actionselectcontour.h" -#include "rs_actionselectintersected.h" -#include "rs_actionselectinvert.h" -#include "rs_actionselectlayer.h" -#include "rs_actionselectsingle.h" -#include "rs_actionselectwindow.h" -#include "rs_actionsetrelativezero.h" -#include "rs_actionsetsnapmode.h" -#include "rs_actionsetsnaprestriction.h" -#include "rs_actionsnapintersectionmanual.h" -#include "rs_actiontoolregeneratedimensions.h" -#include "rs_actionzoomauto.h" -#include "rs_actionzoomin.h" -#include "rs_actionzoompan.h" -#include "rs_actionzoomprevious.h" -#include "rs_actionzoomredraw.h" -#include "rs_actionzoomwindow.h" +#include "actionblocksadd.h" +#include "actionblocksattributes.h" +#include "actionblockscreate.h" +#include "actionblocksedit.h" +#include "actionblocksexplode.h" +#include "actionblocksfreezeall.h" +#include "actionblocksinsert.h" +#include "actionblocksremove.h" +#include "actionblockstoggleview.h" +#include "actiondimaligned.h" +#include "actiondimangular.h" +#include "actiondimdiametric.h" +#include "actiondimleader.h" +#include "actiondimlinear.h" +#include "actiondimradial.h" +#include "actiondrawarc.h" +#include "actiondrawarc3p.h" +#include "actiondrawarctangential.h" +#include "actiondrawcircle.h" +#include "actiondrawcircle2p.h" +#include "actiondrawcircle3p.h" +#include "actiondrawcirclecr.h" +#include "actiondrawellipseaxis.h" +#include "actiondrawhatch.h" +#include "actiondrawimage.h" +#include "actiondrawline.h" +#include "actiondrawlineangle.h" +#include "actiondrawlinebisector.h" +#include "actiondrawlinefree.h" +#include "actiondrawlinehorvert.h" +#include "actiondrawlineparallel.h" +#include "actiondrawlineparallelthrough.h" +#include "actiondrawlinepolygon.h" +#include "actiondrawlinepolygon2.h" +#include "actiondrawlinerectangle.h" +#include "actiondrawlinerelangle.h" +#include "actiondrawlinetangent1.h" +#include "actiondrawlinetangent2.h" +#include "actiondrawpoint.h" +#include "actiondrawspline.h" +#include "actiondrawtext.h" +#include "actioneditcopy.h" +#include "actioneditpaste.h" +#include "actioneditundo.h" +#include "actionfileopen.h" +#include "actionfilesaveas.h" +#include "actioninfoangle.h" +#include "actioninfoarea.h" +#include "actioninfodist.h" +#include "actioninfodist2.h" +#include "actioninfoinside.h" +#include "actioninfototallength.h" +#include "actioninterface.h" +#include "actionlayersadd.h" +#include "actionlayersedit.h" +#include "actionlayersfreezeall.h" +#include "actionlayersremove.h" +#include "actionlayerstogglelock.h" +#include "actionlayerstoggleview.h" +#include "actionlibraryinsert.h" +#include "actionlockrelativezero.h" +#include "actionmodifyattributes.h" +#include "actionmodifybevel.h" +#include "actionmodifycut.h" +#include "actionmodifydelete.h" +#include "actionmodifydeletefree.h" +#include "actionmodifydeletequick.h" +#include "actionmodifyentity.h" +#include "actionmodifyexplodetext.h" +#include "actionmodifymirror.h" +#include "actionmodifymove.h" +#include "actionmodifymoverotate.h" +#include "actionmodifyrotate.h" +#include "actionmodifyrotate2.h" +#include "actionmodifyround.h" +#include "actionmodifyscale.h" +#include "actionmodifystretch.h" +#include "actionmodifytrim.h" +#include "actionmodifytrimamount.h" +#include "actionoptionsdrawing.h" +#include "actionselect.h" +#include "actionselectall.h" +#include "actionselectcontour.h" +#include "actionselectintersected.h" +#include "actionselectinvert.h" +#include "actionselectlayer.h" +#include "actionselectsingle.h" +#include "actionselectwindow.h" +#include "actionsetrelativezero.h" +#include "actionsetsnapmode.h" +#include "actionsetsnaprestriction.h" +#include "actionsnapintersectionmanual.h" +#include "actiontoolregeneratedimensions.h" +#include "actionzoomauto.h" +#include "actionzoomin.h" +#include "actionzoompan.h" +#include "actionzoomprevious.h" +#include "actionzoomredraw.h" +#include "actionzoomwindow.h" #warning "!!! Need to add polyline functionality !!!" -#ifdef RS_PROF -#include "rs_actiondrawpolyline.h" -#include "rs_actionpolylineadd.h" -#include "rs_actionpolylineappend.h" -#include "rs_actionpolylinedel.h" -#include "rs_actionpolylinedelbetween.h" -#include "rs_actionpolylinetrim.h" +#if 0 +#include "actiondrawpolyline.h" +#include "actionpolylineadd.h" +#include "actionpolylineappend.h" +#include "actionpolylinedel.h" +#include "actionpolylinedelbetween.h" +#include "actionpolylinetrim.h" #endif #ifdef RS_CAM @@ -183,7 +183,7 @@ void QG_ActionHandler::killSelectActions() /** * @return Current action or NULL. */ -RS_ActionInterface * QG_ActionHandler::getCurrentAction() +ActionInterface * QG_ActionHandler::getCurrentAction() { GraphicView * gv = mainWindow->getGraphicView(); @@ -195,7 +195,7 @@ RS_ActionInterface * QG_ActionHandler::getCurrentAction() #if 0 Instead of the following giant switch statement, you could something like the following: -RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS_ActionInterface * action) +ActionInterface * QG_ActionHandler::setCurrentAction(ActionInterface * action) { GraphicView * gv = mainWindow->getGraphicView(); RS_Document * doc = mainWindow->getDocument(); @@ -212,7 +212,7 @@ RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS_ActionInterface * act return action; } Then you'd call it with: - a = new RS_ActionEditUndo(true, *doc, *gv); + a = new ActionEditUndo(true, *doc, *gv); Hmmm.... We need gv & doc *before* we call this... @@ -229,13 +229,13 @@ Well... The problem is the action, they're all different... * * @return Pointer to the created action or NULL. */ -RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS2::ActionType id) +ActionInterface * QG_ActionHandler::setCurrentAction(RS2::ActionType id) { RS_DEBUG->print("QG_ActionHandler::setCurrentAction()"); GraphicView * gv = mainWindow->getGraphicView(); RS_Document * doc = mainWindow->getDocument(); - RS_ActionInterface * a = NULL; + ActionInterface * a = NULL; // only global options are allowed without a document: if (gv == NULL || doc == NULL) @@ -248,527 +248,527 @@ RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS2::ActionType id) switch (id) { //case RS2::ActionFileNew: - // a = new RS_ActionFileNew(*doc, *gv); + // a = new ActionFileNew(*doc, *gv); // break; //case RS2::ActionFileSave: - // a = new RS_ActionFileSave(*doc, *gv); + // a = new ActionFileSave(*doc, *gv); // break; //case RS2::ActionFileClose: - // //a = new RS_ActionFileClose(*doc, *gv); + // //a = new ActionFileClose(*doc, *gv); // break; //case RS2::ActionFileQuit: - // //a = new RS_ActionFileQuit(*doc, *gv); + // //a = new ActionFileQuit(*doc, *gv); // break; case RS2::ActionFileOpen: - a = new RS_ActionFileOpen(*doc, *gv); + a = new ActionFileOpen(*doc, *gv); break; case RS2::ActionFileSaveAs: - a = new RS_ActionFileSaveAs(*doc, *gv); + a = new ActionFileSaveAs(*doc, *gv); break; // Editing actions: // case RS2::ActionEditUndo: - a = new RS_ActionEditUndo(true, *doc, *gv); + a = new ActionEditUndo(true, *doc, *gv); break; case RS2::ActionEditRedo: - a = new RS_ActionEditUndo(false, *doc, *gv); + a = new ActionEditUndo(false, *doc, *gv); break; case RS2::ActionEditCut: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionEditCutNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionEditCutNoSelect); break; case RS2::ActionEditCutNoSelect: - a = new RS_ActionEditCopy(false, *doc, *gv); + a = new ActionEditCopy(false, *doc, *gv); break; case RS2::ActionEditCopy: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionEditCopyNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionEditCopyNoSelect); break; case RS2::ActionEditCopyNoSelect: - a = new RS_ActionEditCopy(true, *doc, *gv); + a = new ActionEditCopy(true, *doc, *gv); break; case RS2::ActionEditPaste: - a = new RS_ActionEditPaste(*doc, *gv); + a = new ActionEditPaste(*doc, *gv); break; // Selecting actions: // case RS2::ActionSelectSingle: gv->killSelectActions(); - a = new RS_ActionSelectSingle(*doc, *gv); + a = new ActionSelectSingle(*doc, *gv); break; case RS2::ActionSelectContour: gv->killSelectActions(); - a = new RS_ActionSelectContour(*doc, *gv); + a = new ActionSelectContour(*doc, *gv); break; case RS2::ActionSelectAll: - a = new RS_ActionSelectAll(*doc, *gv, true); + a = new ActionSelectAll(*doc, *gv, true); break; case RS2::ActionDeselectAll: - a = new RS_ActionSelectAll(*doc, *gv, false); + a = new ActionSelectAll(*doc, *gv, false); break; case RS2::ActionSelectWindow: gv->killSelectActions(); - a = new RS_ActionSelectWindow(*doc, *gv, true); + a = new ActionSelectWindow(*doc, *gv, true); break; case RS2::ActionDeselectWindow: gv->killSelectActions(); - a = new RS_ActionSelectWindow(*doc, *gv, false); + a = new ActionSelectWindow(*doc, *gv, false); break; case RS2::ActionSelectInvert: - a = new RS_ActionSelectInvert(*doc, *gv); + a = new ActionSelectInvert(*doc, *gv); break; case RS2::ActionSelectIntersected: gv->killSelectActions(); - a = new RS_ActionSelectIntersected(*doc, *gv, true); + a = new ActionSelectIntersected(*doc, *gv, true); break; case RS2::ActionDeselectIntersected: gv->killSelectActions(); - a = new RS_ActionSelectIntersected(*doc, *gv, false); + a = new ActionSelectIntersected(*doc, *gv, false); break; case RS2::ActionSelectLayer: gv->killSelectActions(); - a = new RS_ActionSelectLayer(*doc, *gv); + a = new ActionSelectLayer(*doc, *gv); break; // Tool actions: // case RS2::ActionToolRegenerateDimensions: - a = new RS_ActionToolRegenerateDimensions(*doc, *gv); + a = new ActionToolRegenerateDimensions(*doc, *gv); break; // Zooming actions: // case RS2::ActionZoomIn: - a = new RS_ActionZoomIn(*doc, *gv, RS2::In, RS2::Both); + a = new ActionZoomIn(*doc, *gv, RS2::In, RS2::Both); break; case RS2::ActionZoomOut: - a = new RS_ActionZoomIn(*doc, *gv, RS2::Out, RS2::Both); + a = new ActionZoomIn(*doc, *gv, RS2::Out, RS2::Both); break; case RS2::ActionZoomAuto: - a = new RS_ActionZoomAuto(*doc, *gv); + a = new ActionZoomAuto(*doc, *gv); break; case RS2::ActionZoomWindow: - a = new RS_ActionZoomWindow(*doc, *gv); + a = new ActionZoomWindow(*doc, *gv); break; case RS2::ActionZoomPan: - a = new RS_ActionZoomPan(*doc, *gv); + a = new ActionZoomPan(*doc, *gv); break; case RS2::ActionZoomPrevious: - a = new RS_ActionZoomPrevious(*doc, *gv); + a = new ActionZoomPrevious(*doc, *gv); break; case RS2::ActionZoomRedraw: - a = new RS_ActionZoomRedraw(*doc, *gv); + a = new ActionZoomRedraw(*doc, *gv); break; // Drawing actions: // case RS2::ActionDrawPoint: - a = new RS_ActionDrawPoint(*doc, *gv); + a = new ActionDrawPoint(*doc, *gv); break; case RS2::ActionDrawLine: - a = new RS_ActionDrawLine(*doc, *gv); + a = new ActionDrawLine(*doc, *gv); break; case RS2::ActionDrawLineAngle: - a = new RS_ActionDrawLineAngle(*doc, *gv, 0.0, false); + a = new ActionDrawLineAngle(*doc, *gv, 0.0, false); break; case RS2::ActionDrawLineHorizontal: - a = new RS_ActionDrawLineAngle(*doc, *gv, 0.0, true); + a = new ActionDrawLineAngle(*doc, *gv, 0.0, true); break; case RS2::ActionDrawLineHorVert: - a = new RS_ActionDrawLineHorVert(*doc, *gv); + a = new ActionDrawLineHorVert(*doc, *gv); break; case RS2::ActionDrawLineVertical: - a = new RS_ActionDrawLineAngle(*doc, *gv, M_PI/2.0, true); + a = new ActionDrawLineAngle(*doc, *gv, M_PI / 2.0, true); break; case RS2::ActionDrawLineFree: - a = new RS_ActionDrawLineFree(*doc, *gv); + a = new ActionDrawLineFree(*doc, *gv); break; case RS2::ActionDrawLineParallel: - a = new RS_ActionDrawLineParallel(*doc, *gv); + a = new ActionDrawLineParallel(*doc, *gv); break; case RS2::ActionDrawLineParallelThrough: - a = new RS_ActionDrawLineParallelThrough(*doc, *gv); + a = new ActionDrawLineParallelThrough(*doc, *gv); break; case RS2::ActionDrawLineRectangle: - a = new RS_ActionDrawLineRectangle(*doc, *gv); + a = new ActionDrawLineRectangle(*doc, *gv); break; case RS2::ActionDrawLineBisector: - a = new RS_ActionDrawLineBisector(*doc, *gv); + a = new ActionDrawLineBisector(*doc, *gv); break; case RS2::ActionDrawLineTangent1: - a = new RS_ActionDrawLineTangent1(*doc, *gv); + a = new ActionDrawLineTangent1(*doc, *gv); break; case RS2::ActionDrawLineTangent2: - a = new RS_ActionDrawLineTangent2(*doc, *gv); + a = new ActionDrawLineTangent2(*doc, *gv); break; case RS2::ActionDrawLineOrthogonal: - a = new RS_ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, true); + a = new ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, true); break; case RS2::ActionDrawLineRelAngle: - a = new RS_ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, false); + a = new ActionDrawLineRelAngle(*doc, *gv, M_PI / 2.0, false); break; #warning "!!! Need to add polyline functionality !!!" #ifdef RS_PROF case RS2::ActionDrawPolyline: - a = new RS_ActionDrawPolyline(*doc, *gv); + a = new ActionDrawPolyline(*doc, *gv); break; case RS2::ActionPolylineAdd: - a = new RS_ActionPolylineAdd(*doc, *gv); + a = new ActionPolylineAdd(*doc, *gv); break; case RS2::ActionPolylineAppend: - a = new RS_ActionPolylineAppend(*doc, *gv); + a = new ActionPolylineAppend(*doc, *gv); break; case RS2::ActionPolylineDel: - a = new RS_ActionPolylineDel(*doc, *gv); + a = new ActionPolylineDel(*doc, *gv); break; case RS2::ActionPolylineDelBetween: - a = new RS_ActionPolylineDelBetween(*doc, *gv); + a = new ActionPolylineDelBetween(*doc, *gv); break; case RS2::ActionPolylineTrim: - a = new RS_ActionPolylineTrim(*doc, *gv); + a = new ActionPolylineTrim(*doc, *gv); break; #endif case RS2::ActionDrawLinePolygon: - a = new RS_ActionDrawLinePolygon(*doc, *gv); + a = new ActionDrawLinePolygon(*doc, *gv); break; case RS2::ActionDrawLinePolygon2: - a = new RS_ActionDrawLinePolygon2(*doc, *gv); + a = new ActionDrawLinePolygon2(*doc, *gv); break; case RS2::ActionDrawCircle: - a = new RS_ActionDrawCircle(*doc, *gv); + a = new ActionDrawCircle(*doc, *gv); break; case RS2::ActionDrawCircleCR: - a = new RS_ActionDrawCircleCR(*doc, *gv); + a = new ActionDrawCircleCR(*doc, *gv); break; case RS2::ActionDrawCircle2P: - a = new RS_ActionDrawCircle2P(*doc, *gv); + a = new ActionDrawCircle2P(*doc, *gv); break; case RS2::ActionDrawCircle3P: - a = new RS_ActionDrawCircle3P(*doc, *gv); + a = new ActionDrawCircle3P(*doc, *gv); break; case RS2::ActionDrawCircleParallel: - a = new RS_ActionDrawLineParallel(*doc, *gv); + a = new ActionDrawLineParallel(*doc, *gv); break; case RS2::ActionDrawArc: - a = new RS_ActionDrawArc(*doc, *gv); + a = new ActionDrawArc(*doc, *gv); break; case RS2::ActionDrawArc3P: - a = new RS_ActionDrawArc3P(*doc, *gv); + a = new ActionDrawArc3P(*doc, *gv); break; case RS2::ActionDrawArcParallel: - a = new RS_ActionDrawLineParallel(*doc, *gv); + a = new ActionDrawLineParallel(*doc, *gv); break; case RS2::ActionDrawArcTangential: - a = new RS_ActionDrawArcTangential(*doc, *gv); + a = new ActionDrawArcTangential(*doc, *gv); break; case RS2::ActionDrawEllipseAxis: - a = new RS_ActionDrawEllipseAxis(*doc, *gv, false); + a = new ActionDrawEllipseAxis(*doc, *gv, false); break; case RS2::ActionDrawEllipseArcAxis: - a = new RS_ActionDrawEllipseAxis(*doc, *gv, true); + a = new ActionDrawEllipseAxis(*doc, *gv, true); break; case RS2::ActionDrawSpline: - a = new RS_ActionDrawSpline(*doc, *gv); + a = new ActionDrawSpline(*doc, *gv); break; case RS2::ActionDrawText: - a = new RS_ActionDrawText(*doc, *gv); + a = new ActionDrawText(*doc, *gv); break; case RS2::ActionDrawHatch: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionDrawHatchNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionDrawHatchNoSelect); break; case RS2::ActionDrawHatchNoSelect: - a = new RS_ActionDrawHatch(*doc, *gv); + a = new ActionDrawHatch(*doc, *gv); break; case RS2::ActionDrawImage: - a = new RS_ActionDrawImage(*doc, *gv); + a = new ActionDrawImage(*doc, *gv); break; // Dimensioning actions: // case RS2::ActionDimAligned: - a = new RS_ActionDimAligned(*doc, *gv); + a = new ActionDimAligned(*doc, *gv); break; case RS2::ActionDimLinear: - a = new RS_ActionDimLinear(*doc, *gv); + a = new ActionDimLinear(*doc, *gv); break; case RS2::ActionDimLinearHor: - a = new RS_ActionDimLinear(*doc, *gv, 0.0, true); + a = new ActionDimLinear(*doc, *gv, 0.0, true); break; case RS2::ActionDimLinearVer: - a = new RS_ActionDimLinear(*doc, *gv, M_PI / 2.0, true); + a = new ActionDimLinear(*doc, *gv, M_PI / 2.0, true); break; case RS2::ActionDimRadial: - a = new RS_ActionDimRadial(*doc, *gv); + a = new ActionDimRadial(*doc, *gv); break; case RS2::ActionDimDiametric: - a = new RS_ActionDimDiametric(*doc, *gv); + a = new ActionDimDiametric(*doc, *gv); break; case RS2::ActionDimAngular: - a = new RS_ActionDimAngular(*doc, *gv); + a = new ActionDimAngular(*doc, *gv); break; case RS2::ActionDimLeader: - a = new RS_ActionDimLeader(*doc, *gv); + a = new ActionDimLeader(*doc, *gv); break; // Modifying actions: // case RS2::ActionModifyAttributes: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyAttributesNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyAttributesNoSelect); break; case RS2::ActionModifyAttributesNoSelect: - a = new RS_ActionModifyAttributes(*doc, *gv); + a = new ActionModifyAttributes(*doc, *gv); break; case RS2::ActionModifyDelete: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyDeleteNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyDeleteNoSelect); break; case RS2::ActionModifyDeleteNoSelect: - a = new RS_ActionModifyDelete(*doc, *gv); + a = new ActionModifyDelete(*doc, *gv); break; case RS2::ActionModifyDeleteQuick: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyDeleteQuick); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyDeleteQuick); break; case RS2::ActionModifyDeleteFree: - a = new RS_ActionModifyDeleteFree(*doc, *gv); + a = new ActionModifyDeleteFree(*doc, *gv); break; case RS2::ActionModifyMove: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyMoveNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyMoveNoSelect); break; case RS2::ActionModifyMoveNoSelect: - a = new RS_ActionModifyMove(*doc, *gv); + a = new ActionModifyMove(*doc, *gv); break; case RS2::ActionModifyRotate: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyRotateNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyRotateNoSelect); break; case RS2::ActionModifyRotateNoSelect: - a = new RS_ActionModifyRotate(*doc, *gv); + a = new ActionModifyRotate(*doc, *gv); break; case RS2::ActionModifyScale: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyScaleNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyScaleNoSelect); break; case RS2::ActionModifyScaleNoSelect: - a = new RS_ActionModifyScale(*doc, *gv); + a = new ActionModifyScale(*doc, *gv); break; case RS2::ActionModifyMirror: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyMirrorNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyMirrorNoSelect); break; case RS2::ActionModifyMirrorNoSelect: - a = new RS_ActionModifyMirror(*doc, *gv); + a = new ActionModifyMirror(*doc, *gv); break; case RS2::ActionModifyMoveRotate: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyMoveRotateNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyMoveRotateNoSelect); break; case RS2::ActionModifyMoveRotateNoSelect: - a = new RS_ActionModifyMoveRotate(*doc, *gv); + a = new ActionModifyMoveRotate(*doc, *gv); break; case RS2::ActionModifyRotate2: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyRotate2NoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyRotate2NoSelect); break; case RS2::ActionModifyRotate2NoSelect: - a = new RS_ActionModifyRotate2(*doc, *gv); + a = new ActionModifyRotate2(*doc, *gv); break; case RS2::ActionModifyEntity: - a = new RS_ActionModifyEntity(*doc, *gv); + a = new ActionModifyEntity(*doc, *gv); break; case RS2::ActionModifyTrim: - a = new RS_ActionModifyTrim(*doc, *gv, false); + a = new ActionModifyTrim(*doc, *gv, false); break; case RS2::ActionModifyTrim2: - a = new RS_ActionModifyTrim(*doc, *gv, true); + a = new ActionModifyTrim(*doc, *gv, true); break; case RS2::ActionModifyTrimAmount: - a = new RS_ActionModifyTrimAmount(*doc, *gv); + a = new ActionModifyTrimAmount(*doc, *gv); break; case RS2::ActionModifyCut: - a = new RS_ActionModifyCut(*doc, *gv); + a = new ActionModifyCut(*doc, *gv); break; case RS2::ActionModifyStretch: - a = new RS_ActionModifyStretch(*doc, *gv); + a = new ActionModifyStretch(*doc, *gv); break; case RS2::ActionModifyBevel: - a = new RS_ActionModifyBevel(*doc, *gv); + a = new ActionModifyBevel(*doc, *gv); break; case RS2::ActionModifyRound: - a = new RS_ActionModifyRound(*doc, *gv); + a = new ActionModifyRound(*doc, *gv); break; case RS2::ActionModifyExplodeText: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionModifyExplodeTextNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionModifyExplodeTextNoSelect); break; case RS2::ActionModifyExplodeTextNoSelect: - a = new RS_ActionModifyExplodeText(*doc, *gv); + a = new ActionModifyExplodeText(*doc, *gv); break; // Snapping actions: // case RS2::ActionSnapFree: - a = new RS_ActionSetSnapMode(*doc, *gv, RS2::SnapFree); + a = new ActionSetSnapMode(*doc, *gv, RS2::SnapFree); break; case RS2::ActionSnapGrid: - a = new RS_ActionSetSnapMode(*doc, *gv, RS2::SnapGrid); + a = new ActionSetSnapMode(*doc, *gv, RS2::SnapGrid); break; case RS2::ActionSnapEndpoint: - a = new RS_ActionSetSnapMode(*doc, *gv, RS2::SnapEndpoint); + a = new ActionSetSnapMode(*doc, *gv, RS2::SnapEndpoint); break; case RS2::ActionSnapOnEntity: - a = new RS_ActionSetSnapMode(*doc, *gv, RS2::SnapOnEntity); + a = new ActionSetSnapMode(*doc, *gv, RS2::SnapOnEntity); break; case RS2::ActionSnapCenter: - a = new RS_ActionSetSnapMode(*doc, *gv, RS2::SnapCenter); + a = new ActionSetSnapMode(*doc, *gv, RS2::SnapCenter); break; case RS2::ActionSnapMiddle: - a = new RS_ActionSetSnapMode(*doc, *gv, RS2::SnapMiddle); + a = new ActionSetSnapMode(*doc, *gv, RS2::SnapMiddle); break; case RS2::ActionSnapDist: - a = new RS_ActionSetSnapMode(*doc, *gv, RS2::SnapDist); + a = new ActionSetSnapMode(*doc, *gv, RS2::SnapDist); break; case RS2::ActionSnapIntersection: - a = new RS_ActionSetSnapMode(*doc, *gv, RS2::SnapIntersection); + a = new ActionSetSnapMode(*doc, *gv, RS2::SnapIntersection); break; case RS2::ActionSnapIntersectionManual: - a = new RS_ActionSnapIntersectionManual(*doc, *gv); + a = new ActionSnapIntersectionManual(*doc, *gv); break; // Snap restriction actions: // case RS2::ActionRestrictNothing: - a = new RS_ActionSetSnapRestriction(*doc, *gv, RS2::RestrictNothing); + a = new ActionSetSnapRestriction(*doc, *gv, RS2::RestrictNothing); break; case RS2::ActionRestrictOrthogonal: - a = new RS_ActionSetSnapRestriction(*doc, *gv, + a = new ActionSetSnapRestriction(*doc, *gv, RS2::RestrictOrthogonal); break; case RS2::ActionRestrictHorizontal: - a = new RS_ActionSetSnapRestriction(*doc, *gv, + a = new ActionSetSnapRestriction(*doc, *gv, RS2::RestrictHorizontal); break; case RS2::ActionRestrictVertical: - a = new RS_ActionSetSnapRestriction(*doc, *gv, + a = new ActionSetSnapRestriction(*doc, *gv, RS2::RestrictVertical); break; // Relative zero: // case RS2::ActionSetRelativeZero: - a = new RS_ActionSetRelativeZero(*doc, *gv); + a = new ActionSetRelativeZero(*doc, *gv); break; case RS2::ActionLockRelativeZero: - a = new RS_ActionLockRelativeZero(*doc, *gv, true); + a = new ActionLockRelativeZero(*doc, *gv, true); break; case RS2::ActionUnlockRelativeZero: - a = new RS_ActionLockRelativeZero(*doc, *gv, false); + a = new ActionLockRelativeZero(*doc, *gv, false); break; // Info actions: // case RS2::ActionInfoInside: - a = new RS_ActionInfoInside(*doc, *gv); + a = new ActionInfoInside(*doc, *gv); break; case RS2::ActionInfoDist: - a = new RS_ActionInfoDist(*doc, *gv); + a = new ActionInfoDist(*doc, *gv); break; case RS2::ActionInfoDist2: - a = new RS_ActionInfoDist2(*doc, *gv); + a = new ActionInfoDist2(*doc, *gv); break; case RS2::ActionInfoAngle: - a = new RS_ActionInfoAngle(*doc, *gv); + a = new ActionInfoAngle(*doc, *gv); break; case RS2::ActionInfoTotalLength: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionInfoTotalLengthNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionInfoTotalLengthNoSelect); break; case RS2::ActionInfoTotalLengthNoSelect: - a = new RS_ActionInfoTotalLength(*doc, *gv); + a = new ActionInfoTotalLength(*doc, *gv); break; case RS2::ActionInfoArea: - a = new RS_ActionInfoArea(*doc, *gv); + a = new ActionInfoArea(*doc, *gv); break; // Layer actions: // case RS2::ActionLayersDefreezeAll: - a = new RS_ActionLayersFreezeAll(false, *doc, *gv); + a = new ActionLayersFreezeAll(false, *doc, *gv); break; case RS2::ActionLayersFreezeAll: - a = new RS_ActionLayersFreezeAll(true, *doc, *gv); + a = new ActionLayersFreezeAll(true, *doc, *gv); break; case RS2::ActionLayersAdd: - a = new RS_ActionLayersAdd(*doc, *gv); + a = new ActionLayersAdd(*doc, *gv); break; case RS2::ActionLayersRemove: - a = new RS_ActionLayersRemove(*doc, *gv); + a = new ActionLayersRemove(*doc, *gv); break; case RS2::ActionLayersEdit: - a = new RS_ActionLayersEdit(*doc, *gv); + a = new ActionLayersEdit(*doc, *gv); break; case RS2::ActionLayersToggleView: - a = new RS_ActionLayersToggleView(*doc, *gv); + a = new ActionLayersToggleView(*doc, *gv); break; case RS2::ActionLayersToggleLock: - a = new RS_ActionLayersToggleLock(*doc, *gv); + a = new ActionLayersToggleLock(*doc, *gv); break; // Block actions: // case RS2::ActionBlocksDefreezeAll: - a = new RS_ActionBlocksFreezeAll(false, *doc, *gv); + a = new ActionBlocksFreezeAll(false, *doc, *gv); break; case RS2::ActionBlocksFreezeAll: - a = new RS_ActionBlocksFreezeAll(true, *doc, *gv); + a = new ActionBlocksFreezeAll(true, *doc, *gv); break; case RS2::ActionBlocksAdd: - a = new RS_ActionBlocksAdd(*doc, *gv); + a = new ActionBlocksAdd(*doc, *gv); break; case RS2::ActionBlocksRemove: - a = new RS_ActionBlocksRemove(*doc, *gv); + a = new ActionBlocksRemove(*doc, *gv); break; case RS2::ActionBlocksAttributes: - a = new RS_ActionBlocksAttributes(*doc, *gv); + a = new ActionBlocksAttributes(*doc, *gv); break; case RS2::ActionBlocksEdit: - a = new RS_ActionBlocksEdit(*doc, *gv); + a = new ActionBlocksEdit(*doc, *gv); break; case RS2::ActionBlocksInsert: - a = new RS_ActionBlocksInsert(*doc, *gv); + a = new ActionBlocksInsert(*doc, *gv); break; case RS2::ActionBlocksToggleView: - a = new RS_ActionBlocksToggleView(*doc, *gv); + a = new ActionBlocksToggleView(*doc, *gv); break; case RS2::ActionBlocksCreate: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionBlocksCreateNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionBlocksCreateNoSelect); break; case RS2::ActionBlocksCreateNoSelect: - a = new RS_ActionBlocksCreate(*doc, *gv); + a = new ActionBlocksCreate(*doc, *gv); break; case RS2::ActionBlocksExplode: - a = new RS_ActionSelect(*doc, *gv, RS2::ActionBlocksExplodeNoSelect); + a = new ActionSelect(*doc, *gv, RS2::ActionBlocksExplodeNoSelect); break; case RS2::ActionBlocksExplodeNoSelect: - a = new RS_ActionBlocksExplode(*doc, *gv); + a = new ActionBlocksExplode(*doc, *gv); break; // library browser: // case RS2::ActionLibraryInsert: - a = new RS_ActionLibraryInsert(*doc, *gv); + a = new ActionLibraryInsert(*doc, *gv); break; // options: // //case RS2::ActionOptionsGeneral: - // a = new RS_ActionOptionsGeneral(*doc, *gv); + // a = new ActionOptionsGeneral(*doc, *gv); // break; case RS2::ActionOptionsDrawing: - a = new RS_ActionOptionsDrawing(*doc, *gv); + a = new ActionOptionsDrawing(*doc, *gv); break; // cam: // #ifdef RS_CAM case RS2::ActionCamExportAuto: - a = new RS_ActionCamExportAuto(*doc, *gv); + a = new ActionCamExportAuto(*doc, *gv); break; case RS2::ActionCamReorder: - a = new RS_ActionCamReorder(*doc, *gv); + a = new ActionCamReorder(*doc, *gv); break; #endif @@ -791,7 +791,7 @@ RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS2::ActionType id) */ QStringList QG_ActionHandler::getAvailableCommands() { - RS_ActionInterface * currentAction = getCurrentAction(); + ActionInterface * currentAction = getCurrentAction(); if (currentAction) return currentAction->getAvailableCommands(); diff --git a/src/widgets/qg_actionhandler.h b/src/widgets/qg_actionhandler.h index 3126a37..ba86f02 100644 --- a/src/widgets/qg_actionhandler.h +++ b/src/widgets/qg_actionhandler.h @@ -6,7 +6,7 @@ class QG_MainWindowInterface; class CadToolBarSnap; -class RS_ActionInterface; +class ActionInterface; /** * This class can trigger actions (from menus, buttons, ...). @@ -19,8 +19,8 @@ class QG_ActionHandler: public QObject QG_ActionHandler(QG_MainWindowInterface * mw); virtual ~QG_ActionHandler(); - RS_ActionInterface * getCurrentAction(); - RS_ActionInterface * setCurrentAction(RS2::ActionType id); + ActionInterface * getCurrentAction(); + ActionInterface * setCurrentAction(RS2::ActionType id); void killSelectActions(); bool keycode(const QString & code); diff --git a/src/widgets/qg_dialogfactory.cpp b/src/widgets/qg_dialogfactory.cpp index 9c857a0..16ad8be 100644 --- a/src/widgets/qg_dialogfactory.cpp +++ b/src/widgets/qg_dialogfactory.cpp @@ -17,8 +17,8 @@ #include "graphicview.h" #include "qg_layerwidget.h" #include "qg_mainwindowinterface.h" -#include "rs_actiondimlinear.h" -#include "rs_actioninterface.h" +#include "actiondimlinear.h" +#include "actioninterface.h" #include "rs_blocklist.h" #include "rs_document.h" #include "rs_hatch.h" @@ -707,7 +707,7 @@ QString QG_DialogFactory::requestImageOpenDialog() return fn; } -void QG_DialogFactory::requestOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestOptions(ActionInterface * action, bool on, bool update) { RS_DEBUG->print("QG_DialogFactory::requestOptions"); @@ -796,7 +796,7 @@ void QG_DialogFactory::requestOptions(RS_ActionInterface * action, bool on, bool case RS2::ActionDimLinear: requestDimensionOptions(action, on, update); - if (((RS_ActionDimLinear *)action)->hasFixedAngle() == false) + if (((ActionDimLinear *)action)->hasFixedAngle() == false) requestDimLinearOptions(action, on, update); break; @@ -843,7 +843,7 @@ void QG_DialogFactory::requestOptions(RS_ActionInterface * action, bool on, bool /** * Shows a widget for options for the action: "print preview" */ -void QG_DialogFactory::requestPrintPreviewOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestPrintPreviewOptions(ActionInterface * action, bool on, bool update) { static PrintPreviewOptions * toolWidget = NULL; @@ -866,7 +866,7 @@ void QG_DialogFactory::requestPrintPreviewOptions(RS_ActionInterface * action, b /** * Shows a widget for options for the action: "draw line" */ -void QG_DialogFactory::requestLineOptions(RS_ActionInterface * action, bool on) +void QG_DialogFactory::requestLineOptions(ActionInterface * action, bool on) { /* The way I see it, this is failure. We're constantly creating & deleting @@ -899,7 +899,7 @@ them over and over. May need to do some more refactoring based on this idea... /** * Shows a widget for options for the action: "draw polyline" */ -void QG_DialogFactory::requestPolylineOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestPolylineOptions(ActionInterface * action, bool on, bool update) { #ifdef RS_PROF static PolylineOptions * toolWidget = NULL; @@ -924,7 +924,7 @@ void QG_DialogFactory::requestPolylineOptions(RS_ActionInterface * action, bool /** * Shows a widget for options for the action: "draw line parallel" */ -void QG_DialogFactory::requestLineParallelOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestLineParallelOptions(ActionInterface * action, bool on, bool update) { static LineParallelOptions * toolWidget = NULL; @@ -946,7 +946,7 @@ void QG_DialogFactory::requestLineParallelOptions(RS_ActionInterface * action, b /** * Shows a widget for options for the action: "draw line parallel through" */ -void QG_DialogFactory::requestLineParallelThroughOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestLineParallelThroughOptions(ActionInterface * action, bool on, bool update) { static LineParallelThroughOptions * toolWidget = NULL; @@ -965,7 +965,7 @@ void QG_DialogFactory::requestLineParallelThroughOptions(RS_ActionInterface * ac /** * Shows a widget for options for the action: "line angle" */ -void QG_DialogFactory::requestLineAngleOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestLineAngleOptions(ActionInterface * action, bool on, bool update) { static LineAngleOptions * toolWidget = NULL; @@ -988,7 +988,7 @@ void QG_DialogFactory::requestLineAngleOptions(RS_ActionInterface * action, bool /** * Shows a widget for options for the action: "line relative angle" */ -void QG_DialogFactory::requestLineRelAngleOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestLineRelAngleOptions(ActionInterface * action, bool on, bool update) { static LineRelAngleOptions * toolWidget = NULL; @@ -1011,7 +1011,7 @@ void QG_DialogFactory::requestLineRelAngleOptions(RS_ActionInterface * action, b /** * Shows a widget for options for the action: "line angle" */ -void QG_DialogFactory::requestLineBisectorOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestLineBisectorOptions(ActionInterface * action, bool on, bool update) { static LineBisectorOptions * toolWidget = NULL; @@ -1030,7 +1030,7 @@ void QG_DialogFactory::requestLineBisectorOptions(RS_ActionInterface * action, b /** * Shows a widget for options for the action: "draw polygon" */ -void QG_DialogFactory::requestLinePolygonOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestLinePolygonOptions(ActionInterface * action, bool on, bool update) { static LinePolygonOptions * toolWidget = NULL; @@ -1049,7 +1049,7 @@ void QG_DialogFactory::requestLinePolygonOptions(RS_ActionInterface * action, bo /** * Shows a widget for options for the action: "draw polygon2" */ -void QG_DialogFactory::requestLinePolygon2Options(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestLinePolygon2Options(ActionInterface * action, bool on, bool update) { static LinePolygon2Options * toolWidget = NULL; @@ -1068,7 +1068,7 @@ void QG_DialogFactory::requestLinePolygon2Options(RS_ActionInterface * action, b /** * Shows a widget for arc options. */ -void QG_DialogFactory::requestArcOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestArcOptions(ActionInterface * action, bool on, bool update) { static ArcOptions * toolWidget = NULL; @@ -1092,7 +1092,7 @@ void QG_DialogFactory::requestArcOptions(RS_ActionInterface * action, bool on, b /** * Shows a widget for tangential arc options. */ -void QG_DialogFactory::requestArcTangentialOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestArcTangentialOptions(ActionInterface * action, bool on, bool update) { static ArcTangentialOptions * toolWidget = NULL; @@ -1116,7 +1116,7 @@ void QG_DialogFactory::requestArcTangentialOptions(RS_ActionInterface * action, /** * Shows a widget for circle options. */ -void QG_DialogFactory::requestCircleOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestCircleOptions(ActionInterface * action, bool on, bool update) { static CircleOptions * toolWidget = NULL; @@ -1139,26 +1139,30 @@ void QG_DialogFactory::requestCircleOptions(RS_ActionInterface * action, bool on /** * Shows a widget for spline options. */ -void QG_DialogFactory::requestSplineOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestSplineOptions(ActionInterface * action, bool on, bool update) { static SplineOptions * toolWidget = NULL; - if (optionWidget!=NULL) { - if (toolWidget!=NULL) { - delete toolWidget; - toolWidget = NULL; - } - if (on==true && toolWidget==NULL) { - toolWidget = new SplineOptions(optionWidget); - toolWidget->setAction(action, update); - } + if (!optionWidget) + return; + + if (toolWidget) + { + delete toolWidget; + toolWidget = NULL; + } + + if (on) + { + toolWidget = new SplineOptions(optionWidget); + toolWidget->setAction(action, update); } } /** * Shows a widget for text options. */ -void QG_DialogFactory::requestTextOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestTextOptions(ActionInterface * action, bool on, bool update) { static TextOptions * toolWidget = NULL; @@ -1181,7 +1185,7 @@ void QG_DialogFactory::requestTextOptions(RS_ActionInterface * action, bool on, /** * Shows a widget for insert options. */ -void QG_DialogFactory::requestInsertOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestInsertOptions(ActionInterface * action, bool on, bool update) { static InsertOptions * toolWidget = NULL; @@ -1200,7 +1204,7 @@ void QG_DialogFactory::requestInsertOptions(RS_ActionInterface * action, bool on /** * Shows a widget for image options. */ -void QG_DialogFactory::requestImageOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestImageOptions(ActionInterface * action, bool on, bool update) { static ImageOptions * toolWidget = NULL; @@ -1219,7 +1223,7 @@ void QG_DialogFactory::requestImageOptions(RS_ActionInterface * action, bool on, /** * Shows a widget for dimension options. */ -void QG_DialogFactory::requestDimensionOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestDimensionOptions(ActionInterface * action, bool on, bool update) { static DimOptions * toolWidget = NULL; @@ -1238,7 +1242,7 @@ void QG_DialogFactory::requestDimensionOptions(RS_ActionInterface * action, bool /** * Shows a widget for linear dimension options. */ -void QG_DialogFactory::requestDimLinearOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestDimLinearOptions(ActionInterface * action, bool on, bool update) { static DimLinearOptions * toolWidget = NULL; @@ -1284,7 +1288,7 @@ void QG_DialogFactory::requestSnapDistOptions(double & dist, bool on) /** * Shows a widget for 'snap to a point with a given distance' options. */ -void QG_DialogFactory::requestMoveRotateOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestMoveRotateOptions(ActionInterface * action, bool on, bool update) { static MoveRotateOptions * toolWidget = NULL; @@ -1307,7 +1311,7 @@ void QG_DialogFactory::requestMoveRotateOptions(RS_ActionInterface * action, boo /** * Shows a widget for 'trim amount' options. */ -void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestTrimAmountOptions(ActionInterface * action, bool on, bool update) { static TrimAmountOptions * toolWidget = NULL; @@ -1330,7 +1334,7 @@ void QG_DialogFactory::requestTrimAmountOptions(RS_ActionInterface * action, boo /** * Shows a widget for beveling options. */ -void QG_DialogFactory::requestBevelOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestBevelOptions(ActionInterface * action, bool on, bool update) { static BevelOptions * toolWidget = NULL; @@ -1353,7 +1357,7 @@ void QG_DialogFactory::requestBevelOptions(RS_ActionInterface * action, bool on, /** * Shows a widget for rounding options. */ -void QG_DialogFactory::requestRoundOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestRoundOptions(ActionInterface * action, bool on, bool update) { static RoundOptions * toolWidget = NULL; @@ -1376,7 +1380,7 @@ void QG_DialogFactory::requestRoundOptions(RS_ActionInterface * action, bool on, /** * Shows a widget for library insert options. */ -void QG_DialogFactory::requestLibraryInsertOptions(RS_ActionInterface * action, bool on, bool update) +void QG_DialogFactory::requestLibraryInsertOptions(ActionInterface * action, bool on, bool update) { static LibraryInsertOptions * toolWidget = NULL; @@ -1408,7 +1412,7 @@ void QG_DialogFactory::requestToolBar(RS2::ToolBarId id) /** * Shows the select toolbar with the given action to launch. */ -void QG_DialogFactory::requestToolBarSelect(RS_ActionInterface * selectAction, +void QG_DialogFactory::requestToolBarSelect(ActionInterface * selectAction, RS2::ActionType nextAction) { if (cadToolBar != NULL) @@ -1836,10 +1840,10 @@ void QG_DialogFactory::updateCoordinateWidget(const Vector & abs, */ void QG_DialogFactory::updateMouseWidget(const QString & left, const QString & right) { - if (mouseWidget != NULL) + if (mouseWidget) mouseWidget->setHelp(left, right); - if (commandWidget != NULL) + if (commandWidget) commandWidget->setCommand(left); } diff --git a/src/widgets/qg_dialogfactory.h b/src/widgets/qg_dialogfactory.h index 8696e99..c2d08c6 100644 --- a/src/widgets/qg_dialogfactory.h +++ b/src/widgets/qg_dialogfactory.h @@ -6,6 +6,7 @@ #include "vector.h" #include "rs_debug.h" +class ActionInterface; class CadToolBar; class CommandWidget; class CoordinateWidget; @@ -15,7 +16,7 @@ class QG_MainWindowInterface; class MouseWidget; class SelectionWidget; -#define QG_DIALOGFACTORY (RS_DialogFactory::instance()->getFactoryObject()->isAdapter()==false ? ((QG_DialogFactory*)RS_DialogFactory::instance()->getFactoryObject()) : NULL) +#define QG_DIALOGFACTORY (RS_DialogFactory::instance()->getFactoryObject()->isAdapter() == false ? ((QG_DialogFactory *)RS_DialogFactory::instance()->getFactoryObject()) : NULL) // !A_WIDGET /** @@ -59,40 +60,40 @@ class QG_DialogFactory: public RS_DialogFactoryInterface //virtual QString requestFileOpenDialog(); virtual QString requestImageOpenDialog(); - virtual void requestOptions(RS_ActionInterface * action, bool on, bool update = false); + virtual void requestOptions(ActionInterface * action, bool on, bool update = false); protected: - virtual void requestPrintPreviewOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestLineOptions(RS_ActionInterface * action, bool on); - virtual void requestPolylineOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestLineAngleOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestLineRelAngleOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestLineParallelOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestLineParallelThroughOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestLineBisectorOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestLinePolygonOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestLinePolygon2Options(RS_ActionInterface * action, bool on, bool update); - virtual void requestArcOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestArcTangentialOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestCircleOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestSplineOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestTextOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestDimensionOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestDimLinearOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestInsertOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestImageOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestTrimAmountOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestMoveRotateOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestBevelOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestRoundOptions(RS_ActionInterface * action, bool on, bool update); - virtual void requestLibraryInsertOptions(RS_ActionInterface * action, bool on, bool update); + virtual void requestPrintPreviewOptions(ActionInterface * action, bool on, bool update); + virtual void requestLineOptions(ActionInterface * action, bool on); + virtual void requestPolylineOptions(ActionInterface * action, bool on, bool update); + virtual void requestLineAngleOptions(ActionInterface * action, bool on, bool update); + virtual void requestLineRelAngleOptions(ActionInterface * action, bool on, bool update); + virtual void requestLineParallelOptions(ActionInterface * action, bool on, bool update); + virtual void requestLineParallelThroughOptions(ActionInterface * action, bool on, bool update); + virtual void requestLineBisectorOptions(ActionInterface * action, bool on, bool update); + virtual void requestLinePolygonOptions(ActionInterface * action, bool on, bool update); + virtual void requestLinePolygon2Options(ActionInterface * action, bool on, bool update); + virtual void requestArcOptions(ActionInterface * action, bool on, bool update); + virtual void requestArcTangentialOptions(ActionInterface * action, bool on, bool update); + virtual void requestCircleOptions(ActionInterface * action, bool on, bool update); + virtual void requestSplineOptions(ActionInterface * action, bool on, bool update); + virtual void requestTextOptions(ActionInterface * action, bool on, bool update); + virtual void requestDimensionOptions(ActionInterface * action, bool on, bool update); + virtual void requestDimLinearOptions(ActionInterface * action, bool on, bool update); + virtual void requestInsertOptions(ActionInterface * action, bool on, bool update); + virtual void requestImageOptions(ActionInterface * action, bool on, bool update); + virtual void requestTrimAmountOptions(ActionInterface * action, bool on, bool update); + virtual void requestMoveRotateOptions(ActionInterface * action, bool on, bool update); + virtual void requestBevelOptions(ActionInterface * action, bool on, bool update); + virtual void requestRoundOptions(ActionInterface * action, bool on, bool update); + virtual void requestLibraryInsertOptions(ActionInterface * action, bool on, bool update); public: virtual void requestSnapDistOptions(double& dist, bool on); public: virtual void requestToolBar(RS2::ToolBarId id); - virtual void requestToolBarSelect(RS_ActionInterface * selectAction, RS2::ActionType nextAction); + virtual void requestToolBarSelect(ActionInterface * selectAction, RS2::ActionType nextAction); virtual bool requestAttributesDialog(RS_AttributesData & data, RS_LayerList & layerList); virtual bool requestMoveDialog(RS_MoveData & data); diff --git a/src/widgets/qg_graphicview.cpp b/src/widgets/qg_graphicview.cpp index 3c825c7..9e68c5d 100644 --- a/src/widgets/qg_graphicview.cpp +++ b/src/widgets/qg_graphicview.cpp @@ -14,22 +14,22 @@ #include "qg_graphicview.h" -#include "rs_actiondefault.h" -#include "rs_actionzoomin.h" -#include "rs_actionzoompan.h" -#include "rs_actionzoomscroll.h" -#include "rs_actionmodifydelete.h" -#include "rs_actionselectsingle.h" +#include "qg_dialogfactory.h" +#include "actiondefault.h" +#include "actionzoomin.h" +#include "actionzoompan.h" +#include "actionzoomscroll.h" +#include "actionmodifydelete.h" +#include "actionselectsingle.h" +#include "cadtoolbar.h" #include "rs_dialogfactory.h" +#include "drawing.h" #include "graphicview.h" +#include "rs_patternlist.h" +#include "paintinterface.h" #include "rs_preview.h" -#include "drawing.h" #include "settings.h" #include "rs_system.h" -#include "rs_patternlist.h" -#include "cadtoolbar.h" -#include "paintintf.h" -#include "qg_dialogfactory.h" #define QG_SCROLLMARGIN 400 @@ -65,7 +65,7 @@ QG_GraphicView::QG_GraphicView(RS_Document * doc, QWidget * parent) setBorders(10, 10, 10, 10); if (doc) - setDefaultAction(new RS_ActionDefault(*doc, *this)); + setDefaultAction(new ActionDefault(*doc, *this)); } void QG_GraphicView::CommonInitialization(void) @@ -402,7 +402,7 @@ void QG_GraphicView::mousePressEvent(QMouseEvent * e) { // pan zoom with middle mouse button if (e->button() == Qt::MidButton /*|| (e->state()==Qt::LeftButton|Qt::AltButton)*/) - setCurrentAction(new RS_ActionZoomPan(*container, *this)); + setCurrentAction(new ActionZoomPan(*container, *this)); GraphicView::mousePressEvent(e); QWidget::mousePressEvent(e); @@ -428,20 +428,8 @@ void QG_GraphicView::mouseReleaseEvent(QMouseEvent * e) void QG_GraphicView::mouseMoveEvent(QMouseEvent * e) { - //RS_DEBUG->print("QG_GraphicView::mouseMoveEvent begin"); - //QMouseEvent rsm = QG_Qt2Rs::mouseEvent(e); - GraphicView::mouseMoveEvent(e); QWidget::mouseMoveEvent(e); - -//What kind of cacamamie crap is this??? -//#ifdef Q_OS_WIN32 -// // make sure that we can still use hotkeys and the mouse wheel -// if (parent() != NULL) -// ((QWidget *)parent())->setFocus(); -//#endif - - //RS_DEBUG->print("QG_GraphicView::mouseMoveEvent end"); } /** @@ -459,7 +447,7 @@ void QG_GraphicView::tabletEvent(QTabletEvent * e) { if (container != NULL) { - RS_ActionSelectSingle * a = new RS_ActionSelectSingle(*container, *this); + ActionSelectSingle * a = new ActionSelectSingle(*container, *this); setCurrentAction(a); #warning "!!! !!!" // QMouseEvent ev(QEvent::MouseButtonRelease, e->pos(), Qt::LeftButton, Qt::LeftButton); @@ -467,7 +455,7 @@ void QG_GraphicView::tabletEvent(QTabletEvent * e) a->finish(); if (container->countSelected() > 0) - setCurrentAction(new RS_ActionModifyDelete(*container, *this)); + setCurrentAction(new ActionModifyDelete(*container, *this)); } } break; @@ -588,15 +576,15 @@ void QG_GraphicView::wheelEvent(QWheelEvent * e) } if (scroll) - setCurrentAction(new RS_ActionZoomScroll(direction, *container, *this)); + setCurrentAction(new ActionZoomScroll(direction, *container, *this)); // zoom in / out: // else if (e->state() == 0) else if (keyState == 0) { if (e->delta() > 0) - setCurrentAction(new RS_ActionZoomIn(*container, *this, RS2::In, RS2::Both, mouse)); + setCurrentAction(new ActionZoomIn(*container, *this, RS2::In, RS2::Both, mouse)); else - setCurrentAction(new RS_ActionZoomIn(*container, *this, RS2::Out, RS2::Both, mouse)); + setCurrentAction(new ActionZoomIn(*container, *this, RS2::Out, RS2::Both, mouse)); } e->accept(); @@ -634,7 +622,7 @@ void QG_GraphicView::keyPressEvent(QKeyEvent * e) } if (scroll) - setCurrentAction(new RS_ActionZoomScroll(direction, *container, *this)); + setCurrentAction(new ActionZoomScroll(direction, *container, *this)); GraphicView::keyPressEvent(e); } @@ -839,6 +827,7 @@ of VectorWorks & etc. as well... snapper.Draw(this, painter); if (preview.Visible()) +#if 0 { painter->setPen(RS_Pen(RS_Color(60, 255, 80), RS2::Width00, RS2::SolidLine)); painter->setOffset(preview.Offset()); @@ -853,6 +842,9 @@ of VectorWorks & etc. as well... painter->setOffset(Vector(0, 0)); } +#else + preview.Draw(this, painter); +#endif delete painter; painter = NULL;