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 \
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 \
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 \
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 \
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 \
--- /dev/null
+// 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 <jlhamm@acm.org>
+//
+// 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();
+}
--- /dev/null
+#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__
--- /dev/null
+// 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 <jlhamm@acm.org>
+//
+// 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();
+}
--- /dev/null
+#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__
-// rs_actionblockscreate.cpp
+// actionblockscreate.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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"
/**
* 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"),
#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();
graphicView->killSelectActions();
}
-void RS_ActionBlocksCreate::mouseMoveEvent(QMouseEvent * e)
+void ActionBlocksCreate::mouseMoveEvent(QMouseEvent * e)
{
- snapPoint(e);
+// snapPoint(e);
+ graphicView->snapper.snapPoint(e);
switch (getStatus())
{
}
}
-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;
}
}
-void RS_ActionBlocksCreate::updateMouseButtonHints()
+void ActionBlocksCreate::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
-#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:
/**
};
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);
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();
Vector referencePoint;
};
-#endif
+#endif // __ACTIONBLOCKSCREATE_H__
--- /dev/null
+// 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 <jlhamm@acm.org>
+//
+// 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();
+}
--- /dev/null
+#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__
--- /dev/null
+// 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 <jlhamm@acm.org>
+//
+// 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();
+}
--- /dev/null
+#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__
-// rs_actionblocksfreezeall.cpp
+// actionblocksfreezeall.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
}
-
--- /dev/null
+#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__
-// rs_actionblocksinsert.cpp
+// actionblocksinsert.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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"
/**
* 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;
}
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;
}
}
-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();
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
}
}
-QStringList RS_ActionBlocksInsert::getAvailableCommands()
+QStringList ActionBlocksInsert::getAvailableCommands()
{
QStringList cmd;
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())
{
}
}
-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);
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;
}
-
-#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:
/**
};
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);
Status lastStatus;
};
-#endif
+#endif // __ACTIONBLOCKSINSERT_H__
-// rs_actionblocksremove.cpp
+// actionblocksremove.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Added this text. :-)
//
-#include "rs_actionblocksremove.h"
+#include "actionblocksremove.h"
#include "rs_block.h"
#include "rs_dialogfactory.h"
#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<RS_EntityContainer> containerList;
QList<RS_EntityContainer *> containerList;
containerList.append(graphic);
RS_BlockList * blkLst = graphic->getBlockList();
- for (uint bi = 0; bi < blkLst->count(); bi++)
+ for(uint bi=0; bi<blkLst->count(); 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; i<containerList.size(); i++)
{
RS_EntityContainer * cont = containerList[i];
// remove all inserts from the graphic:
{
done = true;
- for (RS_Entity * e = cont->firstEntity(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;
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:
RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}
-void RS_ActionBlocksRemove::init(int status)
+void ActionBlocksRemove::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
--- /dev/null
+#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__
-// rs_actionblockstoggleview.cpp
+// actionblockstoggleview.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
finish();
}
-void RS_ActionBlocksToggleView::init(int status)
+void ActionBlocksToggleView::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
--- /dev/null
+#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__
-// rs_actiondefault.cpp
+// actiondefault.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Added this text. :-)
//
-#include "rs_actiondefault.h"
+#include "actiondefault.h"
#include "rs.h"
#include "rs_commandevent.h"
/**
* 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();
switch (getStatus())
{
case Dragging:
- //v2 = graphicView->toGraph(e->x(), e->y());
v2 = mouse;
if (graphicView->toGuiDX(v1.distanceTo(v2)) > 10)
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;
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);
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:
}
}
-void RS_ActionDefault::mousePressEvent(QMouseEvent * e)
+void ActionDefault::mousePressEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
case Moving:
{
v2 = snapPoint(e);
- deleteSnapper();
- deletePreview();
- clearPreview();
+// deleteSnapper();
+// deletePreview();
+// clearPreview();
RS_Modification m(*container, graphicView);
RS_MoveData data;
data.number = 0;
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);
}
}
-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)
{
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);
}
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);
setStatus(Neutral);
e->accept();
- //}
}
break;
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;
}
}
-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())
{
break;
case SetCorner2:
- RS_DIALOGFACTORY->updateMouseWidget(tr("Choose second edge"), tr("Back"));
+ RS_DIALOGFACTORY->updateMouseWidget(tr("Drag to second point"), tr("Back"));
break;
default:
}
}
-void RS_ActionDefault::updateMouseCursor()
+void ActionDefault::updateMouseCursor()
{
switch (getStatus())
{
}
}
-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:
break;
}
}
-
-#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.
};
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();
RS2::SnapRestriction restrBak;
};
-#endif
+#endif // __ACTIONDEFAULT_H__
-// rs_actiondimaligned.cpp
+// actiondimaligned.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Added this text. :-)
//
-#include "rs_actiondimaligned.h"
+#include "actiondimaligned.h"
#include "rs_commandevent.h"
#include "rs_constructionline.h"
#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;
RS_DIALOGFACTORY->requestOptions(this, true, true);
}
-void RS_ActionDimAligned::trigger()
+void ActionDimAligned::trigger()
{
- RS_ActionDimension::trigger();
+ ActionDimension::trigger();
preparePreview();
graphicView->moveRelativeZero(data.definitionPoint);
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())
{
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;
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;
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)
}
}
-void RS_ActionDimAligned::coordinateEvent(Vector * e)
+void ActionDimAligned::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDimAligned::commandEvent(RS_CommandEvent * e)
+void ActionDimAligned::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDimAligned::getAvailableCommands()
+QStringList ActionDimAligned::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDimAligned::updateMouseButtonHints()
+void ActionDimAligned::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-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);
-#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:
/**
};
public:
- RS_ActionDimAligned(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDimAligned();
+ ActionDimAligned(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDimAligned();
virtual RS2::ActionType rtti();
virtual void reset();
Status lastStatus;
};
-#endif
+#endif // __ACTIONDIMALIGNED_H__
-// rs_actiondimangular.cpp
+// actiondimangular.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Added this text. :-)
//
-#include "rs_actiondimangular.h"
+#include "actiondimangular.h"
#include "rs_commandevent.h"
#include "rs_dialogfactory.h"
#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;
RS_DIALOGFACTORY->requestOptions(this, true, true);
}
-void RS_ActionDimAngular::trigger()
+void ActionDimAngular::trigger()
{
- RS_PreviewActionInterface::trigger();
+ ActionInterface::trigger();
if (line1 != NULL && line2 != NULL)
{
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()));
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;
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
}
break;
- case SetLine2: {
+ case SetLine2:
+ {
RS_Entity * en = catchEntity(e, RS2::ResolveAll);
if (en != NULL
}
break;
- case SetPos: {
+ case SetPos:
+ {
Vector ce(snapPoint(e));
coordinateEvent(&ce);
}
}
}
-void RS_ActionDimAngular::coordinateEvent(Vector * e)
+void ActionDimAngular::coordinateEvent(Vector * e)
{
- if (e == NULL)
+ if (!e)
return;
switch (getStatus())
}
}
-void RS_ActionDimAngular::commandEvent(RS_CommandEvent * e)
+void ActionDimAngular::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDimAngular::getAvailableCommands()
+QStringList ActionDimAngular::getAvailableCommands()
{
QStringList cmd;
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())
{
break;
}
}
-
-// EOF
-#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"
*
* @author Andrew Mustun
*/
-class RS_ActionDimAngular: public RS_ActionDimension
+class ActionDimAngular: public ActionDimension
{
private:
enum Status {
};
public:
- RS_ActionDimAngular(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDimAngular();
+ ActionDimAngular(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDimAngular();
virtual RS2::ActionType rtti();
virtual void reset();
Status lastStatus;
};
-#endif
+#endif // __ACTIONDIMANGULAR_H__
-// rs_actiondimdiametric.cpp
+// actiondimdiametric.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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;
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));
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);
}
}
-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()));
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;
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)
{
}
}
-void RS_ActionDimDiametric::coordinateEvent(Vector * e)
+void ActionDimDiametric::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDimDiametric::commandEvent(RS_CommandEvent * e)
+void ActionDimDiametric::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDimDiametric::getAvailableCommands()
+QStringList ActionDimDiametric::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDimDiametric::updateMouseButtonHints()
+void ActionDimDiametric::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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
-#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"
/**
* 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 {
};
public:
- RS_ActionDimDiametric(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDimDiametric();
+ ActionDimDiametric(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDimDiametric();
virtual RS2::ActionType rtti();
virtual void reset();
Status lastStatus;
};
-#endif
+#endif // __ACTIONDIMDIAMETRIC_H__
-// rs_actiondimension.cpp
+// actiondimension.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
{
}
}
-QString RS_ActionDimension::getText()
+QString ActionDimension::getText()
{
if (!data.text.isEmpty())
return data.text;
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
-#ifndef RS_ACTIONDIMENSION_H
-#define RS_ACTIONDIMENSION_H
+#ifndef __ACTIONDIMENSION_H__
+#define __ACTIONDIMENSION_H__
#include <QtCore>
#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);
bool diameter;
};
-#endif
+#endif // __ACTIONDIMENSION_H__
-// rs_actiondimleader.cpp
+// actiondimleader.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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)
{
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);
// 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; i<points.size(); i++)
{
Vector * v = points[i];
- if (last.valid)
- preview->addEntity(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)
{
}
}
-void RS_ActionDimLeader::keyPressEvent(QKeyEvent * e)
+void ActionDimLeader::keyPressEvent(QKeyEvent * e)
{
if (getStatus() == SetEndpoint && e->key() == Qt::Key_Enter)
{
}
}
-void RS_ActionDimLeader::coordinateEvent(Vector * e)
+void ActionDimLeader::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDimLeader::commandEvent(RS_CommandEvent * e)
+void ActionDimLeader::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDimLeader::getAvailableCommands()
+QStringList ActionDimLeader::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDimLeader::updateMouseButtonHints()
+void ActionDimLeader::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-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);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarDim);
}
}
-
-#ifndef RS_ACTIONDIMLEADER_H
-#define RS_ACTIONDIMLEADER_H
+#ifndef __ACTIONDIMLEADER_H__
+#define __ACTIONDIMLEADER_H__
#include <QtCore>
+#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:
/**
};
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();
QList<Vector *> points;
};
-#endif
+#endif // __ACTIONDIMLEADER_H__
-// rs_actiondimlinear.cpp
+// actiondimlinear.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actiondimlinear.h"
+#include "actiondimlinear.h"
#include "rs_commandevent.h"
#include "rs_constructionline.h"
* @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;
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();
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);
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);
{
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;
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)
{
}
}
-void RS_ActionDimLinear::coordinateEvent(Vector * e)
+void ActionDimLinear::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDimLinear::commandEvent(RS_CommandEvent * e)
+void ActionDimLinear::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDimLinear::getAvailableCommands()
+QStringList ActionDimLinear::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDimLinear::updateMouseButtonHints()
+void ActionDimLinear::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-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;
}
-
-#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:
/**
};
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();
Status lastStatus;
};
-#endif
+#endif // __ACTIONDIMLINEAR_H__
-// rs_actiondimradial.cpp
+// actiondimradial.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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));
//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)
{
}
}
-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())
{
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;
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)
{
}
}
-void RS_ActionDimRadial::coordinateEvent(Vector * e)
+void ActionDimRadial::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDimRadial::commandEvent(RS_CommandEvent * e)
+void ActionDimRadial::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDimRadial::getAvailableCommands()
+QStringList ActionDimRadial::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDimRadial::updateMouseButtonHints()
+void ActionDimRadial::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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
+
-#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"
/**
* 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 {
};
public:
- RS_ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDimRadial();
+ ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDimRadial();
virtual RS2::ActionType rtti();
virtual void reset();
Status lastStatus;
};
-#endif
+#endif // __ACTIONDIMRADIAL_H__
-// rs_actiondrawarc.cpp
+// actiondrawarc.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Added this text. :-)
//
-#include "rs_actiondrawarc.h"
+#include "actiondrawarc.h"
#include "rs_commandevent.h"
#include "commands.h"
#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();
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())
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;
deletePreview();
clearPreview();
- preview->addEntity(new RS_Arc(preview, data));
+// preview->addEntity(new RS_Arc(preview, data));
drawPreview();
break;
data.angle2 = data.center.angleTo(mouse);
deletePreview();
clearPreview();
- preview->addEntity(new RS_Arc(preview, data));
+// preview->addEntity(new RS_Arc(preview, data));
drawPreview();
break;
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;
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();
}
}
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)
{
}
}
-void RS_ActionDrawArc::coordinateEvent(Vector * e)
+void ActionDrawArc::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawArc::commandEvent(RS_CommandEvent * e)
+void ActionDrawArc::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-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)
{
}
}
-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())
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;
}
-
-#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:
/**
};
public:
- RS_ActionDrawArc(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDrawArc();
+ ActionDrawArc(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDrawArc();
virtual RS2::ActionType rtti();
void reset();
RS_ArcData data;
};
-#endif
+#endif // __ACTIONDRAWARC_H__
-// rs_actiondrawarc3p.cpp
+// actiondrawarc3p.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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())
RS_DIALOGFACTORY->commandMessage(tr("Invalid arc data."));
}
-void RS_ActionDrawArc3P::preparePreview()
+void ActionDrawArc3P::preparePreview()
{
data.reset();
}
}
-void RS_ActionDrawArc3P::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawArc3P::mouseMoveEvent(QMouseEvent * e)
{
Vector mouse = snapPoint(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;
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;
}
}
-void RS_ActionDrawArc3P::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawArc3P::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionDrawArc3P::coordinateEvent(Vector * e)
+void ActionDrawArc3P::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawArc3P::commandEvent(RS_CommandEvent * e)
+void ActionDrawArc3P::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
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())
{
}
}
-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);
-#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:
/**
};
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);
Vector point3;
};
-#endif
+#endif // __ACTIONDRAWARC3P_H__
-// rs_actiondrawarctangential.cpp
+// actiondrawarctangential.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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;
}
reset();
}
-void RS_ActionDrawArcTangential::preparePreview()
+void ActionDrawArcTangential::preparePreview()
{
if (baseEntity != NULL && point.valid)
{
}
}
-void RS_ActionDrawArcTangential::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawArcTangential::mouseMoveEvent(QMouseEvent * e)
{
switch (getStatus())
{
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;
}
}
-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);
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)
}
}
-void RS_ActionDrawArcTangential::coordinateEvent(Vector * e)
+void ActionDrawArcTangential::coordinateEvent(Vector * e)
{
- if (e == NULL)
+ if (!e)
return;
Vector mouse = *e;
}
}
-void RS_ActionDrawArcTangential::commandEvent(RS_CommandEvent * e)
+void ActionDrawArcTangential::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-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())
{
}
}
-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);
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;
}
-
-#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"
* 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:
/**
};
public:
- RS_ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDrawArcTangential();
+ ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDrawArcTangential();
virtual RS2::ActionType rtti();
void reset();
RS_ArcData data;
};
-#endif
+#endif // __ACTIONDRAWARCTANGENTIAL_H__
-// rs_actiondrawcircle.cpp
+// actiondrawcircle.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
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);
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)
{
}
}
-void RS_ActionDrawCircle::coordinateEvent(Vector * e)
+void ActionDrawCircle::coordinateEvent(Vector * e)
{
- if (e == NULL)
+ if (!e)
return;
Vector mouse = *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;
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
-
-#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:
/**
};
public:
- RS_ActionDrawCircle(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDrawCircle();
+ ActionDrawCircle(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDrawCircle();
virtual RS2::ActionType rtti();
void reset();
RS_CircleData data;
};
-#endif
+#endif // __ACTIONDRAWCIRCLE_H__
-// rs_actiondrawcircle2p.cpp
+// actiondrawcircle2p.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
RS_DIALOGFACTORY->requestWarningDialog(tr("Invalid Circle data."));
}
-void RS_ActionDrawCircle2P::preparePreview()
+void ActionDrawCircle2P::preparePreview()
{
data.reset();
}
}
-void RS_ActionDrawCircle2P::mouseMoveEvent(QMouseEvent * e)
+void ActionDrawCircle2P::mouseMoveEvent(QMouseEvent * e)
{
Vector mouse = snapPoint(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_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();
}
}
-void RS_ActionDrawCircle2P::coordinateEvent(Vector * e)
+void ActionDrawCircle2P::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawCircle2P::commandEvent(RS_CommandEvent * e)
+void ActionDrawCircle2P::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDrawCircle2P::getAvailableCommands()
+QStringList ActionDrawCircle2P::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawCircle2P::updateMouseButtonHints()
+void ActionDrawCircle2P::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-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);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarCircles);
}
}
-
-// EOF
-
-#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:
/**
};
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);
Vector point2;
};
-#endif
+#endif // __ACTIONDRAWCIRCLE2P_H__
-// rs_actiondrawcircle3p.cpp
+// actiondrawcircle3p.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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));
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);
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();
}
}
-void RS_ActionDrawCircle3P::coordinateEvent(Vector * e)
+void ActionDrawCircle3P::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawCircle3P::commandEvent(RS_CommandEvent * e)
+void ActionDrawCircle3P::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-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:
}
}
-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
-
-#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:
/**
};
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);
Vector point3;
};
-#endif
+#endif // __ACTIONDRAWCIRCLE3P_H__
-// rs_actiondrawcirclecr.cpp
+// actiondrawcirclecr.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Added this text. :-)
//
-#include "rs_actiondrawcirclecr.h"
+#include "actiondrawcirclecr.h"
#include "rs_commandevent.h"
#include "rs_dialogfactory.h"
/**
* 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();
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())
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();
}
}
-void RS_ActionDrawCircleCR::coordinateEvent(Vector * e)
+void ActionDrawCircleCR::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawCircleCR::commandEvent(RS_CommandEvent * e)
+void ActionDrawCircleCR::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDrawCircleCR::getAvailableCommands()
+QStringList ActionDrawCircleCR::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawCircleCR::updateMouseButtonHints()
+void ActionDrawCircleCR::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
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;
}
-
-#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:
/**
};
public:
- RS_ActionDrawCircleCR(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDrawCircleCR();
+ ActionDrawCircleCR(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDrawCircleCR();
virtual RS2::ActionType rtti();
void reset();
RS_CircleData data;
};
-#endif
+#endif // __ACTIONDRAWCIRCLECR_H__
-// rs_actiondrawellipseaxis.cpp
+// actiondrawellipseaxis.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actiondrawellipseaxis.h"
+#include "actiondrawellipseaxis.h"
#include "rs_commandevent.h"
#include "rs_dialogfactory.h"
* @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;
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);
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);
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);
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;
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;
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;
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();
}
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();
}
}
-void RS_ActionDrawEllipseAxis::coordinateEvent(Vector * e)
+void ActionDrawEllipseAxis::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawEllipseAxis::commandEvent(RS_CommandEvent * e)
+void ActionDrawEllipseAxis::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDrawEllipseAxis::getAvailableCommands()
+QStringList ActionDrawEllipseAxis::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawEllipseAxis::updateMouseButtonHints()
+void ActionDrawEllipseAxis::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-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);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarEllipses);
}
}
-
-// EOF
-#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:
/**
};
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();
bool isArc;
};
-#endif
+#endif // __ACTIONDRAWELLIPSEAXIS_H__
-// rs_actiondrawhatch.cpp
+// actiondrawhatch.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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;
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);
document->addUndoable(hatch);
document->endUndoCycle();
}
- hatch->update();
+ hatch->update();
graphicView->drawEntity(hatch);
-
RS_DIALOGFACTORY->commandMessage(tr("Hatch created successfully."));
}
else
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);
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);
break;
}
}
-// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton)
else if (e->button() == Qt::RightButton)
{
//deletePreview();
}
}
-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);
}
-
-#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:
/**
};
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();
RS_Hatch * hatch;
};
-#endif
+#endif // __ACTIONDRAWHATCH_H__
-// rs_actiondrawimage.cpp
+// actiondrawimage.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actiondrawimage.h"
+#include "actiondrawimage.h"
#include "rs_commandevent.h"
#include "rs_creation.h"
/**
* 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();
}
}
-void RS_ActionDrawImage::reset()
+void ActionDrawImage::reset()
{
data = RS_ImageData(0,
Vector(0.0, 0.0),
50, 50, 0);
}
-void RS_ActionDrawImage::trigger()
+void ActionDrawImage::trigger()
{
deleteSnapper();
deletePreview();
}
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:
}
}
-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();
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);
}
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);
}
}
}
-QStringList RS_ActionDrawImage::getAvailableCommands()
+QStringList ActionDrawImage::getAvailableCommands()
{
QStringList cmd;
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())
{
}
}
-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);
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);
-#ifndef RS_ACTIONDRAWIMAGE_H
-#define RS_ACTIONDRAWIMAGE_H
+#ifndef __ACTIONDRAWIMAGE_H__
+#define __ACTIONDRAWIMAGE_H__
#include <QtGui>
#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:
/**
};
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);
Status lastStatus;
};
-#endif
+#endif // __ACTIONDRAWIMAGE_H__
-// rs_actiondrawline.cpp
+// actiondrawline.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
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;
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
//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)
{
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;
}
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())
break;
}
- RS_DEBUG->print("RS_ActionDrawLine::commandEvent: OK");
+ RS_DEBUG->print("ActionDrawLine::commandEvent: OK");
}
-QStringList RS_ActionDrawLine::getAvailableCommands()
+QStringList ActionDrawLine::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawLine::updateMouseButtonHints()
+void ActionDrawLine::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
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
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();
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();
-#ifndef RS_ACTIONDRAWLINE_H
-#define RS_ACTIONDRAWLINE_H
+#ifndef __ACTIONDRAWLINE_H__
+#define __ACTIONDRAWLINE_H__
#include <QtCore>
-#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:
/**
};
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();
QList<Vector *> history;
};
-#endif
+#endif // __ACTIONDRAWLINE_H__
-// rs_actiondrawlineangle.cpp
+// actiondrawlineangle.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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;
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)
{
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)
{
}
}
-void RS_ActionDrawLineAngle::preparePreview()
+void ActionDrawLineAngle::preparePreview()
{
Vector p1, p2;
data = RS_LineData(p1, p2);
}
-void RS_ActionDrawLineAngle::coordinateEvent(Vector * e)
+void ActionDrawLineAngle::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawLineAngle::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineAngle::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDrawLineAngle::getAvailableCommands()
+QStringList ActionDrawLineAngle::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawLineAngle::updateMouseButtonHints()
+void ActionDrawLineAngle::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
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;
}
-
-#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:
/**
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();
int snpPoint;
};
-#endif
-
+#endif // __ACTIONDRAWLINEANGLE_H__
-// rs_actiondrawlinebisector.cpp
+// actiondrawlinebisector.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/03/2010 Added this text. :-)
//
-#include "rs_actiondrawlinebisector.h"
+#include "actiondrawlinebisector.h"
#include "rs_commandevent.h"
#include "rs_creation.h"
#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;
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);
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()));
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)
{
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);
}
}
-void RS_ActionDrawLineBisector::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineBisector::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDrawLineBisector::getAvailableCommands()
+QStringList ActionDrawLineBisector::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawLineBisector::updateMouseButtonHints()
+void ActionDrawLineBisector::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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;
}
-
-#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;
/**
* 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 {
};
public:
- RS_ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDrawLineBisector();
+ ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDrawLineBisector();
virtual RS2::ActionType rtti();
virtual void trigger();
Status lastStatus;
};
-#endif
+#endif // __ACTIONDRAWLINEBISECTOR_H__
-// rs_actiondrawlinefree.cpp
+// actiondrawlinefree.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
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);
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);
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;
}
}
-void RS_ActionDrawLineFree::updateMouseButtonHints()
+void ActionDrawLineFree::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
}
-
-#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;
/**
* 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);
RS_Polyline * polyline;
};
-#endif
+#endif // __ACTIONDRAWLINEFREE_H__
-// rs_actiondrawlinehorvert.cpp
+// actiondrawlinehorvert.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
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);
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);
break;
}
}
-// else if (RS2::qtToRsButtonState(e->button())==RS2::RightButton)
else if (e->button() == Qt::RightButton)
{
deletePreview();
}
}
-void RS_ActionDrawLineHorVert::updateMouseButtonHints()
+void ActionDrawLineHorVert::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
}
-
-#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"
/**
*
* @author Ulf Lehnert
*/
-class RS_ActionDrawLineHorVert: public RS_PreviewActionInterface
+class ActionDrawLineHorVert: public ActionInterface
{
public:
/**
};
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);
Vector p2;
};
-#endif
+#endif // __ACTIONDRAWLINEHORVERT_H__
-// rs_actiondrawlineparallel.cpp
+// actiondrawlineparallel.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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"
#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;
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);
{
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;
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)
{
}
}
-void RS_ActionDrawLineParallel::showOptions()
+void ActionDrawLineParallel::showOptions()
{
- RS_ActionInterface::showOptions();
+ ActionInterface::showOptions();
if (RS_DIALOGFACTORY != NULL)
RS_DIALOGFACTORY->requestOptions(this, true);
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();
if (checkCommand("through", c))
{
finish();
- graphicView->setCurrentAction(new RS_ActionDrawLineParallelThrough(*container,
+ graphicView->setCurrentAction(new ActionDrawLineParallelThrough(*container,
*graphicView));
}
else if (checkCommand("number", c))
}
}
-QStringList RS_ActionDrawLineParallel::getAvailableCommands()
+QStringList ActionDrawLineParallel::getAvailableCommands()
{
QStringList cmd;
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;
}
-
-#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 {
};
public:
- RS_ActionDrawLineParallel(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDrawLineParallel();
+ ActionDrawLineParallel(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDrawLineParallel();
virtual RS2::ActionType rtti();
virtual void trigger();
RS_Entity * entity;
};
-#endif
+#endif // __ACTIONDRAWLINEPARALLEL_H__
-// rs_actiondrawlineparallelthrough.cpp
+// actiondrawlineparallelthrough.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actiondrawlineparallelthrough.h"
+#include "actiondrawlineparallelthrough.h"
#include "rs_commandevent.h"
#include "rs_creation.h"
#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();
}
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())
case SetEntity:
entity = catchEntity(e, RS2::ResolveAll);
- if (entity != NULL)
+ if (entity)
{
entity->setHighlighted(true);
graphicView->drawEntity(entity);
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);
}
}
-void RS_ActionDrawLineParallelThrough::coordinateEvent(Vector * e)
+void ActionDrawLineParallelThrough::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawLineParallelThrough::updateMouseButtonHints()
+void ActionDrawLineParallelThrough::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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();
}
break;
- case SetNumber: {
+ case SetNumber:
+ {
bool ok;
int n = c.toInt(&ok);
RS_DIALOGFACTORY->requestOptions(this, true, true);
setStatus(lastStatus);
}
- break;
+ break;
default:
break;
}
}
-QStringList RS_ActionDrawLineParallelThrough::getAvailableCommands()
+QStringList ActionDrawLineParallelThrough::getAvailableCommands()
{
QStringList cmd;
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);
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;
}
-
-#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 {
};
public:
- RS_ActionDrawLineParallelThrough(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDrawLineParallelThrough();
+ ActionDrawLineParallelThrough(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDrawLineParallelThrough();
virtual RS2::ActionType rtti();
virtual void trigger();
Status lastStatus;
};
-#endif
+#endif // __ACTIONDRAWLINEPARALLELTHROUGH_H__
-// rs_actiondrawlinepolygon.cpp
+// actiondrawlinepolygon.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actiondrawlinepolygon.h"
+#include "actiondrawlinepolygon.h"
#include "rs_commandevent.h"
#include "rs_creation.h"
#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);
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);
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();
}
}
}
-void RS_ActionDrawLinePolygon::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawLinePolygon::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionDrawLinePolygon::coordinateEvent(Vector * e)
+void ActionDrawLinePolygon::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawLinePolygon::updateMouseButtonHints()
+void ActionDrawLinePolygon::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-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();
}
}
-QStringList RS_ActionDrawLinePolygon::getAvailableCommands()
+QStringList ActionDrawLinePolygon::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawLinePolygon::updateMouseCursor()
+void ActionDrawLinePolygon::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionDrawLinePolygon::updateToolBar()
+void ActionDrawLinePolygon::updateToolBar()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-int RS_ActionDrawLinePolygon::getNumber()
+int ActionDrawLinePolygon::getNumber()
{
return number;
}
-void RS_ActionDrawLinePolygon::setNumber(int n)
+void ActionDrawLinePolygon::setNumber(int n)
{
number = n;
}
-
-#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 {
};
public:
- RS_ActionDrawLinePolygon(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDrawLinePolygon();
+ ActionDrawLinePolygon(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDrawLinePolygon();
virtual RS2::ActionType rtti();
virtual void trigger();
Status lastStatus;
};
-#endif
+#endif // __ACTIONDRAWLINEPOLYGON_H__
-// rs_actiondrawlinepolygon2.cpp
+// actiondrawlinepolygon2.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actiondrawlinepolygon2.h"
+#include "actiondrawlinepolygon2.h"
#include "rs_commandevent.h"
#include "rs_creation.h"
#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);
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();
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);
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();
}
}
}
-void RS_ActionDrawLinePolygon2::mouseReleaseEvent(QMouseEvent * e)
+void ActionDrawLinePolygon2::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionDrawLinePolygon2::coordinateEvent(Vector * e)
+void ActionDrawLinePolygon2::coordinateEvent(Vector * e)
{
- if (e == NULL)
+ if (!e)
return;
Vector mouse = *e;
}
}
-void RS_ActionDrawLinePolygon2::updateMouseButtonHints()
+void ActionDrawLinePolygon2::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-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();
}
}
-QStringList RS_ActionDrawLinePolygon2::getAvailableCommands()
+QStringList ActionDrawLinePolygon2::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawLinePolygon2::updateMouseCursor()
+void ActionDrawLinePolygon2::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionDrawLinePolygon2::updateToolBar()
+void ActionDrawLinePolygon2::updateToolBar()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-int RS_ActionDrawLinePolygon2::getNumber()
+int ActionDrawLinePolygon2::getNumber()
{
return number;
}
-void RS_ActionDrawLinePolygon2::setNumber(int n)
+void ActionDrawLinePolygon2::setNumber(int n)
{
number = n;
}
-
-#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 {
};
public:
- RS_ActionDrawLinePolygon2(RS_EntityContainer & container, GraphicView & graphicView);
- ~RS_ActionDrawLinePolygon2();
+ ActionDrawLinePolygon2(RS_EntityContainer & container, GraphicView & graphicView);
+ ~ActionDrawLinePolygon2();
virtual RS2::ActionType rtti();
virtual void trigger();
Status lastStatus;
};
-#endif
+#endif // __ACTIONDRAWLINEPOLYGON2_H__
-// rs_actiondrawlinerectangle.cpp
+// actiondrawlinerectangle.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
}
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);
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)
{
}
}
-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);
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;
}
}
-void RS_ActionDrawLineRectangle::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineRectangle::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDrawLineRectangle::getAvailableCommands()
+QStringList ActionDrawLineRectangle::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawLineRectangle::updateMouseButtonHints()
+void ActionDrawLineRectangle::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-void RS_ActionDrawLineRectangle::updateMouseCursor()
+void ActionDrawLineRectangle::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionDrawLineRectangle::updateToolBar()
+void ActionDrawLineRectangle::updateToolBar()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-// EOF
+
-#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:
/**
};
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);
Vector corner2;
};
-#endif
+#endif // __ACTIONDRAWLINERECTANGLE_H__
-// rs_actiondrawlinerelangle.cpp
+// actiondrawlinerelangle.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actiondrawlinerelangle.h"
+#include "actiondrawlinerelangle.h"
#include "rs_commandevent.h"
#include "rs_creation.h"
#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;
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())
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
setStatus(SetPos);
}
}
- break;
+ break;
- case SetPos: {
+ case SetPos:
+ {
Vector ce(snapPoint(e));
coordinateEvent(&ce);
}
- break;
+ break;
default:
break;
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;
}
}
-void RS_ActionDrawLineRelAngle::commandEvent(RS_CommandEvent * e)
+void ActionDrawLineRelAngle::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
{
case SetEntity:
case SetPos:
-
if (!fixedAngle && checkCommand("angle", c))
{
deleteSnapper();
}
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;
{
case SetPos:
case SetLength:
-
if (!fixedAngle)
cmd += command("angle");
cmd += command("length");
return cmd;
}
-void RS_ActionDrawLineRelAngle::updateMouseButtonHints()
+void ActionDrawLineRelAngle::updateMouseButtonHints()
{
- if (RS_DIALOGFACTORY != NULL)
+ if (RS_DIALOGFACTORY)
{
switch (getStatus())
{
}
}
-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);
}
}
-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;
}
-
-#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;
* 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 {
};
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();
bool fixedAngle;
};
-#endif
+#endif // __ACTIONDRAWLINERELANGLE_H__
-// rs_actiondrawlinetangent1.cpp
+// actiondrawlinetangent1.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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;
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);
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())
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)
{
{
switch (getStatus())
{
- case SetPoint: {
+ case SetPoint:
+ {
Vector ce(snapPoint(e));
coordinateEvent(&ce);
}
- break;
+ break;
case SetCircle:
trigger();
}
}
-void RS_ActionDrawLineTangent1::coordinateEvent(Vector * e)
+void ActionDrawLineTangent1::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-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:
}
}
-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);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarLines);
}
}
-
-// EOF
-#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;
* 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 {
};
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);
RS_LineData data;
};
-#endif
+#endif // __ACTIONDRAWLINETANGENT1_H__
-// rs_actiondrawlinetangent2.cpp
+// actiondrawlinetangent2.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
{
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()));
}
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();
}
}
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)
{
}
}
-void RS_ActionDrawLineTangent2::updateMouseButtonHints()
+void ActionDrawLineTangent2::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-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
-#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 {
};
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);
RS_LineData data;
};
-#endif
+#endif // __ACTIONDRAWLINETANGENT2_H__
-// rs_actiondrawpoint.cpp
+// actiondrawpoint.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
{
}
}
-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)
{
}
}
-void RS_ActionDrawPoint::coordinateEvent(Vector * e)
+void ActionDrawPoint::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
trigger();
}
-void RS_ActionDrawPoint::commandEvent(RS_CommandEvent * e)
+void ActionDrawPoint::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionDrawPoint::getAvailableCommands()
+QStringList ActionDrawPoint::getAvailableCommands()
{
QStringList cmd;
return cmd;
}
-void RS_ActionDrawPoint::updateMouseButtonHints()
+void ActionDrawPoint::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-void RS_ActionDrawPoint::updateMouseCursor()
+void ActionDrawPoint::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionDrawPoint::updateToolBar()
+void ActionDrawPoint::updateToolBar()
{
if (RS_DIALOGFACTORY != NULL)
{
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarPoints);
}
}
-
-#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);
Vector pt;
};
-#endif
+#endif // __ACTIONDRAWPOINT_H__
-// rs_actiondrawspline.cpp
+// actiondrawspline.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actiondrawspline.h"
+#include "actiondrawspline.h"
#include "rs_commandevent.h"
#include "commands.h"
#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 !!!"
//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);
//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();
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();
RS_Spline * tmpSpline = (RS_Spline *)spline->clone();
tmpSpline->addControlPoint(mouse);
tmpSpline->update();
- preview->addEntity(tmpSpline);
+// preview->addEntity(tmpSpline);
QList<Vector> cpts = tmpSpline->getControlPoints();
QList<Vector>::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)
{
}
}
-void RS_ActionDrawSpline::coordinateEvent(Vector * e)
+void ActionDrawSpline::coordinateEvent(Vector * e)
{
- if (e == NULL)
+ if (!e)
return;
Vector mouse = *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();
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:
}
}
-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:
}
}
-QStringList RS_ActionDrawSpline::getAvailableCommands()
+QStringList ActionDrawSpline::getAvailableCommands()
{
QStringList cmd;
break;
case SetNextPoint:
-
if (history.count() >= 2)
cmd += command("undo");
-
if (history.count() >= 3)
cmd += command("close");
+
break;
default:
return cmd;
}
-void RS_ActionDrawSpline::updateMouseButtonHints()
+void ActionDrawSpline::updateMouseButtonHints()
{
switch (getStatus())
{
tr("Cancel"));
break;
- case SetNextPoint: {
+ case SetNextPoint:
+ {
QString msg = "";
if (history.count() >= 3)
tr("Specify next control point"),
tr("Back"));
}
- break;
+ break;
default:
RS_DIALOGFACTORY->updateMouseWidget("", "");
}
}
-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
-#ifndef RS_ACTIONDRAWSPLINE_H
-#define RS_ACTIONDRAWSPLINE_H
+#ifndef __ACTIONDRAWSPLINE_H__
+#define __ACTIONDRAWSPLINE_H__
#include <QtCore>
-#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:
/**
};
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();
virtual void updateMouseCursor();
virtual void updateToolBar();
- //void close();
void undo();
void setDegree(int deg);
int getDegree();
QList<Vector *> history;
};
-#endif
+#endif // __ACTIONDRAWSPLINE_H__
-// rs_actiondrawtext.cpp
+// actiondrawtext.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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;
{
data = tmp.getData();
preparePreview();
- preview->setVisible(false);
+// preview->setVisible(false);
setStatus(SetPos);
showOptions();
}
}
-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)
{
}
}
-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)
{
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)
{
}
}
-void RS_ActionDrawText::coordinateEvent(Vector * e)
+void ActionDrawText::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionDrawText::commandEvent(RS_CommandEvent * e)
+void ActionDrawText::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
case SetText:
setText(e->getCommand());
- if (RS_DIALOGFACTORY != NULL)
+ if (RS_DIALOGFACTORY)
RS_DIALOGFACTORY->requestOptions(this, true, true);
graphicView->enableCoordinateInput();
}
}
-QStringList RS_ActionDrawText::getAvailableCommands()
+QStringList ActionDrawText::getAvailableCommands()
{
QStringList cmd;
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())
}
}
-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())
}
}
-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;
}
-
-#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:
/**
};
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);
bool textChanged;
};
-#endif
+#endif // __ACTIONDRAWTEXT_H__
-// rs_actioneditcopy.cpp
+// actioneditcopy.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actioneditcopy.h"
+#include "actioneditcopy.h"
#include "rs_dialogfactory.h"
#include "rs_modification.h"
*
* @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)
{
}
}
-void RS_ActionEditCopy::coordinateEvent(Vector * e)
+void ActionEditCopy::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
trigger();
}
-void RS_ActionEditCopy::updateMouseButtonHints()
+void ActionEditCopy::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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
-#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:
/**
};
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();
Vector referencePoint;
};
-#endif
+#endif // __ACTIONEDITCOPY_H__
-// rs_actioneditpaste.cpp
+// actioneditpaste.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actioneditpaste.h"
+#include "actioneditpaste.h"
#include "rs_clipboard.h"
#include "rs_dialogfactory.h"
*
* @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();
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())
{
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;
}
}
-void RS_ActionEditPaste::mouseReleaseEvent(QMouseEvent * e)
+void ActionEditPaste::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionEditPaste::coordinateEvent(Vector * e)
+void ActionEditPaste::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
trigger();
}
-void RS_ActionEditPaste::updateMouseButtonHints()
+void ActionEditPaste::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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
-#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:
/**
};
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();
Vector targetPoint;
};
-#endif
+#endif // __ACTIONEDITPASTE_H__
-// rs_actioneditundo.cpp
+// actioneditundo.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actioneditundo.h"
+#include "actioneditundo.h"
#include "rs_dialogfactory.h"
#include "graphicview.h"
*
* @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();
finish();
RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}
-
--- /dev/null
+#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__
-// rs_actionfilenew.cpp
+// actionfilenew.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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()) {
finish();
}
-void RS_ActionFileNew::init(int status)
+void ActionFileNew::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
--- /dev/null
+#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__
-// rs_actionfileopen.cpp
+// actionfileopen.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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()) {
finish();
}
-void RS_ActionFileOpen::init(int status)
+void ActionFileOpen::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
--- /dev/null
+#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__
-// rs_actionfilesave.cpp
+// actionfilesave.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
finish();
}
-void RS_ActionFileSave::init(int status)
+void ActionFileSave::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
--- /dev/null
+#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__
-// rs_actionfilesaveas.cpp
+// actionfilesaveas.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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())
finish();
}
-void RS_ActionFileSaveAs::init(int status)
+void ActionFileSaveAs::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
--- /dev/null
+#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__
-// rs_actioninfoangle.cpp
+// actioninfoangle.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
}
}
-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())
{
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)
{
}
}
-void RS_ActionInfoAngle::updateMouseButtonHints()
+void ActionInfoAngle::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionInfoAngle::updateMouseCursor()
+void ActionInfoAngle::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionInfoAngle::updateToolBar()
+void ActionInfoAngle::updateToolBar()
{
switch (getStatus())
{
break;
}
}
-
-#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;
/**
* 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:
/**
};
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();
Vector intersection;
};
-#endif
+#endif // __ACTIONINFOANGLE_H__
-// rs_actioninfoarea.cpp
+// actioninfoarea.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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())
{
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));
}
*/
}
-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)
{
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();
}
break;
}
}
-
- //RS_DEBUG->print("RS_ActionInfoArea::mouseMoveEvent end");
}
-void RS_ActionInfoArea::mouseReleaseEvent(QMouseEvent * e)
+void ActionInfoArea::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
else if (e->button() == Qt::RightButton)
{
- //deletePreview();
- //clearPreview();
-
// close the polygon (preview)
if (getStatus() == SetNextPoint && prev.valid)
{
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();
}
}
}
-void RS_ActionInfoArea::coordinateEvent(Vector * e)
+void ActionInfoArea::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
if (point1.valid)
{
- //point2 = mouse;
- /*deletePreview();
- clearPreview();
- */
ia.addPoint(mouse);
RS_DIALOGFACTORY->commandMessage(tr("Point: %1/%2").arg(mouse.x).arg(mouse.y));
trigger();
setStatus(SetFirstPoint);
}
- //trigger();
- //setStatus(SetFirstPoint);
}
break;
}
}
-void RS_ActionInfoArea::updateMouseButtonHints()
+void ActionInfoArea::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionInfoArea::updateMouseCursor()
+void ActionInfoArea::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionInfoArea::updateToolBar()
+void ActionInfoArea::updateToolBar()
{
switch (getStatus())
{
break;
}
}
-
-// EOF
-#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;
* 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:
/**
};
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();
RS_InfoArea ia;
};
-#endif
+#endif // __ACTIONINFOAREA_H__
-// rs_actioninfodist.cpp
+// actioninfodist.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
{
}
}
-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)
deletePreview();
clearPreview();
-
- preview->addEntity(new RS_Line(preview,
- RS_LineData(point1,
- point2)));
-
+// preview->addEntity(new RS_Line(preview, RS_LineData(point1, point2)));
drawPreview();
}
break;
}
}
- 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)
{
}
}
-void RS_ActionInfoDist::coordinateEvent(Vector * e)
+void ActionInfoDist::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionInfoDist::updateMouseButtonHints()
+void ActionInfoDist::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionInfoDist::updateMouseCursor()
+void ActionInfoDist::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionInfoDist::updateToolBar()
+void ActionInfoDist::updateToolBar()
{
switch (getStatus())
{
break;
}
}
-
-// EOF
-#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:
/**
};
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();
Vector point2;
};
-#endif
+#endif // __ACTIONINFODIST_H__
-// rs_actioninfodist2.cpp
+// actioninfodist2.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
}
}
-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())
{
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)
{
setStatus(SetPoint);
break;
- case SetPoint: {
+ case SetPoint:
+ {
Vector ce(snapPoint(e));
coordinateEvent(&ce);
}
- break;
+ break;
default:
break;
}
}
-void RS_ActionInfoDist2::coordinateEvent(Vector * e)
+void ActionInfoDist2::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-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:
}
}
-void RS_ActionInfoDist2::updateMouseCursor()
+void ActionInfoDist2::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionInfoDist2::updateToolBar()
+void ActionInfoDist2::updateToolBar()
{
switch (getStatus())
{
break;
}
}
-
-// EOF
-#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;
* 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:
/**
};
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();
Vector point;
};
-#endif
+#endif // __ACTIONINFODIST2_H__
-// rs_actioninfoinside.cpp
+// actioninfoinside.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
contour->addEntity(e);
}
-RS_ActionInfoInside::~RS_ActionInfoInside()
+ActionInfoInside::~ActionInfoInside()
{
delete contour;
}
-void RS_ActionInfoInside::trigger()
+void ActionInfoInside::trigger()
{
deleteSnapper();
bool onContour = false;
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)
{
}
}
-void RS_ActionInfoInside::updateMouseButtonHints()
+void ActionInfoInside::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
}
-
--- /dev/null
+#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__
-// rs_actioninfototallength.cpp
+// actioninfototallength.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
else
len += l;
}
+ }
if (len > 0.0)
RS_DIALOGFACTORY->commandMessage(
finish();
}
-void RS_ActionInfoTotalLength::updateToolBar()
+void ActionInfoTotalLength::updateToolBar()
{
if (RS_DIALOGFACTORY != NULL)
{
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
}
}
-
-// EOF
--- /dev/null
+#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__
-// rs_actionlayersadd.cpp
+// actionlayersadd.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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");
finish();
}
-void RS_ActionLayersAdd::init(int status)
+void ActionLayersAdd::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
--- /dev/null
+#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__
-// rs_actionlayersedit.cpp
+// actionlayersedit.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
}
}
graphicView->redraw();
}
-void RS_ActionLayersEdit::init(int status)
+void ActionLayersEdit::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
-// EOF
--- /dev/null
+#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__
--- /dev/null
+// 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 <jlhamm@acm.org>
+//
+// 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();
+}
--- /dev/null
+#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__
--- /dev/null
+// 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 <jlhamm@acm.org>
+//
+// 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();
+}
--- /dev/null
+#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__
-// rs_actionlayerstogglelock.cpp
+// actionlayerstogglelock.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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");
finish();
}
-void RS_ActionLayersToggleLock::init(int status)
+void ActionLayersToggleLock::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
--- /dev/null
+#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__
-// rs_actionlayerstoggleview.cpp
+// actionlayerstoggleview.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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");
finish();
}
-void RS_ActionLayersToggleView::init(int status)
+void ActionLayersToggleView::init(int status)
{
- RS_ActionInterface::init(status);
+ ActionInterface::init(status);
trigger();
}
-
--- /dev/null
+#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__
-// rs_actionlibraryinsert.cpp
+// actionlibraryinsert.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actionlibraryinsert.h"
+#include "actionlibraryinsert.h"
#include "rs_commandevent.h"
#include "rs_dialogfactory.h"
/**
* 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();
//trigger();
}
-void RS_ActionLibraryInsert::setFile(const QString & file)
+void ActionLibraryInsert::setFile(const QString & file)
{
data.file = 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),
data.angle = 0.0;
}
-void RS_ActionLibraryInsert::trigger()
+void ActionLibraryInsert::trigger()
{
deleteSnapper();
deletePreview();
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:
}
}
-void RS_ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e)
+void ActionLibraryInsert::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionLibraryInsert::coordinateEvent(Vector * e)
+void ActionLibraryInsert::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
trigger();
}
-void RS_ActionLibraryInsert::commandEvent(RS_CommandEvent * e)
+void ActionLibraryInsert::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionLibraryInsert::getAvailableCommands()
+QStringList ActionLibraryInsert::getAvailableCommands()
{
QStringList cmd;
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())
{
}
}
-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);
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;
}
-
-#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:
/**
};
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);
Status lastStatus;
};
-#endif
+#endif // __ACTIONLIBRARYINSERT_H__
-// rs_actionlockrelativezero.cpp
+// actionlockrelativezero.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
}
-
--- /dev/null
+#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__
-// rs_actionmodifyattributes.cpp
+// actionmodifyattributes.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}
-void RS_ActionModifyAttributes::updateMouseButtonHints()
+void ActionModifyAttributes::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
}
-
-#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:
/**
};
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();
virtual void updateToolBar();
};
-#endif
+#endif // __ACTIONMODIFYATTRIBUTES_H__
-// rs_actionmodifybevel.cpp
+// actionmodifybevel.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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;
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;
}
}
-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);
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)
{
}
}
-void RS_ActionModifyBevel::commandEvent(RS_CommandEvent * e)
+void ActionModifyBevel::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionModifyBevel::getAvailableCommands()
+QStringList ActionModifyBevel::getAvailableCommands()
{
QStringList cmd;
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())
{
}
}
-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;
}
-
-#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:
/**
};
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);
Status lastStatus;
};
-#endif
+#endif // __ACTIONMODIFYBEVEL_H__
-// rs_actionmodifycut.cpp
+// actionmodifycut.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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))
}
}
-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())
{
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)
{
}
}
-void RS_ActionModifyCut::updateMouseButtonHints()
+void ActionModifyCut::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionModifyCut::updateMouseCursor()
+void ActionModifyCut::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionModifyCut::updateToolBar()
+void ActionModifyCut::updateToolBar()
{
switch (getStatus())
{
-#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;
/**
* 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:
/**
};
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();
Vector cutCoord;
};
-#endif
+#endif // __ACTIONMODIFYCUT_H__
-// rs_actionmodifydelete.cpp
+// actionmodifydelete.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
}
-void RS_ActionModifyDelete::updateMouseButtonHints()
+void ActionModifyDelete::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY != NULL)
{
}
}
-void RS_ActionModifyDelete::updateMouseCursor()
+void ActionModifyDelete::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::DelCursor);
}
-void RS_ActionModifyDelete::updateToolBar()
+void ActionModifyDelete::updateToolBar()
{
if (RS_DIALOGFACTORY != NULL)
{
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain);
}
}
-
-#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:
/**
};
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();
virtual void updateToolBar();
};
-#endif
+#endif // __ACTIONMODIFYDELETE_H__
-// rs_actionmodifydeletefree.cpp
+// actionmodifydeletefree.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actionmodifydeletefree.h"
+#include "actionmodifydeletefree.h"
#include "rs_dialogfactory.h"
#include "graphicview.h"
#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)
{
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)
{
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);
{
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)
{
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"));
}
}
-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:
break;
}
}
-
-#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;
/**
* 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();
Vector v2;
};
-#endif
+#endif // __ACTIONMODIFYDELETEFREE_H__
-// rs_actionmodifydeletequick.cpp
+// actionmodifydeletequick.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
{
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);
}
}
-void RS_ActionModifyDeleteQuick::updateMouseButtonHints()
+void ActionModifyDeleteQuick::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionModifyDeleteQuick::updateMouseCursor()
+void ActionModifyDeleteQuick::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::DelCursor);
}
-
-// EOF
-#ifndef RS_ACTIONMODIFYDELETEQUICK_H
-#define RS_ACTIONMODIFYDELETEQUICK_H
+#ifndef __ACTIONMODIFYDELETEQUICK_H__
+#define __ACTIONMODIFYDELETEQUICK_H__
-#include "rs_actioninterface.h"
+#include "actioninterface.h"
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);
RS_Entity * en;
};
-#endif
+#endif // __ACTIONMODIFYDELETEQUICK_H__
-// rs_actionmodifyentity.cpp
+// actionmodifyentity.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
{
}
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);
}
}
-void RS_ActionModifyEntity::updateMouseCursor()
+void ActionModifyEntity::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::SelectCursor);
}
-// EOF
+
--- /dev/null
+#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__
-// rs_actionmodifyexplodetext.cpp
+// actionmodifyexplodetext.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
--- /dev/null
+#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__
-// rs_actionmodifymirror.cpp
+// actionmodifymirror.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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)
{
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;
}
}
- 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)
{
}
}
-void RS_ActionModifyMirror::coordinateEvent(Vector * e)
+void ActionModifyMirror::coordinateEvent(Vector * e)
{
if (!e)
return;
}
}
-void RS_ActionModifyMirror::updateMouseButtonHints()
+void ActionModifyMirror::updateMouseButtonHints()
{
if (RS_DIALOGFACTORY)
{
}
}
-void RS_ActionModifyMirror::updateMouseCursor()
+void ActionModifyMirror::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionModifyMirror::updateToolBar()
+void ActionModifyMirror::updateToolBar()
{
if (RS_DIALOGFACTORY != NULL)
{
-#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:
/**
};
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();
Vector axisPoint2;
};
-#endif
+#endif // __ACTIONMODIFYMIRROR_H__
-// rs_actionmodifymove.cpp
+// actionmodifymove.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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)
deletePreview();
clearPreview();
- preview->addSelectionFrom(*container);
- preview->move(targetPoint - referencePoint);
+/* preview->addSelectionFrom(*container);
+ preview->move(targetPoint - referencePoint);*/
drawPreview();
}
break;
}
}
- 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)
{
}
}
-void RS_ActionModifyMove::coordinateEvent(Vector * e)
+void ActionModifyMove::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionModifyMove::updateMouseButtonHints()
+void ActionModifyMove::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionModifyMove::updateMouseCursor()
+void ActionModifyMove::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionModifyMove::updateToolBar()
+void ActionModifyMove::updateToolBar()
{
switch (getStatus())
{
}
}
-// EOF
+
-#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:
/**
};
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();
Vector targetPoint;
};
-#endif
+#endif // __ACTIONMODIFYMOVE_H__
-// rs_actionmodifymoverotate.cpp
+// actionmodifymoverotate.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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)
{
deletePreview();
clearPreview();
- preview->addSelectionFrom(*container);
+/* preview->addSelectionFrom(*container);
preview->rotate(data.referencePoint, data.angle);
- preview->move(data.offset);
+ preview->move(data.offset);*/
drawPreview();
}
break;
}
}
- 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)
{
}
}
-void RS_ActionModifyMoveRotate::coordinateEvent(Vector * e)
+void ActionModifyMoveRotate::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionModifyMoveRotate::commandEvent(RS_CommandEvent * e)
+void ActionModifyMoveRotate::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionModifyMoveRotate::getAvailableCommands()
+QStringList ActionModifyMoveRotate::getAvailableCommands()
{
QStringList cmd;
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())
{
}
}
-void RS_ActionModifyMoveRotate::updateMouseCursor()
+void ActionModifyMoveRotate::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionModifyMoveRotate::updateToolBar()
+void ActionModifyMoveRotate::updateToolBar()
{
switch (getStatus())
{
}
}
-void RS_ActionModifyMoveRotate::setAngle(double a)
+void ActionModifyMoveRotate::setAngle(double a)
{
data.angle = a;
}
-double RS_ActionModifyMoveRotate::getAngle()
+double ActionModifyMoveRotate::getAngle()
{
return data.angle;
}
-#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:
/**
};
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);
QString cmdAngle3;
};
-#endif
+#endif // __ACTIONMODIFYMOVEROTATE_H__
-// rs_actionmodifyrotate.cpp
+// actionmodifyrotate.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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)
{
}
}
- 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)
{
}
}
-void RS_ActionModifyRotate::coordinateEvent(Vector * e)
+void ActionModifyRotate::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionModifyRotate::updateMouseButtonHints()
+void ActionModifyRotate::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionModifyRotate::updateMouseCursor()
+void ActionModifyRotate::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionModifyRotate::updateToolBar()
+void ActionModifyRotate::updateToolBar()
{
switch (getStatus())
{
break;
}
}
-
-// EOF
-#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:
/**
};
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();
Vector targetPoint;
};
-#endif
+#endif // __ACTIONMODIFYROTATE_H__
-// rs_actionmodifyrotate2.cpp
+// actionmodifyrotate2.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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);
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:
}
}
- 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)
{
}
}
-void RS_ActionModifyRotate2::coordinateEvent(Vector * e)
+void ActionModifyRotate2::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-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())
{
}
}
-void RS_ActionModifyRotate2::updateMouseCursor()
+void ActionModifyRotate2::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionModifyRotate2::updateToolBar()
+void ActionModifyRotate2::updateToolBar()
{
switch (getStatus())
{
break;
}
}
-
-// EOF
-#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:
/**
};
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();
RS_Rotate2Data data;
};
-#endif
+#endif // __ACTIONMODIFYROTATE2_H__
-// rs_actionmodifyround.cpp
+// actionmodifyround.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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;
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())
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);
}
}
-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);
{
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;
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);
}
}
-void RS_ActionModifyRound::commandEvent(RS_CommandEvent * e)
+void ActionModifyRound::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionModifyRound::getAvailableCommands()
+QStringList ActionModifyRound::getAvailableCommands()
{
QStringList cmd;
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)
{
}
}
-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;
}
-#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;
/**
* 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:
/**
};
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);
Status lastStatus;
};
-#endif
+#endif // __ACTIONMODIFYROUND_H__
-// rs_actionmodifyscale.cpp
+// actionmodifyscale.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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)
{
}
}
- 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)
{
}
}
-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:
}
}
-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;
break;
}
}
-
-// EOF
-#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:
/**
};
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();
Vector targetPoint;
};
-#endif
+#endif // __ACTIONMODIFYSCALE_H__
-// rs_actionmodifystretch.cpp
+// actionmodifystretch.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
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();
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);
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)
{
}
}
-void RS_ActionModifyStretch::coordinateEvent(Vector * e)
+void ActionModifyStretch::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
}
}
-void RS_ActionModifyStretch::updateMouseButtonHints()
+void ActionModifyStretch::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
}
-// EOF
+
-#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.
};
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();
Vector targetPoint;
};
-#endif
+#endif // __ACTIONMODIFYSTRETCH_H__
-// rs_actionmodifytrim.cpp
+// actionmodifytrim.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actionmodifytrim.h"
+#include "actionmodifytrim.h"
#include "rs_dialogfactory.h"
#include "rs_modification.h"
/**
* @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;
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;
}
}
-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);
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)
{
limitCoord = mouse;
limitEntity = se;
- if (limitEntity != NULL /*&& limitEntity->isAtomic()*/)
+ if (limitEntity)
{
limitEntity->setHighlighted(true);
graphicView->drawEntity(limitEntity);
}
}
-void RS_ActionModifyTrim::updateMouseButtonHints()
+void ActionModifyTrim::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionModifyTrim::updateMouseCursor()
+void ActionModifyTrim::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionModifyTrim::updateToolBar()
+void ActionModifyTrim::updateToolBar()
{
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarModify);
}
-#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;
/**
* 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:
/**
};
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();
bool both;
};
-#endif
+#endif // __ACTIONMODIFYTRIM_H__
-// rs_actionmodifytrimamount.cpp
+// actionmodifytrimamount.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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;
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())
{
}
}
-void RS_ActionModifyTrimAmount::mouseReleaseEvent(QMouseEvent * e)
+void ActionModifyTrimAmount::mouseReleaseEvent(QMouseEvent * e)
{
trimCoord = graphicView->toGraph(e->x(), e->y());
trimEntity = catchEntity(e);
}
}
-void RS_ActionModifyTrimAmount::commandEvent(RS_CommandEvent * e)
+void ActionModifyTrimAmount::commandEvent(RS_CommandEvent * e)
{
QString c = e->getCommand().toLower();
}
}
-QStringList RS_ActionModifyTrimAmount::getAvailableCommands()
+QStringList ActionModifyTrimAmount::getAvailableCommands()
{
QStringList cmd;
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:
}
}
-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;
}
-#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;
* 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:
/**
};
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);
double distance;
};
-#endif
+#endif // __ACTIONMODIFYTRIMAMOUNT_H__
-// rs_actionoptionsdrawing.cpp
+// actionoptionsdrawing.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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
--- /dev/null
+#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__
-// rs_actionprintpreview.cpp
+// actionprintpreview.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/04/2010 Added this text. :-)
//
-#include "rs_actionprintpreview.h"
+#include "actionprintpreview.h"
#include "rs_dialogfactory.h"
#include "drawing.h"
/**
* 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;
}
}
-void RS_ActionPrintPreview::mousePressEvent(QMouseEvent * e)
+void ActionPrintPreview::mousePressEvent(QMouseEvent * e)
{
if (e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionPrintPreview::mouseReleaseEvent(QMouseEvent * e)
+void ActionPrintPreview::mouseReleaseEvent(QMouseEvent * e)
{
switch (getStatus())
{
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;
+}
-#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:
/**
};
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);
Vector v2;
};
-#endif
+#endif // __ACTIONPRINTPREVIEW_H__
-// rs_actionselect.cpp
+// actionselect.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
{
--- /dev/null
+#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__
-// rs_actionselectall.cpp
+// actionselectall.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
--- /dev/null
+#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__
-// rs_actionselectbase.cpp
+// actionselectbase.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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()
{
}
* 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);
}
--- /dev/null
+#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__
-// rs_actionselectcontour.cpp
+// actionselectcontour.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
}
}
-void RS_ActionSelectContour::updateMouseCursor()
+void ActionSelectContour::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::SelectCursor);
}
-
-// EOF
--- /dev/null
+#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__
-// rs_actionselectintersected.cpp
+// actionselectintersected.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actionselectintersected.h"
+#include "actionselectintersected.h"
#include "rs_dialogfactory.h"
#include "rs_selection.h"
*
* @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)
{
}
}
- 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)
{
}
}
-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
+
-#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:
/**
};
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);
bool select;
};
-#endif
+#endif // __ACTIONSELECTINTERSECTED_H__
-// rs_actionselectinvert.cpp
+// actionselectinvert.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
--- /dev/null
+#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__
-// rs_actionselectlayer.cpp
+// actionselectlayer.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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);
}
}
-void RS_ActionSelectLayer::updateMouseCursor()
+void ActionSelectLayer::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::SelectCursor);
}
-
-// EOF
-#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();
RS_Entity * en;
};
-#endif
+#endif // __ACTIONSELECTLAYER_H__
-// rs_actionselectsingle.cpp
+// actionselectsingle.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
{
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);
}
}
-void RS_ActionSelectSingle::updateMouseCursor()
+void ActionSelectSingle::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::SelectCursor);
}
-// EOF
+
-#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();
RS_Entity * en;
};
-#endif
+#endif // __ACTIONSELECTSINGLE_H__
-// rs_actionselectwindow.cpp
+// actionselectwindow.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actionselectwindow.h"
+#include "actionselectwindow.h"
#include "rs_dialogfactory.h"
#include "rs_selection.h"
*
* @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)
{
}
}
- 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)
{
{
if (getStatus() == SetCorner2)
deletePreview();
+
deleteSnapper();
init(getStatus() - 1);
}
}
-void RS_ActionSelectWindow::updateMouseButtonHints()
+void ActionSelectWindow::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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
-#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:
/**
};
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);
bool select;
};
-#endif
+#endif // __ACTIONSELECTWINDOW_H__
-// rs_actionsetrelativezero.cpp
+// actionsetrelativezero.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
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)
{
}
}
-void RS_ActionSetRelativeZero::coordinateEvent(Vector * e)
+void ActionSetRelativeZero::coordinateEvent(Vector * e)
{
if (e == NULL)
return;
trigger();
}
-void RS_ActionSetRelativeZero::updateMouseButtonHints()
+void ActionSetRelativeZero::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-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);
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
}
-// EOF
+
--- /dev/null
+#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__
-// rs_actionsetsnapmode.cpp
+// actionsetsnapmode.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/05/2010 Added this text. :-)
//
-#include "rs_actionsetsnapmode.h"
+#include "actionsetsnapmode.h"
#include "graphicview.h"
*
* @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();
}
--- /dev/null
+#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__
-// rs_actionsetsnaprestriction.cpp
+// actionsetsnaprestriction.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/05/2010 Added this text. :-)
//
-#include "rs_actionsetsnaprestriction.h"
+#include "actionsetsnaprestriction.h"
#include "graphicview.h"
* @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();
}
--- /dev/null
+#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__
-// rs_actionsetsnapintersectionmanual.cpp
+// actionsetsnapintersectionmanual.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/05/2010 Added this text. :-)
//
-#include "rs_actionsnapintersectionmanual.h"
+#include "actionsnapintersectionmanual.h"
#include "rs_dialogfactory.h"
#include "graphicview.h"
/**
* @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())
}
}
-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());
entity1 = se;
break;
- case ChooseEntity2: {
+ case ChooseEntity2:
+ {
entity2 = se;
coord = mouse;
- VectorSolutions sol =
- RS_Information::getIntersection(entity1, entity2, false);
-
- //for (int i=0; i<sol.getNumber(); i++) {
- // ip = sol.get(i);
- // break;
- //}
-
+ VectorSolutions sol = RS_Information::getIntersection(entity1, entity2, false);
Vector ip = sol.getClosest(coord);
if (ip.valid)
{
deletePreview();
clearPreview();
- preview->addEntity(
- 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)
{
if (entity1 != NULL && entity1->isAtomic())
setStatus(ChooseEntity2);
+
break;
case ChooseEntity2:
}
}
-void RS_ActionSnapIntersectionManual::updateMouseButtonHints()
+void ActionSnapIntersectionManual::updateMouseButtonHints()
{
switch (getStatus())
{
}
}
-void RS_ActionSnapIntersectionManual::updateMouseCursor()
+void ActionSnapIntersectionManual::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::CadCursor);
}
-void RS_ActionSnapIntersectionManual::updateToolBar()
+void ActionSnapIntersectionManual::updateToolBar()
{
RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap);
}
-// EOF
+
-#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;
/**
* 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:
/**
};
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();
Vector coord;
};
-#endif
+#endif // __ACTIONSNAPINTERSECTIONMANUAL_H__
-// rs_actiontoolregeneratedimensions.cpp
+// actiontoolregeneratedimensions.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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;
finish();
}
-// EOF
+
--- /dev/null
+#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__
-// rs_actionzoomauto.cpp
+// actionzoomauto.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/05/2010 Added this text. :-)
//
-#include "rs_actionzoomauto.h"
+#include "actionzoomauto.h"
#include "graphicview.h"
* @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();
--- /dev/null
+#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__
-// rs_actionzoomautoy.cpp
+// actionzoomautoy.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
}
--- /dev/null
+#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__
-// rs_actionzoomin.cpp
+// actionzoomin.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/28/2010 Added this text. :-)
//
-#include "rs_actionzoomin.h"
+#include "actionzoomin.h"
#include "graphicview.h"
* @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)
{
finish();
}
-// EOF
+
--- /dev/null
+#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__
-// rs_actionzoompan.cpp
+// actionzoompan.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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)
{
}
#define SCROLL_DELTA 4
-void RS_ActionZoomPan::mouseMoveEvent(QMouseEvent * e)
+void ActionZoomPan::mouseMoveEvent(QMouseEvent * e)
{
x2 = e->x();
y2 = e->y();
trigger();
}
-void RS_ActionZoomPan::mousePressEvent(QMouseEvent * e)
+void ActionZoomPan::mousePressEvent(QMouseEvent * e)
{
if (e->button() == Qt::MidButton || e->button() == Qt::LeftButton)
{
}
}
-void RS_ActionZoomPan::mouseReleaseEvent(QMouseEvent * e)
+void ActionZoomPan::mouseReleaseEvent(QMouseEvent * e)
{
if (e->button() == Qt::RightButton)
init(getStatus() - 1);
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);
-#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();
int y2;
};
-#endif
+#endif // __ACTIONZOOMPAN_H__
-// rs_actionzoomprevious.cpp
+// actionzoomprevious.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
--- /dev/null
+#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__
-// rs_actionzoomredraw.cpp
+// actionzoomredraw.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/05/2010 Added this text. :-)
//
-#include "rs_actionzoomredraw.h"
+#include "actionzoomredraw.h"
#include "graphicview.h"
* @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();
--- /dev/null
+#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__
-// rs_actionzoomscroll.cpp
+// actionzoomscroll.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// 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();
}
--- /dev/null
+#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__
-// rs_actionzoomwindow.cpp
+// actionzoomwindow.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 06/05/2010 Added this text. :-)
//
-#include "rs_actionzoomwindow.h"
+#include "actionzoomwindow.h"
#include "rs_dialogfactory.h"
#include "graphicview.h"
* 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)
{
}
}
-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)
{
}
}
- 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)
{
}
}
-void RS_ActionZoomWindow::updateMouseButtonHints()
+void ActionZoomWindow::updateMouseButtonHints()
{
- RS_DEBUG->print("RS_ActionZoomWindow::updateMouseButtonHints()");
+ RS_DEBUG->print("ActionZoomWindow::updateMouseButtonHints()");
switch (getStatus())
{
}
}
-void RS_ActionZoomWindow::updateMouseCursor()
+void ActionZoomWindow::updateMouseCursor()
{
graphicView->setMouseCursor(RS2::MagnifierCursor);
}
-// EOF
+
-#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();
bool keepAspectRatio;
};
-#endif
+#endif // __ACTIONZOOMWINDOW_H__
+++ /dev/null
-/****************************************************************************
-** $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
+++ /dev/null
-/****************************************************************************
-** $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
+++ /dev/null
-/****************************************************************************
-** $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
+++ /dev/null
-/****************************************************************************
-** $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
+++ /dev/null
-/****************************************************************************
-** $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();
-}
-
+++ /dev/null
-/****************************************************************************
-** $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
+++ /dev/null
-/****************************************************************************
-** $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
+++ /dev/null
-/****************************************************************************
-** $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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-// 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 <jlhamm@acm.org>
-//
-// 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();
-}
-
+++ /dev/null
-#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
+++ /dev/null
-// 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 <jlhamm@acm.org>
-//
-// 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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
+++ /dev/null
-#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
-// rs_actioninterface.cpp
+// actioninterface.cpp
//
// Part of the Architektonas Project
// Originally part of QCad Community Edition by Andrew Mustun
// JLH 05/22/2010 Added this text. :-)
//
-#include "rs_actioninterface.h"
+#include "actioninterface.h"
#include "commands.h"
#include "rs_debug.h"
* 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();
*
* @todo no default implementation
*/
-RS2::ActionType RS_ActionInterface::rtti()
+RS2::ActionType ActionInterface::rtti()
{
return RS2::ActionNone;
}
/**
* @return name of this action
*/
-QString RS_ActionInterface::getName()
+QString ActionInterface::getName()
{
return name;
}
* @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)
* 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 *)
{
}
* This function can be overwritten by the implementing action.
* The default implementation does nothing.
*/
-void RS_ActionInterface::mousePressEvent(QMouseEvent *)
+void 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 *)
{
}
* 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();
}
* 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();
}
* 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 *)
{
}
* 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 *)
{
}
* Must be implemented to return the currently available commands
* for the command line.
*/
-QStringList RS_ActionInterface::getAvailableCommands()
+QStringList ActionInterface::getAvailableCommands()
{
QStringList l;
return l;
* 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;
/**
* @return Current status of this action.
*/
-int RS_ActionInterface::getStatus()
+int ActionInterface::getStatus()
{
return status;
}
* data needed for this action was collected / set.
* The default implementation does nothing.
*/
-void RS_ActionInterface::trigger()
+void 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;
}
/**
* Forces a termination of the action without any cleanup.
*/
-void RS_ActionInterface::setFinished()
+void ActionInterface::setFinished()
{
status = -1;
}
/**
* 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);
/**
* 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);
}
/**
* 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)
+{
+}
-#ifndef RS_ACTIONINTERFACE_H
-#define RS_ACTIONINTERFACE_H
+#ifndef __ACTIONINTERFACE_H__
+#define __ACTIONINTERFACE_H__
#include <QtGui>
-#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();
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();
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;
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;
/**
* Predecessor of this action or NULL.
*/
- RS_ActionInterface * predecessor;
+ ActionInterface * predecessor;
+
+ GraphicView * graphicView;
+ RS_EntityContainer * container;
};
-#endif
+#endif // __ACTIONINTERFACE_H__
-// 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
//
//
// 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"
-// 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 <QtGui>
#include "rs.h"
RS_Pen lpen;
};
-#endif // __PAINTINTF_H__
+#endif // __PAINTINTERFACE_H__
#include "rs_information.h"
#include "rs_math.h"
#include "graphicview.h"
-#include "paintintf.h"
+#include "paintinterface.h"
/**
* Default constructor.
#include "rs_information.h"
#include "rs_linetypepattern.h"
#include "graphicview.h"
-#include "paintintf.h"
+#include "paintinterface.h"
/**
* Default constructor.
RS_DEBUG->print("RS_DialogFacgory::RS_DialogFactory: OK");
}
+/*virtual*/ RS_DialogFactory::~RS_DialogFactory()
+{
+}
+
/**
* @return Instance to the unique font list.
*/
RS_DialogFactory();
public:
- virtual ~RS_DialogFactory() {}
+ virtual ~RS_DialogFactory();
static RS_DialogFactory * instance();
* 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() {}
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; }
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; }
#include <QtCore>
#include "rs.h"
-class RS_ActionInterface;
+class ActionInterface;
class RS_ArcData;
class RS_AttributesData;
class RS_BevelData;
* @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
*
* @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
}
friend class RS_DimAligned;
- friend class RS_ActionDimAligned;
+ friend class ActionDimAligned;
friend std::ostream & operator<<(std::ostream & os, const RS_DimAlignedData & dd)
{
#include "graphicview.h"
#include "rs_information.h"
#include "rs_linetypepattern.h"
-#include "paintintf.h"
+#include "paintinterface.h"
/**
* Constructor.
#include "rs_spline.h"
#include "rs_information.h"
#include "graphicview.h"
-#include "paintintf.h"
+#include "paintinterface.h"
bool RS_EntityContainer::autoUpdateBorders = true;
#include "rs_eventhandler.h"
-#include <QtGui>
-#include "rs_actioninterface.h"
+#include "actioninterface.h"
#include "rs_commandevent.h"
#include "rs_debug.h"
#include "rs_dialogfactory.h"
*/
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");
}
*/
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();
}
}
*/
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();
*/
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();
/**
* @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];
/**
* @return The current default action.
*/
-RS_ActionInterface * RS_EventHandler::getDefaultAction()
+ActionInterface * RS_EventHandler::getDefaultAction()
{
return defaultAction;
}
/**
* 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;
/**
* Sets the current action.
*/
-void RS_EventHandler::setCurrentAction(RS_ActionInterface * action)
+void RS_EventHandler::setCurrentAction(ActionInterface * action)
{
RS_DEBUG->print("RS_EventHandler::setCurrentAction");
return;
// Predecessor of the new action or NULL:
- RS_ActionInterface * predecessor = NULL;
+ ActionInterface * predecessor = NULL;
// Suspend current action:
if (actionIndex >= 0 && currentActions[actionIndex]
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];
{
for(int c=0; c<RS_MAXACTIONS; ++c)
{
- if (currentActions[c] != NULL)
+ if (currentActions[c])
{
if (currentActions[c]->rtti() == RS2::ActionSelectSingle
|| currentActions[c]->rtti() == RS2::ActionSelectContour
*/
void RS_EventHandler::setSnapMode(RS2::SnapMode sm)
{
+#if 0
for(int c=0; c<RS_MAXACTIONS; ++c)
if (currentActions[c])
currentActions[c]->setSnapMode(sm);
if (defaultAction)
defaultAction->setSnapMode(sm);
+#else
+#warning "!!! Not sure if this is going to work correctly..."
+ graphicView->snapper.setSnapMode(sm);
+#endif
}
/**
*/
void RS_EventHandler::setSnapRestriction(RS2::SnapRestriction sr)
{
+#if 0
for(int c=0; c<RS_MAXACTIONS; ++c)
if (currentActions[c])
currentActions[c]->setSnapRestriction(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()
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");
#ifndef RS_EVENTHANDLER_H
#define RS_EVENTHANDLER_H
-#include "rs_actioninterface.h"
+#include <QtGui>
+#include "rs.h"
#define RS_MAXACTIONS 16
-class RS_ActionInterface;
+class ActionInterface;
+class RS_CommandEvent;
class GraphicView;
/**
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();
protected:
GraphicView * graphicView;
- RS_ActionInterface * defaultAction;
- RS_ActionInterface * currentActions[RS_MAXACTIONS];
+ ActionInterface * defaultAction;
+ ActionInterface * currentActions[RS_MAXACTIONS];
int actionIndex;
bool coordinateInputEnabled;
};
#include "drawing.h"
#include "graphicview.h"
#include "rs_information.h"
-#include "paintintf.h"
+#include "paintinterface.h"
#include "rs_pattern.h"
#include "rs_patternlist.h"
#include "rs_debug.h"
#include "graphicview.h"
#include "rs_line.h"
-#include "paintintf.h"
+#include "paintinterface.h"
/**
* Constructor.
#include "drawing.h"
#include "graphicview.h"
#include "rs_linetypepattern.h"
-#include "paintintf.h"
+#include "paintinterface.h"
/**
* Constructor.
#include "rs_point.h"
#include "graphicview.h"
-#include "paintintf.h"
+#include "paintinterface.h"
/**
* Default constructor.
#include "rs_line.h"
#include "rs_arc.h"
#include "graphicview.h"
-#include "paintintf.h"
+#include "paintinterface.h"
/**
* Constructor.
#include "rs_entitycontainer.h"
#include "graphicview.h"
#include "rs_information.h"
-#include "paintintf.h"
+#include "paintinterface.h"
#include "settings.h"
/**
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));
}
+++ /dev/null
-// 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 <jlhamm@acm.org>
-//
-// 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
-}
+++ /dev/null
-#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
#include "graphicview.h"
#include "rs_grid.h"
#include "rs_information.h"
-#include "paintintf.h"
+#include "paintinterface.h"
#include "settings.h"
/**
}
/**
- * @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()
{
#include "rs_solid.h"
#include "graphicview.h"
-#include "paintintf.h"
+#include "paintinterface.h"
/**
* Default constructor.
#include "rs_debug.h"
#include "graphicview.h"
#include "drawing.h"
-#include "paintintf.h"
+#include "paintinterface.h"
/**
* Constructor.
#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*/):
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;
//#include "ui_arcoptions.h"
#include <QtGui>
-class RS_ActionDrawArc;
-class RS_ActionInterface;
+class ActionDrawArc;
+class ActionInterface;
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;
#include "arctangentialoptions.h"
-#include "rs_actiondrawarctangential.h"
+#include "actiondrawarctangential.h"
#include "settings.h"
ArcTangentialOptions::ArcTangentialOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
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;
//#include "ui_arctangentialoptions.h"
#include <QtGui>
-class RS_ActionDrawArcTangential;
-class RS_ActionInterface;
+class ActionDrawArcTangential;
+class ActionInterface;
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;
#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*/):
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;
#include <QtGui>
-class RS_ActionInterface;
-class RS_ActionModifyBevel;
+class ActionInterface;
+class ActionModifyBevel;
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;
showToolBarSelect(NULL, -1);
}
-void CadToolBar::showToolBarSelect(RS_ActionInterface * selectAction, int nextAction)
+void CadToolBar::showToolBarSelect(ActionInterface * selectAction, int nextAction)
{
tbSelect->setNextAction(nextAction);
tbSelect->setSelectAction(selectAction);
#include <QtGui>
-class RS_ActionInterface;
+class ActionInterface;
class QG_ActionHandler;
class CadToolBarSplines;
class CadToolBarInfo;
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);
#include "cadtoolbarselect.h"
#include "qg_actionhandler.h"
-#include "rs_actioninterface.h"
+#include "actioninterface.h"
#include "cadtoolbar.h"
#include "createqtactions.h"
}
//hmm, should these three funcs be here???
-void CadToolBarSelect::setSelectAction(RS_ActionInterface * selectAction)
+void CadToolBarSelect::setSelectAction(ActionInterface * selectAction)
{
this->selectAction = selectAction;
}
class CadToolBar;
class QG_ActionHandler;
-class RS_ActionInterface;
+class ActionInterface;
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:
private:
QToolButton * doit;
QG_ActionHandler * actionHandler;
- RS_ActionInterface * selectAction;
+ ActionInterface * selectAction;
int nextAction;
};
#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*/):
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;
#include <QtGui>
-class RS_ActionInterface;
-class RS_ActionDrawCircleCR;
+class ActionInterface;
+class ActionDrawCircleCR;
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;
#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*/):
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;
#include <QtGui>
-class RS_ActionDimLinear;
-class RS_ActionInterface;
+class ActionDimLinear;
+class ActionInterface;
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;
#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*/):
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;
#include <QtGui>
-class RS_ActionDimension;
-class RS_ActionInterface;
+class ActionDimension;
+class ActionInterface;
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;
#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)
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;
#include "ui_imageoptions.h"
-class RS_ActionDrawImage;
-class RS_ActionInterface;
+class ActionDrawImage;
+class ActionInterface;
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;
#include "insertoptions.h"
-#include "rs_actionblocksinsert.h"
+#include "actionblocksinsert.h"
#include "settings.h"
InsertOptions::InsertOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
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;
#include <QtGui>
-class RS_ActionBlocksInsert;
-class RS_ActionInterface;
+class ActionBlocksInsert;
+class ActionInterface;
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;
#include "libraryinsertoptions.h"
-#include "rs_actionlibraryinsert.h"
+#include "actionlibraryinsert.h"
#include "settings.h"
LibraryInsertOptions::LibraryInsertOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
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;
#include <QtGui>
-class RS_ActionInterface;
-class RS_ActionLibraryInsert;
+class ActionInterface;
+class ActionLibraryInsert;
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;
#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)
{
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");
}
}
}
#include "lineangleoptions.h"
-#include "rs_actiondrawlineangle.h"
+#include "actiondrawlineangle.h"
#include "settings.h"
LineAngleOptions::LineAngleOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
}
}
-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())
{
#include <QtGui>
-class RS_ActionDrawLineAngle;
-class RS_ActionInterface;
+class ActionDrawLineAngle;
+class ActionInterface;
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;
#include "linebisectoroptions.h"
-#include "rs_actiondrawlinebisector.h"
+#include "actiondrawlinebisector.h"
#include "settings.h"
LineBisectorOptions::LineBisectorOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
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;
#include <QtGui>
-class RS_ActionDrawLineBisector;
-class RS_ActionInterface;
+class ActionDrawLineBisector;
+class ActionInterface;
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;
#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),
{
}
-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
{
#include <QtGui>
-class RS_ActionDrawLine;
-class RS_ActionInterface;
+class ActionDrawLine;
+class ActionInterface;
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;
#include "lineparalleloptions.h"
-#include "rs_actiondrawlineparallel.h"
+#include "actiondrawlineparallel.h"
#include "settings.h"
LineParallelOptions::LineParallelOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
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;
#include <QtGui>
-class RS_ActionDrawLineParallel;
-class RS_ActionInterface;
+class ActionDrawLineParallel;
+class ActionInterface;
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;
#include "lineparallelthroughoptions.h"
-#include "rs_actiondrawlineparallelthrough.h"
+#include "actiondrawlineparallelthrough.h"
#include "settings.h"
LineParallelThroughOptions::LineParallelThroughOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
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;
#include <QtGui>
-class RS_ActionDrawLineParallelThrough;
-class RS_ActionInterface;
+class ActionDrawLineParallelThrough;
+class ActionInterface;
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;
#include "linepolygon2options.h"
-#include "rs_actiondrawlinepolygon2.h"
+#include "actiondrawlinepolygon2.h"
#include "rs_debug.h"
#include "settings.h"
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;
#include <QtGui>
-class RS_ActionDrawLinePolygon2;
-class RS_ActionInterface;
+class ActionDrawLinePolygon2;
+class ActionInterface;
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;
#include "linepolygonoptions.h"
-#include "rs_actiondrawlinepolygon.h"
+#include "actiondrawlinepolygon.h"
#include "rs_debug.h"
#include "settings.h"
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;
#include <QtGui>
-class RS_ActionDrawLinePolygon;
-class RS_ActionInterface;
+class ActionDrawLinePolygon;
+class ActionInterface;
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;
#include "linerelangleoptions.h"
-#include "rs_actiondrawlinerelangle.h"
+#include "actiondrawlinerelangle.h"
#include "settings.h"
LineRelAngleOptions::LineRelAngleOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
}
}
-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())
{
#include <QtGui>
-class RS_ActionDrawLineRelAngle;
-class RS_ActionInterface;
+class ActionDrawLineRelAngle;
+class ActionInterface;
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;
#include "moverotateoptions.h"
-#include "rs_actionmodifymoverotate.h"
+#include "actionmodifymoverotate.h"
#include "settings.h"
MoveRotateOptions::MoveRotateOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
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;
#include <QtGui>
-class RS_ActionInterface;
-class RS_ActionModifyMoveRotate;
+class ActionInterface;
+class ActionModifyMoveRotate;
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;
#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"
*/
}
-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();
#include "ui_printpreviewoptions.h"
-class RS_ActionInterface;
-class RS_ActionPrintPreview;
+class ActionInterface;
+class ActionPrintPreview;
class QToolBar;
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);
void scale(const QString & s);
protected:
- RS_ActionPrintPreview * action;
+ ActionPrintPreview * action;
private:
QStringList imperialScales;
#include "roundoptions.h"
-#include "rs_actionmodifyround.h"
+#include "actionmodifyround.h"
#include "settings.h"
RoundOptions::RoundOptions(QToolBar * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
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;
#include <QtGui>
-class RS_ActionInterface;
-class RS_ActionModifyRound;
+class ActionInterface;
+class ActionModifyRound;
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;
#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"
#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*/):
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;
#include <QtGui>
-class RS_ActionDrawSpline;
-class RS_ActionInterface;
+class ActionDrawSpline;
+class ActionInterface;
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;
#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)
{
}
-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;
#include "ui_textoptions.h"
-class RS_ActionInterface;
-class RS_ActionDrawText;
+class ActionInterface;
+class ActionDrawText;
class QToolBar;
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;
#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"
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;
#include <QtGui>
-class RS_ActionModifyTrimAmount;
-class RS_ActionInterface;
+class ActionModifyTrimAmount;
+class ActionInterface;
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;
#include "applicationwindow.h"
#include <fstream>
-#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"
#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"
if (graphicView && document)
{
- RS_ActionLibraryInsert * action = new RS_ActionLibraryInsert(*document, *graphicView);
+ ActionLibraryInsert * action = new ActionLibraryInsert(*document, *graphicView);
action->setFile(name);
graphicView->setCurrentAction(action);
}
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");
//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) {
#include "rs_document.h"
#include "qc_dialogfactory.h"
-//#include "qc_graphicview.h"
#include "mdiwindow.h"
#include "qg_actionhandler.h"
#include "qg_blockwidget.h"
/**
* 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
#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"
/**
* Constructor.
*/
-GraphicView::GraphicView(): background(), foreground(), previewMode(false),
- previewOffset(Vector(0, 0))//, snapperDraw(false)
+GraphicView::GraphicView(): background(), foreground()
{
drawingMode = RS2::ModeFull;
printing = false;
grid = new RS_Grid(this);
updateEnabled = 0;
zoomFrozen = false;
- //gridVisible = true;
draftMode = false;
painter = NULL;
- //drawRecursion = 0;
borderLeft = 0;
borderTop = 0;
simulationSmooth = false;
simulationRapid = false;
simulationRunning = false;
-
- //currentInsert = NULL;
}
/**
*/
GraphicView::~GraphicView()
{
- //delete eventHandler;
- if (painter)
- delete painter;
-
delete grid;
}
{
}
-#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.
void GraphicView::setContainer(RS_EntityContainer * container)
{
this->container = container;
- //adjustOffsetControls();
}
/**
*/
bool GraphicView::isGridOn()
{
- if (container != NULL)
+ if (container)
{
Drawing * g = container->getGraphic();
- if (g != NULL)
+ if (g)
return g->isGridOn();
}
/**
* @return Current action or NULL.
*/
-RS_ActionInterface * GraphicView::getDefaultAction()
+ActionInterface * GraphicView::getDefaultAction()
{
if (eventHandler != NULL)
return eventHandler->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;
/**
* 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");
if (e->button() != Qt::RightButton || eventHandler->hasAction())
{
eventHandler->mouseReleaseEvent(e);
- //e->accept();
}
else
{
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();
}
/**
*/
void GraphicView::zoomPan(int dx, int dy)
{
- //offsetX+=(int)toGuiDX(v1.x);
- //offsetY+=(int)toGuiDY(v1.y);
if (simulationRunning)
return;
disableUpdate();
adjustOffsetControls();
- //adjustZoomControls();
updateGrid();
enableUpdate();
redraw();
simulationRunning = true;
simulationLast = Vector(0.0, 0.0);
-//jlh destroyPainter();
-
painter->erase();
// drawing paper border:
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())
{
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;
}
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);
}
}
else
{
-//jlh createDirectPainter();
- //RS_Pen pen(foreground, RS2::Width00, RS2::SolidLine);
painter->setPen(pen);
drawEntityPlain(e);
}
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));
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);
}
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
{
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));
}
}
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...
*/
void GraphicView::drawRelativeZero()
{
-// PROBLEM: relativeZero IS NOT VALID!!!
if (!relativeZero.valid || !painter)
#if 1
return;
}
#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);
*/
void GraphicView::drawMetaGrid()
{
- if (!grid || isGridOn() == false /*|| grid->getMetaSpacing()<0.0*/)
+ if (!grid || isGridOn() == false)
return;
if (!painter)
*/
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()
{
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
#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
{
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();
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;
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;
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
//! Hand mouse cursor
QCursor * curHand;
-//QC
+//QC was merged with QG
};
#endif // __GRAPHICVIEW_H__
#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
/**
* @return Current action or NULL.
*/
-RS_ActionInterface * QG_ActionHandler::getCurrentAction()
+ActionInterface * QG_ActionHandler::getCurrentAction()
{
GraphicView * gv = mainWindow->getGraphicView();
#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();
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...
*
* @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)
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
*/
QStringList QG_ActionHandler::getAvailableCommands()
{
- RS_ActionInterface * currentAction = getCurrentAction();
+ ActionInterface * currentAction = getCurrentAction();
if (currentAction)
return currentAction->getAvailableCommands();
class QG_MainWindowInterface;
class CadToolBarSnap;
-class RS_ActionInterface;
+class ActionInterface;
/**
* This class can trigger actions (from menus, buttons, ...).
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);
#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"
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");
case RS2::ActionDimLinear:
requestDimensionOptions(action, on, update);
- if (((RS_ActionDimLinear *)action)->hasFixedAngle() == false)
+ if (((ActionDimLinear *)action)->hasFixedAngle() == false)
requestDimLinearOptions(action, on, update);
break;
/**
* 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;
/**
* 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
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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;
/**
* 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)
*/
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);
}
#include "vector.h"
#include "rs_debug.h"
+class ActionInterface;
class CadToolBar;
class CommandWidget;
class CoordinateWidget;
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
/**
//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);
#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
setBorders(10, 10, 10, 10);
if (doc)
- setDefaultAction(new RS_ActionDefault(*doc, *this));
+ setDefaultAction(new ActionDefault(*doc, *this));
}
void QG_GraphicView::CommonInitialization(void)
{
// 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);
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");
}
/**
{
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);
a->finish();
if (container->countSelected() > 0)
- setCurrentAction(new RS_ActionModifyDelete(*container, *this));
+ setCurrentAction(new ActionModifyDelete(*container, *this));
}
}
break;
}
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();
}
if (scroll)
- setCurrentAction(new RS_ActionZoomScroll(direction, *container, *this));
+ setCurrentAction(new ActionZoomScroll(direction, *container, *this));
GraphicView::keyPressEvent(e);
}
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());
painter->setOffset(Vector(0, 0));
}
+#else
+ preview.Draw(this, painter);
+#endif
delete painter;
painter = NULL;