From 27d4a138d23453e93a833e9347444b828a971cb4 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Fri, 18 Jun 2010 02:47:05 +0000 Subject: [PATCH] Refactoring: Moved RS_GraphicView to GraphicView. --- architektonas.pro | 9 +- src/actions/rs_actionblocksadd.cpp | 2 +- src/actions/rs_actionblocksadd.h | 2 +- src/actions/rs_actionblocksattributes.cpp | 2 +- src/actions/rs_actionblocksattributes.h | 2 +- src/actions/rs_actionblockscreate.cpp | 3 +- src/actions/rs_actionblockscreate.h | 5 +- src/actions/rs_actionblocksedit.cpp | 2 +- src/actions/rs_actionblocksedit.h | 2 +- src/actions/rs_actionblocksexplode.cpp | 2 +- src/actions/rs_actionblocksexplode.h | 2 +- src/actions/rs_actionblocksfreezeall.cpp | 4 +- src/actions/rs_actionblocksfreezeall.h | 3 +- src/actions/rs_actionblocksinsert.cpp | 3 +- src/actions/rs_actionblocksinsert.h | 2 +- src/actions/rs_actionblocksremove.cpp | 4 +- src/actions/rs_actionblocksremove.h | 2 +- src/actions/rs_actionblockstoggleview.cpp | 4 +- src/actions/rs_actionblockstoggleview.h | 2 +- src/actions/rs_actiondefault.cpp | 3 +- src/actions/rs_actiondefault.h | 2 +- src/actions/rs_actiondimaligned.cpp | 5 +- src/actions/rs_actiondimaligned.h | 2 +- src/actions/rs_actiondimangular.cpp | 5 +- src/actions/rs_actiondimangular.h | 2 +- src/actions/rs_actiondimdiametric.cpp | 5 +- src/actions/rs_actiondimdiametric.h | 2 +- src/actions/rs_actiondimension.cpp | 4 +- src/actions/rs_actiondimension.h | 2 +- src/actions/rs_actiondimleader.cpp | 5 +- src/actions/rs_actiondimleader.h | 2 +- src/actions/rs_actiondimlinear.cpp | 5 +- src/actions/rs_actiondimlinear.h | 2 +- src/actions/rs_actiondimradial.cpp | 5 +- src/actions/rs_actiondimradial.h | 2 +- src/actions/rs_actiondrawarc.cpp | 5 +- src/actions/rs_actiondrawarc.h | 2 +- src/actions/rs_actiondrawarc3p.cpp | 5 +- src/actions/rs_actiondrawarc3p.h | 2 +- src/actions/rs_actiondrawarctangential.cpp | 5 +- src/actions/rs_actiondrawarctangential.h | 2 +- src/actions/rs_actiondrawcircle.cpp | 5 +- src/actions/rs_actiondrawcircle.h | 2 +- src/actions/rs_actiondrawcircle2p.cpp | 5 +- src/actions/rs_actiondrawcircle2p.h | 2 +- src/actions/rs_actiondrawcircle3p.cpp | 5 +- src/actions/rs_actiondrawcircle3p.h | 2 +- src/actions/rs_actiondrawcirclecr.cpp | 5 +- src/actions/rs_actiondrawcirclecr.h | 2 +- src/actions/rs_actiondrawellipseaxis.cpp | 5 +- src/actions/rs_actiondrawellipseaxis.h | 2 +- src/actions/rs_actiondrawhatch.cpp | 4 +- src/actions/rs_actiondrawhatch.h | 2 +- src/actions/rs_actiondrawimage.cpp | 5 +- src/actions/rs_actiondrawimage.h | 2 +- src/actions/rs_actiondrawline.cpp | 5 +- src/actions/rs_actiondrawline.h | 2 +- src/actions/rs_actiondrawlineangle.cpp | 5 +- src/actions/rs_actiondrawlineangle.h | 2 +- src/actions/rs_actiondrawlinebisector.cpp | 5 +- src/actions/rs_actiondrawlinebisector.h | 2 +- src/actions/rs_actiondrawlinefree.cpp | 4 +- src/actions/rs_actiondrawlinefree.h | 2 +- src/actions/rs_actiondrawlinehorvert.cpp | 4 +- src/actions/rs_actiondrawlinehorvert.h | 2 +- src/actions/rs_actiondrawlineparallel.cpp | 5 +- src/actions/rs_actiondrawlineparallel.h | 2 +- .../rs_actiondrawlineparallelthrough.cpp | 5 +- .../rs_actiondrawlineparallelthrough.h | 2 +- src/actions/rs_actiondrawlinepolygon.cpp | 5 +- src/actions/rs_actiondrawlinepolygon.h | 2 +- src/actions/rs_actiondrawlinepolygon2.cpp | 5 +- src/actions/rs_actiondrawlinepolygon2.h | 2 +- src/actions/rs_actiondrawlinerectangle.cpp | 5 +- src/actions/rs_actiondrawlinerectangle.h | 2 +- src/actions/rs_actiondrawlinerelangle.cpp | 5 +- src/actions/rs_actiondrawlinerelangle.h | 2 +- src/actions/rs_actiondrawlinetangent1.cpp | 4 +- src/actions/rs_actiondrawlinetangent1.h | 2 +- src/actions/rs_actiondrawlinetangent2.cpp | 4 +- src/actions/rs_actiondrawlinetangent2.h | 2 +- src/actions/rs_actiondrawpoint.cpp | 5 +- src/actions/rs_actiondrawpoint.h | 2 +- src/actions/rs_actiondrawspline.cpp | 5 +- src/actions/rs_actiondrawspline.h | 2 +- src/actions/rs_actiondrawtext.cpp | 5 +- src/actions/rs_actiondrawtext.h | 2 +- src/actions/rs_actioneditcopy.cpp | 2 +- src/actions/rs_actioneditcopy.h | 2 +- src/actions/rs_actioneditpaste.cpp | 2 +- src/actions/rs_actioneditpaste.h | 2 +- src/actions/rs_actioneditundo.cpp | 4 +- src/actions/rs_actioneditundo.h | 2 +- src/actions/rs_actionfilenew.cpp | 2 +- src/actions/rs_actionfilenew.h | 2 +- src/actions/rs_actionfileopen.cpp | 2 +- src/actions/rs_actionfileopen.h | 2 +- src/actions/rs_actionfilesave.cpp | 2 +- src/actions/rs_actionfilesave.h | 2 +- src/actions/rs_actionfilesaveas.cpp | 2 +- src/actions/rs_actionfilesaveas.h | 2 +- src/actions/rs_actioninfoangle.cpp | 4 +- src/actions/rs_actioninfoangle.h | 2 +- src/actions/rs_actioninfoarea.cpp | 4 +- src/actions/rs_actioninfoarea.h | 2 +- src/actions/rs_actioninfodist.cpp | 4 +- src/actions/rs_actioninfodist.h | 2 +- src/actions/rs_actioninfodist2.cpp | 4 +- src/actions/rs_actioninfodist2.h | 2 +- src/actions/rs_actioninfoinside.cpp | 4 +- src/actions/rs_actioninfoinside.h | 2 +- src/actions/rs_actioninfototallength.cpp | 2 +- src/actions/rs_actioninfototallength.h | 2 +- src/actions/rs_actionlayersadd.cpp | 2 +- src/actions/rs_actionlayersadd.h | 2 +- src/actions/rs_actionlayersedit.cpp | 4 +- src/actions/rs_actionlayersedit.h | 2 +- src/actions/rs_actionlayersfreezeall.cpp | 2 +- src/actions/rs_actionlayersfreezeall.h | 2 +- src/actions/rs_actionlayersremove.cpp | 2 +- src/actions/rs_actionlayersremove.h | 2 +- src/actions/rs_actionlayerstogglelock.cpp | 4 +- src/actions/rs_actionlayerstogglelock.h | 2 +- src/actions/rs_actionlayerstoggleview.cpp | 2 +- src/actions/rs_actionlayerstoggleview.h | 2 +- src/actions/rs_actionlibraryinsert.cpp | 5 +- src/actions/rs_actionlibraryinsert.h | 2 +- src/actions/rs_actionlockrelativezero.cpp | 4 +- src/actions/rs_actionlockrelativezero.h | 2 +- src/actions/rs_actionmodifyattributes.cpp | 4 +- src/actions/rs_actionmodifyattributes.h | 2 +- src/actions/rs_actionmodifybevel.cpp | 3 +- src/actions/rs_actionmodifybevel.h | 2 +- src/actions/rs_actionmodifycut.cpp | 4 +- src/actions/rs_actionmodifycut.h | 2 +- src/actions/rs_actionmodifydelete.cpp | 4 +- src/actions/rs_actionmodifydelete.h | 2 +- src/actions/rs_actionmodifydeletefree.cpp | 4 +- src/actions/rs_actionmodifydeletefree.h | 2 +- src/actions/rs_actionmodifydeletequick.cpp | 4 +- src/actions/rs_actionmodifydeletequick.h | 2 +- src/actions/rs_actionmodifyentity.cpp | 4 +- src/actions/rs_actionmodifyentity.h | 2 +- src/actions/rs_actionmodifyexplodetext.cpp | 2 +- src/actions/rs_actionmodifyexplodetext.h | 2 +- src/actions/rs_actionmodifymirror.cpp | 2 +- src/actions/rs_actionmodifymirror.h | 2 +- src/actions/rs_actionmodifymove.cpp | 2 +- src/actions/rs_actionmodifymove.h | 2 +- src/actions/rs_actionmodifymoverotate.cpp | 3 +- src/actions/rs_actionmodifymoverotate.h | 2 +- src/actions/rs_actionmodifyrotate.cpp | 2 +- src/actions/rs_actionmodifyrotate.h | 2 +- src/actions/rs_actionmodifyrotate2.cpp | 2 +- src/actions/rs_actionmodifyrotate2.h | 2 +- src/actions/rs_actionmodifyround.cpp | 3 +- src/actions/rs_actionmodifyround.h | 2 +- src/actions/rs_actionmodifyscale.cpp | 2 +- src/actions/rs_actionmodifyscale.h | 2 +- src/actions/rs_actionmodifystretch.cpp | 2 +- src/actions/rs_actionmodifystretch.h | 2 +- src/actions/rs_actionmodifytrim.cpp | 2 +- src/actions/rs_actionmodifytrim.h | 2 +- src/actions/rs_actionmodifytrimamount.cpp | 3 +- src/actions/rs_actionmodifytrimamount.h | 2 +- src/actions/rs_actionoptionsdrawing.cpp | 4 +- src/actions/rs_actionoptionsdrawing.h | 2 +- src/actions/rs_actionprintpreview.cpp | 4 +- src/actions/rs_actionprintpreview.h | 2 +- src/actions/rs_actionselect.cpp | 4 +- src/actions/rs_actionselect.h | 2 +- src/actions/rs_actionselectall.cpp | 2 +- src/actions/rs_actionselectall.h | 2 +- src/actions/rs_actionselectbase.cpp | 4 +- src/actions/rs_actionselectbase.h | 2 +- src/actions/rs_actionselectcontour.cpp | 2 +- src/actions/rs_actionselectcontour.h | 2 +- src/actions/rs_actionselectintersected.cpp | 2 +- src/actions/rs_actionselectintersected.h | 2 +- src/actions/rs_actionselectinvert.cpp | 2 +- src/actions/rs_actionselectinvert.h | 2 +- src/actions/rs_actionselectlayer.cpp | 2 +- src/actions/rs_actionselectlayer.h | 2 +- src/actions/rs_actionselectsingle.cpp | 2 +- src/actions/rs_actionselectsingle.h | 2 +- src/actions/rs_actionselectwindow.cpp | 2 +- src/actions/rs_actionselectwindow.h | 2 +- src/actions/rs_actionsetrelativezero.cpp | 4 +- src/actions/rs_actionsetrelativezero.h | 2 +- src/actions/rs_actionsetsnapmode.cpp | 4 +- src/actions/rs_actionsetsnapmode.h | 2 +- src/actions/rs_actionsetsnaprestriction.cpp | 4 +- src/actions/rs_actionsetsnaprestriction.h | 2 +- .../rs_actionsnapintersectionmanual.cpp | 4 +- src/actions/rs_actionsnapintersectionmanual.h | 2 +- .../rs_actiontoolregeneratedimensions.cpp | 4 +- .../rs_actiontoolregeneratedimensions.h | 2 +- src/actions/rs_actionzoomauto.cpp | 4 +- src/actions/rs_actionzoomauto.h | 2 +- src/actions/rs_actionzoomautoy.cpp | 4 +- src/actions/rs_actionzoomautoy.h | 2 +- src/actions/rs_actionzoomin.cpp | 4 +- src/actions/rs_actionzoomin.h | 2 +- src/actions/rs_actionzoompan.cpp | 4 +- src/actions/rs_actionzoompan.h | 2 +- src/actions/rs_actionzoomprevious.cpp | 4 +- src/actions/rs_actionzoomprevious.h | 2 +- src/actions/rs_actionzoomredraw.cpp | 4 +- src/actions/rs_actionzoomredraw.h | 2 +- src/actions/rs_actionzoomscroll.cpp | 4 +- src/actions/rs_actionzoomscroll.h | 2 +- src/actions/rs_actionzoomwindow.cpp | 4 +- src/actions/rs_actionzoomwindow.h | 2 +- src/base/rs_actioninterface.cpp | 4 +- src/base/rs_actioninterface.h | 6 +- src/base/rs_arc.cpp | 1272 +++++++++-------- src/base/rs_arc.h | 351 ++--- src/base/rs_circle.cpp | 588 ++++---- src/base/rs_circle.h | 219 +-- src/base/rs_constructionline.cpp | 4 + src/base/rs_constructionline.h | 4 +- src/base/rs_creation.cpp | 4 +- src/base/rs_creation.h | 6 +- src/base/rs_dialogfactoryadapter.h | 2 +- src/base/rs_dialogfactoryinterface.h | 6 +- src/base/rs_ellipse.cpp | 816 ++++++----- src/base/rs_ellipse.h | 338 ++--- src/base/rs_entity.cpp | 9 +- src/base/rs_entity.h | 165 ++- src/base/rs_entitycontainer.cpp | 5 +- src/base/rs_entitycontainer.h | 4 +- src/base/rs_eventhandler.cpp | 20 +- src/base/rs_eventhandler.h | 5 +- src/base/rs_grid.cpp | 16 +- src/base/rs_grid.h | 13 +- src/base/rs_hatch.cpp | 7 +- src/base/rs_hatch.h | 5 +- src/base/rs_image.cpp | 378 +++-- src/base/rs_image.h | 297 ++-- src/base/rs_line.cpp | 6 +- src/base/rs_line.h | 9 +- src/base/rs_mainwindowinterface.h | 4 +- src/base/rs_modification.cpp | 2 +- src/base/rs_modification.h | 6 +- src/base/rs_point.cpp | 6 +- src/base/rs_point.h | 4 +- src/base/rs_polyline.cpp | 7 +- src/base/rs_polyline.h | 9 +- src/base/rs_previewactioninterface.cpp | 5 +- src/base/rs_previewactioninterface.h | 2 +- src/base/rs_selection.cpp | 2 +- src/base/rs_selection.h | 6 +- src/base/rs_snapper.cpp | 4 +- src/base/rs_snapper.h | 6 +- src/base/rs_solid.cpp | 80 +- src/base/rs_solid.h | 200 ++- src/base/rs_spline.cpp | 7 +- src/base/rs_spline.h | 10 +- src/base/rs_staticgraphicview.h | 4 +- src/forms/cadtoolbararcs.cpp | 1 + src/forms/cadtoolbarcircles.cpp | 1 + src/forms/cadtoolbardim.cpp | 1 + src/forms/cadtoolbarellipses.cpp | 1 + src/forms/cadtoolbarinfo.cpp | 1 + src/forms/cadtoolbarlines.cpp | 1 + src/forms/cadtoolbarmain.cpp | 2 +- src/forms/cadtoolbarmodify.cpp | 1 + src/forms/cadtoolbarpoints.cpp | 1 + src/forms/cadtoolbarpolylines.cpp | 1 + src/forms/cadtoolbarselect.cpp | 1 + src/forms/cadtoolbarsnap.cpp | 1 + src/forms/cadtoolbarsplines.cpp | 1 + src/forms/dlghatch.cpp | 3 - src/mainapp/applicationwindow.cpp | 54 +- src/mainapp/applicationwindow.h | 8 +- .../graphicview.cpp} | 416 +++--- .../graphicview.h} | 163 ++- src/mainapp/mdiwindow.h | 1 - src/mainapp/qc_graphicview.cpp | 2 +- src/mainapp/qc_graphicview.h | 2 - src/widgets/qg_actionhandler.cpp | 16 +- src/widgets/qg_actionhandler.h | 4 +- src/widgets/qg_dialogfactory.cpp | 4 +- src/widgets/qg_dialogfactory.h | 3 +- src/widgets/qg_graphicview.cpp | 22 +- src/widgets/qg_graphicview.h | 11 +- src/widgets/qg_mainwindowinterface.h | 7 +- src/widgets/qg_qt2rs.h | 68 - .../{qg_recentfiles.cpp => recentfiles.cpp} | 24 +- .../{qg_recentfiles.h => recentfiles.h} | 12 +- 290 files changed, 3155 insertions(+), 3212 deletions(-) rename src/{base/rs_graphicview.cpp => mainapp/graphicview.cpp} (80%) rename src/{base/rs_graphicview.h => mainapp/graphicview.h} (72%) delete mode 100644 src/widgets/qg_qt2rs.h rename src/widgets/{qg_recentfiles.cpp => recentfiles.cpp} (82%) rename src/widgets/{qg_recentfiles.h => recentfiles.h} (62%) diff --git a/architektonas.pro b/architektonas.pro index 877884a..9e63187 100644 --- a/architektonas.pro +++ b/architektonas.pro @@ -65,7 +65,6 @@ HEADERS = \ src/base/rs_font.h \ src/base/rs_fontchar.h \ src/base/rs_fontlist.h \ - src/base/rs_graphicview.h \ src/base/rs_grid.h \ src/base/rs_hatch.h \ src/base/rs_image.h \ @@ -144,7 +143,6 @@ SOURCES = \ src/base/rs_filterinterface.cpp \ src/base/rs_font.cpp \ src/base/rs_fontlist.cpp \ - src/base/rs_graphicview.cpp \ src/base/rs_grid.cpp \ src/base/rs_hatch.cpp \ src/base/rs_image.cpp \ @@ -489,8 +487,7 @@ HEADERS += \ src/widgets/qg_mainwindowinterface.h \ src/widgets/qg_patternbox.h \ src/widgets/qg_pentoolbar.h \ - src/widgets/qg_qt2rs.h \ - src/widgets/qg_recentfiles.h \ + src/widgets/recentfiles.h \ src/widgets/qg_scrollbar.h \ src/widgets/qg_widthbox.h @@ -579,7 +576,7 @@ SOURCES += \ src/widgets/qg_listviewitem.cpp \ src/widgets/qg_patternbox.cpp \ src/widgets/qg_pentoolbar.cpp \ - src/widgets/qg_recentfiles.cpp \ + src/widgets/recentfiles.cpp \ src/widgets/qg_scrollbar.cpp \ src/widgets/qg_widthbox.cpp @@ -639,6 +636,7 @@ HEADERS += \ src/mainapp/commands.h \ src/mainapp/createqtactions.h \ src/mainapp/qc_dialogfactory.h \ + src/mainapp/graphicview.h \ src/mainapp/qc_graphicview.h \ src/mainapp/main.h \ src/mainapp/mdiwindow.h \ @@ -649,6 +647,7 @@ SOURCES += \ src/mainapp/commands.cpp \ src/mainapp/createqtactions.cpp \ src/mainapp/qc_dialogfactory.cpp \ + src/mainapp/graphicview.cpp \ src/mainapp/qc_graphicview.cpp \ src/mainapp/main.cpp \ src/mainapp/mdiwindow.cpp \ diff --git a/src/actions/rs_actionblocksadd.cpp b/src/actions/rs_actionblocksadd.cpp index a0ca3d6..d8b197f 100644 --- a/src/actions/rs_actionblocksadd.cpp +++ b/src/actions/rs_actionblocksadd.cpp @@ -29,7 +29,7 @@ #include "drawing.h" #include "rs_dialogfactory.h" -RS_ActionBlocksAdd::RS_ActionBlocksAdd(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionBlocksAdd::RS_ActionBlocksAdd(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Add Block", container, graphicView) { } diff --git a/src/actions/rs_actionblocksadd.h b/src/actions/rs_actionblocksadd.h index c2b2e0c..5bb31b9 100644 --- a/src/actions/rs_actionblocksadd.h +++ b/src/actions/rs_actionblocksadd.h @@ -38,7 +38,7 @@ class RS_ActionBlocksAdd: public RS_ActionInterface { //Q_OBJECT public: - RS_ActionBlocksAdd(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionBlocksAdd(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionBlocksAdd() { } diff --git a/src/actions/rs_actionblocksattributes.cpp b/src/actions/rs_actionblocksattributes.cpp index 67ef48b..a4e084b 100644 --- a/src/actions/rs_actionblocksattributes.cpp +++ b/src/actions/rs_actionblocksattributes.cpp @@ -30,7 +30,7 @@ #include "rs_dialogfactory.h" RS_ActionBlocksAttributes::RS_ActionBlocksAttributes( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Edit Block Attributes", container, graphicView) { } diff --git a/src/actions/rs_actionblocksattributes.h b/src/actions/rs_actionblocksattributes.h index 80dc698..5945bde 100644 --- a/src/actions/rs_actionblocksattributes.h +++ b/src/actions/rs_actionblocksattributes.h @@ -38,7 +38,7 @@ class RS_ActionBlocksAttributes: public RS_ActionInterface { //Q_OBJECT public: - RS_ActionBlocksAttributes(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionBlocksAttributes(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionBlocksAttributes() { } diff --git a/src/actions/rs_actionblockscreate.cpp b/src/actions/rs_actionblockscreate.cpp index 70f57d0..30e7a39 100644 --- a/src/actions/rs_actionblockscreate.cpp +++ b/src/actions/rs_actionblockscreate.cpp @@ -17,13 +17,14 @@ #include "rs_creation.h" #include "rs_dialogfactory.h" +#include "graphicview.h" #include "rs_insert.h" #include "rs_modification.h" /** * Constructor. */ -RS_ActionBlocksCreate::RS_ActionBlocksCreate(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Blocks Create", container, graphicView) +RS_ActionBlocksCreate::RS_ActionBlocksCreate(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Blocks Create", container, graphicView) { referencePoint = Vector(false); } diff --git a/src/actions/rs_actionblockscreate.h b/src/actions/rs_actionblockscreate.h index 021c47c..dacd03c 100644 --- a/src/actions/rs_actionblockscreate.h +++ b/src/actions/rs_actionblockscreate.h @@ -2,7 +2,6 @@ #define RS_ACTIONBLOCKSCREATE_H #include "rs_previewactioninterface.h" -//#include "rs_insert.h" /** * This action class can handle user events for creating blocks from @@ -12,7 +11,6 @@ */ class RS_ActionBlocksCreate: public RS_PreviewActionInterface { - //Q_OBJECT public: /** * Action States. @@ -23,7 +21,7 @@ class RS_ActionBlocksCreate: public RS_PreviewActionInterface }; public: - RS_ActionBlocksCreate(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionBlocksCreate(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionBlocksCreate(); virtual RS2::ActionType rtti(); @@ -31,7 +29,6 @@ class RS_ActionBlocksCreate: public RS_PreviewActionInterface virtual void trigger(); virtual void mouseMoveEvent(QMouseEvent * e); virtual void mouseReleaseEvent(QMouseEvent * e); -// virtual void coordinateEvent(Vector * e); virtual void coordinateEvent(Vector * e); //virtual void commandEvent(RS_CommandEvent * e); //virtual QStringList getAvailableCommands(); diff --git a/src/actions/rs_actionblocksedit.cpp b/src/actions/rs_actionblocksedit.cpp index c8b163c..3383648 100644 --- a/src/actions/rs_actionblocksedit.cpp +++ b/src/actions/rs_actionblocksedit.cpp @@ -29,7 +29,7 @@ #include "drawing.h" #include "rs_dialogfactory.h" -RS_ActionBlocksEdit::RS_ActionBlocksEdit(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionBlocksEdit::RS_ActionBlocksEdit(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Edit Block", container, graphicView) { } diff --git a/src/actions/rs_actionblocksedit.h b/src/actions/rs_actionblocksedit.h index 764e036..0a0780e 100644 --- a/src/actions/rs_actionblocksedit.h +++ b/src/actions/rs_actionblocksedit.h @@ -38,7 +38,7 @@ class RS_ActionBlocksEdit: public RS_ActionInterface { //Q_OBJECT public: - RS_ActionBlocksEdit(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionBlocksEdit(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionBlocksEdit() { } diff --git a/src/actions/rs_actionblocksexplode.cpp b/src/actions/rs_actionblocksexplode.cpp index f0de0d6..a868083 100644 --- a/src/actions/rs_actionblocksexplode.cpp +++ b/src/actions/rs_actionblocksexplode.cpp @@ -31,7 +31,7 @@ /** * Constructor. */ -RS_ActionBlocksExplode::RS_ActionBlocksExplode(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionBlocksExplode::RS_ActionBlocksExplode(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Blocks Explode", container, graphicView) { diff --git a/src/actions/rs_actionblocksexplode.h b/src/actions/rs_actionblocksexplode.h index ed2de13..d5fae51 100644 --- a/src/actions/rs_actionblocksexplode.h +++ b/src/actions/rs_actionblocksexplode.h @@ -40,7 +40,7 @@ class RS_ActionBlocksExplode: public RS_PreviewActionInterface { //Q_OBJECT public: - RS_ActionBlocksExplode(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionBlocksExplode(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionBlocksExplode(); static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); diff --git a/src/actions/rs_actionblocksfreezeall.cpp b/src/actions/rs_actionblocksfreezeall.cpp index 90313f7..ef5f779 100644 --- a/src/actions/rs_actionblocksfreezeall.cpp +++ b/src/actions/rs_actionblocksfreezeall.cpp @@ -15,9 +15,9 @@ #include "rs_actionblocksfreezeall.h" #include "drawing.h" -#include "rs_graphicview.h" +#include "graphicview.h" -RS_ActionBlocksFreezeAll::RS_ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionInterface("Freeze all Blocks", +RS_ActionBlocksFreezeAll::RS_ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Freeze all Blocks", container, graphicView) { this->freeze = freeze; diff --git a/src/actions/rs_actionblocksfreezeall.h b/src/actions/rs_actionblocksfreezeall.h index 32a04b7..6f75d9e 100644 --- a/src/actions/rs_actionblocksfreezeall.h +++ b/src/actions/rs_actionblocksfreezeall.h @@ -10,9 +10,8 @@ */ class RS_ActionBlocksFreezeAll: public RS_ActionInterface { - //Q_OBJECT public: - RS_ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionBlocksFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionBlocksFreezeAll(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionblocksinsert.cpp b/src/actions/rs_actionblocksinsert.cpp index 390485c..8e70dfb 100644 --- a/src/actions/rs_actionblocksinsert.cpp +++ b/src/actions/rs_actionblocksinsert.cpp @@ -16,6 +16,7 @@ #include "rs_actionblocksinsert.h" #include "commands.h" +#include "rs_commandevent.h" #include "rs_creation.h" #include "rs_dialogfactory.h" #include "rs_modification.h" @@ -24,7 +25,7 @@ /** * Constructor. */ -RS_ActionBlocksInsert::RS_ActionBlocksInsert(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Blocks Insert", +RS_ActionBlocksInsert::RS_ActionBlocksInsert(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Blocks Insert", container, graphicView) { } diff --git a/src/actions/rs_actionblocksinsert.h b/src/actions/rs_actionblocksinsert.h index 5ef4095..7e3fb94 100644 --- a/src/actions/rs_actionblocksinsert.h +++ b/src/actions/rs_actionblocksinsert.h @@ -27,7 +27,7 @@ class RS_ActionBlocksInsert: public RS_PreviewActionInterface }; public: - RS_ActionBlocksInsert(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionBlocksInsert(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionBlocksInsert(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionblocksremove.cpp b/src/actions/rs_actionblocksremove.cpp index 0fae7c7..f1aa15b 100644 --- a/src/actions/rs_actionblocksremove.cpp +++ b/src/actions/rs_actionblocksremove.cpp @@ -17,10 +17,10 @@ #include "rs_block.h" #include "rs_dialogfactory.h" #include "drawing.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_insert.h" -RS_ActionBlocksRemove::RS_ActionBlocksRemove(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionBlocksRemove::RS_ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Remove Block", container, graphicView) { } diff --git a/src/actions/rs_actionblocksremove.h b/src/actions/rs_actionblocksremove.h index 4ad441e..ed0faf8 100644 --- a/src/actions/rs_actionblocksremove.h +++ b/src/actions/rs_actionblocksremove.h @@ -11,7 +11,7 @@ class RS_ActionBlocksRemove: public RS_ActionInterface { public: - RS_ActionBlocksRemove(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionBlocksRemove(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionBlocksRemove(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionblockstoggleview.cpp b/src/actions/rs_actionblockstoggleview.cpp index f596ceb..3b8c84d 100644 --- a/src/actions/rs_actionblockstoggleview.cpp +++ b/src/actions/rs_actionblockstoggleview.cpp @@ -15,9 +15,9 @@ #include "rs_actionblockstoggleview.h" #include "drawing.h" -#include "rs_graphicview.h" +#include "graphicview.h" -RS_ActionBlocksToggleView::RS_ActionBlocksToggleView(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionInterface("Toggle Block Visibility", +RS_ActionBlocksToggleView::RS_ActionBlocksToggleView(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Toggle Block Visibility", container, graphicView) { } diff --git a/src/actions/rs_actionblockstoggleview.h b/src/actions/rs_actionblockstoggleview.h index 9009d34..f48d90d 100644 --- a/src/actions/rs_actionblockstoggleview.h +++ b/src/actions/rs_actionblockstoggleview.h @@ -11,7 +11,7 @@ class RS_ActionBlocksToggleView: public RS_ActionInterface { public: - RS_ActionBlocksToggleView(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionBlocksToggleView(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionBlocksToggleView(); virtual void init(int status = 0); diff --git a/src/actions/rs_actiondefault.cpp b/src/actions/rs_actiondefault.cpp index 7ae500b..e49edd8 100644 --- a/src/actions/rs_actiondefault.cpp +++ b/src/actions/rs_actiondefault.cpp @@ -15,6 +15,7 @@ #include "rs_actiondefault.h" #include "rs.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "rs_line.h" #include "rs_modification.h" @@ -25,7 +26,7 @@ /** * Constructor. */ -RS_ActionDefault::RS_ActionDefault(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Default", +RS_ActionDefault::RS_ActionDefault(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Default", container, graphicView) { RS_DEBUG->print("RS_ActionDefault::RS_ActionDefault"); diff --git a/src/actions/rs_actiondefault.h b/src/actions/rs_actiondefault.h index 53e56ab..a329098 100644 --- a/src/actions/rs_actiondefault.h +++ b/src/actions/rs_actiondefault.h @@ -27,7 +27,7 @@ class RS_ActionDefault: public RS_PreviewActionInterface }; public: - RS_ActionDefault(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDefault(RS_EntityContainer & container, GraphicView & graphicView); virtual ~RS_ActionDefault(); static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); diff --git a/src/actions/rs_actiondimaligned.cpp b/src/actions/rs_actiondimaligned.cpp index 90401f4..02be819 100644 --- a/src/actions/rs_actiondimaligned.cpp +++ b/src/actions/rs_actiondimaligned.cpp @@ -14,13 +14,14 @@ #include "rs_actiondimaligned.h" +#include "rs_commandevent.h" #include "rs_constructionline.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" #include "rs_snapper.h" -RS_ActionDimAligned::RS_ActionDimAligned(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionDimension("Draw aligned dimensions", +RS_ActionDimAligned::RS_ActionDimAligned(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionDimension("Draw aligned dimensions", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondimaligned.h b/src/actions/rs_actiondimaligned.h index 8e6b958..b7bf152 100644 --- a/src/actions/rs_actiondimaligned.h +++ b/src/actions/rs_actiondimaligned.h @@ -24,7 +24,7 @@ class RS_ActionDimAligned: public RS_ActionDimension }; public: - RS_ActionDimAligned(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDimAligned(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDimAligned(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondimangular.cpp b/src/actions/rs_actiondimangular.cpp index 9ebb568..3442ad7 100644 --- a/src/actions/rs_actiondimangular.cpp +++ b/src/actions/rs_actiondimangular.cpp @@ -14,12 +14,13 @@ #include "rs_actiondimangular.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_information.h" #include "rs_preview.h" -RS_ActionDimAngular::RS_ActionDimAngular(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionDimension("Draw Angular Dimensions", +RS_ActionDimAngular::RS_ActionDimAngular(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionDimension("Draw Angular Dimensions", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondimangular.h b/src/actions/rs_actiondimangular.h index a8e9a52..5f02dba 100644 --- a/src/actions/rs_actiondimangular.h +++ b/src/actions/rs_actiondimangular.h @@ -23,7 +23,7 @@ class RS_ActionDimAngular: public RS_ActionDimension }; public: - RS_ActionDimAngular(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDimAngular(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDimAngular(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondimdiametric.cpp b/src/actions/rs_actiondimdiametric.cpp index ce47570..80264c5 100644 --- a/src/actions/rs_actiondimdiametric.cpp +++ b/src/actions/rs_actiondimdiametric.cpp @@ -14,11 +14,12 @@ #include "rs_actiondimdiametric.h" -#include "rs_graphicview.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDimDiametric::RS_ActionDimDiametric(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionDimension("Draw Diametric Dimensions", +RS_ActionDimDiametric::RS_ActionDimDiametric(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionDimension("Draw Diametric Dimensions", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondimdiametric.h b/src/actions/rs_actiondimdiametric.h index 1515b02..e4b37c1 100644 --- a/src/actions/rs_actiondimdiametric.h +++ b/src/actions/rs_actiondimdiametric.h @@ -22,7 +22,7 @@ class RS_ActionDimDiametric: public RS_ActionDimension }; public: - RS_ActionDimDiametric(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDimDiametric(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDimDiametric(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondimension.cpp b/src/actions/rs_actiondimension.cpp index 89af7a5..864b771 100644 --- a/src/actions/rs_actiondimension.cpp +++ b/src/actions/rs_actiondimension.cpp @@ -15,9 +15,9 @@ #include "rs_actiondimension.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" -RS_ActionDimension::RS_ActionDimension(const char * name, RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDimension::RS_ActionDimension(const char * name, RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface(name, container, graphicView) { reset(); diff --git a/src/actions/rs_actiondimension.h b/src/actions/rs_actiondimension.h index 1c4735b..910bfc0 100644 --- a/src/actions/rs_actiondimension.h +++ b/src/actions/rs_actiondimension.h @@ -13,7 +13,7 @@ class RS_ActionDimension: public RS_PreviewActionInterface { public: - RS_ActionDimension(const char * name, RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDimension(const char * name, RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDimension(); virtual void reset(); diff --git a/src/actions/rs_actiondimleader.cpp b/src/actions/rs_actiondimleader.cpp index 8d625d9..31d2995 100644 --- a/src/actions/rs_actiondimleader.cpp +++ b/src/actions/rs_actiondimleader.cpp @@ -14,11 +14,12 @@ #include "rs_actiondimleader.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDimLeader::RS_ActionDimLeader(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDimLeader::RS_ActionDimLeader(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw leaders", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondimleader.h b/src/actions/rs_actiondimleader.h index 545bff6..91f5e3e 100644 --- a/src/actions/rs_actiondimleader.h +++ b/src/actions/rs_actiondimleader.h @@ -25,7 +25,7 @@ class RS_ActionDimLeader: public RS_PreviewActionInterface }; public: - RS_ActionDimLeader(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDimLeader(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDimLeader(); //static QAction * createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/); diff --git a/src/actions/rs_actiondimlinear.cpp b/src/actions/rs_actiondimlinear.cpp index efa3be0..9fe8fab 100644 --- a/src/actions/rs_actiondimlinear.cpp +++ b/src/actions/rs_actiondimlinear.cpp @@ -14,9 +14,10 @@ #include "rs_actiondimlinear.h" +#include "rs_commandevent.h" #include "rs_constructionline.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" /** @@ -26,7 +27,7 @@ * @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, RS_GraphicView & graphicView, double angle, bool fixedAngle): +RS_ActionDimLinear::RS_ActionDimLinear(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle): RS_ActionDimension("Draw linear dimensions", container, graphicView) { edata.angle = angle; diff --git a/src/actions/rs_actiondimlinear.h b/src/actions/rs_actiondimlinear.h index 471c03b..289d243 100644 --- a/src/actions/rs_actiondimlinear.h +++ b/src/actions/rs_actiondimlinear.h @@ -34,7 +34,7 @@ class RS_ActionDimLinear: public RS_ActionDimension }; public: - RS_ActionDimLinear(RS_EntityContainer & container, RS_GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); + RS_ActionDimLinear(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); ~RS_ActionDimLinear(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondimradial.cpp b/src/actions/rs_actiondimradial.cpp index f9b8641..6248e5b 100644 --- a/src/actions/rs_actiondimradial.cpp +++ b/src/actions/rs_actiondimradial.cpp @@ -14,11 +14,12 @@ #include "rs_actiondimradial.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDimRadial::RS_ActionDimRadial(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionDimension("Draw Radial Dimensions", +RS_ActionDimRadial::RS_ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionDimension("Draw Radial Dimensions", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondimradial.h b/src/actions/rs_actiondimradial.h index 475aa94..04ff60f 100644 --- a/src/actions/rs_actiondimradial.h +++ b/src/actions/rs_actiondimradial.h @@ -22,7 +22,7 @@ class RS_ActionDimRadial: public RS_ActionDimension }; public: - RS_ActionDimRadial(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDimRadial(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDimRadial(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawarc.cpp b/src/actions/rs_actiondrawarc.cpp index 671d3cd..e47f1bd 100644 --- a/src/actions/rs_actiondrawarc.cpp +++ b/src/actions/rs_actiondrawarc.cpp @@ -14,12 +14,13 @@ #include "rs_actiondrawarc.h" +#include "rs_commandevent.h" #include "commands.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawArc::RS_ActionDrawArc(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDrawArc::RS_ActionDrawArc(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw arcs", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawarc.h b/src/actions/rs_actiondrawarc.h index 6edc795..90fec85 100644 --- a/src/actions/rs_actiondrawarc.h +++ b/src/actions/rs_actiondrawarc.h @@ -26,7 +26,7 @@ class RS_ActionDrawArc: public RS_PreviewActionInterface }; public: - RS_ActionDrawArc(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawArc(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawArc(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawarc3p.cpp b/src/actions/rs_actiondrawarc3p.cpp index bf1c493..2450e76 100644 --- a/src/actions/rs_actiondrawarc3p.cpp +++ b/src/actions/rs_actiondrawarc3p.cpp @@ -15,12 +15,13 @@ #include "rs_actiondrawarc3p.h" #include "rs_actiondrawarc.h" +#include "rs_commandevent.h" #include "commands.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawArc3P::RS_ActionDrawArc3P(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDrawArc3P::RS_ActionDrawArc3P(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw arcs 3P", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawarc3p.h b/src/actions/rs_actiondrawarc3p.h index 052c095..5402631 100644 --- a/src/actions/rs_actiondrawarc3p.h +++ b/src/actions/rs_actiondrawarc3p.h @@ -24,7 +24,7 @@ class RS_ActionDrawArc3P: public RS_PreviewActionInterface }; public: - RS_ActionDrawArc3P(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawArc3P(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawArc3P(); void reset(); diff --git a/src/actions/rs_actiondrawarctangential.cpp b/src/actions/rs_actiondrawarctangential.cpp index 1f639dc..1bdc135 100644 --- a/src/actions/rs_actiondrawarctangential.cpp +++ b/src/actions/rs_actiondrawarctangential.cpp @@ -14,11 +14,12 @@ #include "rs_actiondrawarctangential.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawArcTangential::RS_ActionDrawArcTangential(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw arcs tangential", +RS_ActionDrawArcTangential::RS_ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw arcs tangential", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawarctangential.h b/src/actions/rs_actiondrawarctangential.h index bca26bd..1d56f14 100644 --- a/src/actions/rs_actiondrawarctangential.h +++ b/src/actions/rs_actiondrawarctangential.h @@ -25,7 +25,7 @@ class RS_ActionDrawArcTangential: public RS_PreviewActionInterface }; public: - RS_ActionDrawArcTangential(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawArcTangential(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawArcTangential(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawcircle.cpp b/src/actions/rs_actiondrawcircle.cpp index 7b1d50b..cf20b47 100644 --- a/src/actions/rs_actiondrawcircle.cpp +++ b/src/actions/rs_actiondrawcircle.cpp @@ -14,11 +14,12 @@ #include "rs_actiondrawcircle.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawCircle::RS_ActionDrawCircle(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDrawCircle::RS_ActionDrawCircle(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw circles", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawcircle.h b/src/actions/rs_actiondrawcircle.h index 8757275..c5ca1fd 100644 --- a/src/actions/rs_actiondrawcircle.h +++ b/src/actions/rs_actiondrawcircle.h @@ -22,7 +22,7 @@ class RS_ActionDrawCircle: public RS_PreviewActionInterface }; public: - RS_ActionDrawCircle(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawCircle(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawCircle(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawcircle2p.cpp b/src/actions/rs_actiondrawcircle2p.cpp index 71c410a..d942555 100644 --- a/src/actions/rs_actiondrawcircle2p.cpp +++ b/src/actions/rs_actiondrawcircle2p.cpp @@ -14,11 +14,12 @@ #include "rs_actiondrawcircle2p.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawCircle2P::RS_ActionDrawCircle2P(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw circles", +RS_ActionDrawCircle2P::RS_ActionDrawCircle2P(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw circles", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawcircle2p.h b/src/actions/rs_actiondrawcircle2p.h index 97c0ef5..aebbbae 100644 --- a/src/actions/rs_actiondrawcircle2p.h +++ b/src/actions/rs_actiondrawcircle2p.h @@ -23,7 +23,7 @@ class RS_ActionDrawCircle2P: public RS_PreviewActionInterface }; public: - RS_ActionDrawCircle2P(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawCircle2P(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawCircle2P(); void reset(); diff --git a/src/actions/rs_actiondrawcircle3p.cpp b/src/actions/rs_actiondrawcircle3p.cpp index a659543..1d01eff 100644 --- a/src/actions/rs_actiondrawcircle3p.cpp +++ b/src/actions/rs_actiondrawcircle3p.cpp @@ -14,11 +14,12 @@ #include "rs_actiondrawcircle3p.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawCircle3P::RS_ActionDrawCircle3P(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw circles", +RS_ActionDrawCircle3P::RS_ActionDrawCircle3P(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw circles", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawcircle3p.h b/src/actions/rs_actiondrawcircle3p.h index 695cc2f..a00e04b 100644 --- a/src/actions/rs_actiondrawcircle3p.h +++ b/src/actions/rs_actiondrawcircle3p.h @@ -24,7 +24,7 @@ class RS_ActionDrawCircle3P: public RS_PreviewActionInterface }; public: - RS_ActionDrawCircle3P(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawCircle3P(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawCircle3P(); void reset(); diff --git a/src/actions/rs_actiondrawcirclecr.cpp b/src/actions/rs_actiondrawcirclecr.cpp index 1825b4f..9e9d49a 100644 --- a/src/actions/rs_actiondrawcirclecr.cpp +++ b/src/actions/rs_actiondrawcirclecr.cpp @@ -14,14 +14,15 @@ #include "rs_actiondrawcirclecr.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" /** * Constructor. */ -RS_ActionDrawCircleCR::RS_ActionDrawCircleCR(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw circles CR", +RS_ActionDrawCircleCR::RS_ActionDrawCircleCR(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw circles CR", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawcirclecr.h b/src/actions/rs_actiondrawcirclecr.h index f60f461..8bd35ec 100644 --- a/src/actions/rs_actiondrawcirclecr.h +++ b/src/actions/rs_actiondrawcirclecr.h @@ -22,7 +22,7 @@ class RS_ActionDrawCircleCR: public RS_PreviewActionInterface }; public: - RS_ActionDrawCircleCR(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawCircleCR(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawCircleCR(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawellipseaxis.cpp b/src/actions/rs_actiondrawellipseaxis.cpp index a262fa1..f1c7261 100644 --- a/src/actions/rs_actiondrawellipseaxis.cpp +++ b/src/actions/rs_actiondrawellipseaxis.cpp @@ -14,8 +14,9 @@ #include "rs_actiondrawellipseaxis.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" /** @@ -24,7 +25,7 @@ * @param isArc true if this action will produce an ellipse arc. * false if it will produce a full ellipse. */ -RS_ActionDrawEllipseAxis::RS_ActionDrawEllipseAxis(RS_EntityContainer & container, RS_GraphicView & graphicView, bool isArc): RS_PreviewActionInterface("Draw ellipse with axis", +RS_ActionDrawEllipseAxis::RS_ActionDrawEllipseAxis(RS_EntityContainer & container, GraphicView & graphicView, bool isArc): RS_PreviewActionInterface("Draw ellipse with axis", container, graphicView) { this->isArc = isArc; diff --git a/src/actions/rs_actiondrawellipseaxis.h b/src/actions/rs_actiondrawellipseaxis.h index 67796f7..2aacd50 100644 --- a/src/actions/rs_actiondrawellipseaxis.h +++ b/src/actions/rs_actiondrawellipseaxis.h @@ -25,7 +25,7 @@ class RS_ActionDrawEllipseAxis: public RS_PreviewActionInterface }; public: - RS_ActionDrawEllipseAxis(RS_EntityContainer & container, RS_GraphicView & graphicView, bool isArc); + RS_ActionDrawEllipseAxis(RS_EntityContainer & container, GraphicView & graphicView, bool isArc); ~RS_ActionDrawEllipseAxis(); virtual void init(int status = 0); diff --git a/src/actions/rs_actiondrawhatch.cpp b/src/actions/rs_actiondrawhatch.cpp index 096d959..0fd90c2 100644 --- a/src/actions/rs_actiondrawhatch.cpp +++ b/src/actions/rs_actiondrawhatch.cpp @@ -15,10 +15,10 @@ #include "rs_actiondrawhatch.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_information.h" -RS_ActionDrawHatch::RS_ActionDrawHatch(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDrawHatch::RS_ActionDrawHatch(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Hatch", container, graphicView) { hatch = NULL; diff --git a/src/actions/rs_actiondrawhatch.h b/src/actions/rs_actiondrawhatch.h index c632753..2954564 100644 --- a/src/actions/rs_actiondrawhatch.h +++ b/src/actions/rs_actiondrawhatch.h @@ -20,7 +20,7 @@ class RS_ActionDrawHatch: public RS_PreviewActionInterface }; public: - RS_ActionDrawHatch(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawHatch(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawHatch(); virtual void init(int status = 0); diff --git a/src/actions/rs_actiondrawimage.cpp b/src/actions/rs_actiondrawimage.cpp index 2ba383d..b80cfd5 100644 --- a/src/actions/rs_actiondrawimage.cpp +++ b/src/actions/rs_actiondrawimage.cpp @@ -14,15 +14,16 @@ #include "rs_actiondrawimage.h" +#include "rs_commandevent.h" #include "rs_creation.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" /** * Constructor. */ -RS_ActionDrawImage::RS_ActionDrawImage(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDrawImage::RS_ActionDrawImage(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Image", container, graphicView) { } diff --git a/src/actions/rs_actiondrawimage.h b/src/actions/rs_actiondrawimage.h index 284208d..47a3307 100644 --- a/src/actions/rs_actiondrawimage.h +++ b/src/actions/rs_actiondrawimage.h @@ -29,7 +29,7 @@ class RS_ActionDrawImage: public RS_PreviewActionInterface }; public: - RS_ActionDrawImage(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawImage(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawImage(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawline.cpp b/src/actions/rs_actiondrawline.cpp index 8a3d4f5..ce6ccdf 100644 --- a/src/actions/rs_actiondrawline.cpp +++ b/src/actions/rs_actiondrawline.cpp @@ -14,12 +14,13 @@ #include "rs_actiondrawline.h" #include "rs_actioneditundo.h" +#include "rs_commandevent.h" #include "commands.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLine::RS_ActionDrawLine(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDrawLine::RS_ActionDrawLine(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw lines", container, graphicView) { RS_DEBUG->print("RS_ActionDrawLine::RS_ActionDrawLine"); diff --git a/src/actions/rs_actiondrawline.h b/src/actions/rs_actiondrawline.h index ef3d668..b059d6e 100644 --- a/src/actions/rs_actiondrawline.h +++ b/src/actions/rs_actiondrawline.h @@ -24,7 +24,7 @@ class RS_ActionDrawLine: public RS_PreviewActionInterface }; public: - RS_ActionDrawLine(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLine(RS_EntityContainer & container, GraphicView & graphicView); virtual ~RS_ActionDrawLine(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawlineangle.cpp b/src/actions/rs_actiondrawlineangle.cpp index cf25401..a71dbe8 100644 --- a/src/actions/rs_actiondrawlineangle.cpp +++ b/src/actions/rs_actiondrawlineangle.cpp @@ -15,11 +15,12 @@ #include "rs_actiondrawlineangle.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineAngle::RS_ActionDrawLineAngle(RS_EntityContainer & container, RS_GraphicView & graphicView, double angle, bool fixedAngle): +RS_ActionDrawLineAngle::RS_ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle): RS_PreviewActionInterface("Draw lines with given angle", container, graphicView) { diff --git a/src/actions/rs_actiondrawlineangle.h b/src/actions/rs_actiondrawlineangle.h index 71c5ec4..49b1c3c 100644 --- a/src/actions/rs_actiondrawlineangle.h +++ b/src/actions/rs_actiondrawlineangle.h @@ -23,7 +23,7 @@ class RS_ActionDrawLineAngle: public RS_PreviewActionInterface SetLength /**< Setting length in the command line. */ }; - RS_ActionDrawLineAngle(RS_EntityContainer & container, RS_GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); + RS_ActionDrawLineAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); ~RS_ActionDrawLineAngle(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawlinebisector.cpp b/src/actions/rs_actiondrawlinebisector.cpp index e06ebf9..285be69 100644 --- a/src/actions/rs_actiondrawlinebisector.cpp +++ b/src/actions/rs_actiondrawlinebisector.cpp @@ -14,12 +14,13 @@ #include "rs_actiondrawlinebisector.h" +#include "rs_commandevent.h" #include "rs_creation.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineBisector::RS_ActionDrawLineBisector(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDrawLineBisector::RS_ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Bisectors", container, graphicView) { bisector = NULL; diff --git a/src/actions/rs_actiondrawlinebisector.h b/src/actions/rs_actiondrawlinebisector.h index 2caf564..d524b2d 100644 --- a/src/actions/rs_actiondrawlinebisector.h +++ b/src/actions/rs_actiondrawlinebisector.h @@ -23,7 +23,7 @@ class RS_ActionDrawLineBisector: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineBisector(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLineBisector(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLineBisector(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawlinefree.cpp b/src/actions/rs_actiondrawlinefree.cpp index f2d18e7..8c36b10 100644 --- a/src/actions/rs_actiondrawlinefree.cpp +++ b/src/actions/rs_actiondrawlinefree.cpp @@ -15,10 +15,10 @@ #include "rs_actiondrawlinefree.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_polyline.h" -RS_ActionDrawLineFree::RS_ActionDrawLineFree(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionInterface("Draw freehand lines", +RS_ActionDrawLineFree::RS_ActionDrawLineFree(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Draw freehand lines", container, graphicView) { vertex = Vector(false); diff --git a/src/actions/rs_actiondrawlinefree.h b/src/actions/rs_actiondrawlinefree.h index b8e01ed..97c781c 100644 --- a/src/actions/rs_actiondrawlinefree.h +++ b/src/actions/rs_actiondrawlinefree.h @@ -14,7 +14,7 @@ class RS_Polyline; class RS_ActionDrawLineFree: public RS_ActionInterface { public: - RS_ActionDrawLineFree(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLineFree(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLineFree(); virtual void trigger(); diff --git a/src/actions/rs_actiondrawlinehorvert.cpp b/src/actions/rs_actiondrawlinehorvert.cpp index 67be5e2..71f650f 100644 --- a/src/actions/rs_actiondrawlinehorvert.cpp +++ b/src/actions/rs_actiondrawlinehorvert.cpp @@ -15,10 +15,10 @@ #include "rs_actiondrawlinehorvert.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineHorVert::RS_ActionDrawLineHorVert(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw horizontal/vertical lines", +RS_ActionDrawLineHorVert::RS_ActionDrawLineHorVert(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw horizontal/vertical lines", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawlinehorvert.h b/src/actions/rs_actiondrawlinehorvert.h index 618ed84..5a88b90 100644 --- a/src/actions/rs_actiondrawlinehorvert.h +++ b/src/actions/rs_actiondrawlinehorvert.h @@ -25,7 +25,7 @@ class RS_ActionDrawLineHorVert: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineHorVert(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLineHorVert(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLineHorVert(); void reset(); diff --git a/src/actions/rs_actiondrawlineparallel.cpp b/src/actions/rs_actiondrawlineparallel.cpp index 03ab268..a9e687c 100644 --- a/src/actions/rs_actiondrawlineparallel.cpp +++ b/src/actions/rs_actiondrawlineparallel.cpp @@ -15,13 +15,14 @@ #include "rs_actiondrawlineparallel.h" #include "rs_actiondrawlineparallelthrough.h" +#include "rs_commandevent.h" #include "commands.h" #include "rs_creation.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineParallel::RS_ActionDrawLineParallel(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw Parallels", +RS_ActionDrawLineParallel::RS_ActionDrawLineParallel(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Parallels", container, graphicView) { parallel = NULL; diff --git a/src/actions/rs_actiondrawlineparallel.h b/src/actions/rs_actiondrawlineparallel.h index 162e2de..f3666cd 100644 --- a/src/actions/rs_actiondrawlineparallel.h +++ b/src/actions/rs_actiondrawlineparallel.h @@ -24,7 +24,7 @@ class RS_ActionDrawLineParallel: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineParallel(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLineParallel(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLineParallel(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawlineparallelthrough.cpp b/src/actions/rs_actiondrawlineparallelthrough.cpp index aa9db00..81a9bce 100644 --- a/src/actions/rs_actiondrawlineparallelthrough.cpp +++ b/src/actions/rs_actiondrawlineparallelthrough.cpp @@ -14,13 +14,14 @@ #include "rs_actiondrawlineparallelthrough.h" +#include "rs_commandevent.h" #include "rs_creation.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" RS_ActionDrawLineParallelThrough::RS_ActionDrawLineParallelThrough( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Parallels", container, graphicView) { parallel = NULL; diff --git a/src/actions/rs_actiondrawlineparallelthrough.h b/src/actions/rs_actiondrawlineparallelthrough.h index 4963bc8..8a6acd3 100644 --- a/src/actions/rs_actiondrawlineparallelthrough.h +++ b/src/actions/rs_actiondrawlineparallelthrough.h @@ -23,7 +23,7 @@ class RS_ActionDrawLineParallelThrough: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineParallelThrough(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLineParallelThrough(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLineParallelThrough(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawlinepolygon.cpp b/src/actions/rs_actiondrawlinepolygon.cpp index c9761a6..7bfe2bc 100644 --- a/src/actions/rs_actiondrawlinepolygon.cpp +++ b/src/actions/rs_actiondrawlinepolygon.cpp @@ -14,12 +14,13 @@ #include "rs_actiondrawlinepolygon.h" +#include "rs_commandevent.h" #include "rs_creation.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLinePolygon::RS_ActionDrawLinePolygon(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw Polygons", +RS_ActionDrawLinePolygon::RS_ActionDrawLinePolygon(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Polygons", container, graphicView) { center = Vector(false); diff --git a/src/actions/rs_actiondrawlinepolygon.h b/src/actions/rs_actiondrawlinepolygon.h index 13a377e..8f787a6 100644 --- a/src/actions/rs_actiondrawlinepolygon.h +++ b/src/actions/rs_actiondrawlinepolygon.h @@ -19,7 +19,7 @@ class RS_ActionDrawLinePolygon: public RS_PreviewActionInterface }; public: - RS_ActionDrawLinePolygon(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLinePolygon(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLinePolygon(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawlinepolygon2.cpp b/src/actions/rs_actiondrawlinepolygon2.cpp index 8e26061..fb783d6 100644 --- a/src/actions/rs_actiondrawlinepolygon2.cpp +++ b/src/actions/rs_actiondrawlinepolygon2.cpp @@ -14,12 +14,13 @@ #include "rs_actiondrawlinepolygon2.h" +#include "rs_commandevent.h" #include "rs_creation.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLinePolygon2::RS_ActionDrawLinePolygon2(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw Polygons", +RS_ActionDrawLinePolygon2::RS_ActionDrawLinePolygon2(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Polygons", container, graphicView) { corner1 = Vector(false); diff --git a/src/actions/rs_actiondrawlinepolygon2.h b/src/actions/rs_actiondrawlinepolygon2.h index e856976..243a56f 100644 --- a/src/actions/rs_actiondrawlinepolygon2.h +++ b/src/actions/rs_actiondrawlinepolygon2.h @@ -19,7 +19,7 @@ class RS_ActionDrawLinePolygon2: public RS_PreviewActionInterface }; public: - RS_ActionDrawLinePolygon2(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLinePolygon2(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLinePolygon2(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawlinerectangle.cpp b/src/actions/rs_actiondrawlinerectangle.cpp index 455eeeb..db82d01 100644 --- a/src/actions/rs_actiondrawlinerectangle.cpp +++ b/src/actions/rs_actiondrawlinerectangle.cpp @@ -14,12 +14,13 @@ #include "rs_actiondrawlinerectangle.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" RS_ActionDrawLineRectangle::RS_ActionDrawLineRectangle( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw rectangles", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawlinerectangle.h b/src/actions/rs_actiondrawlinerectangle.h index 6097a15..2bf88a0 100644 --- a/src/actions/rs_actiondrawlinerectangle.h +++ b/src/actions/rs_actiondrawlinerectangle.h @@ -23,7 +23,7 @@ class RS_ActionDrawLineRectangle: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineRectangle(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLineRectangle(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLineRectangle(); void reset(); diff --git a/src/actions/rs_actiondrawlinerelangle.cpp b/src/actions/rs_actiondrawlinerelangle.cpp index 1ecd4c0..911a165 100644 --- a/src/actions/rs_actiondrawlinerelangle.cpp +++ b/src/actions/rs_actiondrawlinerelangle.cpp @@ -14,12 +14,13 @@ #include "rs_actiondrawlinerelangle.h" +#include "rs_commandevent.h" #include "rs_creation.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineRelAngle::RS_ActionDrawLineRelAngle(RS_EntityContainer & container, RS_GraphicView & graphicView, double angle, bool fixedAngle): +RS_ActionDrawLineRelAngle::RS_ActionDrawLineRelAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle, bool fixedAngle): RS_PreviewActionInterface("Draw Lines with relative angles", container, graphicView) { diff --git a/src/actions/rs_actiondrawlinerelangle.h b/src/actions/rs_actiondrawlinerelangle.h index 6908afa..beaf461 100644 --- a/src/actions/rs_actiondrawlinerelangle.h +++ b/src/actions/rs_actiondrawlinerelangle.h @@ -24,7 +24,7 @@ class RS_ActionDrawLineRelAngle: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineRelAngle(RS_EntityContainer & container, RS_GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); + RS_ActionDrawLineRelAngle(RS_EntityContainer & container, GraphicView & graphicView, double angle = 0.0, bool fixedAngle = false); ~RS_ActionDrawLineRelAngle(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawlinetangent1.cpp b/src/actions/rs_actiondrawlinetangent1.cpp index d6f0770..ed3703d 100644 --- a/src/actions/rs_actiondrawlinetangent1.cpp +++ b/src/actions/rs_actiondrawlinetangent1.cpp @@ -16,10 +16,10 @@ #include "rs_creation.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawLineTangent1::RS_ActionDrawLineTangent1(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw Tangents 1", +RS_ActionDrawLineTangent1::RS_ActionDrawLineTangent1(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Tangents 1", container, graphicView) { tangent = NULL; diff --git a/src/actions/rs_actiondrawlinetangent1.h b/src/actions/rs_actiondrawlinetangent1.h index 0269434..b772f74 100644 --- a/src/actions/rs_actiondrawlinetangent1.h +++ b/src/actions/rs_actiondrawlinetangent1.h @@ -23,7 +23,7 @@ class RS_ActionDrawLineTangent1: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineTangent1(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLineTangent1(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLineTangent1(); virtual void trigger(); diff --git a/src/actions/rs_actiondrawlinetangent2.cpp b/src/actions/rs_actiondrawlinetangent2.cpp index a284560..f4bcf99 100644 --- a/src/actions/rs_actiondrawlinetangent2.cpp +++ b/src/actions/rs_actiondrawlinetangent2.cpp @@ -16,11 +16,11 @@ #include "rs_creation.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" RS_ActionDrawLineTangent2::RS_ActionDrawLineTangent2( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Tangents 2", container, graphicView) { tangent = NULL; diff --git a/src/actions/rs_actiondrawlinetangent2.h b/src/actions/rs_actiondrawlinetangent2.h index 7b7cd5c..374e304 100644 --- a/src/actions/rs_actiondrawlinetangent2.h +++ b/src/actions/rs_actiondrawlinetangent2.h @@ -20,7 +20,7 @@ class RS_ActionDrawLineTangent2: public RS_PreviewActionInterface }; public: - RS_ActionDrawLineTangent2(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawLineTangent2(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawLineTangent2(); virtual void trigger(); diff --git a/src/actions/rs_actiondrawpoint.cpp b/src/actions/rs_actiondrawpoint.cpp index 0a3d48d..8208639 100644 --- a/src/actions/rs_actiondrawpoint.cpp +++ b/src/actions/rs_actiondrawpoint.cpp @@ -14,11 +14,12 @@ #include "rs_actiondrawpoint.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawPoint::RS_ActionDrawPoint(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDrawPoint::RS_ActionDrawPoint(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Points", container, graphicView) { } diff --git a/src/actions/rs_actiondrawpoint.h b/src/actions/rs_actiondrawpoint.h index be4fb01..e7efb20 100644 --- a/src/actions/rs_actiondrawpoint.h +++ b/src/actions/rs_actiondrawpoint.h @@ -12,7 +12,7 @@ class RS_ActionDrawPoint: public RS_PreviewActionInterface { public: - RS_ActionDrawPoint(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawPoint(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawPoint(); virtual void trigger(); diff --git a/src/actions/rs_actiondrawspline.cpp b/src/actions/rs_actiondrawspline.cpp index faa11eb..91fa9a1 100644 --- a/src/actions/rs_actiondrawspline.cpp +++ b/src/actions/rs_actiondrawspline.cpp @@ -14,12 +14,13 @@ #include "rs_actiondrawspline.h" +#include "rs_commandevent.h" #include "commands.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawSpline::RS_ActionDrawSpline(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionDrawSpline::RS_ActionDrawSpline(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw splines", container, graphicView) { reset(); diff --git a/src/actions/rs_actiondrawspline.h b/src/actions/rs_actiondrawspline.h index 4e484ca..928db1e 100644 --- a/src/actions/rs_actiondrawspline.h +++ b/src/actions/rs_actiondrawspline.h @@ -22,7 +22,7 @@ class RS_ActionDrawSpline: public RS_PreviewActionInterface }; public: - RS_ActionDrawSpline(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawSpline(RS_EntityContainer & container, GraphicView & graphicView); virtual ~RS_ActionDrawSpline(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actiondrawtext.cpp b/src/actions/rs_actiondrawtext.cpp index 55b9ae6..1d3eb7c 100644 --- a/src/actions/rs_actiondrawtext.cpp +++ b/src/actions/rs_actiondrawtext.cpp @@ -16,11 +16,12 @@ #include "rs_actiondrawtext.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionDrawText::RS_ActionDrawText(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Draw Text", container, graphicView) +RS_ActionDrawText::RS_ActionDrawText(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Draw Text", container, graphicView) { pos = Vector(false); textChanged = true; diff --git a/src/actions/rs_actiondrawtext.h b/src/actions/rs_actiondrawtext.h index dcafd56..a8e9c46 100644 --- a/src/actions/rs_actiondrawtext.h +++ b/src/actions/rs_actiondrawtext.h @@ -23,7 +23,7 @@ class RS_ActionDrawText: public RS_PreviewActionInterface }; public: - RS_ActionDrawText(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionDrawText(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionDrawText(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actioneditcopy.cpp b/src/actions/rs_actioneditcopy.cpp index 02f0e2c..e174d42 100644 --- a/src/actions/rs_actioneditcopy.cpp +++ b/src/actions/rs_actioneditcopy.cpp @@ -22,7 +22,7 @@ * * @param undo true for undo and false for redo. */ -RS_ActionEditCopy::RS_ActionEditCopy(bool copy, RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionEditCopy::RS_ActionEditCopy(bool copy, RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Edit Copy", container, graphicView) { this->copy = copy; diff --git a/src/actions/rs_actioneditcopy.h b/src/actions/rs_actioneditcopy.h index 98033ac..5f97a2f 100644 --- a/src/actions/rs_actioneditcopy.h +++ b/src/actions/rs_actioneditcopy.h @@ -21,7 +21,7 @@ class RS_ActionEditCopy: public RS_ActionInterface }; public: - RS_ActionEditCopy(bool copy, RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionEditCopy(bool copy, RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionEditCopy(); virtual void init(int status = 0); diff --git a/src/actions/rs_actioneditpaste.cpp b/src/actions/rs_actioneditpaste.cpp index e52a7d1..40f3110 100644 --- a/src/actions/rs_actioneditpaste.cpp +++ b/src/actions/rs_actioneditpaste.cpp @@ -25,7 +25,7 @@ * * @param undo true for undo and false for redo. */ -RS_ActionEditPaste::RS_ActionEditPaste(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Edit Paste", +RS_ActionEditPaste::RS_ActionEditPaste(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Edit Paste", container, graphicView) { } diff --git a/src/actions/rs_actioneditpaste.h b/src/actions/rs_actioneditpaste.h index decb09d..d910bf4 100644 --- a/src/actions/rs_actioneditpaste.h +++ b/src/actions/rs_actioneditpaste.h @@ -21,7 +21,7 @@ class RS_ActionEditPaste: public RS_PreviewActionInterface }; public: - RS_ActionEditPaste(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionEditPaste(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionEditPaste(); virtual void init(int status = 0); diff --git a/src/actions/rs_actioneditundo.cpp b/src/actions/rs_actioneditundo.cpp index 3a9cfea..5380adc 100644 --- a/src/actions/rs_actioneditundo.cpp +++ b/src/actions/rs_actioneditundo.cpp @@ -15,14 +15,14 @@ #include "rs_actioneditundo.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * Constructor. * * @param undo true for undo and false for redo. */ -RS_ActionEditUndo::RS_ActionEditUndo(bool undo, RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionInterface("Edit Undo", container, graphicView) +RS_ActionEditUndo::RS_ActionEditUndo(bool undo, RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Edit Undo", container, graphicView) { this->undo = undo; } diff --git a/src/actions/rs_actioneditundo.h b/src/actions/rs_actioneditundo.h index 6ae1c62..9b9720a 100644 --- a/src/actions/rs_actioneditundo.h +++ b/src/actions/rs_actioneditundo.h @@ -11,7 +11,7 @@ class RS_ActionEditUndo: public RS_ActionInterface { public: - RS_ActionEditUndo(bool undo, RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionEditUndo(bool undo, RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionEditUndo(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionfilenew.cpp b/src/actions/rs_actionfilenew.cpp index 980e4b9..6ed300a 100644 --- a/src/actions/rs_actionfilenew.cpp +++ b/src/actions/rs_actionfilenew.cpp @@ -16,7 +16,7 @@ //#include "drawing.h" -RS_ActionFileNew::RS_ActionFileNew(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionFileNew::RS_ActionFileNew(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("File New", container, graphicView) { } diff --git a/src/actions/rs_actionfilenew.h b/src/actions/rs_actionfilenew.h index fe8ddc6..43ecc2e 100644 --- a/src/actions/rs_actionfilenew.h +++ b/src/actions/rs_actionfilenew.h @@ -11,7 +11,7 @@ class RS_ActionFileNew: public RS_ActionInterface { public: - RS_ActionFileNew(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionFileNew(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionFileNew(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionfileopen.cpp b/src/actions/rs_actionfileopen.cpp index 517670f..a8d1fa8 100644 --- a/src/actions/rs_actionfileopen.cpp +++ b/src/actions/rs_actionfileopen.cpp @@ -16,7 +16,7 @@ //#include "drawing.h" -RS_ActionFileOpen::RS_ActionFileOpen(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionFileOpen::RS_ActionFileOpen(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("File Open", container, graphicView) { } diff --git a/src/actions/rs_actionfileopen.h b/src/actions/rs_actionfileopen.h index 110a30c..eb478b1 100644 --- a/src/actions/rs_actionfileopen.h +++ b/src/actions/rs_actionfileopen.h @@ -11,7 +11,7 @@ class RS_ActionFileOpen: public RS_ActionInterface { public: - RS_ActionFileOpen(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionFileOpen(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionFileOpen(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionfilesave.cpp b/src/actions/rs_actionfilesave.cpp index dc040c8..06274c4 100644 --- a/src/actions/rs_actionfilesave.cpp +++ b/src/actions/rs_actionfilesave.cpp @@ -16,7 +16,7 @@ #include "drawing.h" -RS_ActionFileSave::RS_ActionFileSave(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionFileSave::RS_ActionFileSave(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("File Save", container, graphicView) { } diff --git a/src/actions/rs_actionfilesave.h b/src/actions/rs_actionfilesave.h index c5463fd..a2a119d 100644 --- a/src/actions/rs_actionfilesave.h +++ b/src/actions/rs_actionfilesave.h @@ -11,7 +11,7 @@ class RS_ActionFileSave: public RS_ActionInterface { public: - RS_ActionFileSave(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionFileSave(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionFileSave(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionfilesaveas.cpp b/src/actions/rs_actionfilesaveas.cpp index 6f2b656..000546a 100644 --- a/src/actions/rs_actionfilesaveas.cpp +++ b/src/actions/rs_actionfilesaveas.cpp @@ -16,7 +16,7 @@ #include "drawing.h" -RS_ActionFileSaveAs::RS_ActionFileSaveAs(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionFileSaveAs::RS_ActionFileSaveAs(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Add Layer", container, graphicView) { } diff --git a/src/actions/rs_actionfilesaveas.h b/src/actions/rs_actionfilesaveas.h index 8df2c4f..33a609d 100644 --- a/src/actions/rs_actionfilesaveas.h +++ b/src/actions/rs_actionfilesaveas.h @@ -12,7 +12,7 @@ class RS_ActionFileSaveAs: public RS_ActionInterface { public: - RS_ActionFileSaveAs(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionFileSaveAs(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionFileSaveAs(); virtual void init(int status = 0); diff --git a/src/actions/rs_actioninfoangle.cpp b/src/actions/rs_actioninfoangle.cpp index 3dc6cb8..31aa8fb 100644 --- a/src/actions/rs_actioninfoangle.cpp +++ b/src/actions/rs_actioninfoangle.cpp @@ -15,10 +15,10 @@ #include "rs_actioninfoangle.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_information.h" -RS_ActionInfoAngle::RS_ActionInfoAngle(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Info Angle", +RS_ActionInfoAngle::RS_ActionInfoAngle(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Info Angle", container, graphicView) { } diff --git a/src/actions/rs_actioninfoangle.h b/src/actions/rs_actioninfoangle.h index ca33687..50bff94 100644 --- a/src/actions/rs_actioninfoangle.h +++ b/src/actions/rs_actioninfoangle.h @@ -23,7 +23,7 @@ class RS_ActionInfoAngle: public RS_PreviewActionInterface }; public: - RS_ActionInfoAngle(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionInfoAngle(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionInfoAngle(); virtual void init(int status = 0); diff --git a/src/actions/rs_actioninfoarea.cpp b/src/actions/rs_actioninfoarea.cpp index ffb5063..ae2c2c3 100644 --- a/src/actions/rs_actioninfoarea.cpp +++ b/src/actions/rs_actioninfoarea.cpp @@ -15,10 +15,10 @@ #include "rs_actioninfoarea.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionInfoArea::RS_ActionInfoArea(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Info Area", +RS_ActionInfoArea::RS_ActionInfoArea(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Info Area", container, graphicView) { } diff --git a/src/actions/rs_actioninfoarea.h b/src/actions/rs_actioninfoarea.h index 0f701ac..1d1bcd4 100644 --- a/src/actions/rs_actioninfoarea.h +++ b/src/actions/rs_actioninfoarea.h @@ -25,7 +25,7 @@ class RS_ActionInfoArea: public RS_PreviewActionInterface }; public: - RS_ActionInfoArea(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionInfoArea(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionInfoArea(); virtual void init(int status = 0); diff --git a/src/actions/rs_actioninfodist.cpp b/src/actions/rs_actioninfodist.cpp index a63ea03..af59d52 100644 --- a/src/actions/rs_actioninfodist.cpp +++ b/src/actions/rs_actioninfodist.cpp @@ -15,10 +15,10 @@ #include "rs_actioninfodist.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionInfoDist::RS_ActionInfoDist(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Info Dist", +RS_ActionInfoDist::RS_ActionInfoDist(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Info Dist", container, graphicView) { } diff --git a/src/actions/rs_actioninfodist.h b/src/actions/rs_actioninfodist.h index 91e02cb..9209de4 100644 --- a/src/actions/rs_actioninfodist.h +++ b/src/actions/rs_actioninfodist.h @@ -22,7 +22,7 @@ class RS_ActionInfoDist: public RS_PreviewActionInterface }; public: - RS_ActionInfoDist(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionInfoDist(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionInfoDist(); virtual void init(int status = 0); diff --git a/src/actions/rs_actioninfodist2.cpp b/src/actions/rs_actioninfodist2.cpp index 84859d8..c8cea15 100644 --- a/src/actions/rs_actioninfodist2.cpp +++ b/src/actions/rs_actioninfodist2.cpp @@ -15,10 +15,10 @@ #include "rs_actioninfodist2.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" -RS_ActionInfoDist2::RS_ActionInfoDist2(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionInfoDist2::RS_ActionInfoDist2(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Info Dist2", container, graphicView) { } diff --git a/src/actions/rs_actioninfodist2.h b/src/actions/rs_actioninfodist2.h index a5de1ab..c33dfe5 100644 --- a/src/actions/rs_actioninfodist2.h +++ b/src/actions/rs_actioninfodist2.h @@ -24,7 +24,7 @@ class RS_ActionInfoDist2: public RS_PreviewActionInterface }; public: - RS_ActionInfoDist2(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionInfoDist2(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionInfoDist2(); virtual void init(int status = 0); diff --git a/src/actions/rs_actioninfoinside.cpp b/src/actions/rs_actioninfoinside.cpp index 7012a93..5edbf63 100644 --- a/src/actions/rs_actioninfoinside.cpp +++ b/src/actions/rs_actioninfoinside.cpp @@ -15,10 +15,10 @@ #include "rs_actioninfoinside.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_information.h" -RS_ActionInfoInside::RS_ActionInfoInside(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionInfoInside::RS_ActionInfoInside(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Info Inside", container, graphicView) { contour = new RS_EntityContainer(NULL, false); diff --git a/src/actions/rs_actioninfoinside.h b/src/actions/rs_actioninfoinside.h index a1f1a08..eaa7bfc 100644 --- a/src/actions/rs_actioninfoinside.h +++ b/src/actions/rs_actioninfoinside.h @@ -12,7 +12,7 @@ class RS_ActionInfoInside: public RS_ActionInterface { public: - RS_ActionInfoInside(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionInfoInside(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionInfoInside(); virtual void trigger(); diff --git a/src/actions/rs_actioninfototallength.cpp b/src/actions/rs_actioninfototallength.cpp index 5b96dac..40b2605 100644 --- a/src/actions/rs_actioninfototallength.cpp +++ b/src/actions/rs_actioninfototallength.cpp @@ -16,7 +16,7 @@ #include "rs_dialogfactory.h" -RS_ActionInfoTotalLength::RS_ActionInfoTotalLength(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionInterface("Info Total Length", +RS_ActionInfoTotalLength::RS_ActionInfoTotalLength(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Info Total Length", container, graphicView) { } diff --git a/src/actions/rs_actioninfototallength.h b/src/actions/rs_actioninfototallength.h index cd75db9..8225cb9 100644 --- a/src/actions/rs_actioninfototallength.h +++ b/src/actions/rs_actioninfototallength.h @@ -19,7 +19,7 @@ class RS_ActionInfoTotalLength: public RS_ActionInterface }; public: - RS_ActionInfoTotalLength(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionInfoTotalLength(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionInfoTotalLength(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionlayersadd.cpp b/src/actions/rs_actionlayersadd.cpp index 594e824..4919653 100644 --- a/src/actions/rs_actionlayersadd.cpp +++ b/src/actions/rs_actionlayersadd.cpp @@ -17,7 +17,7 @@ #include "rs_dialogfactory.h" #include "drawing.h" -RS_ActionLayersAdd::RS_ActionLayersAdd(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionLayersAdd::RS_ActionLayersAdd(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Add Layer", container, graphicView) { } diff --git a/src/actions/rs_actionlayersadd.h b/src/actions/rs_actionlayersadd.h index d650279..0c1b37e 100644 --- a/src/actions/rs_actionlayersadd.h +++ b/src/actions/rs_actionlayersadd.h @@ -11,7 +11,7 @@ class RS_ActionLayersAdd: public RS_ActionInterface { public: - RS_ActionLayersAdd(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionLayersAdd(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionLayersAdd(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionlayersedit.cpp b/src/actions/rs_actionlayersedit.cpp index cd55b24..85ebe06 100644 --- a/src/actions/rs_actionlayersedit.cpp +++ b/src/actions/rs_actionlayersedit.cpp @@ -15,10 +15,10 @@ #include "rs_actionlayersedit.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "drawing.h" -RS_ActionLayersEdit::RS_ActionLayersEdit(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionLayersEdit::RS_ActionLayersEdit(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Edit Layer", container, graphicView) { } diff --git a/src/actions/rs_actionlayersedit.h b/src/actions/rs_actionlayersedit.h index 415afdc..86f9adc 100644 --- a/src/actions/rs_actionlayersedit.h +++ b/src/actions/rs_actionlayersedit.h @@ -11,7 +11,7 @@ class RS_ActionLayersEdit: public RS_ActionInterface { public: - RS_ActionLayersEdit(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionLayersEdit(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionLayersEdit(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionlayersfreezeall.cpp b/src/actions/rs_actionlayersfreezeall.cpp index d94ffc8..62308d0 100644 --- a/src/actions/rs_actionlayersfreezeall.cpp +++ b/src/actions/rs_actionlayersfreezeall.cpp @@ -16,7 +16,7 @@ #include "drawing.h" -RS_ActionLayersFreezeAll::RS_ActionLayersFreezeAll(bool freeze, RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionLayersFreezeAll::RS_ActionLayersFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Freeze all Layers", container, graphicView) { this->freeze = freeze; diff --git a/src/actions/rs_actionlayersfreezeall.h b/src/actions/rs_actionlayersfreezeall.h index ac6c29d..11b9290 100644 --- a/src/actions/rs_actionlayersfreezeall.h +++ b/src/actions/rs_actionlayersfreezeall.h @@ -11,7 +11,7 @@ class RS_ActionLayersFreezeAll: public RS_ActionInterface { public: - RS_ActionLayersFreezeAll(bool freeze, RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionLayersFreezeAll(bool freeze, RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionLayersFreezeAll(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionlayersremove.cpp b/src/actions/rs_actionlayersremove.cpp index 82aaa47..ba4daef 100644 --- a/src/actions/rs_actionlayersremove.cpp +++ b/src/actions/rs_actionlayersremove.cpp @@ -17,7 +17,7 @@ #include "rs_dialogfactory.h" #include "drawing.h" -RS_ActionLayersRemove::RS_ActionLayersRemove(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionLayersRemove::RS_ActionLayersRemove(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Remove Layer", container, graphicView) { } diff --git a/src/actions/rs_actionlayersremove.h b/src/actions/rs_actionlayersremove.h index a737703..f0be5ca 100644 --- a/src/actions/rs_actionlayersremove.h +++ b/src/actions/rs_actionlayersremove.h @@ -11,7 +11,7 @@ class RS_ActionLayersRemove: public RS_ActionInterface { public: - RS_ActionLayersRemove(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionLayersRemove(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionLayersRemove(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionlayerstogglelock.cpp b/src/actions/rs_actionlayerstogglelock.cpp index b8ac389..578be16 100644 --- a/src/actions/rs_actionlayerstogglelock.cpp +++ b/src/actions/rs_actionlayerstogglelock.cpp @@ -14,10 +14,10 @@ #include "rs_actionlayerstogglelock.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "drawing.h" -RS_ActionLayersToggleLock::RS_ActionLayersToggleLock(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionInterface("Toggle Layer Visibility", +RS_ActionLayersToggleLock::RS_ActionLayersToggleLock(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Toggle Layer Visibility", container, graphicView) { } diff --git a/src/actions/rs_actionlayerstogglelock.h b/src/actions/rs_actionlayerstogglelock.h index b27c9e2..80f60b0 100644 --- a/src/actions/rs_actionlayerstogglelock.h +++ b/src/actions/rs_actionlayerstogglelock.h @@ -11,7 +11,7 @@ class RS_ActionLayersToggleLock: public RS_ActionInterface { public: - RS_ActionLayersToggleLock(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionLayersToggleLock(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionLayersToggleLock(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionlayerstoggleview.cpp b/src/actions/rs_actionlayerstoggleview.cpp index e61ce40..1e824d6 100644 --- a/src/actions/rs_actionlayerstoggleview.cpp +++ b/src/actions/rs_actionlayerstoggleview.cpp @@ -16,7 +16,7 @@ #include "drawing.h" -RS_ActionLayersToggleView::RS_ActionLayersToggleView(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionInterface("Toggle Layer Visibility", +RS_ActionLayersToggleView::RS_ActionLayersToggleView(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Toggle Layer Visibility", container, graphicView) { } diff --git a/src/actions/rs_actionlayerstoggleview.h b/src/actions/rs_actionlayerstoggleview.h index 202a769..95e737d 100644 --- a/src/actions/rs_actionlayerstoggleview.h +++ b/src/actions/rs_actionlayerstoggleview.h @@ -11,7 +11,7 @@ class RS_ActionLayersToggleView: public RS_ActionInterface { public: - RS_ActionLayersToggleView(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionLayersToggleView(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionLayersToggleView(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionlibraryinsert.cpp b/src/actions/rs_actionlibraryinsert.cpp index 2447d8f..b1a5757 100644 --- a/src/actions/rs_actionlibraryinsert.cpp +++ b/src/actions/rs_actionlibraryinsert.cpp @@ -14,15 +14,16 @@ #include "rs_actionlibraryinsert.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" #include "rs_units.h" /** * Constructor. */ -RS_ActionLibraryInsert::RS_ActionLibraryInsert(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionLibraryInsert::RS_ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Library Insert", container, graphicView) { } diff --git a/src/actions/rs_actionlibraryinsert.h b/src/actions/rs_actionlibraryinsert.h index c64f8db..51e3e44 100644 --- a/src/actions/rs_actionlibraryinsert.h +++ b/src/actions/rs_actionlibraryinsert.h @@ -28,7 +28,7 @@ class RS_ActionLibraryInsert: public RS_PreviewActionInterface }; public: - RS_ActionLibraryInsert(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView); virtual ~RS_ActionLibraryInsert(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionlockrelativezero.cpp b/src/actions/rs_actionlockrelativezero.cpp index 6f7f641..68ccada 100644 --- a/src/actions/rs_actionlockrelativezero.cpp +++ b/src/actions/rs_actionlockrelativezero.cpp @@ -14,10 +14,10 @@ #include "rs_actionlockrelativezero.h" -#include "rs_graphicview.h" +#include "graphicview.h" RS_ActionLockRelativeZero::RS_ActionLockRelativeZero( - RS_EntityContainer & container, RS_GraphicView & graphicView, bool on): + RS_EntityContainer & container, GraphicView & graphicView, bool on): RS_ActionInterface("(Un-)lock the relative Zero", container, graphicView) { this->on = on; diff --git a/src/actions/rs_actionlockrelativezero.h b/src/actions/rs_actionlockrelativezero.h index 146d654..36bc65c 100644 --- a/src/actions/rs_actionlockrelativezero.h +++ b/src/actions/rs_actionlockrelativezero.h @@ -13,7 +13,7 @@ class RS_ActionLockRelativeZero: public RS_ActionInterface { public: - RS_ActionLockRelativeZero(RS_EntityContainer & container, RS_GraphicView & graphicView, bool on); + RS_ActionLockRelativeZero(RS_EntityContainer & container, GraphicView & graphicView, bool on); ~RS_ActionLockRelativeZero(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifyattributes.cpp b/src/actions/rs_actionmodifyattributes.cpp index 50b54a6..ee84685 100644 --- a/src/actions/rs_actionmodifyattributes.cpp +++ b/src/actions/rs_actionmodifyattributes.cpp @@ -16,11 +16,11 @@ #include "rs_dialogfactory.h" #include "drawing.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_modification.h" RS_ActionModifyAttributes::RS_ActionModifyAttributes( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Change Attributes", container, graphicView) { } diff --git a/src/actions/rs_actionmodifyattributes.h b/src/actions/rs_actionmodifyattributes.h index af0858d..6337e0e 100644 --- a/src/actions/rs_actionmodifyattributes.h +++ b/src/actions/rs_actionmodifyattributes.h @@ -20,7 +20,7 @@ class RS_ActionModifyAttributes: public RS_ActionInterface }; public: - RS_ActionModifyAttributes(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyAttributes(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyAttributes(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifybevel.cpp b/src/actions/rs_actionmodifybevel.cpp index 652e447..1949c81 100644 --- a/src/actions/rs_actionmodifybevel.cpp +++ b/src/actions/rs_actionmodifybevel.cpp @@ -14,10 +14,11 @@ #include "rs_actionmodifybevel.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "rs_information.h" -RS_ActionModifyBevel::RS_ActionModifyBevel(RS_EntityContainer & container, RS_GraphicView & graphicView): RS_PreviewActionInterface("Bevel Entities", +RS_ActionModifyBevel::RS_ActionModifyBevel(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Bevel Entities", container, graphicView) { entity1 = NULL; diff --git a/src/actions/rs_actionmodifybevel.h b/src/actions/rs_actionmodifybevel.h index 8a6d05e..997993d 100644 --- a/src/actions/rs_actionmodifybevel.h +++ b/src/actions/rs_actionmodifybevel.h @@ -24,7 +24,7 @@ class RS_ActionModifyBevel: public RS_PreviewActionInterface }; public: - RS_ActionModifyBevel(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyBevel(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyBevel(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionmodifycut.cpp b/src/actions/rs_actionmodifycut.cpp index fb59aac..1fa53a6 100644 --- a/src/actions/rs_actionmodifycut.cpp +++ b/src/actions/rs_actionmodifycut.cpp @@ -15,11 +15,11 @@ #include "rs_actionmodifycut.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_modification.h" RS_ActionModifyCut::RS_ActionModifyCut(RS_EntityContainer & container, - RS_GraphicView & graphicView): RS_ActionInterface("Cut Entity", + GraphicView & graphicView): RS_ActionInterface("Cut Entity", container, graphicView) { cutEntity = NULL; diff --git a/src/actions/rs_actionmodifycut.h b/src/actions/rs_actionmodifycut.h index 041f3be..61c73b1 100644 --- a/src/actions/rs_actionmodifycut.h +++ b/src/actions/rs_actionmodifycut.h @@ -23,7 +23,7 @@ class RS_ActionModifyCut: public RS_ActionInterface }; public: - RS_ActionModifyCut(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyCut(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyCut(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifydelete.cpp b/src/actions/rs_actionmodifydelete.cpp index 15668e7..abfd500 100644 --- a/src/actions/rs_actionmodifydelete.cpp +++ b/src/actions/rs_actionmodifydelete.cpp @@ -15,11 +15,11 @@ #include "rs_actionmodifydelete.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_modification.h" RS_ActionModifyDelete::RS_ActionModifyDelete(RS_EntityContainer & container, - RS_GraphicView & graphicView): RS_ActionInterface("Delete Entities", + GraphicView & graphicView): RS_ActionInterface("Delete Entities", container, graphicView) { } diff --git a/src/actions/rs_actionmodifydelete.h b/src/actions/rs_actionmodifydelete.h index dafa14c..49c388a 100644 --- a/src/actions/rs_actionmodifydelete.h +++ b/src/actions/rs_actionmodifydelete.h @@ -19,7 +19,7 @@ class RS_ActionModifyDelete: public RS_ActionInterface }; public: - RS_ActionModifyDelete(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyDelete(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyDelete(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifydeletefree.cpp b/src/actions/rs_actionmodifydeletefree.cpp index dabac67..2a4c8bb 100644 --- a/src/actions/rs_actionmodifydeletefree.cpp +++ b/src/actions/rs_actionmodifydeletefree.cpp @@ -15,13 +15,13 @@ #include "rs_actionmodifydeletefree.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_modification.h" #include "rs_polyline.h" #include "rs_undo.h" RS_ActionModifyDeleteFree::RS_ActionModifyDeleteFree( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Delete Entities Freehand", container, graphicView) { diff --git a/src/actions/rs_actionmodifydeletefree.h b/src/actions/rs_actionmodifydeletefree.h index c7fd4fe..c88c6ee 100644 --- a/src/actions/rs_actionmodifydeletefree.h +++ b/src/actions/rs_actionmodifydeletefree.h @@ -15,7 +15,7 @@ class RS_Polyline; class RS_ActionModifyDeleteFree: public RS_ActionInterface { public: - RS_ActionModifyDeleteFree(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyDeleteFree(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyDeleteFree(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifydeletequick.cpp b/src/actions/rs_actionmodifydeletequick.cpp index f8dc8af..737c30a 100644 --- a/src/actions/rs_actionmodifydeletequick.cpp +++ b/src/actions/rs_actionmodifydeletequick.cpp @@ -15,10 +15,10 @@ #include "rs_actionmodifydeletequick.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" RS_ActionModifyDeleteQuick::RS_ActionModifyDeleteQuick( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Quick Delete Entities", container, graphicView) { en = NULL; diff --git a/src/actions/rs_actionmodifydeletequick.h b/src/actions/rs_actionmodifydeletequick.h index 25b732d..b97efd9 100644 --- a/src/actions/rs_actionmodifydeletequick.h +++ b/src/actions/rs_actionmodifydeletequick.h @@ -14,7 +14,7 @@ class RS_Entity; class RS_ActionModifyDeleteQuick: public RS_ActionInterface { public: - RS_ActionModifyDeleteQuick(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyDeleteQuick(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyDeleteQuick(); virtual void trigger(); diff --git a/src/actions/rs_actionmodifyentity.cpp b/src/actions/rs_actionmodifyentity.cpp index 63b2299..7aaaae4 100644 --- a/src/actions/rs_actionmodifyentity.cpp +++ b/src/actions/rs_actionmodifyentity.cpp @@ -15,10 +15,10 @@ #include "rs_actionmodifyentity.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" RS_ActionModifyEntity::RS_ActionModifyEntity(RS_EntityContainer & container, - RS_GraphicView & graphicView): + GraphicView & graphicView): RS_ActionInterface("Modify Entity", container, graphicView) { en = NULL; diff --git a/src/actions/rs_actionmodifyentity.h b/src/actions/rs_actionmodifyentity.h index f790bc4..c38477b 100644 --- a/src/actions/rs_actionmodifyentity.h +++ b/src/actions/rs_actionmodifyentity.h @@ -14,7 +14,7 @@ class RS_ActionModifyEntity: public RS_ActionInterface { //Q_OBJECT public: - RS_ActionModifyEntity(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyEntity(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyEntity(); virtual void trigger(); diff --git a/src/actions/rs_actionmodifyexplodetext.cpp b/src/actions/rs_actionmodifyexplodetext.cpp index a5037a2..62a263c 100644 --- a/src/actions/rs_actionmodifyexplodetext.cpp +++ b/src/actions/rs_actionmodifyexplodetext.cpp @@ -20,7 +20,7 @@ * Constructor. */ RS_ActionModifyExplodeText::RS_ActionModifyExplodeText(RS_EntityContainer & container, - RS_GraphicView & graphicView): RS_PreviewActionInterface("Blocks Explode", + GraphicView & graphicView): RS_PreviewActionInterface("Blocks Explode", container, graphicView) { } diff --git a/src/actions/rs_actionmodifyexplodetext.h b/src/actions/rs_actionmodifyexplodetext.h index d0ebe74..f4e7c71 100644 --- a/src/actions/rs_actionmodifyexplodetext.h +++ b/src/actions/rs_actionmodifyexplodetext.h @@ -12,7 +12,7 @@ class RS_ActionModifyExplodeText: public RS_PreviewActionInterface { public: - RS_ActionModifyExplodeText(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyExplodeText(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyExplodeText(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionmodifymirror.cpp b/src/actions/rs_actionmodifymirror.cpp index 437de4b..ea2cd26 100644 --- a/src/actions/rs_actionmodifymirror.cpp +++ b/src/actions/rs_actionmodifymirror.cpp @@ -17,7 +17,7 @@ #include "rs_dialogfactory.h" #include "rs_preview.h" -RS_ActionModifyMirror::RS_ActionModifyMirror(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionModifyMirror::RS_ActionModifyMirror(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Mirror Entities", container, graphicView) { } diff --git a/src/actions/rs_actionmodifymirror.h b/src/actions/rs_actionmodifymirror.h index 83aeb56..feb5398 100644 --- a/src/actions/rs_actionmodifymirror.h +++ b/src/actions/rs_actionmodifymirror.h @@ -23,7 +23,7 @@ class RS_ActionModifyMirror: public RS_PreviewActionInterface }; public: - RS_ActionModifyMirror(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyMirror(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyMirror(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifymove.cpp b/src/actions/rs_actionmodifymove.cpp index 5421298..5a966f7 100644 --- a/src/actions/rs_actionmodifymove.cpp +++ b/src/actions/rs_actionmodifymove.cpp @@ -18,7 +18,7 @@ #include "rs_preview.h" RS_ActionModifyMove::RS_ActionModifyMove(RS_EntityContainer & container, - RS_GraphicView & graphicView): + GraphicView & graphicView): RS_PreviewActionInterface("Move Entities", container, graphicView) { } diff --git a/src/actions/rs_actionmodifymove.h b/src/actions/rs_actionmodifymove.h index 2610aab..ebdda4c 100644 --- a/src/actions/rs_actionmodifymove.h +++ b/src/actions/rs_actionmodifymove.h @@ -23,7 +23,7 @@ class RS_ActionModifyMove: public RS_PreviewActionInterface }; public: - RS_ActionModifyMove(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyMove(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyMove(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifymoverotate.cpp b/src/actions/rs_actionmodifymoverotate.cpp index 2480d92..706c9d2 100644 --- a/src/actions/rs_actionmodifymoverotate.cpp +++ b/src/actions/rs_actionmodifymoverotate.cpp @@ -14,11 +14,12 @@ #include "rs_actionmodifymoverotate.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "rs_preview.h" RS_ActionModifyMoveRotate::RS_ActionModifyMoveRotate( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Move and Rotate Entities", container, graphicView) { } diff --git a/src/actions/rs_actionmodifymoverotate.h b/src/actions/rs_actionmodifymoverotate.h index f370566..ad09386 100644 --- a/src/actions/rs_actionmodifymoverotate.h +++ b/src/actions/rs_actionmodifymoverotate.h @@ -25,7 +25,7 @@ class RS_ActionModifyMoveRotate: public RS_PreviewActionInterface }; public: - RS_ActionModifyMoveRotate(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyMoveRotate(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyMoveRotate(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionmodifyrotate.cpp b/src/actions/rs_actionmodifyrotate.cpp index 224a07e..41efd58 100644 --- a/src/actions/rs_actionmodifyrotate.cpp +++ b/src/actions/rs_actionmodifyrotate.cpp @@ -16,7 +16,7 @@ #include "rs_dialogfactory.h" -RS_ActionModifyRotate::RS_ActionModifyRotate(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionModifyRotate::RS_ActionModifyRotate(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Rotate Entities", container, graphicView) { diff --git a/src/actions/rs_actionmodifyrotate.h b/src/actions/rs_actionmodifyrotate.h index ef99098..1569dc2 100644 --- a/src/actions/rs_actionmodifyrotate.h +++ b/src/actions/rs_actionmodifyrotate.h @@ -22,7 +22,7 @@ class RS_ActionModifyRotate: public RS_PreviewActionInterface }; public: - RS_ActionModifyRotate(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyRotate(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyRotate(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifyrotate2.cpp b/src/actions/rs_actionmodifyrotate2.cpp index 4191234..0bdabab 100644 --- a/src/actions/rs_actionmodifyrotate2.cpp +++ b/src/actions/rs_actionmodifyrotate2.cpp @@ -17,7 +17,7 @@ #include "rs_dialogfactory.h" RS_ActionModifyRotate2::RS_ActionModifyRotate2( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Rotate Entities around two centers", container, graphicView) { } diff --git a/src/actions/rs_actionmodifyrotate2.h b/src/actions/rs_actionmodifyrotate2.h index af0a254..c74074a 100644 --- a/src/actions/rs_actionmodifyrotate2.h +++ b/src/actions/rs_actionmodifyrotate2.h @@ -23,7 +23,7 @@ class RS_ActionModifyRotate2: public RS_PreviewActionInterface }; public: - RS_ActionModifyRotate2(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyRotate2(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyRotate2(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifyround.cpp b/src/actions/rs_actionmodifyround.cpp index 8b6eaf3..530ddfa 100644 --- a/src/actions/rs_actionmodifyround.cpp +++ b/src/actions/rs_actionmodifyround.cpp @@ -14,11 +14,12 @@ #include "rs_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, RS_GraphicView & graphicView): +RS_ActionModifyRound::RS_ActionModifyRound(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Round Entities", container, graphicView) { entity1 = NULL; diff --git a/src/actions/rs_actionmodifyround.h b/src/actions/rs_actionmodifyround.h index 37f79c2..27efe84 100644 --- a/src/actions/rs_actionmodifyround.h +++ b/src/actions/rs_actionmodifyround.h @@ -26,7 +26,7 @@ class RS_ActionModifyRound: public RS_PreviewActionInterface }; public: - RS_ActionModifyRound(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyRound(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyRound(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionmodifyscale.cpp b/src/actions/rs_actionmodifyscale.cpp index 5ab6499..c8168f6 100644 --- a/src/actions/rs_actionmodifyscale.cpp +++ b/src/actions/rs_actionmodifyscale.cpp @@ -16,7 +16,7 @@ #include "rs_dialogfactory.h" -RS_ActionModifyScale::RS_ActionModifyScale(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionModifyScale::RS_ActionModifyScale(RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Scale Entities", container, graphicView) { diff --git a/src/actions/rs_actionmodifyscale.h b/src/actions/rs_actionmodifyscale.h index 0b98a4a..099672e 100644 --- a/src/actions/rs_actionmodifyscale.h +++ b/src/actions/rs_actionmodifyscale.h @@ -22,7 +22,7 @@ class RS_ActionModifyScale: public RS_PreviewActionInterface }; public: - RS_ActionModifyScale(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyScale(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyScale(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifystretch.cpp b/src/actions/rs_actionmodifystretch.cpp index 7f391f8..df7c9ae 100644 --- a/src/actions/rs_actionmodifystretch.cpp +++ b/src/actions/rs_actionmodifystretch.cpp @@ -19,7 +19,7 @@ #include "rs_preview.h" RS_ActionModifyStretch::RS_ActionModifyStretch(RS_EntityContainer & container, - RS_GraphicView & graphicView): RS_PreviewActionInterface("Stretch Entities", + GraphicView & graphicView): RS_PreviewActionInterface("Stretch Entities", container, graphicView) { firstCorner = Vector(false); diff --git a/src/actions/rs_actionmodifystretch.h b/src/actions/rs_actionmodifystretch.h index f4c4849..a6cd584 100644 --- a/src/actions/rs_actionmodifystretch.h +++ b/src/actions/rs_actionmodifystretch.h @@ -24,7 +24,7 @@ class RS_ActionModifyStretch: public RS_PreviewActionInterface }; public: - RS_ActionModifyStretch(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyStretch(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyStretch(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifytrim.cpp b/src/actions/rs_actionmodifytrim.cpp index a73ebfd..6ba19ea 100644 --- a/src/actions/rs_actionmodifytrim.cpp +++ b/src/actions/rs_actionmodifytrim.cpp @@ -21,7 +21,7 @@ * @param both Trim both entities. */ RS_ActionModifyTrim::RS_ActionModifyTrim(RS_EntityContainer & container, - RS_GraphicView & graphicView, bool both): RS_PreviewActionInterface("Trim Entity", + GraphicView & graphicView, bool both): RS_PreviewActionInterface("Trim Entity", container, graphicView) { trimEntity = NULL; diff --git a/src/actions/rs_actionmodifytrim.h b/src/actions/rs_actionmodifytrim.h index 5c37406..f88156d 100644 --- a/src/actions/rs_actionmodifytrim.h +++ b/src/actions/rs_actionmodifytrim.h @@ -23,7 +23,7 @@ class RS_ActionModifyTrim: public RS_PreviewActionInterface }; public: - RS_ActionModifyTrim(RS_EntityContainer & container, RS_GraphicView & graphicView, bool both = false); + RS_ActionModifyTrim(RS_EntityContainer & container, GraphicView & graphicView, bool both = false); ~RS_ActionModifyTrim(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionmodifytrimamount.cpp b/src/actions/rs_actionmodifytrimamount.cpp index c28031e..94a3ad8 100644 --- a/src/actions/rs_actionmodifytrimamount.cpp +++ b/src/actions/rs_actionmodifytrimamount.cpp @@ -14,11 +14,12 @@ #include "rs_actionmodifytrimamount.h" +#include "rs_commandevent.h" #include "rs_dialogfactory.h" #include "rs_modification.h" RS_ActionModifyTrimAmount::RS_ActionModifyTrimAmount( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Trim Entity by a given amount", container, graphicView) { diff --git a/src/actions/rs_actionmodifytrimamount.h b/src/actions/rs_actionmodifytrimamount.h index 3cb02c0..e77df4f 100644 --- a/src/actions/rs_actionmodifytrimamount.h +++ b/src/actions/rs_actionmodifytrimamount.h @@ -23,7 +23,7 @@ class RS_ActionModifyTrimAmount: public RS_ActionInterface }; public: - RS_ActionModifyTrimAmount(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionModifyTrimAmount(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionModifyTrimAmount(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionoptionsdrawing.cpp b/src/actions/rs_actionoptionsdrawing.cpp index 54c866f..7e84868 100644 --- a/src/actions/rs_actionoptionsdrawing.cpp +++ b/src/actions/rs_actionoptionsdrawing.cpp @@ -15,9 +15,9 @@ #include "rs_actionoptionsdrawing.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" -RS_ActionOptionsDrawing::RS_ActionOptionsDrawing(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionOptionsDrawing::RS_ActionOptionsDrawing(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Drawing Options", container, graphicView) { } diff --git a/src/actions/rs_actionoptionsdrawing.h b/src/actions/rs_actionoptionsdrawing.h index d9bfc58..27b5f7c 100644 --- a/src/actions/rs_actionoptionsdrawing.h +++ b/src/actions/rs_actionoptionsdrawing.h @@ -12,7 +12,7 @@ class RS_ActionOptionsDrawing: public RS_ActionInterface { public: - RS_ActionOptionsDrawing(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionOptionsDrawing(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionOptionsDrawing(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionprintpreview.cpp b/src/actions/rs_actionprintpreview.cpp index b9c6d1f..c3f274c 100644 --- a/src/actions/rs_actionprintpreview.cpp +++ b/src/actions/rs_actionprintpreview.cpp @@ -16,12 +16,12 @@ #include "rs_dialogfactory.h" #include "drawing.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * Constructor. */ -RS_ActionPrintPreview::RS_ActionPrintPreview(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionPrintPreview::RS_ActionPrintPreview(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Print Preview", container, graphicView) { diff --git a/src/actions/rs_actionprintpreview.h b/src/actions/rs_actionprintpreview.h index 3e94eac..eb20194 100644 --- a/src/actions/rs_actionprintpreview.h +++ b/src/actions/rs_actionprintpreview.h @@ -22,7 +22,7 @@ class RS_ActionPrintPreview: public RS_ActionInterface }; public: - RS_ActionPrintPreview(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionPrintPreview(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionPrintPreview(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionselect.cpp b/src/actions/rs_actionselect.cpp index 15afb6f..1fe684a 100644 --- a/src/actions/rs_actionselect.cpp +++ b/src/actions/rs_actionselect.cpp @@ -16,9 +16,9 @@ #include "rs_actionselectsingle.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" -RS_ActionSelect::RS_ActionSelect(RS_EntityContainer & container, RS_GraphicView & graphicView, RS2::ActionType nextAction): +RS_ActionSelect::RS_ActionSelect(RS_EntityContainer & container, GraphicView & graphicView, RS2::ActionType nextAction): RS_ActionInterface("Select Entities", container, graphicView) { this->nextAction = nextAction; diff --git a/src/actions/rs_actionselect.h b/src/actions/rs_actionselect.h index eb400a4..c4fb4c3 100644 --- a/src/actions/rs_actionselect.h +++ b/src/actions/rs_actionselect.h @@ -11,7 +11,7 @@ class RS_ActionSelect: public RS_ActionInterface { public: - RS_ActionSelect(RS_EntityContainer & container, RS_GraphicView & graphicView, RS2::ActionType nextAction); + RS_ActionSelect(RS_EntityContainer & container, GraphicView & graphicView, RS2::ActionType nextAction); ~RS_ActionSelect(); void init(int status); diff --git a/src/actions/rs_actionselectall.cpp b/src/actions/rs_actionselectall.cpp index 9a58bfe..912dce5 100644 --- a/src/actions/rs_actionselectall.cpp +++ b/src/actions/rs_actionselectall.cpp @@ -18,7 +18,7 @@ #include "rs_selection.h" RS_ActionSelectAll::RS_ActionSelectAll(RS_EntityContainer & container, - RS_GraphicView & graphicView, bool select): + GraphicView & graphicView, bool select): RS_ActionInterface("Select All Entities", container, graphicView) { this->select = select; diff --git a/src/actions/rs_actionselectall.h b/src/actions/rs_actionselectall.h index c12d028..daef00f 100644 --- a/src/actions/rs_actionselectall.h +++ b/src/actions/rs_actionselectall.h @@ -11,7 +11,7 @@ class RS_ActionSelectAll: public RS_ActionInterface { public: - RS_ActionSelectAll(RS_EntityContainer & container, RS_GraphicView & graphicView, bool select); + RS_ActionSelectAll(RS_EntityContainer & container, GraphicView & graphicView, bool select); ~RS_ActionSelectAll(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionselectbase.cpp b/src/actions/rs_actionselectbase.cpp index c065235..d1bfb1e 100644 --- a/src/actions/rs_actionselectbase.cpp +++ b/src/actions/rs_actionselectbase.cpp @@ -14,10 +14,10 @@ #include "rs_actionselectbase.h" -#include "rs_graphicview.h" +#include "graphicview.h" RS_ActionSelectBase::RS_ActionSelectBase(const char * name, - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface(name, container, graphicView) { } diff --git a/src/actions/rs_actionselectbase.h b/src/actions/rs_actionselectbase.h index 0908ffc..6af7a6b 100644 --- a/src/actions/rs_actionselectbase.h +++ b/src/actions/rs_actionselectbase.h @@ -11,7 +11,7 @@ class RS_ActionSelectBase: public RS_ActionInterface { public: - RS_ActionSelectBase(const char * name, RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionSelectBase(const char * name, RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionSelectBase(); virtual void keyReleaseEvent(QKeyEvent * e); diff --git a/src/actions/rs_actionselectcontour.cpp b/src/actions/rs_actionselectcontour.cpp index 9f98a06..9924747 100644 --- a/src/actions/rs_actionselectcontour.cpp +++ b/src/actions/rs_actionselectcontour.cpp @@ -18,7 +18,7 @@ #include "rs_selection.h" RS_ActionSelectContour::RS_ActionSelectContour(RS_EntityContainer & container, - RS_GraphicView & graphicView): + GraphicView & graphicView): RS_ActionInterface("Select Contours", container, graphicView) { en = NULL; diff --git a/src/actions/rs_actionselectcontour.h b/src/actions/rs_actionselectcontour.h index 7e32c54..8ef6b53 100644 --- a/src/actions/rs_actionselectcontour.h +++ b/src/actions/rs_actionselectcontour.h @@ -13,7 +13,7 @@ class RS_Entity; class RS_ActionSelectContour: public RS_ActionInterface { public: - RS_ActionSelectContour(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionSelectContour(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionSelectContour(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionselectintersected.cpp b/src/actions/rs_actionselectintersected.cpp index 7f73a75..240c4da 100644 --- a/src/actions/rs_actionselectintersected.cpp +++ b/src/actions/rs_actionselectintersected.cpp @@ -24,7 +24,7 @@ * @param select true: select window. false: deselect window */ RS_ActionSelectIntersected::RS_ActionSelectIntersected( - RS_EntityContainer & container, RS_GraphicView & graphicView, bool select): + RS_EntityContainer & container, GraphicView & graphicView, bool select): RS_PreviewActionInterface("Select Intersected", container, graphicView) { this->select = select; diff --git a/src/actions/rs_actionselectintersected.h b/src/actions/rs_actionselectintersected.h index 9697d1e..6dceec7 100644 --- a/src/actions/rs_actionselectintersected.h +++ b/src/actions/rs_actionselectintersected.h @@ -21,7 +21,7 @@ class RS_ActionSelectIntersected: public RS_PreviewActionInterface }; public: - RS_ActionSelectIntersected(RS_EntityContainer & container, RS_GraphicView & graphicView, bool select); + RS_ActionSelectIntersected(RS_EntityContainer & container, GraphicView & graphicView, bool select); ~RS_ActionSelectIntersected(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionselectinvert.cpp b/src/actions/rs_actionselectinvert.cpp index 8451e14..b285426 100644 --- a/src/actions/rs_actionselectinvert.cpp +++ b/src/actions/rs_actionselectinvert.cpp @@ -18,7 +18,7 @@ #include "rs_selection.h" RS_ActionSelectInvert::RS_ActionSelectInvert(RS_EntityContainer & container, - RS_GraphicView & graphicView): RS_ActionInterface("Invert Selection", + GraphicView & graphicView): RS_ActionInterface("Invert Selection", container, graphicView) { } diff --git a/src/actions/rs_actionselectinvert.h b/src/actions/rs_actionselectinvert.h index 5a4a2bb..bcf7f82 100644 --- a/src/actions/rs_actionselectinvert.h +++ b/src/actions/rs_actionselectinvert.h @@ -11,7 +11,7 @@ class RS_ActionSelectInvert: public RS_ActionInterface { public: - RS_ActionSelectInvert(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionSelectInvert(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionSelectInvert(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionselectlayer.cpp b/src/actions/rs_actionselectlayer.cpp index 72306ec..788e403 100644 --- a/src/actions/rs_actionselectlayer.cpp +++ b/src/actions/rs_actionselectlayer.cpp @@ -17,7 +17,7 @@ #include "rs_dialogfactory.h" #include "rs_selection.h" -RS_ActionSelectLayer::RS_ActionSelectLayer(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionSelectLayer::RS_ActionSelectLayer(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Select Layers", container, graphicView) { en = NULL; diff --git a/src/actions/rs_actionselectlayer.h b/src/actions/rs_actionselectlayer.h index 6c6e714..743c997 100644 --- a/src/actions/rs_actionselectlayer.h +++ b/src/actions/rs_actionselectlayer.h @@ -13,7 +13,7 @@ class RS_Entity; class RS_ActionSelectLayer: public RS_ActionInterface { public: - RS_ActionSelectLayer(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionSelectLayer(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionSelectLayer(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionselectsingle.cpp b/src/actions/rs_actionselectsingle.cpp index 33792d3..28f966a 100644 --- a/src/actions/rs_actionselectsingle.cpp +++ b/src/actions/rs_actionselectsingle.cpp @@ -17,7 +17,7 @@ #include "rs_dialogfactory.h" #include "rs_selection.h" -RS_ActionSelectSingle::RS_ActionSelectSingle(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionSelectSingle::RS_ActionSelectSingle(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Select Entities", container, graphicView) { en = NULL; diff --git a/src/actions/rs_actionselectsingle.h b/src/actions/rs_actionselectsingle.h index 17e9547..bb003b6 100644 --- a/src/actions/rs_actionselectsingle.h +++ b/src/actions/rs_actionselectsingle.h @@ -13,7 +13,7 @@ class RS_Entity; class RS_ActionSelectSingle: public RS_ActionInterface { public: - RS_ActionSelectSingle(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionSelectSingle(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionSelectSingle(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionselectwindow.cpp b/src/actions/rs_actionselectwindow.cpp index 4441606..293ac98 100644 --- a/src/actions/rs_actionselectwindow.cpp +++ b/src/actions/rs_actionselectwindow.cpp @@ -24,7 +24,7 @@ * @param select true: select window. false: deselect window */ RS_ActionSelectWindow::RS_ActionSelectWindow(RS_EntityContainer & container, - RS_GraphicView & graphicView, bool select): + GraphicView & graphicView, bool select): RS_PreviewActionInterface("Select Window", container, graphicView) { this->select = select; diff --git a/src/actions/rs_actionselectwindow.h b/src/actions/rs_actionselectwindow.h index 856281d..62aafc7 100644 --- a/src/actions/rs_actionselectwindow.h +++ b/src/actions/rs_actionselectwindow.h @@ -21,7 +21,7 @@ class RS_ActionSelectWindow: public RS_PreviewActionInterface }; public: - RS_ActionSelectWindow(RS_EntityContainer & container, RS_GraphicView & graphicView, bool select); + RS_ActionSelectWindow(RS_EntityContainer & container, GraphicView & graphicView, bool select); ~RS_ActionSelectWindow(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionsetrelativezero.cpp b/src/actions/rs_actionsetrelativezero.cpp index 46d22a4..fc7484d 100644 --- a/src/actions/rs_actionsetrelativezero.cpp +++ b/src/actions/rs_actionsetrelativezero.cpp @@ -15,10 +15,10 @@ #include "rs_actionsetrelativezero.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" RS_ActionSetRelativeZero::RS_ActionSetRelativeZero(RS_EntityContainer & container, - RS_GraphicView & graphicView): RS_PreviewActionInterface("Set the relative Zero", + GraphicView & graphicView): RS_PreviewActionInterface("Set the relative Zero", container, graphicView) { } diff --git a/src/actions/rs_actionsetrelativezero.h b/src/actions/rs_actionsetrelativezero.h index d79978e..801df0f 100644 --- a/src/actions/rs_actionsetrelativezero.h +++ b/src/actions/rs_actionsetrelativezero.h @@ -14,7 +14,7 @@ class RS_ActionSetRelativeZero: public RS_PreviewActionInterface { public: - RS_ActionSetRelativeZero(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionSetRelativeZero(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionSetRelativeZero(); virtual RS2::ActionType rtti(); diff --git a/src/actions/rs_actionsetsnapmode.cpp b/src/actions/rs_actionsetsnapmode.cpp index 3819e44..49ddf88 100644 --- a/src/actions/rs_actionsetsnapmode.cpp +++ b/src/actions/rs_actionsetsnapmode.cpp @@ -14,14 +14,14 @@ #include "rs_actionsetsnapmode.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * Constructor. * * @param snapMode The new snap mode used from now on. */ -RS_ActionSetSnapMode::RS_ActionSetSnapMode(RS_EntityContainer & container, RS_GraphicView & graphicView, RS2::SnapMode snapMode): +RS_ActionSetSnapMode::RS_ActionSetSnapMode(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapMode snapMode): RS_ActionInterface("Set Snap Mode", container, graphicView) { this->snapMode = snapMode; diff --git a/src/actions/rs_actionsetsnapmode.h b/src/actions/rs_actionsetsnapmode.h index ebe0c2c..f9315b1 100644 --- a/src/actions/rs_actionsetsnapmode.h +++ b/src/actions/rs_actionsetsnapmode.h @@ -12,7 +12,7 @@ class RS_ActionSetSnapMode: public RS_ActionInterface { public: - RS_ActionSetSnapMode(RS_EntityContainer & container, RS_GraphicView & graphicView, RS2::SnapMode snapMode); + RS_ActionSetSnapMode(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapMode snapMode); ~RS_ActionSetSnapMode(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionsetsnaprestriction.cpp b/src/actions/rs_actionsetsnaprestriction.cpp index 8da558d..d4805d0 100644 --- a/src/actions/rs_actionsetsnaprestriction.cpp +++ b/src/actions/rs_actionsetsnaprestriction.cpp @@ -14,7 +14,7 @@ #include "rs_actionsetsnaprestriction.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * Constructor. @@ -23,7 +23,7 @@ * @param set true: set additional snap mode / false: unset */ RS_ActionSetSnapRestriction::RS_ActionSetSnapRestriction( - RS_EntityContainer & container, RS_GraphicView & graphicView, RS2::SnapRestriction snapRes): + RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapRestriction snapRes): RS_ActionInterface("Set Additional Snap Mode", container, graphicView) { this->snapRes = snapRes; diff --git a/src/actions/rs_actionsetsnaprestriction.h b/src/actions/rs_actionsetsnaprestriction.h index 4d3f67d..dc2a92e 100644 --- a/src/actions/rs_actionsetsnaprestriction.h +++ b/src/actions/rs_actionsetsnaprestriction.h @@ -12,7 +12,7 @@ class RS_ActionSetSnapRestriction: public RS_ActionInterface { public: - RS_ActionSetSnapRestriction(RS_EntityContainer & container, RS_GraphicView & graphicView, RS2::SnapRestriction snapRes); + RS_ActionSetSnapRestriction(RS_EntityContainer & container, GraphicView & graphicView, RS2::SnapRestriction snapRes); ~RS_ActionSetSnapRestriction(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionsnapintersectionmanual.cpp b/src/actions/rs_actionsnapintersectionmanual.cpp index 319e7ed..d10c830 100644 --- a/src/actions/rs_actionsnapintersectionmanual.cpp +++ b/src/actions/rs_actionsnapintersectionmanual.cpp @@ -15,7 +15,7 @@ #include "rs_actionsnapintersectionmanual.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_information.h" #include "rs_preview.h" @@ -23,7 +23,7 @@ * @param both Trim both entities. */ RS_ActionSnapIntersectionManual::RS_ActionSnapIntersectionManual( - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_PreviewActionInterface("Trim Entity", container, graphicView) { entity2 = NULL; diff --git a/src/actions/rs_actionsnapintersectionmanual.h b/src/actions/rs_actionsnapintersectionmanual.h index fca9b25..10e6b3f 100644 --- a/src/actions/rs_actionsnapintersectionmanual.h +++ b/src/actions/rs_actionsnapintersectionmanual.h @@ -23,7 +23,7 @@ class RS_ActionSnapIntersectionManual: public RS_PreviewActionInterface }; public: - RS_ActionSnapIntersectionManual(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionSnapIntersectionManual(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionSnapIntersectionManual(); virtual void init(int status = 0); diff --git a/src/actions/rs_actiontoolregeneratedimensions.cpp b/src/actions/rs_actiontoolregeneratedimensions.cpp index 2ad2048..04827e6 100644 --- a/src/actions/rs_actiontoolregeneratedimensions.cpp +++ b/src/actions/rs_actiontoolregeneratedimensions.cpp @@ -16,10 +16,10 @@ #include "rs_dialogfactory.h" #include "rs_dimension.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_information.h" -RS_ActionToolRegenerateDimensions::RS_ActionToolRegenerateDimensions(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionToolRegenerateDimensions::RS_ActionToolRegenerateDimensions(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Tool Regen Dim", container, graphicView) { } diff --git a/src/actions/rs_actiontoolregeneratedimensions.h b/src/actions/rs_actiontoolregeneratedimensions.h index 92dd955..905a855 100644 --- a/src/actions/rs_actiontoolregeneratedimensions.h +++ b/src/actions/rs_actiontoolregeneratedimensions.h @@ -11,7 +11,7 @@ class RS_ActionToolRegenerateDimensions: public RS_ActionInterface { public: - RS_ActionToolRegenerateDimensions(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionToolRegenerateDimensions(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionToolRegenerateDimensions(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionzoomauto.cpp b/src/actions/rs_actionzoomauto.cpp index 6d1942b..1d57827 100644 --- a/src/actions/rs_actionzoomauto.cpp +++ b/src/actions/rs_actionzoomauto.cpp @@ -14,7 +14,7 @@ #include "rs_actionzoomauto.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * Constructor. @@ -23,7 +23,7 @@ * false: adjust both x and y individually */ RS_ActionZoomAuto::RS_ActionZoomAuto(RS_EntityContainer & container, - RS_GraphicView & graphicView, bool keepAspectRatio): + GraphicView & graphicView, bool keepAspectRatio): RS_ActionInterface("Auto zoom", container, graphicView) { this->keepAspectRatio = keepAspectRatio; diff --git a/src/actions/rs_actionzoomauto.h b/src/actions/rs_actionzoomauto.h index 73d5437..2f7411a 100644 --- a/src/actions/rs_actionzoomauto.h +++ b/src/actions/rs_actionzoomauto.h @@ -11,7 +11,7 @@ class RS_ActionZoomAuto: public RS_ActionInterface { public: - RS_ActionZoomAuto(RS_EntityContainer & container, RS_GraphicView & graphicView, bool keepAspectRatio = true); + RS_ActionZoomAuto(RS_EntityContainer & container, GraphicView & graphicView, bool keepAspectRatio = true); ~RS_ActionZoomAuto(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionzoomautoy.cpp b/src/actions/rs_actionzoomautoy.cpp index 01868f6..1705ff6 100644 --- a/src/actions/rs_actionzoomautoy.cpp +++ b/src/actions/rs_actionzoomautoy.cpp @@ -14,9 +14,9 @@ #include "rs_actionzoomautoy.h" -#include "rs_graphicview.h" +#include "graphicview.h" -RS_ActionZoomAutoY::RS_ActionZoomAutoY(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionZoomAutoY::RS_ActionZoomAutoY(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Auto zoom Y", container, graphicView) { } diff --git a/src/actions/rs_actionzoomautoy.h b/src/actions/rs_actionzoomautoy.h index c0a32e3..7c85883 100644 --- a/src/actions/rs_actionzoomautoy.h +++ b/src/actions/rs_actionzoomautoy.h @@ -11,7 +11,7 @@ class RS_ActionZoomAutoY: public RS_ActionInterface { public: - RS_ActionZoomAutoY(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionZoomAutoY(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionZoomAutoY(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionzoomin.cpp b/src/actions/rs_actionzoomin.cpp index 56cb9ef..dd37159 100644 --- a/src/actions/rs_actionzoomin.cpp +++ b/src/actions/rs_actionzoomin.cpp @@ -14,7 +14,7 @@ #include "rs_actionzoomin.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * Default constructor. @@ -22,7 +22,7 @@ * @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, RS_GraphicView & graphicView, RS2::ZoomDirection direction, RS2::Axis axis, const Vector & center): +RS_ActionZoomIn::RS_ActionZoomIn(RS_EntityContainer & container, GraphicView & graphicView, RS2::ZoomDirection direction, RS2::Axis axis, const Vector & center): RS_ActionInterface("Zoom in", container, graphicView) { this->direction = direction; diff --git a/src/actions/rs_actionzoomin.h b/src/actions/rs_actionzoomin.h index 68abaeb..4dbd693 100644 --- a/src/actions/rs_actionzoomin.h +++ b/src/actions/rs_actionzoomin.h @@ -13,7 +13,7 @@ class RS_ActionZoomIn: public RS_ActionInterface { public: - RS_ActionZoomIn(RS_EntityContainer & container, RS_GraphicView & graphicView, RS2::ZoomDirection direction = RS2::In, RS2::Axis axis = RS2::Both, const Vector & center = Vector(false)); + 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); diff --git a/src/actions/rs_actionzoompan.cpp b/src/actions/rs_actionzoompan.cpp index ac46efb..2066442 100644 --- a/src/actions/rs_actionzoompan.cpp +++ b/src/actions/rs_actionzoompan.cpp @@ -14,9 +14,9 @@ #include "rs_actionzoompan.h" -#include "rs_graphicview.h" +#include "graphicview.h" -RS_ActionZoomPan::RS_ActionZoomPan(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionZoomPan::RS_ActionZoomPan(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Zoom Pan", container, graphicView) { } diff --git a/src/actions/rs_actionzoompan.h b/src/actions/rs_actionzoompan.h index d9019e9..a2cc839 100644 --- a/src/actions/rs_actionzoompan.h +++ b/src/actions/rs_actionzoompan.h @@ -11,7 +11,7 @@ class RS_ActionZoomPan: public RS_ActionInterface { public: - RS_ActionZoomPan(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionZoomPan(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionZoomPan(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionzoomprevious.cpp b/src/actions/rs_actionzoomprevious.cpp index 3b6ee3b..eb0642b 100644 --- a/src/actions/rs_actionzoomprevious.cpp +++ b/src/actions/rs_actionzoomprevious.cpp @@ -14,12 +14,12 @@ #include "rs_actionzoomprevious.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * Constructor. */ -RS_ActionZoomPrevious::RS_ActionZoomPrevious(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionZoomPrevious::RS_ActionZoomPrevious(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Previous zoom", container, graphicView) { } diff --git a/src/actions/rs_actionzoomprevious.h b/src/actions/rs_actionzoomprevious.h index bc6b8ce..ef82c90 100644 --- a/src/actions/rs_actionzoomprevious.h +++ b/src/actions/rs_actionzoomprevious.h @@ -11,7 +11,7 @@ class RS_ActionZoomPrevious: public RS_ActionInterface { public: - RS_ActionZoomPrevious(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionZoomPrevious(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionZoomPrevious(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionzoomredraw.cpp b/src/actions/rs_actionzoomredraw.cpp index f884539..3cd34d3 100644 --- a/src/actions/rs_actionzoomredraw.cpp +++ b/src/actions/rs_actionzoomredraw.cpp @@ -14,7 +14,7 @@ #include "rs_actionzoomredraw.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * Constructor. @@ -22,7 +22,7 @@ * @param keepAspectRatio true: keep same zoom value for x/y. * false: adjust both x and y individually */ -RS_ActionZoomRedraw::RS_ActionZoomRedraw(RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionZoomRedraw::RS_ActionZoomRedraw(RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Redraw", container, graphicView) { } diff --git a/src/actions/rs_actionzoomredraw.h b/src/actions/rs_actionzoomredraw.h index 712c900..33b8c01 100644 --- a/src/actions/rs_actionzoomredraw.h +++ b/src/actions/rs_actionzoomredraw.h @@ -11,7 +11,7 @@ class RS_ActionZoomRedraw: public RS_ActionInterface { public: - RS_ActionZoomRedraw(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionZoomRedraw(RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionZoomRedraw(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionzoomscroll.cpp b/src/actions/rs_actionzoomscroll.cpp index 621e916..50779c4 100644 --- a/src/actions/rs_actionzoomscroll.cpp +++ b/src/actions/rs_actionzoomscroll.cpp @@ -14,9 +14,9 @@ #include "rs_actionzoomscroll.h" -#include "rs_graphicview.h" +#include "graphicview.h" -RS_ActionZoomScroll::RS_ActionZoomScroll(RS2::Direction direction, RS_EntityContainer & container, RS_GraphicView & graphicView): +RS_ActionZoomScroll::RS_ActionZoomScroll(RS2::Direction direction, RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface("Zoom scroll", container, graphicView) { this->direction = direction; diff --git a/src/actions/rs_actionzoomscroll.h b/src/actions/rs_actionzoomscroll.h index f461d5f..2832bc9 100644 --- a/src/actions/rs_actionzoomscroll.h +++ b/src/actions/rs_actionzoomscroll.h @@ -11,7 +11,7 @@ class RS_ActionZoomScroll: public RS_ActionInterface { public: - RS_ActionZoomScroll(RS2::Direction direction, RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_ActionZoomScroll(RS2::Direction direction, RS_EntityContainer & container, GraphicView & graphicView); ~RS_ActionZoomScroll(); virtual void init(int status = 0); diff --git a/src/actions/rs_actionzoomwindow.cpp b/src/actions/rs_actionzoomwindow.cpp index 4f370eb..1c53bbb 100644 --- a/src/actions/rs_actionzoomwindow.cpp +++ b/src/actions/rs_actionzoomwindow.cpp @@ -15,7 +15,7 @@ #include "rs_actionzoomwindow.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" /** @@ -26,7 +26,7 @@ * area will be fit to the viewport. */ RS_ActionZoomWindow::RS_ActionZoomWindow(RS_EntityContainer & container, - RS_GraphicView & graphicView, bool keepAspectRatio): + GraphicView & graphicView, bool keepAspectRatio): RS_PreviewActionInterface("Zoom Window", container, graphicView) { this->keepAspectRatio = keepAspectRatio; diff --git a/src/actions/rs_actionzoomwindow.h b/src/actions/rs_actionzoomwindow.h index aca5cd6..f1f8165 100644 --- a/src/actions/rs_actionzoomwindow.h +++ b/src/actions/rs_actionzoomwindow.h @@ -12,7 +12,7 @@ class RS_ActionZoomWindow: public RS_PreviewActionInterface { public: - RS_ActionZoomWindow(RS_EntityContainer & container, RS_GraphicView & graphicView, bool keepAspectRatio = true); + RS_ActionZoomWindow(RS_EntityContainer & container, GraphicView & graphicView, bool keepAspectRatio = true); ~RS_ActionZoomWindow(); virtual void init(int status = 0); diff --git a/src/base/rs_actioninterface.cpp b/src/base/rs_actioninterface.cpp index 9557d31..7a885f8 100644 --- a/src/base/rs_actioninterface.cpp +++ b/src/base/rs_actioninterface.cpp @@ -17,7 +17,7 @@ #include "commands.h" #include "rs_debug.h" #include "rs_entitycontainer.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * Constructor. @@ -36,7 +36,7 @@ * be reset to the one given here. */ RS_ActionInterface::RS_ActionInterface(const char * name, - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_Snapper(container, graphicView) { RS_DEBUG->print("RS_ActionInterface::RS_ActionInterface: Setting up action: \"%s\"", name); diff --git a/src/base/rs_actioninterface.h b/src/base/rs_actioninterface.h index 8b16095..c2daeb1 100644 --- a/src/base/rs_actioninterface.h +++ b/src/base/rs_actioninterface.h @@ -8,7 +8,7 @@ class RS_CommandEvent; class RS_Document; class Drawing; class RS_EntityContainer; -class RS_GraphicView; +class GraphicView; class Vector; /** @@ -25,9 +25,10 @@ class RS_ActionInterface: public QObject, public RS_Snapper //huh? no slots/signals here... Q_OBJECT //WHY derive from QObject??? //for the TR macro??? +//mebbe... public: RS_ActionInterface(const char * name, RS_EntityContainer & container, - RS_GraphicView & graphicView); + GraphicView & graphicView); virtual ~RS_ActionInterface(); virtual RS2::ActionType rtti(); @@ -38,7 +39,6 @@ class RS_ActionInterface: public QObject, public RS_Snapper virtual void mouseReleaseEvent(QMouseEvent *); virtual void keyPressEvent(QKeyEvent * e); virtual void keyReleaseEvent(QKeyEvent * e); -// virtual void coordinateEvent(RS_CoordinateEvent *); virtual void coordinateEvent(Vector *); virtual void commandEvent(RS_CommandEvent *); virtual QStringList getAvailableCommands(); diff --git a/src/base/rs_arc.cpp b/src/base/rs_arc.cpp index 89a91e5..f9bb52c 100644 --- a/src/base/rs_arc.cpp +++ b/src/base/rs_arc.cpp @@ -10,6 +10,7 @@ // Who When What // --- ---------- ----------------------------------------------------------- // JLH 05/28/2010 Added this text. :-) +// JLH 06/16/2010 Moved implementation from header file to this file // #include "rs_arc.h" @@ -18,20 +19,158 @@ #include "rs_linetypepattern.h" #include "rs_information.h" #include "rs_math.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "paintintf.h" /** * Default constructor. */ -RS_Arc::RS_Arc(RS_EntityContainer* parent, - const RS_ArcData& d) - : RS_AtomicEntity(parent), data(d) { - calculateEndpoints(); - calculateBorders(); +RS_Arc::RS_Arc(RS_EntityContainer * parent, const RS_ArcData & d): + RS_AtomicEntity(parent), data(d) +{ + calculateEndpoints(); + calculateBorders(); +} + +/*virtual*/ RS_Arc::~RS_Arc() +{ +} + +/*virtual*/ RS_Entity * RS_Arc::clone() +{ + RS_Arc * a = new RS_Arc(*this); + a->initId(); + return a; +} + +/** @return RS2::EntityArc */ +/*virtual*/ RS2::EntityType RS_Arc::rtti() const +{ + return RS2::EntityArc; +} + +/** @return true */ +/*virtual*/ bool RS_Arc::isEdge() const +{ + return true; +} + +/** @return Copy of data that defines the arc. **/ +RS_ArcData RS_Arc::getData() const +{ + return data; +} + +/*virtual*/ VectorSolutions RS_Arc::getRefPoints() +{ + VectorSolutions ret(startpoint, endpoint, data.center); + return ret; +} + +/** Sets new arc parameters. **/ +void RS_Arc::setData(RS_ArcData d) +{ + data = d; +} + +/** @return The center point (x) of this arc */ +Vector RS_Arc::getCenter() const +{ + return data.center; +} + +/** Sets new center. */ +void RS_Arc::setCenter(const Vector & c) +{ + data.center = c; +} + +/** @return The radius of this arc */ +double RS_Arc::getRadius() const +{ + return data.radius; +} + +/** Sets new radius. */ +void RS_Arc::setRadius(double r) +{ + data.radius = r; +} + +/** @return The start angle of this arc */ +double RS_Arc::getAngle1() const +{ + return data.angle1; +} + +/** Sets new start angle. */ +void RS_Arc::setAngle1(double a1) +{ + data.angle1 = a1; +} + +/** @return The end angle of this arc */ +double RS_Arc::getAngle2() const +{ + return data.angle2; +} + +/** Sets new end angle. */ +void RS_Arc::setAngle2(double a2) +{ + data.angle2 = a2; } +/** + * @return Direction 1. The angle at which the arc starts at + * the startpoint. + */ +double RS_Arc::getDirection1() const +{ + if (!data.reversed) + return RS_Math::correctAngle(data.angle1 + M_PI / 2.0); + + return RS_Math::correctAngle(data.angle1 - M_PI / 2.0); +} + +/** + * @return Direction 2. The angle at which the arc starts at + * the endpoint. + */ +double RS_Arc::getDirection2() const +{ + if (!data.reversed) + return RS_Math::correctAngle(data.angle2 - M_PI / 2.0); + + return RS_Math::correctAngle(data.angle2 + M_PI / 2.0); +} + +/** + * @retval true if the arc is reversed (clockwise), + * @retval false otherwise + */ +bool RS_Arc::isReversed() const +{ + return data.reversed; +} + +/** sets the reversed status. */ +void RS_Arc::setReversed(bool r) +{ + data.reversed = r; +} + +/** @return Start point of the entity. */ +/*virtual*/ Vector RS_Arc::getStartpoint() const +{ + return startpoint; +} +/** @return End point of the entity. */ +/*virtual*/ Vector RS_Arc::getEndpoint() const +{ + return endpoint; +} /** * Creates this arc from 3 given points which define the arc line. @@ -40,59 +179,62 @@ RS_Arc::RS_Arc(RS_EntityContainer* parent, * @param p2 2nd point. * @param p3 3rd point. */ -bool RS_Arc::createFrom3P(const Vector& p1, const Vector& p2, - const Vector& p3) { - if (p1.distanceTo(p2)>RS_TOLERANCE && - p2.distanceTo(p3)>RS_TOLERANCE && - p3.distanceTo(p1)>RS_TOLERANCE) { - - // middle points between 3 points: - Vector mp1, mp2; - Vector dir1, dir2; - double a1, a2; - - // intersection of two middle lines - mp1 = (p1 + p2)/2.0; - a1 = p1.angleTo(p2) + M_PI/2.0; - dir1.setPolar(100.0, a1); - mp2 = (p2 + p3)/2.0; - a2 = p2.angleTo(p3) + M_PI/2.0; - dir2.setPolar(100.0, a2); - - RS_ConstructionLineData d1(mp1, mp1 + dir1); - RS_ConstructionLineData d2(mp2, mp2 + dir2); - RS_ConstructionLine midLine1(NULL, d1); - RS_ConstructionLine midLine2(NULL, d2); - - VectorSolutions sol = - RS_Information::getIntersection(&midLine1, &midLine2); - - data.center = sol.get(0); - data.radius = data.center.distanceTo(p3); - data.angle1 = data.center.angleTo(p1); - data.angle2 = data.center.angleTo(p3); - data.reversed = RS_Math::isAngleBetween(data.center.angleTo(p2), - data.angle1, data.angle2, true); - - if (sol.get(0).valid && data.radius<1.0e14 && - data.radius>RS_TOLERANCE) { - calculateEndpoints(); - calculateBorders(); - return true; - } else { - RS_DEBUG->print("RS_Arc::createFrom3P(): " - "Cannot create an arc with inf radius."); - return false; - } - } else { - RS_DEBUG->print("RS_Arc::createFrom3P(): " - "Cannot create an arc with radius 0.0."); - return false; - } +bool RS_Arc::createFrom3P(const Vector & p1, const Vector & p2, const Vector & p3) +{ + if (p1.distanceTo(p2) > RS_TOLERANCE + && p2.distanceTo(p3) > RS_TOLERANCE + && p3.distanceTo(p1) > RS_TOLERANCE) + { + // middle points between 3 points: + Vector mp1, mp2; + Vector dir1, dir2; + double a1, a2; + + // intersection of two middle lines + mp1 = (p1 + p2) / 2.0; + a1 = p1.angleTo(p2) + M_PI / 2.0; + dir1.setPolar(100.0, a1); + mp2 = (p2 + p3) / 2.0; + a2 = p2.angleTo(p3) + M_PI / 2.0; + dir2.setPolar(100.0, a2); + + RS_ConstructionLineData d1(mp1, mp1 + dir1); + RS_ConstructionLineData d2(mp2, mp2 + dir2); + RS_ConstructionLine midLine1(NULL, d1); + RS_ConstructionLine midLine2(NULL, d2); + + VectorSolutions sol = + RS_Information::getIntersection(&midLine1, &midLine2); + + data.center = sol.get(0); + data.radius = data.center.distanceTo(p3); + data.angle1 = data.center.angleTo(p1); + data.angle2 = data.center.angleTo(p3); + data.reversed = RS_Math::isAngleBetween(data.center.angleTo(p2), + data.angle1, data.angle2, true); + + if (sol.get(0).valid && data.radius < 1.0e14 + && data.radius > RS_TOLERANCE) + { + calculateEndpoints(); + calculateBorders(); + return true; + } + else + { + RS_DEBUG->print("RS_Arc::createFrom3P(): " + "Cannot create an arc with inf radius."); + return false; + } + } + else + { + RS_DEBUG->print("RS_Arc::createFrom3P(): " + "Cannot create an arc with radius 0.0."); + return false; + } } - - /** * Creates an arc from its startpoint, endpoint, start direction (angle) * and radius. @@ -100,693 +242,643 @@ bool RS_Arc::createFrom3P(const Vector& p1, const Vector& p2, * @retval true Successfully created arc * @retval false Cannot creats arc (radius to small or endpoint to far away) */ -bool RS_Arc::createFrom2PDirectionRadius(const Vector& startPoint, - const Vector& endPoint, - double direction1, double radius) { +bool RS_Arc::createFrom2PDirectionRadius(const Vector & startPoint, const Vector & endPoint, double direction1, double radius) +{ + Vector ortho; + ortho.setPolar(radius, direction1 + M_PI / 2.0); + Vector center1 = startPoint + ortho; + Vector center2 = startPoint - ortho; - Vector ortho; - ortho.setPolar(radius, direction1 + M_PI/2.0); - Vector center1 = startPoint + ortho; - Vector center2 = startPoint - ortho; + if (center1.distanceTo(endPoint) < center2.distanceTo(endPoint)) + data.center = center1; + else + data.center = center2; - if (center1.distanceTo(endPoint) < center2.distanceTo(endPoint)) { - data.center = center1; - } else { - data.center = center2; - } + data.radius = radius; + data.angle1 = data.center.angleTo(startPoint); + data.angle2 = data.center.angleTo(endPoint); + data.reversed = false; - data.radius = radius; - data.angle1 = data.center.angleTo(startPoint); - data.angle2 = data.center.angleTo(endPoint); - data.reversed = false; + double diff = RS_Math::correctAngle(getDirection1() - direction1); - double diff = RS_Math::correctAngle(getDirection1()-direction1); - if (fabs(diff-M_PI)<1.0e-1) { - data.reversed = true; - } + if (fabs(diff - M_PI) < 1.0e-1) + data.reversed = true; - calculateEndpoints(); - calculateBorders(); + calculateEndpoints(); + calculateBorders(); - return true; + return true; } - - /** * Creates an arc from its startpoint, endpoint and bulge. */ -bool RS_Arc::createFrom2PBulge(const Vector& startPoint, const Vector& endPoint, - double bulge) { - data.reversed = (bulge<0.0); - double alpha = atan(bulge)*4.0; +bool RS_Arc::createFrom2PBulge(const Vector & startPoint, const Vector & endPoint, double bulge) +{ + data.reversed = (bulge < 0.0); + double alpha = atan(bulge) * 4.0; - Vector middle = (startPoint+endPoint)/2.0; - double dist = startPoint.distanceTo(endPoint)/2.0; + Vector middle = (startPoint + endPoint) / 2.0; + double dist = startPoint.distanceTo(endPoint) / 2.0; - // alpha can't be 0.0 at this point - data.radius = fabs(dist / sin(alpha/2.0)); + // alpha can't be 0.0 at this point + data.radius = fabs(dist / sin(alpha / 2.0)); - double wu = fabs(RS_Math::pow(data.radius, 2.0) - RS_Math::pow(dist, 2.0)); - double h = sqrt(wu); - double angle = startPoint.angleTo(endPoint); + double wu = fabs(RS_Math::pow(data.radius, 2.0) - RS_Math::pow(dist, 2.0)); + double h = sqrt(wu); + double angle = startPoint.angleTo(endPoint); - if (bulge>0.0) { - angle+=M_PI/2.0; - } else { - angle-=M_PI/2.0; - } + if (bulge > 0.0) + angle += M_PI / 2.0; + else + angle -= M_PI / 2.0; - if (fabs(alpha)>M_PI) { - h*=-1.0; - } + if (fabs(alpha) > M_PI) + h *= -1.0; - data.center.setPolar(h, angle); - data.center+=middle; - data.angle1 = data.center.angleTo(startPoint); - data.angle2 = data.center.angleTo(endPoint); + data.center.setPolar(h, angle); + data.center += middle; + data.angle1 = data.center.angleTo(startPoint); + data.angle2 = data.center.angleTo(endPoint); - calculateEndpoints(); - calculateBorders(); + calculateEndpoints(); + calculateBorders(); return true; } - - /** * Recalculates the endpoints using the angles and the radius. */ -void RS_Arc::calculateEndpoints() { - startpoint.set(data.center.x + cos(data.angle1) * data.radius, - data.center.y + sin(data.angle1) * data.radius); - endpoint.set(data.center.x + cos(data.angle2) * data.radius, - data.center.y + sin(data.angle2) * data.radius); +void RS_Arc::calculateEndpoints() +{ + startpoint.set(data.center.x + cos(data.angle1) * data.radius, + data.center.y + sin(data.angle1) * data.radius); + endpoint.set(data.center.x + cos(data.angle2) * data.radius, + data.center.y + sin(data.angle2) * data.radius); } +void RS_Arc::calculateBorders() +{ + double minX = std::min(startpoint.x, endpoint.x); + double minY = std::min(startpoint.y, endpoint.y); + double maxX = std::max(startpoint.x, endpoint.x); + double maxY = std::max(startpoint.y, endpoint.y); -void RS_Arc::calculateBorders() { - double minX = std::min(startpoint.x, endpoint.x); - double minY = std::min(startpoint.y, endpoint.y); - double maxX = std::max(startpoint.x, endpoint.x); - double maxY = std::max(startpoint.y, endpoint.y); - - double a1 = !isReversed() ? data.angle1 : data.angle2; - double a2 = !isReversed() ? data.angle2 : data.angle1; - - // check for left limit: - if ((a1M_PI) || - (a1>a2-1.0e-12 && a2>M_PI) || - (a1>a2-1.0e-12 && a1 a2-1.0e-12) { - maxX = std::max(data.center.x + data.radius, maxX); - } + double a1 = !isReversed() ? data.angle1 : data.angle2; + double a2 = !isReversed() ? data.angle2 : data.angle1; - // check for bottom limit: - if ((a1<(M_PI_2*3) && a2>(M_PI_2*3)) || - (a1>a2-1.0e-12 && a2>(M_PI_2*3)) || - (a1>a2-1.0e-12 && a1<(M_PI_2*3)) ) { + // check for left limit: + if ((a1 < M_PI && a2 > M_PI) + || (a1 > a2 - 1.0e-12 && a2 > M_PI) + || (a1 > a2 - 1.0e-12 && a1 < M_PI) ) - minY = std::min(data.center.y - data.radius, minY); - } + minX = std::min(data.center.x - data.radius, minX); - // check for top limit: - if ((a1M_PI_2) || - (a1>a2-1.0e-12 && a2>M_PI_2) || - (a1>a2-1.0e-12 && a1 a2 - 1.0e-12) + maxX = std::max(data.center.x + data.radius, maxX); - maxY = std::max(data.center.y + data.radius, maxY); - } + // check for bottom limit: + if ((a1 < (M_PI_2 * 3) && a2 > (M_PI_2 * 3)) + || (a1 > a2 - 1.0e-12 && a2 > (M_PI_2 * 3)) + || (a1 > a2 - 1.0e-12 && a1 < (M_PI_2 * 3)) ) - minV.set(minX, minY); - maxV.set(maxX, maxY); -} + minY = std::min(data.center.y - data.radius, minY); + // check for top limit: + if ((a1 < M_PI_2 && a2 > M_PI_2) + || (a1 > a2 - 1.0e-12 && a2 > M_PI_2) + || (a1 > a2 - 1.0e-12 && a1 < M_PI_2) ) + maxY = std::max(data.center.y + data.radius, maxY); -VectorSolutions RS_Arc::getRefPoints() { - VectorSolutions ret(startpoint, endpoint, data.center); - return ret; + minV.set(minX, minY); + maxV.set(maxX, maxY); } +Vector RS_Arc::getNearestEndpoint(const Vector & coord, double * dist) +{ + double dist1, dist2; + Vector * nearerPoint; -Vector RS_Arc::getNearestEndpoint(const Vector& coord, double* dist) { - double dist1, dist2; - Vector* nearerPoint; - - dist1 = startpoint.distanceTo(coord); - dist2 = endpoint.distanceTo(coord); + dist1 = startpoint.distanceTo(coord); + dist2 = endpoint.distanceTo(coord); - if (dist2rtti()==RS2::EntityPolyline) { - double bulge = getBulge(); - createFrom2PBulge(pos, getEndpoint(), bulge); - //} +void RS_Arc::moveStartpoint(const Vector & pos) +{ + // polyline arcs: move point not angle: + //if (parent!=NULL && parent->rtti()==RS2::EntityPolyline) { + double bulge = getBulge(); + createFrom2PBulge(pos, getEndpoint(), bulge); + //} // normal arc: move angle1 /*else { - data.angle1 = data.center.angleTo(pos); - calculateEndpoints(); - calculateBorders(); - }*/ + data.angle1 = data.center.angleTo(pos); + calculateEndpoints(); + calculateBorders(); + }*/ } - - -void RS_Arc::moveEndpoint(const Vector& pos) { - // polyline arcs: move point not angle: - //if (parent!=NULL && parent->rtti()==RS2::EntityPolyline) { - double bulge = getBulge(); - createFrom2PBulge(getStartpoint(), pos, bulge); - //} +void RS_Arc::moveEndpoint(const Vector & pos) +{ + // polyline arcs: move point not angle: + //if (parent!=NULL && parent->rtti()==RS2::EntityPolyline) { + double bulge = getBulge(); + createFrom2PBulge(getStartpoint(), pos, bulge); + //} // normal arc: move angle1 /*else { - data.angle2 = data.center.angleTo(pos); + data.angle2 = data.center.angleTo(pos); calculateEndpoints(); - calculateBorders(); - }*/ + calculateBorders(); + }*/ } - - -void RS_Arc::trimStartpoint(const Vector& pos) { - data.angle1 = data.center.angleTo(pos); - calculateEndpoints(); - calculateBorders(); +void RS_Arc::trimStartpoint(const Vector & pos) +{ + data.angle1 = data.center.angleTo(pos); + calculateEndpoints(); + calculateBorders(); } - - -void RS_Arc::trimEndpoint(const Vector& pos) { - data.angle2 = data.center.angleTo(pos); - calculateEndpoints(); - calculateBorders(); +void RS_Arc::trimEndpoint(const Vector & pos) +{ + data.angle2 = data.center.angleTo(pos); + calculateEndpoints(); + calculateBorders(); } - -RS2::Ending RS_Arc::getTrimPoint(const Vector& coord, - const Vector& trimPoint) { - - double angEl = data.center.angleTo(trimPoint); - double angM = data.center.angleTo(coord); - - if (RS_Math::getAngleDifference(angM, angEl)>M_PI) { - if (data.reversed) { - return RS2::EndingEnd; - } else { - return RS2::EndingStart; - } - } else { - if (data.reversed) { - return RS2::EndingStart; - } else { - return RS2::EndingEnd; - } - } +RS2::Ending RS_Arc::getTrimPoint(const Vector & coord, const Vector & trimPoint) +{ + double angEl = data.center.angleTo(trimPoint); + double angM = data.center.angleTo(coord); + + if (RS_Math::getAngleDifference(angM, angEl) > M_PI) + { + if (data.reversed) + return RS2::EndingEnd; + else + return RS2::EndingStart; + } + else + { + if (data.reversed) + return RS2::EndingStart; + else + return RS2::EndingEnd; + } } - -void RS_Arc::reverse() { - double a = data.angle1; - data.angle1 = data.angle2; - data.angle2 = a; - data.reversed = !data.reversed; - calculateEndpoints(); - calculateBorders(); +void RS_Arc::reverse() +{ + double a = data.angle1; + data.angle1 = data.angle2; + data.angle2 = a; + data.reversed = !data.reversed; + calculateEndpoints(); + calculateBorders(); } - -void RS_Arc::move(Vector offset) { - data.center.move(offset); - calculateEndpoints(); - calculateBorders(); +void RS_Arc::move(Vector offset) +{ + data.center.move(offset); + calculateEndpoints(); + calculateBorders(); } - - -void RS_Arc::rotate(Vector center, double angle) { - RS_DEBUG->print("RS_Arc::rotate"); - data.center.rotate(center, angle); - data.angle1 = RS_Math::correctAngle(data.angle1+angle); - data.angle2 = RS_Math::correctAngle(data.angle2+angle); - calculateEndpoints(); - calculateBorders(); - RS_DEBUG->print("RS_Arc::rotate: OK"); +void RS_Arc::rotate(Vector center, double angle) +{ + RS_DEBUG->print("RS_Arc::rotate"); + data.center.rotate(center, angle); + data.angle1 = RS_Math::correctAngle(data.angle1 + angle); + data.angle2 = RS_Math::correctAngle(data.angle2 + angle); + calculateEndpoints(); + calculateBorders(); + RS_DEBUG->print("RS_Arc::rotate: OK"); } +void RS_Arc::scale(Vector center, Vector factor) +{ + // negative scaling: mirroring + if (factor.x < 0.0) + mirror(data.center, data.center + Vector(0.0, 1.0)); + //factor.x*=-1; -void RS_Arc::scale(Vector center, Vector factor) { - // negative scaling: mirroring - if (factor.x<0.0) { - mirror(data.center, data.center + Vector(0.0, 1.0)); - //factor.x*=-1; - } - if (factor.y<0.0) { - mirror(data.center, data.center + Vector(1.0, 0.0)); - //factor.y*=-1; - } - - data.center.scale(center, factor); - data.radius *= factor.x; - if (data.radius<0.0) { - data.radius*=-1.0; - } - calculateEndpoints(); - calculateBorders(); -} + if (factor.y < 0.0) + mirror(data.center, data.center + Vector(1.0, 0.0)); + //factor.y*=-1; + data.center.scale(center, factor); + data.radius *= factor.x; + if (data.radius < 0.0) + data.radius *= -1.0; + calculateEndpoints(); + calculateBorders(); +} -void RS_Arc::mirror(Vector axisPoint1, Vector axisPoint2) { - data.center.mirror(axisPoint1, axisPoint2); - data.reversed = (!data.reversed); - /* - startpoint.mirror(axisPoint1, axisPoint2); - endpoint.mirror(axisPoint1, axisPoint2); +void RS_Arc::mirror(Vector axisPoint1, Vector axisPoint2) +{ + data.center.mirror(axisPoint1, axisPoint2); + data.reversed = (!data.reversed); + /* + startpoint.mirror(axisPoint1, axisPoint2); + endpoint.mirror(axisPoint1, axisPoint2); - data.angle1 = data.center.angleTo(startpoint); - data.angle2 = data.center.angleTo(endpoint); - */ + data.angle1 = data.center.angleTo(startpoint); + data.angle2 = data.center.angleTo(endpoint); + */ - Vector vec; - vec.setPolar(1.0, data.angle1); - vec.mirror(Vector(0.0,0.0), axisPoint2-axisPoint1); - data.angle1 = vec.angle(); + Vector vec; + vec.setPolar(1.0, data.angle1); + vec.mirror(Vector(0.0, 0.0), axisPoint2 - axisPoint1); + data.angle1 = vec.angle(); - vec.setPolar(1.0, data.angle2); - vec.mirror(Vector(0.0,0.0), axisPoint2-axisPoint1); - data.angle2 = vec.angle(); + vec.setPolar(1.0, data.angle2); + vec.mirror(Vector(0.0, 0.0), axisPoint2 - axisPoint1); + data.angle2 = vec.angle(); - calculateEndpoints(); - calculateBorders(); + calculateEndpoints(); + calculateBorders(); } +void RS_Arc::moveRef(const Vector & ref, const Vector & offset) +{ + if (ref.distanceTo(startpoint) < 1.0e-4) + moveStartpoint(startpoint + offset); -void RS_Arc::moveRef(const Vector& ref, const Vector& offset) { - if (ref.distanceTo(startpoint)<1.0e-4) { - moveStartpoint(startpoint+offset); - } - if (ref.distanceTo(endpoint)<1.0e-4) { - moveEndpoint(endpoint+offset); - } + if (ref.distanceTo(endpoint) < 1.0e-4) + moveEndpoint(endpoint + offset); } +void RS_Arc::stretch(Vector firstCorner, Vector secondCorner, Vector offset) +{ + if (getMin().isInWindow(firstCorner, secondCorner) + && getMax().isInWindow(firstCorner, secondCorner)) + move(offset); + else + { + if (getStartpoint().isInWindow(firstCorner, + secondCorner)) + moveStartpoint(getStartpoint() + offset); -void RS_Arc::stretch(Vector firstCorner, - Vector secondCorner, - Vector offset) { - - if (getMin().isInWindow(firstCorner, secondCorner) && - getMax().isInWindow(firstCorner, secondCorner)) { - move(offset); - } - else { - if (getStartpoint().isInWindow(firstCorner, - secondCorner)) { - moveStartpoint(getStartpoint() + offset); - } - if (getEndpoint().isInWindow(firstCorner, - secondCorner)) { - moveEndpoint(getEndpoint() + offset); - } + if (getEndpoint().isInWindow(firstCorner, + secondCorner)) + moveEndpoint(getEndpoint() + offset); } } -//void RS_Arc::draw(RS_Painter* painter, RS_GraphicView* view, -void RS_Arc::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/) +void RS_Arc::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/) { - if (painter == NULL || view == NULL) - return; + if (painter == NULL || view == NULL) + return; + + //double styleFactor = getStyleFactor(); + + // simple style-less lines + if (getPen().getLineType() == RS2::SolidLine + || isSelected() + || view->getDrawingMode() == RS2::ModePreview) + + painter->drawArc(view->toGui(getCenter()), + getRadius() * view->getFactor().x, + getAngle1(), getAngle2(), + isReversed()); + else + { + double styleFactor = getStyleFactor(view); + + if (styleFactor < 0.0) + { + painter->drawArc(view->toGui(getCenter()), + getRadius() * view->getFactor().x, + getAngle1(), getAngle2(), + isReversed()); + return; + } - //double styleFactor = getStyleFactor(); + // Pattern: + RS_LineTypePattern * pat; - // simple style-less lines - if (getPen().getLineType()==RS2::SolidLine || - isSelected() || - view->getDrawingMode()==RS2::ModePreview) { + if (isSelected()) + pat = &patternSelected; + else + pat = view->getPattern(getPen().getLineType()); - painter->drawArc(view->toGui(getCenter()), - getRadius() * view->getFactor().x, - getAngle1(), getAngle2(), - isReversed()); - } else { - double styleFactor = getStyleFactor(view); - if (styleFactor<0.0) { - painter->drawArc(view->toGui(getCenter()), - getRadius() * view->getFactor().x, - getAngle1(), getAngle2(), - isReversed()); + if (pat == NULL) return; - } - // Pattern: - RS_LineTypePattern* pat; - if (isSelected()) { - pat = &patternSelected; - } else { - pat = view->getPattern(getPen().getLineType()); - } - - if (pat==NULL) { - return; - } - - if (getRadius()<1.0e-6) { - return; - } - - // Pen to draw pattern is always solid: - RS_Pen pen = painter->getPen(); - pen.setLineType(RS2::SolidLine); - painter->setPen(pen); - - double a1; - double a2; - if (data.reversed) { - a2 = getAngle1(); - a1 = getAngle2(); - } else { - a1 = getAngle1(); - a2 = getAngle2(); - } - - double* da; // array of distances in x. - int i; // index counter - - double length = getAngleLength(); - - // create scaled pattern: - da = new double[pat->num]; - - for (i=0; inum; ++i) { - da[i] = fabs(pat->pattern[i] * styleFactor) / getRadius(); - } - - double tot=0.0; - i=0; - bool done = false; - double curA = a1; - //double cx = getCenter().x * factor.x + offsetX; - //double cy = - a->getCenter().y * factor.y + getHeight() - offsetY; - Vector cp = view->toGui(getCenter()); - double r = getRadius() * view->getFactor().x; - - do { - if (pat->pattern[i] > 0.0) { - if (tot+da[i]drawArc(cp, r, - curA, - curA + da[i], - false); - } else { - painter->drawArc(cp, r, - curA, - a2, - false); - } - } - curA+=da[i]; - tot+=da[i]; - done=tot>length; - - i++; - if (i>=pat->num) { - i=0; - } - } while(!done); - - delete[] da; - } -} + if (getRadius() < 1.0e-6) + return; + // Pen to draw pattern is always solid: + RS_Pen pen = painter->getPen(); + pen.setLineType(RS2::SolidLine); + painter->setPen(pen); + double a1; + double a2; + + if (data.reversed) + { + a2 = getAngle1(); + a1 = getAngle2(); + } + else + { + a1 = getAngle1(); + a2 = getAngle2(); + } + + double * da; // array of distances in x. + int i; // index counter + + double length = getAngleLength(); + + // create scaled pattern: + da = new double[pat->num]; + + for (i = 0; i < pat->num; ++i) + da[i] = fabs(pat->pattern[i] * styleFactor) / getRadius(); + + double tot = 0.0; + i = 0; + bool done = false; + double curA = a1; + //double cx = getCenter().x * factor.x + offsetX; + //double cy = - a->getCenter().y * factor.y + getHeight() - offsetY; + Vector cp = view->toGui(getCenter()); + double r = getRadius() * view->getFactor().x; + + do + { + if (pat->pattern[i] > 0.0) + { + if (tot + da[i] < length) + painter->drawArc(cp, r, + curA, + curA + da[i], + false); + else + painter->drawArc(cp, r, + curA, + a2, + false); + } + curA += da[i]; + tot += da[i]; + done = tot > length; + + i++; + + if (i >= pat->num) + i = 0; + } + while (!done); + + delete[] da; + } +} /** * @return Middle point of the entity. */ -Vector RS_Arc::getMiddlepoint() const { - double a; - Vector ret; +Vector RS_Arc::getMiddlepoint() const +{ + double a; + Vector ret; - if (isReversed()) { - a = data.angle1 - getAngleLength()/2.0; - } else { - a = data.angle1 + getAngleLength()/2.0; - } - ret.setPolar(data.radius, a); - ret+=data.center; + if (isReversed()) + a = data.angle1 - getAngleLength() / 2.0; + else + a = data.angle1 + getAngleLength() / 2.0; + ret.setPolar(data.radius, a); + ret += data.center; - return ret; + return ret; } - - /** * @return Angle length in rad. */ -double RS_Arc::getAngleLength() const { - double ret = 0.0; - - if (isReversed()) { - if (data.angle1center = center; - this->radius = radius; - this->angle1 = angle1; - this->angle2 = angle2; - this->reversed = reversed; - } - - void reset() { - center = Vector(false); - radius = 0.0; - angle1 = 0.0; - angle2 = 0.0; - reversed = false; - } - - bool isValid() { - return (center.valid && radius>RS_TOLERANCE && - fabs(angle1-angle2)>RS_TOLERANCE_ANGLE); - } - - friend std::ostream& operator << (std::ostream& os, const RS_ArcData& ad) { - os << "(" << ad.center << - "/" << ad.radius << - " " << ad.angle1 << - "," << ad.angle2 << - ")"; - return os; - } - -public: - Vector center; - double radius; - double angle1; - double angle2; - bool reversed; -}; +class RS_ArcData +{ + public: + RS_ArcData() + { + } + + RS_ArcData(const Vector & center, double radius, double angle1, double angle2, bool reversed) + { + this->center = center; + this->radius = radius; + this->angle1 = angle1; + this->angle2 = angle2; + this->reversed = reversed; + } + + void reset() + { + center = Vector(false); + radius = 0.0; + angle1 = 0.0; + angle2 = 0.0; + reversed = false; + } + + bool isValid() + { + return (center.valid && radius > RS_TOLERANCE + && fabs(angle1 - angle2) > RS_TOLERANCE_ANGLE); + } + friend std::ostream & operator<<(std::ostream & os, const RS_ArcData & ad) + { + os << "(" << ad.center + << "/" << ad.radius + << " " << ad.angle1 + << "," << ad.angle2 + << ")"; + return os; + } + public: + Vector center; + double radius; + double angle1; + double angle2; + bool reversed; +}; /** * Class for an arc entity. All angles are in Rad. * * @author Andrew Mustun */ -class RS_Arc : public RS_AtomicEntity { -public: - RS_Arc(RS_EntityContainer* parent, - const RS_ArcData& d); - virtual ~RS_Arc() {} - - virtual RS_Entity* clone() { - RS_Arc* a = new RS_Arc(*this); - a->initId(); - return a; - } - - /** @return RS2::EntityArc */ - virtual RS2::EntityType rtti() const { - return RS2::EntityArc; - } - /** @return true */ - virtual bool isEdge() const { - return true; - } - - /** @return Copy of data that defines the arc. **/ - RS_ArcData getData() const { - return data; - } - - virtual VectorSolutions getRefPoints(); - - /** Sets new arc parameters. **/ - void setData(RS_ArcData d) { - data = d; - } - - /** @return The center point (x) of this arc */ - Vector getCenter() const { - return data.center; - } - /** Sets new center. */ - void setCenter(const Vector& c) { - data.center = c; - } - - /** @return The radius of this arc */ - double getRadius() const { - return data.radius; - } - /** Sets new radius. */ - void setRadius(double r) { - data.radius = r; - } - - /** @return The start angle of this arc */ - double getAngle1() const { - return data.angle1; - } - /** Sets new start angle. */ - void setAngle1(double a1) { - data.angle1 = a1; - } - /** @return The end angle of this arc */ - double getAngle2() const { - return data.angle2; - } - /** Sets new end angle. */ - void setAngle2(double a2) { - data.angle2 = a2; - } - /** - * @return Direction 1. The angle at which the arc starts at - * the startpoint. - */ - double getDirection1() const { - if (!data.reversed) { - return RS_Math::correctAngle(data.angle1+M_PI/2.0); - } - else { - return RS_Math::correctAngle(data.angle1-M_PI/2.0); - } - } - /** - * @return Direction 2. The angle at which the arc starts at - * the endpoint. - */ - double getDirection2() const { - if (!data.reversed) { - return RS_Math::correctAngle(data.angle2-M_PI/2.0); - } - else { - return RS_Math::correctAngle(data.angle2+M_PI/2.0); - } - } - - /** - * @retval true if the arc is reversed (clockwise), - * @retval false otherwise - */ - bool isReversed() const { - return data.reversed; - } - /** sets the reversed status. */ - void setReversed(bool r) { - data.reversed = r; - } - - /** @return Start point of the entity. */ - virtual Vector getStartpoint() const { - return startpoint; - } - /** @return End point of the entity. */ - virtual Vector getEndpoint() const { - return endpoint; - } - virtual void moveStartpoint(const Vector& pos); - virtual void moveEndpoint(const Vector& pos); - - virtual void trimStartpoint(const Vector& pos); - virtual void trimEndpoint(const Vector& pos); - - virtual RS2::Ending getTrimPoint(const Vector& coord, - const Vector& trimPoint); - - virtual void reverse(); - - Vector getMiddlepoint() const; - double getAngleLength() const; - virtual double getLength(); - double getBulge() const; - - bool createFrom3P(const Vector& p1, const Vector& p2, - const Vector& p3); - bool createFrom2PDirectionRadius(const Vector& startPoint, const Vector& endPoint, - double direction1, double radius); - bool createFrom2PBulge(const Vector& startPoint, const Vector& endPoint, - double bulge); - - virtual Vector getNearestEndpoint(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestPointOnEntity(const Vector& coord, - bool onEntity = true, double* dist = NULL, RS_Entity** entity=NULL); - virtual Vector getNearestCenter(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestMiddle(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestDist(double distance, - const Vector& coord, - double* dist = NULL); - virtual Vector getNearestDist(double distance, - bool startp); - - virtual double getDistanceToPoint(const Vector& coord, - RS_Entity** entity=NULL, - RS2::ResolveLevel level=RS2::ResolveNone, - double solidDist = RS_MAXDOUBLE); - virtual void move(Vector offset); - virtual void rotate(Vector center, double angle); - virtual void scale(Vector center, Vector factor); - virtual void mirror(Vector axisPoint1, Vector axisPoint2); - virtual void moveRef(const Vector& ref, const Vector& offset); - virtual void stretch(Vector firstCorner, - Vector secondCorner, - Vector offset); - -// virtual void draw(RS_Painter* painter, RS_GraphicView* view, double patternOffset=0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); - - friend std::ostream & operator<<(std::ostream & os, const RS_Arc & a); - - virtual void calculateEndpoints(); - virtual void calculateBorders(); - -protected: - RS_ArcData data; - - /** - * Startpoint. This is redundant but stored for performance - * reasons. - */ - Vector startpoint; - /** - * Endpoint. This is redundant but stored for performance - * reasons. - */ - Vector endpoint; +class RS_Arc: public RS_AtomicEntity +{ + public: + RS_Arc(RS_EntityContainer * parent, const RS_ArcData & d); + virtual ~RS_Arc(); + + virtual RS_Entity * clone(); + virtual RS2::EntityType rtti() const; + virtual bool isEdge() const; + RS_ArcData getData() const; + virtual VectorSolutions getRefPoints(); + void setData(RS_ArcData d); + Vector getCenter() const; + void setCenter(const Vector & c); + double getRadius() const; + void setRadius(double r); + double getAngle1() const; + void setAngle1(double a1); + double getAngle2() const; + void setAngle2(double a2); + double getDirection1() const; + double getDirection2() const; + bool isReversed() const; + void setReversed(bool r); + virtual Vector getStartpoint() const; + virtual Vector getEndpoint() const; + virtual void moveStartpoint(const Vector & pos); + virtual void moveEndpoint(const Vector & pos); + virtual void trimStartpoint(const Vector & pos); + virtual void trimEndpoint(const Vector & pos); + virtual RS2::Ending getTrimPoint(const Vector & coord, const Vector & trimPoint); + virtual void reverse(); + Vector getMiddlepoint() const; + double getAngleLength() const; + virtual double getLength(); + double getBulge() const; + + bool createFrom3P(const Vector & p1, const Vector & p2, const Vector & p3); + bool createFrom2PDirectionRadius(const Vector & startPoint, const Vector & endPoint, double direction1, double radius); + bool createFrom2PBulge(const Vector & startPoint, const Vector & endPoint, double bulge); + + virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL); + virtual Vector getNearestPointOnEntity(const Vector & coord, bool onEntity = true, double * dist = NULL, RS_Entity ** entity = NULL); + virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL); + virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL); + virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL); + virtual Vector getNearestDist(double distance, bool startp); + + virtual double getDistanceToPoint(const Vector & coord, RS_Entity * * entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); + virtual void move(Vector offset); + virtual void rotate(Vector center, double angle); + virtual void scale(Vector center, Vector factor); + virtual void mirror(Vector axisPoint1, Vector axisPoint2); + virtual void moveRef(const Vector & ref, const Vector & offset); + virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset); + + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); + + friend std::ostream & operator<<(std::ostream & os, const RS_Arc & a); + + virtual void calculateEndpoints(); + virtual void calculateBorders(); + + protected: + RS_ArcData data; + + /** + * Startpoint. This is redundant but stored for performance + * reasons. + */ + Vector startpoint; + /** + * Endpoint. This is redundant but stored for performance + * reasons. + */ + Vector endpoint; }; #endif diff --git a/src/base/rs_circle.cpp b/src/base/rs_circle.cpp index 2f5532d..5eebd9a 100644 --- a/src/base/rs_circle.cpp +++ b/src/base/rs_circle.cpp @@ -16,7 +16,8 @@ #include "rs_constructionline.h" #include "rs_information.h" -#include "rs_graphicview.h" +#include "rs_linetypepattern.h" +#include "graphicview.h" #include "paintintf.h" /** @@ -25,12 +26,102 @@ RS_Circle::RS_Circle(RS_EntityContainer * parent, const RS_CircleData & d): RS_AtomicEntity(parent), data(d) { - calculateBorders(); + calculateBorders(); +} + +/*virtual*/ RS_Circle::~RS_Circle() +{ +} + +/*virtual*/ RS_Entity * RS_Circle::clone() +{ + RS_Circle * c = new RS_Circle(*this); + c->initId(); + return c; +} + +/** @return RS2::EntityCircle */ +/*virtual*/ RS2::EntityType RS_Circle::rtti() const +{ + return RS2::EntityCircle; +} + +/** @return true */ +/*virtual*/ bool RS_Circle::isEdge() const +{ + return true; +} + +/** @return Copy of data that defines the circle. **/ +RS_CircleData RS_Circle::getData() +{ + return data; +} + +VectorSolutions RS_Circle::getRefPoints() +{ + Vector v1(data.radius, 0.0); + Vector v2(0.0, data.radius); + + VectorSolutions ret(data.center, data.center + v1, data.center + v2, data.center - v1, data.center - v2); + return ret; +} + +/*virtual*/ Vector RS_Circle::getStartpoint() const +{ + return data.center + Vector(data.radius, 0.0); +} + +/*virtual*/ Vector RS_Circle::getEndpoint() const +{ + return data.center + Vector(data.radius, 0.0); +} + +/** + * @return Direction 1. The angle at which the arc starts at + * the startpoint. + */ +double RS_Circle::getDirection1() const +{ + return M_PI / 2.0; +} + +/** + * @return Direction 2. The angle at which the arc starts at + * the endpoint. + */ +double RS_Circle::getDirection2() const +{ + return M_PI / 2.0 * 3.0; +} + +/** @return The center point (x) of this arc */ +Vector RS_Circle::getCenter() +{ + return data.center; +} + +/** Sets new center. */ +void RS_Circle::setCenter(const Vector & c) +{ + data.center = c; +} + +/** @return The radius of this arc */ +double RS_Circle::getRadius() +{ + return data.radius; +} + +/** Sets new radius. */ +void RS_Circle::setRadius(double r) +{ + data.radius = r; } void RS_Circle::calculateBorders() { - Vector r(data.radius,data.radius,0.0); + Vector r(data.radius, data.radius, 0.0); minV = data.center - r; maxV = data.center + r; } @@ -38,60 +129,63 @@ void RS_Circle::calculateBorders() /** * @return Angle length in rad. */ -double RS_Circle::getAngleLength() const { - return 2*M_PI; +double RS_Circle::getAngleLength() const +{ + return 2 * M_PI; } - - /** * @return Length of the circle which is the circumference. */ -double RS_Circle::getLength() { - return 2*M_PI*data.radius; +double RS_Circle::getLength() +{ + return 2 * M_PI * data.radius; } - /** * Creates this circle from a center point and a radius. * * @param c Center. * @param r Radius */ -bool RS_Circle::createFromCR(const Vector& c, double r) { - if (fabs(r)>RS_TOLERANCE) { - data.radius = fabs(r); - data.center = c; - return true; - } else { - RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Circle::createFromCR(): " - "Cannot create a circle with radius 0.0."); - return false; - } +bool RS_Circle::createFromCR(const Vector & c, double r) +{ + if (fabs(r) > RS_TOLERANCE) + { + data.radius = fabs(r); + data.center = c; + return true; + } + else + { + RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Circle::createFromCR(): " + "Cannot create a circle with radius 0.0."); + return false; + } } - - /** * Creates this circle from two opposite points. * * @param p1 1st point. * @param p2 2nd point. */ -bool RS_Circle::createFrom2P(const Vector& p1, const Vector& p2) { - if (p1.distanceTo(p2)>RS_TOLERANCE) { - data.radius = p1.distanceTo(p2)/2.0; - data.center = p1 + (p2-p1)/2.0; - return true; - } else { - RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Circle::createFrom2P(): " - "Cannot create a circle with radius 0.0."); - return false; - } +bool RS_Circle::createFrom2P(const Vector & p1, const Vector & p2) +{ + if (p1.distanceTo(p2) > RS_TOLERANCE) + { + data.radius = p1.distanceTo(p2) / 2.0; + data.center = p1 + (p2 - p1) / 2.0; + return true; + } + else + { + RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Circle::createFrom2P(): " + "Cannot create a circle with radius 0.0."); + return false; + } } - - /** * Creates this circle from 3 given points which define the circle line. * @@ -99,290 +193,256 @@ bool RS_Circle::createFrom2P(const Vector& p1, const Vector& p2) { * @param p2 2nd point. * @param p3 3rd point. */ -bool RS_Circle::createFrom3P(const Vector& p1, const Vector& p2, - const Vector& p3) { - if (p1.distanceTo(p2)>RS_TOLERANCE && - p2.distanceTo(p3)>RS_TOLERANCE && - p3.distanceTo(p1)>RS_TOLERANCE) { - - // middle points between 3 points: - Vector mp1, mp2; - Vector dir1, dir2; - double a1, a2; - - // intersection of two middle lines - mp1 = (p1 + p2)/2.0; - a1 = p1.angleTo(p2) + M_PI/2.0; - dir1.setPolar(100.0, a1); - mp2 = (p2 + p3)/2.0; - a2 = p2.angleTo(p3) + M_PI/2.0; - dir2.setPolar(100.0, a2); - - RS_ConstructionLineData d1(mp1, mp1 + dir1); - RS_ConstructionLineData d2(mp2, mp2 + dir2); - RS_ConstructionLine midLine1(NULL, d1); - RS_ConstructionLine midLine2(NULL, d2); - - VectorSolutions sol = - RS_Information::getIntersection(&midLine1, &midLine2); - - data.center = sol.get(0); - data.radius = data.center.distanceTo(p3); - - if (sol.get(0).valid && data.radius<1.0e14 && data.radius>RS_TOLERANCE) { - return true; - } else { - RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Circle::createFrom3P(): " - "Cannot create a circle with inf radius."); - return false; - } - } else { - RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Circle::createFrom3P(): " - "Cannot create a circle with radius 0.0."); - return false; - } -} - - - -VectorSolutions RS_Circle::getRefPoints() { - Vector v1(data.radius, 0.0); - Vector v2(0.0, data.radius); - - VectorSolutions ret(data.center, - data.center+v1, data.center+v2, - data.center-v1, data.center-v2); - return ret; +bool RS_Circle::createFrom3P(const Vector & p1, const Vector & p2, const Vector & p3) +{ + if (p1.distanceTo(p2) > RS_TOLERANCE + && p2.distanceTo(p3) > RS_TOLERANCE + && p3.distanceTo(p1) > RS_TOLERANCE) + { + // middle points between 3 points: + Vector mp1, mp2; + Vector dir1, dir2; + double a1, a2; + + // intersection of two middle lines + mp1 = (p1 + p2) / 2.0; + a1 = p1.angleTo(p2) + M_PI / 2.0; + dir1.setPolar(100.0, a1); + mp2 = (p2 + p3) / 2.0; + a2 = p2.angleTo(p3) + M_PI / 2.0; + dir2.setPolar(100.0, a2); + + RS_ConstructionLineData d1(mp1, mp1 + dir1); + RS_ConstructionLineData d2(mp2, mp2 + dir2); + RS_ConstructionLine midLine1(NULL, d1); + RS_ConstructionLine midLine2(NULL, d2); + + VectorSolutions sol = + RS_Information::getIntersection(&midLine1, &midLine2); + + data.center = sol.get(0); + data.radius = data.center.distanceTo(p3); + + if (sol.get(0).valid && data.radius < 1.0e14 && data.radius > RS_TOLERANCE) + return true; + else + { + RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Circle::createFrom3P(): " + "Cannot create a circle with inf radius."); + return false; + } + } + else + { + RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Circle::createFrom3P(): " + "Cannot create a circle with radius 0.0."); + return false; + } } - /** * @return Always an invalid vector. */ -Vector RS_Circle::getNearestEndpoint(const Vector& /*coord*/, double* dist) { - if (dist!=NULL) { - *dist = RS_MAXDOUBLE; - } - return Vector(false); +Vector RS_Circle::getNearestEndpoint(const Vector & /*coord*/, double * dist) +{ + if (dist != NULL) + *dist = RS_MAXDOUBLE; + return Vector(false); } +Vector RS_Circle::getNearestPointOnEntity(const Vector & coord, bool /*onEntity*/, double * dist, RS_Entity ** entity) +{ + Vector vec(false); + if (entity != NULL) + *entity = this; -Vector RS_Circle::getNearestPointOnEntity(const Vector& coord, - bool /*onEntity*/, double* dist, RS_Entity** entity) { - - Vector vec(false); - if (entity!=NULL) { - *entity = this; - } - - double angle = (coord-data.center).angle(); - vec.setPolar(data.radius, angle); - vec+=data.center; + double angle = (coord - data.center).angle(); + vec.setPolar(data.radius, angle); + vec += data.center; - if (dist!=NULL) { - *dist = fabs((vec-data.center).magnitude()-data.radius); - } + if (dist != NULL) + *dist = fabs((vec - data.center).magnitude() - data.radius); - return vec; + return vec; } - - -Vector RS_Circle::getNearestCenter(const Vector& coord, - double* dist) { - if (dist!=NULL) { - *dist = coord.distanceTo(data.center); - } - return data.center; +Vector RS_Circle::getNearestCenter(const Vector & coord, double * dist) +{ + if (dist != NULL) + *dist = coord.distanceTo(data.center); + return data.center; } - - -Vector RS_Circle::getNearestMiddle(const Vector& /*coord*/, - double* dist) { - if (dist!=NULL) { - *dist = RS_MAXDOUBLE; - } - return Vector(false); +Vector RS_Circle::getNearestMiddle(const Vector & /*coord*/, double * dist) +{ + if (dist != NULL) + *dist = RS_MAXDOUBLE; + return Vector(false); } - - -Vector RS_Circle::getNearestDist(double /*distance*/, - const Vector& /*coord*/, - double* dist) { - - if (dist!=NULL) { - *dist = RS_MAXDOUBLE; - } - return Vector(false); +Vector RS_Circle::getNearestDist(double /*distance*/, const Vector & /*coord*/, double * dist) +{ + if (dist != NULL) + *dist = RS_MAXDOUBLE; + return Vector(false); } -Vector RS_Circle::getNearestDist(double /*distance*/, - bool /*startp*/) { - - return Vector(false); +Vector RS_Circle::getNearestDist(double /*distance*/, bool /*startp*/) +{ + return Vector(false); } +double RS_Circle::getDistanceToPoint(const Vector & coord, RS_Entity * * entity, RS2::ResolveLevel, double) +{ + if (entity != NULL) + *entity = this; - -double RS_Circle::getDistanceToPoint(const Vector& coord, - RS_Entity** entity, - RS2::ResolveLevel, double) { - if (entity!=NULL) { - *entity = this; - } - - return fabs((coord-data.center).magnitude() - data.radius); + return fabs((coord - data.center).magnitude() - data.radius); } - - -void RS_Circle::move(Vector offset) { - data.center.move(offset); - calculateBorders(); +void RS_Circle::move(Vector offset) +{ + data.center.move(offset); + calculateBorders(); } - - -void RS_Circle::rotate(Vector center, double angle) { - data.center.rotate(center, angle); - calculateBorders(); +void RS_Circle::rotate(Vector center, double angle) +{ + data.center.rotate(center, angle); + calculateBorders(); } - - -void RS_Circle::scale(Vector center, Vector factor) { - data.center.scale(center, factor); - data.radius *= factor.x; - calculateBorders(); +void RS_Circle::scale(Vector center, Vector factor) +{ + data.center.scale(center, factor); + data.radius *= factor.x; + calculateBorders(); } - - -void RS_Circle::mirror(Vector axisPoint1, Vector axisPoint2) { +void RS_Circle::mirror(Vector axisPoint1, Vector axisPoint2) +{ data.center.mirror(axisPoint1, axisPoint2); - calculateBorders(); + calculateBorders(); } -void RS_Circle::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/) +void RS_Circle::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/) { - if (painter == NULL || view == NULL) - return; - - // simple style-less lines - if (getPen().getLineType()==RS2::SolidLine || - isSelected() || - view->getDrawingMode()==RS2::ModePreview) { - - painter->drawArc(view->toGui(getCenter()), - getRadius() * view->getFactor().x, - 0.0, 2*M_PI, - false); - } else { + if (painter == NULL || view == NULL) + return; + + // simple style-less lines + if (getPen().getLineType() == RS2::SolidLine + || isSelected() + || view->getDrawingMode() == RS2::ModePreview) + + painter->drawArc(view->toGui(getCenter()), + getRadius() * view->getFactor().x, + 0.0, 2 * M_PI, + false); + else + { double styleFactor = getStyleFactor(view); - if (styleFactor<0.0) { - painter->drawArc(view->toGui(getCenter()), - getRadius() * view->getFactor().x, - 0.0, 2*M_PI, - false); + + if (styleFactor < 0.0) + { + painter->drawArc(view->toGui(getCenter()), + getRadius() * view->getFactor().x, + 0.0, 2 * M_PI, + false); return; } - // Pattern: - RS_LineTypePattern* pat; - if (isSelected()) { - pat = &patternSelected; - } else { - pat = view->getPattern(getPen().getLineType()); - } + // Pattern: + RS_LineTypePattern * pat; - if (pat==NULL) { - return; - } + if (isSelected()) + pat = &patternSelected; + else + pat = view->getPattern(getPen().getLineType()); - if (getRadius()<1.0e-6) { + if (pat == NULL) return; + + if (getRadius() < 1.0e-6) + return; + + // Pen to draw pattern is always solid: + RS_Pen pen = painter->getPen(); + pen.setLineType(RS2::SolidLine); + painter->setPen(pen); + + double * da; // array of distances in x. + int i; // index counter + + double length = getAngleLength(); + + // create pattern: + da = new double[pat->num]; + + for (i = 0; i < pat->num; ++i) + da[i] = fabs(pat->pattern[i] * styleFactor) / getRadius(); + + double tot = 0.0; + i = 0; + bool done = false; + double curA = 0.0; + //double cx = getCenter().x * factor.x + offsetX; + //double cy = - a->getCenter().y * factor.y + getHeight() - offsetY; + Vector cp = view->toGui(getCenter()); + double r = getRadius() * view->getFactor().x; + + do + { + if (pat->pattern[i] * styleFactor > 0.0) + { + if (tot + fabs(da[i]) < length) + painter->drawArc(cp, r, + curA, + curA + da[i], + false); + else + painter->drawArc(cp, r, + curA, + 2 * M_PI, + false); + } + curA += da[i]; + tot += fabs(da[i]); + done = tot > length; + + i++; + + if (i >= pat->num) + i = 0; } + while (!done); - // Pen to draw pattern is always solid: - RS_Pen pen = painter->getPen(); - pen.setLineType(RS2::SolidLine); - painter->setPen(pen); - - double* da; // array of distances in x. - int i; // index counter - - double length = getAngleLength(); - - // create pattern: - da = new double[pat->num]; - - for (i=0; inum; ++i) { - da[i] = fabs(pat->pattern[i] * styleFactor)/getRadius(); - } - - double tot=0.0; - i=0; - bool done = false; - double curA = 0.0; - //double cx = getCenter().x * factor.x + offsetX; - //double cy = - a->getCenter().y * factor.y + getHeight() - offsetY; - Vector cp = view->toGui(getCenter()); - double r = getRadius() * view->getFactor().x; - - do { - if (pat->pattern[i] * styleFactor > 0.0) { - if (tot+fabs(da[i])drawArc(cp, r, - curA, - curA + da[i], - false); - } else { - painter->drawArc(cp, r, - curA, - 2*M_PI, - false); - } - } - curA+=da[i]; - tot+=fabs(da[i]); - done=tot>length; - - i++; - if (i>=pat->num) { - i=0; - } - } while(!done); - - delete[] da; - } -} - - - -void RS_Circle::moveRef(const Vector& ref, const Vector& offset) { + delete[] da; + } +} + +void RS_Circle::moveRef(const Vector & ref, const Vector & offset) +{ Vector v1(data.radius, 0.0); Vector v2(0.0, data.radius); - if (ref.distanceTo(data.center + v1)<1.0e-4) { + if (ref.distanceTo(data.center + v1) < 1.0e-4) data.radius = data.center.distanceTo(data.center + v1 + offset); - } else if (ref.distanceTo(data.center + v2)<1.0e-4) { + else if (ref.distanceTo(data.center + v2) < 1.0e-4) data.radius = data.center.distanceTo(data.center + v2 + offset); - } else if (ref.distanceTo(data.center - v1)<1.0e-4) { + else if (ref.distanceTo(data.center - v1) < 1.0e-4) data.radius = data.center.distanceTo(data.center - v1 + offset); - } else if (ref.distanceTo(data.center - v2)<1.0e-4) { + else if (ref.distanceTo(data.center - v2) < 1.0e-4) data.radius = data.center.distanceTo(data.center - v2 + offset); - } } - /** * Dumps the circle's data to stdout. */ -std::ostream& operator << (std::ostream& os, const RS_Circle& a) { - os << " Circle: " << a.data << "\n"; - return os; +std::ostream & operator<<(std::ostream & os, const RS_Circle & a) +{ + os << " Circle: " << a.data << "\n"; + return os; } diff --git a/src/base/rs_circle.h b/src/base/rs_circle.h index ce31de8..d272ad8 100644 --- a/src/base/rs_circle.h +++ b/src/base/rs_circle.h @@ -8,154 +8,93 @@ */ class RS_CircleData { -public: - RS_CircleData() {} - - RS_CircleData(const Vector& center, - double radius) { - - this->center = center; - this->radius = radius; - } - - void reset() { - center = Vector(false); - radius = 0.0; - } - - bool isValid() { - return (center.valid && radius>RS_TOLERANCE); - } - - friend class RS_Circle; - - friend std::ostream& operator << (std::ostream& os, - const RS_CircleData& ad) { - os << "(" << ad.center << - "/" << ad.radius << - ")"; - return os; - } - -public: - Vector center; - double radius; + public: + RS_CircleData() + { + } + + RS_CircleData(const Vector & center, double radius) + { + this->center = center; + this->radius = radius; + } + + void reset() + { + center = Vector(false); + radius = 0.0; + } + + bool isValid() + { + return (center.valid && radius > RS_TOLERANCE); + } + + friend class RS_Circle; + + friend std::ostream & operator<<(std::ostream & os, const RS_CircleData & ad) + { + os << "(" << ad.center << "/" << ad.radius << ")"; + return os; + } + + public: + Vector center; + double radius; }; - - /** * Class for a circle entity. * * @author Andrew Mustun */ -class RS_Circle : public RS_AtomicEntity +class RS_Circle: public RS_AtomicEntity { -public: - RS_Circle (RS_EntityContainer* parent, - const RS_CircleData& d); - virtual ~RS_Circle() {} - - virtual RS_Entity* clone() { - RS_Circle* c = new RS_Circle(*this); - c->initId(); - return c; - } - - /** @return RS2::EntityCircle */ - virtual RS2::EntityType rtti() const { - return RS2::EntityCircle; - } - /** @return true */ - virtual bool isEdge() const { - return true; - } - - /** @return Copy of data that defines the circle. **/ - RS_CircleData getData() { - return data; - } - - virtual VectorSolutions getRefPoints(); - - virtual Vector getStartpoint() const { - return data.center + Vector(data.radius, 0.0); - } - virtual Vector getEndpoint() const { - return data.center + Vector(data.radius, 0.0); - } - /** - * @return Direction 1. The angle at which the arc starts at - * the startpoint. - */ - double getDirection1() const { - return M_PI/2.0; - } - /** - * @return Direction 2. The angle at which the arc starts at - * the endpoint. - */ - double getDirection2() const { - return M_PI/2.0*3.0; - } - - /** @return The center point (x) of this arc */ - Vector getCenter() { - return data.center; - } - /** Sets new center. */ - void setCenter(const Vector& c) { - data.center = c; - } - /** @return The radius of this arc */ - double getRadius() { - return data.radius; - } - /** Sets new radius. */ - void setRadius(double r) { - data.radius = r; - } - double getAngleLength() const; - virtual double getLength(); - - bool createFromCR(const Vector& c, double r); - bool createFrom2P(const Vector& p1, const Vector& p2); - bool createFrom3P(const Vector& p1, const Vector& p2, - const Vector& p3); - - virtual Vector getNearestEndpoint(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestPointOnEntity(const Vector& coord, - bool onEntity = true, double* dist = NULL, RS_Entity** entity=NULL); - virtual Vector getNearestCenter(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestMiddle(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestDist(double distance, - const Vector& coord, - double* dist = NULL); - virtual Vector getNearestDist(double distance, - bool startp); - virtual double getDistanceToPoint(const Vector& coord, - RS_Entity** entity=NULL, - RS2::ResolveLevel level=RS2::ResolveNone, - double solidDist = RS_MAXDOUBLE); - - virtual void move(Vector offset); - virtual void rotate(Vector center, double angle); - virtual void scale(Vector center, Vector factor); - virtual void mirror(Vector axisPoint1, Vector axisPoint2); - virtual void moveRef(const Vector& ref, const Vector& offset); - -// virtual void draw(RS_Painter* painter, RS_GraphicView* view, double patternOffset=0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); - - friend std::ostream & operator<<(std::ostream & os, const RS_Circle & a); - - virtual void calculateBorders(); - -protected: - RS_CircleData data; + public: + RS_Circle (RS_EntityContainer * parent, const RS_CircleData & d); + virtual ~RS_Circle(); + + virtual RS_Entity * clone(); + virtual RS2::EntityType rtti() const; + virtual bool isEdge() const; + RS_CircleData getData(); + virtual VectorSolutions getRefPoints(); + virtual Vector getStartpoint() const; + virtual Vector getEndpoint() const; + double getDirection1() const; + double getDirection2() const; + Vector getCenter(); + void setCenter(const Vector & c); + double getRadius(); + void setRadius(double r); + double getAngleLength() const; + virtual double getLength(); + + bool createFromCR(const Vector & c, double r); + bool createFrom2P(const Vector & p1, const Vector & p2); + bool createFrom3P(const Vector & p1, const Vector & p2, const Vector & p3); + virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL); + virtual Vector getNearestPointOnEntity(const Vector & coord, bool onEntity = true, + double * dist = NULL, RS_Entity ** entity = NULL); + virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL); + virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL); + virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL); + virtual Vector getNearestDist(double distance, bool startp); + virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); + + virtual void move(Vector offset); + virtual void rotate(Vector center, double angle); + virtual void scale(Vector center, Vector factor); + virtual void mirror(Vector axisPoint1, Vector axisPoint2); + virtual void moveRef(const Vector & ref, const Vector & offset); + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); + + friend std::ostream & operator<<(std::ostream & os, const RS_Circle & a); + + virtual void calculateBorders(); + + protected: + RS_CircleData data; }; #endif diff --git a/src/base/rs_constructionline.cpp b/src/base/rs_constructionline.cpp index de54277..f598a4f 100644 --- a/src/base/rs_constructionline.cpp +++ b/src/base/rs_constructionline.cpp @@ -217,6 +217,10 @@ void RS_ConstructionLine::mirror(Vector axisPoint1, Vector axisPoint2) data.point2.mirror(axisPoint1, axisPoint2); } +/*virtual*/ void RS_ConstructionLine::draw(PaintInterface *, GraphicView *, double) +{ +} + /** * Dumps the point's data to stdout. */ diff --git a/src/base/rs_constructionline.h b/src/base/rs_constructionline.h index 321d0e4..c5d797e 100644 --- a/src/base/rs_constructionline.h +++ b/src/base/rs_constructionline.h @@ -68,8 +68,8 @@ class RS_ConstructionLine: public RS_AtomicEntity virtual void rotate(Vector center, double angle); virtual void scale(Vector center, Vector factor); virtual void mirror(Vector axisPoint1, Vector axisPoint2); - virtual void draw(PaintInterface * /*painter*/, RS_GraphicView * /*view*/, - double /*patternOffset*/) {} + virtual void draw(PaintInterface * /*painter*/, GraphicView * /*view*/, + double /*patternOffset*/); friend std::ostream & operator<<(std::ostream & os, const RS_ConstructionLine & l); virtual void calculateBorders(); diff --git a/src/base/rs_creation.cpp b/src/base/rs_creation.cpp index a8a14e0..e57b903 100644 --- a/src/base/rs_creation.cpp +++ b/src/base/rs_creation.cpp @@ -16,7 +16,7 @@ #include "rs_constructionline.h" #include "drawing.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_image.h" #include "rs_information.h" #include "rs_insert.h" @@ -30,7 +30,7 @@ * entities. Usually that's an Drawing entity but * it can also be a polyline, text, ... */ -RS_Creation::RS_Creation(RS_EntityContainer * container, RS_GraphicView * graphicView, +RS_Creation::RS_Creation(RS_EntityContainer * container, GraphicView * graphicView, bool handleUndo) { this->container = container; diff --git a/src/base/rs_creation.h b/src/base/rs_creation.h index 7187add..4e8cab8 100644 --- a/src/base/rs_creation.h +++ b/src/base/rs_creation.h @@ -12,7 +12,7 @@ class RS_Document; class Drawing; class RS_Entity; class RS_EntityContainer; -class RS_GraphicView; +class GraphicView; class RS_Image; class RS_ImageData; class RS_Insert; @@ -40,7 +40,7 @@ struct RS_LibraryInsertData class RS_Creation { public: - RS_Creation(RS_EntityContainer * container, RS_GraphicView * graphicView = NULL, + RS_Creation(RS_EntityContainer * container, GraphicView * graphicView = NULL, bool handleUndo = true); RS_Entity * createParallelThrough(const Vector & coord, int number, @@ -90,7 +90,7 @@ class RS_Creation RS_EntityContainer * container; Drawing * graphic; RS_Document * document; - RS_GraphicView * graphicView; + GraphicView * graphicView; bool handleUndo; }; diff --git a/src/base/rs_dialogfactoryadapter.h b/src/base/rs_dialogfactoryadapter.h index cb376b4..af67162 100644 --- a/src/base/rs_dialogfactoryadapter.h +++ b/src/base/rs_dialogfactoryadapter.h @@ -19,7 +19,7 @@ class RS_DialogFactoryAdapter : public RS_DialogFactoryInterface virtual ~RS_DialogFactoryAdapter() {} virtual void requestPreviousMenu() {} virtual void requestWarningDialog(const QString &) {} - virtual RS_GraphicView * requestNewDocument(const QString & = QString::null, + virtual GraphicView * requestNewDocument(const QString & = QString::null, RS_Document * = NULL) { return NULL; } virtual void requestSimulationControls() {} virtual RS_Layer * requestNewLayerDialog(RS_LayerList * = NULL) { return NULL; } diff --git a/src/base/rs_dialogfactoryinterface.h b/src/base/rs_dialogfactoryinterface.h index 14527f5..2ea6011 100644 --- a/src/base/rs_dialogfactoryinterface.h +++ b/src/base/rs_dialogfactoryinterface.h @@ -15,10 +15,10 @@ class RS_CircleData; class RS_DimLinearData; class RS_DimensionData; class RS_Document; +class Drawing; class RS_Entity; class RS_EventHandler; -class Drawing; -class RS_GraphicView; +class GraphicView; class RS_Grid; class RS_Hatch; class RS_Insert; @@ -63,7 +63,7 @@ public: * window for the given document or for a new document if no document * is given. */ - virtual RS_GraphicView * requestNewDocument(const QString & fileName = QString::null, + virtual GraphicView * requestNewDocument(const QString & fileName = QString::null, RS_Document * doc = NULL) = 0; /** diff --git a/src/base/rs_ellipse.cpp b/src/base/rs_ellipse.cpp index c3a5cf1..380df86 100644 --- a/src/base/rs_ellipse.cpp +++ b/src/base/rs_ellipse.cpp @@ -15,8 +15,9 @@ #include "rs_ellipse.h" #include "drawing.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_information.h" +#include "rs_linetypepattern.h" #include "paintintf.h" /** @@ -29,425 +30,559 @@ RS_Ellipse::RS_Ellipse(RS_EntityContainer * parent, const RS_EllipseData & d): calculateBorders(); } -/** - * Recalculates the endpoints using the angles and the radius. - */ - /* -void RS_Ellipse::calculateEndpoints() { - double angle = data.majorP.angle(); - double radius1 = getMajorRadius(); - double radius2 = getMinorRadius(); +/*virtual*/ RS_Ellipse::~RS_Ellipse() +{ +} - startpoint.set(data.center.x + cos(data.angle1) * radius1, - data.center.y + sin(data.angle1) * radius2); - startpoint.rotate(data.center, angle); - endpoint.set(data.center.x + cos(data.angle2) * radius1, - data.center.y + sin(data.angle2) * radius2); - endpoint.rotate(data.center, angle); +/*virtual*/ RS_Entity * RS_Ellipse::clone() +{ + RS_Ellipse * e = new RS_Ellipse(*this); + e->initId(); + return e; } -*/ +/** @return RS2::EntityEllipse */ +/*virtual*/ RS2::EntityType RS_Ellipse::rtti() const +{ + return RS2::EntityEllipse; +} /** - * Calculates the boundary box of this ellipse. - * - * @todo Fix that - the algorithm used is really bad / slow. + * @return Start point of the entity. */ -void RS_Ellipse::calculateBorders() { - RS_DEBUG->print("RS_Ellipse::calculateBorders"); - - double radius1 = getMajorRadius(); - double radius2 = getMinorRadius(); - double angle = getAngle(); - double a1 = ((!isReversed()) ? data.angle1 : data.angle2); - double a2 = ((!isReversed()) ? data.angle2 : data.angle1); - Vector startpoint = getStartpoint(); - Vector endpoint = getEndpoint(); +/*virtual*/ Vector RS_Ellipse::getStartpoint() const +{ + Vector p; + p.set(data.center.x + cos(data.angle1) * getMajorRadius(), + data.center.y + sin(data.angle1) * getMinorRadius()); + p.rotate(data.center, getAngle()); + return p; +} - double minX = std::min(startpoint.x, endpoint.x); - double minY = std::min(startpoint.y, endpoint.y); - double maxX = std::max(startpoint.x, endpoint.x); - double maxY = std::max(startpoint.y, endpoint.y); +/** + * @return End point of the entity. + */ +/*virtual*/ Vector RS_Ellipse::getEndpoint() const +{ + Vector p; + p.set(data.center.x + cos(data.angle2) * getMajorRadius(), + data.center.y + sin(data.angle2) * getMinorRadius()); + p.rotate(data.center, getAngle()); + return p; +} - // kind of a brute force. TODO: exact calculation - Vector vp; - double a = a1; - do { - vp.set(data.center.x + radius1 * cos(a), - data.center.y + radius2 * sin(a)); - vp.rotate(data.center, angle); +void RS_Ellipse::moveStartpoint(const Vector & pos) +{ + data.angle1 = getEllipseAngle(pos); + //data.angle1 = data.center.angleTo(pos); + //calculateEndpoints(); + calculateBorders(); +} - minX = std::min(minX, vp.x); - minY = std::min(minY, vp.y); - maxX = std::max(maxX, vp.x); - maxY = std::max(maxY, vp.y); +void RS_Ellipse::moveEndpoint(const Vector & pos) +{ + data.angle2 = getEllipseAngle(pos); + //data.angle2 = data.center.angleTo(pos); + //calculateEndpoints(); + calculateBorders(); +} - a += 0.03; - } while (RS_Math::isAngleBetween(RS_Math::correctAngle(a), a1, a2, false) && - a<4*M_PI); +RS2::Ending RS_Ellipse::getTrimPoint(const Vector & coord, const Vector & trimPoint) +{ + double angEl = getEllipseAngle(trimPoint); + double angM = getEllipseAngle(coord); + if (RS_Math::getAngleDifference(angM, angEl) > M_PI) + //if (data.reversed) { + // return RS2::EndingEnd; + //} + //else { + return RS2::EndingStart; + //} + else + //if (data.reversed) { + // return RS2::EndingStart; + //} + //else { + return RS2::EndingEnd; + //} +} - minV.set(minX, minY); - maxV.set(maxX, maxY); - RS_DEBUG->print("RS_Ellipse::calculateBorders: OK"); +double RS_Ellipse::getEllipseAngle(const Vector & pos) +{ + Vector m = pos; + m.rotate(data.center, -data.majorP.angle()); + Vector v = m - data.center; + v.scale(Vector(1.0, 1.0 / data.ratio)); + return v.angle(); } +/** @return Copy of data that defines the ellipse. **/ +RS_EllipseData RS_Ellipse::getData() +{ + return data; +} +VectorSolutions RS_Ellipse::getRefPoints() +{ + VectorSolutions ret(getStartpoint(), getEndpoint(), data.center); + return ret; +} -VectorSolutions RS_Ellipse::getRefPoints() { - VectorSolutions ret(getStartpoint(), getEndpoint(), data.center); - return ret; +/** + * @retval true if the arc is reversed (clockwise), + * @retval false otherwise + */ +bool RS_Ellipse::isReversed() const +{ + return data.reversed; } +/** sets the reversed status. */ +void RS_Ellipse::setReversed(bool r) +{ + data.reversed = r; +} +/** @return The rotation angle of this ellipse */ +double RS_Ellipse::getAngle() const +{ + return data.majorP.angle(); +} -Vector RS_Ellipse::getNearestEndpoint(const Vector& coord, double* dist) { - double dist1, dist2; - Vector nearerPoint; - Vector startpoint = getStartpoint(); - Vector endpoint = getEndpoint(); +/** @return The start angle of this arc */ +double RS_Ellipse::getAngle1() +{ + return data.angle1; +} - dist1 = startpoint.distanceTo(coord); - dist2 = endpoint.distanceTo(coord); - - if (dist2print("RS_Ellipse::getNearestPointOnEntity"); - - Vector ret(false); - - if (entity!=NULL) { - *entity = this; - } - double ang = getAngle(); - - Vector normalized = (coord - data.center).rotate(-ang); - - double dU = normalized.x; - double dV = normalized.y; - double dA = getMajorRadius(); - double dB = getMinorRadius(); - double dEpsilon = 1.0e-8; - int iMax = 32; - int riIFinal = 0; - double rdX = 0.0; - double rdY = 0.0; - double dDistance; - bool swap = false; - bool majorSwap = false; - - if (dAprint("RS_Ellipse::getNearestPointOnEntity: i: %d", i); - double dTpASqr = dT + dA*dA; - double dTpBSqr = dT + dB*dB; - double dInvTpASqr = 1.0/dTpASqr; - double dInvTpBSqr = 1.0/dTpBSqr; - double dXDivA = dA*dU*dInvTpASqr; - double dYDivB = dB*dV*dInvTpBSqr; - double dXDivASqr = dXDivA*dXDivA; - double dYDivBSqr = dYDivB*dYDivB; - double dF = dXDivASqr + dYDivBSqr - 1.0; - RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: dF: %f", dF); - if ( fabs(dF) < dEpsilon ) { - // F(t0) is close enough to zero, terminate the iteration: - rdX = dXDivA*dA; - rdY = dYDivB*dB; - riIFinal = i; - RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: rdX,rdY 1: %f,%f", rdX, rdY); - break; - } - double dFDer = 2.0*(dXDivASqr*dInvTpASqr + dYDivBSqr*dInvTpBSqr); - double dRatio = dF/dFDer; - RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: dRatio: %f", dRatio); - if ( fabs(dRatio) < dEpsilon ) { - // t1-t0 is close enough to zero, terminate the iteration: - rdX = dXDivA*dA; - rdY = dYDivB*dB; - riIFinal = i; - RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: rdX,rdY 2: %f,%f", rdX, rdY); - break; - } - dT += dRatio; - } - if ( i == iMax ) { - // failed to converge: - RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: failed"); - dDistance = RS_MAXDOUBLE; - } - else { - double dDelta0 = rdX - dU; - double dDelta1 = rdY - dV; - dDistance = sqrt(dDelta0*dDelta0 + dDelta1*dDelta1); - ret = Vector(rdX, rdY); - RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: rdX,rdY 2: %f,%f", rdX, rdY); - RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: ret: %f,%f", ret.x, ret.y); - } - - if (dist!=NULL) { - if (ret.valid) { - *dist = dDistance; - } else { - *dist = RS_MAXDOUBLE; - } - } - - if (ret.valid) { - if (swap) { - ret.y*=-1.0; - } - if (majorSwap) { - double dum = ret.x; - ret.x = ret.y; - ret.y = dum; - } - ret = (ret.rotate(ang) + data.center); - - if (onEntity) { - double a1 = data.center.angleTo(getStartpoint()); - double a2 = data.center.angleTo(getEndpoint()); - double a = data.center.angleTo(ret); - if (!RS_Math::isAngleBetween(a, a1, a2, data.reversed)) { - ret = Vector(false); - } - } - } - - return ret; +/** Sets new start angle. */ +void RS_Ellipse::setAngle1(double a1) +{ + data.angle1 = a1; } +/** @return The end angle of this arc */ +double RS_Ellipse::getAngle2() +{ + return data.angle2; +} +/** Sets new end angle. */ +void RS_Ellipse::setAngle2(double a2) +{ + data.angle2 = a2; +} -/** - * @param tolerance Tolerance. - * - * @retval true if the given point is on this entity. - * @retval false otherwise - */ -bool RS_Ellipse::isPointOnEntity(const Vector& coord, - double tolerance) { - double dist = getDistanceToPoint(coord, NULL, RS2::ResolveNone); - return (dist<=tolerance); +/** @return The center point (x) of this arc */ +Vector RS_Ellipse::getCenter() +{ + return data.center; } +/** Sets new center. */ +void RS_Ellipse::setCenter(const Vector & c) +{ + data.center = c; +} +/** @return The endpoint of the major axis (relative to center). */ +Vector RS_Ellipse::getMajorP() +{ + return data.majorP; +} -Vector RS_Ellipse::getNearestCenter(const Vector& coord, - double* dist) { - if (dist!=NULL) { - *dist = coord.distanceTo(data.center); - } - return data.center; +/** Sets new major point (relative to center). */ +void RS_Ellipse::setMajorP(const Vector & p) +{ + data.majorP = p; } +/** @return The ratio of minor to major axis */ +double RS_Ellipse::getRatio() +{ + return data.ratio; +} +/** Sets new ratio. */ +void RS_Ellipse::setRatio(double r) +{ + data.ratio = r; +} /** - * @todo Implement this. + * @return Angle length in rad. */ -Vector RS_Ellipse::getNearestMiddle(const Vector& /*coord*/, - double* dist) { - if (dist!=NULL) { - *dist = RS_MAXDOUBLE; - } - return Vector(false); +/*virtual*/ double RS_Ellipse::getAngleLength() const +{ + if (isReversed()) + return data.angle1 - data.angle2; + else + return data.angle2 - data.angle1; } +/** @return The major radius of this ellipse. Same as getRadius() */ +double RS_Ellipse::getMajorRadius() const +{ + return data.majorP.magnitude(); +} - -Vector RS_Ellipse::getNearestDist(double /*distance*/, - const Vector& /*coord*/, - double* dist) { - if (dist!=NULL) { - *dist = RS_MAXDOUBLE; - } - return Vector(false); +/** @return The minor radius of this ellipse */ +double RS_Ellipse::getMinorRadius() const +{ + return data.majorP.magnitude() * data.ratio; } +/** + * Recalculates the endpoints using the angles and the radius. + */ +/* + void RS_Ellipse::calculateEndpoints() { + double angle = data.majorP.angle(); + double radius1 = getMajorRadius(); + double radius2 = getMinorRadius(); + + startpoint.set(data.center.x + cos(data.angle1) * radius1, + data.center.y + sin(data.angle1) * radius2); + startpoint.rotate(data.center, angle); + endpoint.set(data.center.x + cos(data.angle2) * radius1, + data.center.y + sin(data.angle2) * radius2); + endpoint.rotate(data.center, angle); + } + */ +/** + * Calculates the boundary box of this ellipse. + * + * @todo Fix that - the algorithm used is really bad / slow. + */ +void RS_Ellipse::calculateBorders() +{ + RS_DEBUG->print("RS_Ellipse::calculateBorders"); + + double radius1 = getMajorRadius(); + double radius2 = getMinorRadius(); + double angle = getAngle(); + double a1 = ((!isReversed()) ? data.angle1 : data.angle2); + double a2 = ((!isReversed()) ? data.angle2 : data.angle1); + Vector startpoint = getStartpoint(); + Vector endpoint = getEndpoint(); -double RS_Ellipse::getDistanceToPoint(const Vector& coord, - RS_Entity** entity, - RS2::ResolveLevel, double /*solidDist*/) { - double dist = RS_MAXDOUBLE; - getNearestPointOnEntity(coord, true, &dist, entity); + double minX = std::min(startpoint.x, endpoint.x); + double minY = std::min(startpoint.y, endpoint.y); + double maxX = std::max(startpoint.x, endpoint.x); + double maxY = std::max(startpoint.y, endpoint.y); - return dist; + // kind of a brute force. TODO: exact calculation + Vector vp; + double a = a1; -} + do + { + vp.set(data.center.x + radius1 * cos(a), + data.center.y + radius2 * sin(a)); + vp.rotate(data.center, angle); + minX = std::min(minX, vp.x); + minY = std::min(minY, vp.y); + maxX = std::max(maxX, vp.x); + maxY = std::max(maxY, vp.y); + a += 0.03; + } + while (RS_Math::isAngleBetween(RS_Math::correctAngle(a), a1, a2, false) + && a < 4 * M_PI); -void RS_Ellipse::move(Vector offset) { - data.center.move(offset); - //calculateEndpoints(); - calculateBorders(); + minV.set(minX, minY); + maxV.set(maxX, maxY); + RS_DEBUG->print("RS_Ellipse::calculateBorders: OK"); } +Vector RS_Ellipse::getNearestEndpoint(const Vector & coord, double * dist) +{ + double dist1, dist2; + Vector nearerPoint; + Vector startpoint = getStartpoint(); + Vector endpoint = getEndpoint(); + dist1 = startpoint.distanceTo(coord); + dist2 = endpoint.distanceTo(coord); -void RS_Ellipse::rotate(Vector center, double angle) { - data.center.rotate(center, angle); - data.majorP.rotate(angle); - //calculateEndpoints(); - calculateBorders(); + if (dist2 < dist1) + { + if (dist != NULL) + *dist = dist2; + nearerPoint = endpoint; + } + else + { + if (dist != NULL) + *dist = dist1; + nearerPoint = startpoint; + } + + return nearerPoint; } +Vector RS_Ellipse::getNearestPointOnEntity(const Vector & coord, bool onEntity, double * dist, RS_Entity * * entity) +{ + RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity"); + + Vector ret(false); + + if (entity != NULL) + *entity = this; + double ang = getAngle(); + + Vector normalized = (coord - data.center).rotate(-ang); + + double dU = normalized.x; + double dV = normalized.y; + double dA = getMajorRadius(); + double dB = getMinorRadius(); + double dEpsilon = 1.0e-8; + int iMax = 32; + int riIFinal = 0; + double rdX = 0.0; + double rdY = 0.0; + double dDistance; + bool swap = false; + bool majorSwap = false; + + if (dA < dB) + { + double dum = dA; + dA = dB; + dB = dum; + dum = dU; + dU = dV; + dV = dum; + majorSwap = true; + } + if (dV < 0.0) + { + dV *= -1.0; + swap = true; + } -void RS_Ellipse::moveStartpoint(const Vector& pos) { - data.angle1 = getEllipseAngle(pos); - //data.angle1 = data.center.angleTo(pos); - //calculateEndpoints(); - calculateBorders(); -} + // initial guess + double dT = dB * (dV - dB); + // Newton s method + int i; + for (i = 0; i < iMax; i++) + { + RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: i: %d", i); + double dTpASqr = dT + dA * dA; + double dTpBSqr = dT + dB * dB; + double dInvTpASqr = 1.0 / dTpASqr; + double dInvTpBSqr = 1.0 / dTpBSqr; + double dXDivA = dA * dU * dInvTpASqr; + double dYDivB = dB * dV * dInvTpBSqr; + double dXDivASqr = dXDivA * dXDivA; + double dYDivBSqr = dYDivB * dYDivB; + double dF = dXDivASqr + dYDivBSqr - 1.0; + RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: dF: %f", dF); + + if (fabs(dF) < dEpsilon) + { + // F(t0) is close enough to zero, terminate the iteration: + rdX = dXDivA * dA; + rdY = dYDivB * dB; + riIFinal = i; + RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: rdX,rdY 1: %f,%f", rdX, rdY); + break; + } + double dFDer = 2.0 * (dXDivASqr * dInvTpASqr + dYDivBSqr * dInvTpBSqr); + double dRatio = dF / dFDer; + RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: dRatio: %f", dRatio); -void RS_Ellipse::moveEndpoint(const Vector& pos) { - data.angle2 = getEllipseAngle(pos); - //data.angle2 = data.center.angleTo(pos); - //calculateEndpoints(); - calculateBorders(); -} + if (fabs(dRatio) < dEpsilon) + { + // t1-t0 is close enough to zero, terminate the iteration: + rdX = dXDivA * dA; + rdY = dYDivB * dB; + riIFinal = i; + RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: rdX,rdY 2: %f,%f", rdX, rdY); + break; + } + dT += dRatio; + } + if (i == iMax) + { + // failed to converge: + RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: failed"); + dDistance = RS_MAXDOUBLE; + } + else + { + double dDelta0 = rdX - dU; + double dDelta1 = rdY - dV; + dDistance = sqrt(dDelta0 * dDelta0 + dDelta1 * dDelta1); + ret = Vector(rdX, rdY); + RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: rdX,rdY 2: %f,%f", rdX, rdY); + RS_DEBUG->print("RS_Ellipse::getNearestPointOnEntity: ret: %f,%f", ret.x, ret.y); + } -RS2::Ending RS_Ellipse::getTrimPoint(const Vector& coord, - const Vector& trimPoint) { + if (dist != NULL) + { + if (ret.valid) + *dist = dDistance; + else + *dist = RS_MAXDOUBLE; + } - double angEl = getEllipseAngle(trimPoint); - double angM = getEllipseAngle(coord); + if (ret.valid) + { + if (swap) + ret.y *= -1.0; - if (RS_Math::getAngleDifference(angM, angEl)>M_PI) { - //if (data.reversed) { - // return RS2::EndingEnd; - //} - //else { - return RS2::EndingStart; - //} - } - else { - //if (data.reversed) { - // return RS2::EndingStart; - //} - //else { - return RS2::EndingEnd; - //} + + if (majorSwap) + { + double dum = ret.x; + ret.x = ret.y; + ret.y = dum; + } + ret = (ret.rotate(ang) + data.center); + + if (onEntity) + { + double a1 = data.center.angleTo(getStartpoint()); + double a2 = data.center.angleTo(getEndpoint()); + double a = data.center.angleTo(ret); + + if (!RS_Math::isAngleBetween(a, a1, a2, data.reversed)) + ret = Vector(false); + } } + + return ret; } -double RS_Ellipse::getEllipseAngle(const Vector& pos) { - Vector m = pos; - m.rotate(data.center, -data.majorP.angle()); - Vector v = m-data.center; - v.scale(Vector(1.0, 1.0/data.ratio)); - return v.angle(); +/** + * @param tolerance Tolerance. + * + * @retval true if the given point is on this entity. + * @retval false otherwise + */ +bool RS_Ellipse::isPointOnEntity(const Vector & coord, double tolerance) +{ + double dist = getDistanceToPoint(coord, NULL, RS2::ResolveNone); + return (dist <= tolerance); } +Vector RS_Ellipse::getNearestCenter(const Vector & coord, double * dist) +{ + if (dist != NULL) + *dist = coord.distanceTo(data.center); + return data.center; +} +/** + * @todo Implement this. + */ +Vector RS_Ellipse::getNearestMiddle(const Vector & /*coord*/, double * dist) +{ + if (dist != NULL) + *dist = RS_MAXDOUBLE; + return Vector(false); +} + +Vector RS_Ellipse::getNearestDist(double /*distance*/, const Vector & /*coord*/, double * dist) +{ + if (dist != NULL) + *dist = RS_MAXDOUBLE; + return Vector(false); +} + +double RS_Ellipse::getDistanceToPoint(const Vector & coord, RS_Entity * * entity, RS2::ResolveLevel, double /*solidDist*/) +{ + double dist = RS_MAXDOUBLE; + getNearestPointOnEntity(coord, true, &dist, entity); + + return dist; +} + +void RS_Ellipse::move(Vector offset) +{ + data.center.move(offset); + //calculateEndpoints(); + calculateBorders(); +} -void RS_Ellipse::scale(Vector center, Vector factor) { - data.center.scale(center, factor); - data.majorP.scale(factor); - //calculateEndpoints(); - calculateBorders(); +void RS_Ellipse::rotate(Vector center, double angle) +{ + data.center.rotate(center, angle); + data.majorP.rotate(angle); + //calculateEndpoints(); + calculateBorders(); } +void RS_Ellipse::scale(Vector center, Vector factor) +{ + data.center.scale(center, factor); + data.majorP.scale(factor); + //calculateEndpoints(); + calculateBorders(); +} /** * @todo deal with angles correctly */ -void RS_Ellipse::mirror(Vector axisPoint1, Vector axisPoint2) { - Vector mp = data.center + data.majorP; +void RS_Ellipse::mirror(Vector axisPoint1, Vector axisPoint2) +{ + Vector mp = data.center + data.majorP; - data.center.mirror(axisPoint1, axisPoint2); - mp.mirror(axisPoint1, axisPoint2); + data.center.mirror(axisPoint1, axisPoint2); + mp.mirror(axisPoint1, axisPoint2); - data.majorP = mp - data.center; + data.majorP = mp - data.center; - double a = axisPoint1.angleTo(axisPoint2); + double a = axisPoint1.angleTo(axisPoint2); - Vector vec; - vec.setPolar(1.0, data.angle1); - vec.mirror(Vector(0.0,0.0), axisPoint2-axisPoint1); - data.angle1 = vec.angle() - 2*a; + Vector vec; + vec.setPolar(1.0, data.angle1); + vec.mirror(Vector(0.0, 0.0), axisPoint2 - axisPoint1); + data.angle1 = vec.angle() - 2 * a; - vec.setPolar(1.0, data.angle2); - vec.mirror(Vector(0.0,0.0), axisPoint2-axisPoint1); - data.angle2 = vec.angle() - 2*a; + vec.setPolar(1.0, data.angle2); + vec.mirror(Vector(0.0, 0.0), axisPoint2 - axisPoint1); + data.angle2 = vec.angle() - 2 * a; - data.reversed = (!data.reversed); + data.reversed = (!data.reversed); - //calculateEndpoints(); - calculateBorders(); + //calculateEndpoints(); + calculateBorders(); } - - -void RS_Ellipse::moveRef(const Vector& ref, const Vector& offset) { +void RS_Ellipse::moveRef(const Vector & ref, const Vector & offset) +{ Vector startpoint = getStartpoint(); Vector endpoint = getEndpoint(); - if (ref.distanceTo(startpoint)<1.0e-4) { - moveStartpoint(startpoint+offset); - } - if (ref.distanceTo(endpoint)<1.0e-4) { - moveEndpoint(endpoint+offset); - } -} + if (ref.distanceTo(startpoint) < 1.0e-4) + moveStartpoint(startpoint + offset); + + if (ref.distanceTo(endpoint) < 1.0e-4) + moveEndpoint(endpoint + offset); +} -//void RS_Ellipse::draw(RS_Painter* painter, RS_GraphicView* view, double /*patternOffset*/) { -void RS_Ellipse::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/) +void RS_Ellipse::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/) { - if (painter == NULL || view == NULL) + if (!painter || !view) return; - if (getPen().getLineType()==RS2::SolidLine || isSelected() - || view->getDrawingMode()==RS2::ModePreview) - { + if (getPen().getLineType() == RS2::SolidLine || isSelected() + || view->getDrawingMode() == RS2::ModePreview) painter->drawEllipse(view->toGui(getCenter()), getMajorRadius() * view->getFactor().x, getMinorRadius() * view->getFactor().x, getAngle(), getAngle1(), getAngle2(), isReversed()); - } else { double styleFactor = getStyleFactor(view); @@ -465,18 +600,12 @@ void RS_Ellipse::draw(PaintInterface * painter, RS_GraphicView * view, double /* RS_LineTypePattern * pat; if (isSelected()) - { pat = &patternSelected; - } else - { pat = view->getPattern(getPen().getLineType()); - } if (pat == NULL) - { return; - } // Pen to draw pattern is always solid: RS_Pen pen = painter->getPen(); @@ -503,7 +632,7 @@ void RS_Ellipse::draw(PaintInterface * painter, RS_GraphicView * view, double /* do { curR = sqrt(RS_Math::pow(getMinorRadius() * cos(curA), 2.0) - + RS_Math::pow(getMajorRadius() * sin(curA), 2.0)); + + RS_Math::pow(getMajorRadius() * sin(curA), 2.0)); if (curR > 1.0e-6) { @@ -511,29 +640,23 @@ void RS_Ellipse::draw(PaintInterface * painter, RS_GraphicView * view, double /* if (pat->pattern[i] * styleFactor > 0.0) { - if (tot+fabs(da[i])drawEllipse(cp, r1, r2, getAngle(), curA, curA + da[i], false); - } else - { painter->drawEllipse(cp, r1, r2, getAngle(), curA, getAngle2(), false); - } } } - curA+=da[i]; - tot+=fabs(da[i]); - done=tot>length; + curA += da[i]; + tot += fabs(da[i]); + done = tot > length; i++; if (i >= pat->num) - { - i=0; - } + i = 0; } - while(!done); + while (!done); delete[] da; } @@ -542,8 +665,9 @@ void RS_Ellipse::draw(PaintInterface * painter, RS_GraphicView * view, double /* /** * Dumps the point's data to stdout. */ -std::ostream& operator << (std::ostream& os, const RS_Ellipse& a) { - os << " Ellipse: " << a.data << "\n"; - return os; +std::ostream & operator<<(std::ostream & os, const RS_Ellipse & a) +{ + os << " Ellipse: " << a.data << "\n"; + return os; } diff --git a/src/base/rs_ellipse.h b/src/base/rs_ellipse.h index 2c3e83e..dc0588c 100644 --- a/src/base/rs_ellipse.h +++ b/src/base/rs_ellipse.h @@ -1,30 +1,3 @@ -/**************************************************************************** -** $Id: rs_ellipse.h 2367 2005-04-04 16:57:36Z 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_ELLIPSE_H #define RS_ELLIPSE_H @@ -33,229 +6,108 @@ /** * Holds the data that defines an ellipse. */ -class RS_EllipseData { -public: - RS_EllipseData(const Vector& center, - const Vector& majorP, - double ratio, - double angle1, double angle2, - bool reversed) { - - this->center = center; - this->majorP = majorP; - this->ratio = ratio; - this->angle1 = angle1; - this->angle2 = angle2; - this->reversed = reversed; - } - - friend class RS_Ellipse; - - friend std::ostream& operator << (std::ostream& os, const RS_EllipseData& ed) { - os << "(" << ed.center << - "/" << ed.majorP << - " " << ed.ratio << - " " << ed.angle1 << - "," << ed.angle2 << - ")"; - return os; - } - -private: - //! Ellipse center - Vector center; - //! Endpoint of major axis relative to center. - Vector majorP; - //! Ratio of minor axis to major axis. - double ratio; - //! Start angle - double angle1; - //! End angle - double angle2; - //! Reversed (cw) flag - bool reversed; +class RS_EllipseData +{ + public: + RS_EllipseData(const Vector & center, const Vector & majorP, double ratio, double angle1, double angle2, bool reversed) + { + this->center = center; + this->majorP = majorP; + this->ratio = ratio; + this->angle1 = angle1; + this->angle2 = angle2; + this->reversed = reversed; + } + + friend class RS_Ellipse; + + friend std::ostream & operator<<(std::ostream & os, const RS_EllipseData & ed) + { + os << "(" << ed.center + << "/" << ed.majorP + << " " << ed.ratio + << " " << ed.angle1 + << "," << ed.angle2 + << ")"; + return os; + } + + private: + //! Ellipse center + Vector center; + //! Endpoint of major axis relative to center. + Vector majorP; + //! Ratio of minor axis to major axis. + double ratio; + //! Start angle + double angle1; + //! End angle + double angle2; + //! Reversed (cw) flag + bool reversed; }; - - - /** * Class for an ellipse entity. All angles are in Rad. * * @author Andrew Mustun */ -class RS_Ellipse : public RS_AtomicEntity { -public: - RS_Ellipse(RS_EntityContainer* parent, - const RS_EllipseData& d); - virtual ~RS_Ellipse() {} - - virtual RS_Entity* clone() { - RS_Ellipse* e = new RS_Ellipse(*this); - e->initId(); - return e; - } - - /** @return RS2::EntityEllipse */ - virtual RS2::EntityType rtti() const { - return RS2::EntityEllipse; - } - - - /** - * @return Start point of the entity. - */ - virtual Vector getStartpoint() const { - Vector p; - p.set(data.center.x + cos(data.angle1) * getMajorRadius(), - data.center.y + sin(data.angle1) * getMinorRadius()); - p.rotate(data.center, getAngle()); - return p; - } - /** - * @return End point of the entity. - */ - virtual Vector getEndpoint() const { - Vector p; - p.set(data.center.x + cos(data.angle2) * getMajorRadius(), - data.center.y + sin(data.angle2) * getMinorRadius()); - p.rotate(data.center, getAngle()); - return p; - } - - virtual void moveStartpoint(const Vector& pos); - virtual void moveEndpoint(const Vector& pos); - - virtual RS2::Ending getTrimPoint(const Vector& coord, - const Vector& trimPoint); - - double getEllipseAngle(const Vector& pos); - - /** @return Copy of data that defines the ellipse. **/ - RS_EllipseData getData() { - return data; - } - - virtual VectorSolutions getRefPoints(); - - /** - * @retval true if the arc is reversed (clockwise), - * @retval false otherwise - */ - bool isReversed() const { - return data.reversed; - } - /** sets the reversed status. */ - void setReversed(bool r) { - data.reversed = r; - } - - /** @return The rotation angle of this ellipse */ - double getAngle() const { - return data.majorP.angle(); - } - - /** @return The start angle of this arc */ - double getAngle1() { - return data.angle1; - } - /** Sets new start angle. */ - void setAngle1(double a1) { - data.angle1 = a1; - } - /** @return The end angle of this arc */ - double getAngle2() { - return data.angle2; - } - /** Sets new end angle. */ - void setAngle2(double a2) { - data.angle2 = a2; - } - - - /** @return The center point (x) of this arc */ - Vector getCenter() { - return data.center; - } - /** Sets new center. */ - void setCenter(const Vector& c) { - data.center = c; - } - - /** @return The endpoint of the major axis (relative to center). */ - Vector getMajorP() { - return data.majorP; - } - /** Sets new major point (relative to center). */ - void setMajorP(const Vector& p) { - data.majorP = p; - } - - /** @return The ratio of minor to major axis */ - double getRatio() { - return data.ratio; - } - /** Sets new ratio. */ - void setRatio(double r) { - data.ratio = r; - } - - - /** - * @return Angle length in rad. - */ - virtual double getAngleLength() const { - if (isReversed()) { - return data.angle1-data.angle2; - } else { - return data.angle2-data.angle1; - } - } - - /** @return The major radius of this ellipse. Same as getRadius() */ - double getMajorRadius() const { - return data.majorP.magnitude(); - } - - /** @return The minor radius of this ellipse */ - double getMinorRadius() const { - return data.majorP.magnitude()*data.ratio; - } - - virtual Vector getNearestEndpoint(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestPointOnEntity(const Vector& coord, - bool onEntity = true, double* dist = NULL, RS_Entity** entity=NULL); - virtual Vector getNearestCenter(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestMiddle(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestDist(double distance, - const Vector& coord, - double* dist = NULL); - virtual double getDistanceToPoint(const Vector& coord, - RS_Entity** entity=NULL, - RS2::ResolveLevel level=RS2::ResolveNone, - double solidDist = RS_MAXDOUBLE); - virtual bool isPointOnEntity(const Vector& coord, - double tolerance=RS_TOLERANCE); - - virtual void move(Vector offset); - virtual void rotate(Vector center, double angle); - virtual void scale(Vector center, Vector factor); - virtual void mirror(Vector axisPoint1, Vector axisPoint2); - virtual void moveRef(const Vector& ref, const Vector& offset); - -// virtual void draw(RS_Painter* painter, RS_GraphicView* view, double patternOffset=0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); - - friend std::ostream & operator<<(std::ostream & os, const RS_Ellipse & a); - - //virtual void calculateEndpoints(); - virtual void calculateBorders(); - -protected: - RS_EllipseData data; +class RS_Ellipse: public RS_AtomicEntity +{ + public: + RS_Ellipse(RS_EntityContainer * parent, const RS_EllipseData & d); + virtual ~RS_Ellipse(); + + virtual RS_Entity * clone(); + virtual RS2::EntityType rtti() const; + virtual Vector getStartpoint() const; + virtual Vector getEndpoint() const; + virtual void moveStartpoint(const Vector & pos); + virtual void moveEndpoint(const Vector & pos); + virtual RS2::Ending getTrimPoint(const Vector & coord, const Vector & trimPoint); + double getEllipseAngle(const Vector & pos); + RS_EllipseData getData(); + virtual VectorSolutions getRefPoints(); + bool isReversed() const; + void setReversed(bool r); + double getAngle() const; + double getAngle1(); + void setAngle1(double a1); + double getAngle2(); + void setAngle2(double a2); + Vector getCenter(); + void setCenter(const Vector & c); + Vector getMajorP(); + void setMajorP(const Vector & p); + double getRatio(); + void setRatio(double r); + virtual double getAngleLength() const; + double getMajorRadius() const; + double getMinorRadius() const; + + virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL); + virtual Vector getNearestPointOnEntity(const Vector & coord, bool onEntity = true, double * dist = NULL, RS_Entity ** entity = NULL); + virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL); + virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL); + virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL); + virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); + virtual bool isPointOnEntity(const Vector & coord, double tolerance = RS_TOLERANCE); + + virtual void move(Vector offset); + virtual void rotate(Vector center, double angle); + virtual void scale(Vector center, Vector factor); + virtual void mirror(Vector axisPoint1, Vector axisPoint2); + virtual void moveRef(const Vector & ref, const Vector & offset); + + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); + + friend std::ostream & operator<<(std::ostream & os, const RS_Ellipse & a); + + //virtual void calculateEndpoints(); + virtual void calculateBorders(); + + protected: + RS_EllipseData data; }; #endif diff --git a/src/base/rs_entity.cpp b/src/base/rs_entity.cpp index fc7dbea..da69974 100644 --- a/src/base/rs_entity.cpp +++ b/src/base/rs_entity.cpp @@ -21,7 +21,7 @@ #include "rs_document.h" #include "rs_ellipse.h" #include "drawing.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_insert.h" #include "rs_layer.h" #include "rs_line.h" @@ -736,7 +736,7 @@ RS2::Unit RS_Entity::getGraphicUnit() * Implementations must drag the reference point(s) of all * (sub-)entities that are very close to ref by offset. */ -/*virtual*/ void RS_Entity::moveRef(const Vector & /*ref*/, const Vector & /*offset*/) +/*virtual*/ void RS_Entity::moveRef(const Vector &/*ref*/, const Vector &/*offset*/) { return; } @@ -745,7 +745,7 @@ RS2::Unit RS_Entity::getGraphicUnit() * Implementations must drag the reference point(s) of selected * (sub-)entities that are very close to ref by offset. */ -/*virtual*/ void RS_Entity::moveSelectedRef(const Vector & /*ref*/, const Vector & /*offset*/) +/*virtual*/ void RS_Entity::moveSelectedRef(const Vector &/*ref*/, const Vector &/*offset*/) { return; } @@ -917,7 +917,7 @@ void RS_Entity::stretch(Vector firstCorner, Vector secondCorner, Vector offset) * @return Factor for scaling the line styles considering the current * paper scaling and the fact that styles are stored in Millimeter. */ -double RS_Entity::getStyleFactor(RS_GraphicView * view) +double RS_Entity::getStyleFactor(GraphicView * view) { double styleFactor = 1.0; @@ -1100,4 +1100,3 @@ std::ostream & operator<<(std::ostream & os, RS_Entity & e) return os; } - diff --git a/src/base/rs_entity.h b/src/base/rs_entity.h index 7764832..bd1060e 100644 --- a/src/base/rs_entity.h +++ b/src/base/rs_entity.h @@ -16,7 +16,7 @@ class RS_Circle; class RS_Document; class RS_EntityContainer; class Drawing; -class RS_GraphicView; +class GraphicView; class RS_Insert; class RS_Line; class RS_Point; @@ -45,15 +45,15 @@ class RS_Entity: public RS_Undoable unsigned long int getId() const; /** - * This method must be overwritten in subclasses and return the - * number of atomic entities in this entity. - */ + * This method must be overwritten in subclasses and return the + * number of atomic entities in this entity. + */ virtual unsigned long int count() = 0; /** - * This method must be overwritten in subclasses and return the - * number of atomic entities in this entity including sub containers. - */ + * This method must be overwritten in subclasses and return the + * number of atomic entities in this entity including sub containers. + */ virtual unsigned long int countDeep() = 0; virtual double getLength(); @@ -74,15 +74,15 @@ class RS_Entity: public RS_Undoable RS_Pen getPen(bool resolve = true) const; /** - * Must be overwritten to return true if an entity type - * is a container for other entities (e.g. polyline, group, ...). - */ + * Must be overwritten to return true if an entity type + * is a container for other entities (e.g. polyline, group, ...). + */ virtual bool isContainer() const = 0; /** - * Must be overwritten to return true if an entity type - * is an atomic entity. - */ + * Must be overwritten to return true if an entity type + * is an atomic entity. + */ virtual bool isAtomic() const = 0; virtual bool isEdge() const; @@ -119,59 +119,59 @@ class RS_Entity: public RS_Undoable virtual VectorSolutions getRefPoints(); /** - * Must be overwritten to get the closest endpoint to the - * given coordinate for this entity. - * - * @param coord Coordinate (typically a mouse coordinate) - * @param dist Pointer to a value which will contain the measured - * distance between 'coord' and the closest endpoint. The passed - * pointer can also be NULL in which case the distance will be - * lost. - * - * @return The closest endpoint. - */ + * Must be overwritten to get the closest endpoint to the + * given coordinate for this entity. + * + * @param coord Coordinate (typically a mouse coordinate) + * @param dist Pointer to a value which will contain the measured + * distance between 'coord' and the closest endpoint. The passed + * pointer can also be NULL in which case the distance will be + * lost. + * + * @return The closest endpoint. + */ virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL) = 0; /** - * Must be overwritten to get the closest coordinate to the - * given coordinate which is on this entity. - * - * @param coord Coordinate (typically a mouse coordinate) - * @param dist Pointer to a value which will contain the measured - * distance between \p coord and the point. The passed pointer can - * also be \p NULL in which case the distance will be lost. - * - * @return The closest coordinate. - */ + * Must be overwritten to get the closest coordinate to the + * given coordinate which is on this entity. + * + * @param coord Coordinate (typically a mouse coordinate) + * @param dist Pointer to a value which will contain the measured + * distance between \p coord and the point. The passed pointer can + * also be \p NULL in which case the distance will be lost. + * + * @return The closest coordinate. + */ virtual Vector getNearestPointOnEntity(const Vector& /*coord*/, bool onEntity = true, double * dist = NULL, RS_Entity ** entity = NULL) = 0; /** - * Must be overwritten to get the (nearest) center point to the - * given coordinate for this entity. - * - * @param coord Coordinate (typically a mouse coordinate) - * @param dist Pointer to a value which will contain the measured - * distance between 'coord' and the closest center point. The passed - * pointer can also be NULL in which case the distance will be - * lost. - * - * @return The closest center point. - */ + * Must be overwritten to get the (nearest) center point to the + * given coordinate for this entity. + * + * @param coord Coordinate (typically a mouse coordinate) + * @param dist Pointer to a value which will contain the measured + * distance between 'coord' and the closest center point. The passed + * pointer can also be NULL in which case the distance will be + * lost. + * + * @return The closest center point. + */ virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL) = 0; /** - * Must be overwritten to get the (nearest) middle point to the - * given coordinate for this entity. - * - * @param coord Coordinate (typically a mouse coordinate) - * @param dist Pointer to a value which will contain the measured - * distance between 'coord' and the closest middle point. The passed - * pointer can also be NULL in which case the distance will be - * lost. - * - * @return The closest middle point. - */ + * Must be overwritten to get the (nearest) middle point to the + * given coordinate for this entity. + * + * @param coord Coordinate (typically a mouse coordinate) + * @param dist Pointer to a value which will contain the measured + * distance between 'coord' and the closest middle point. The passed + * pointer can also be NULL in which case the distance will be + * lost. + * + * @return The closest middle point. + */ virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL) = 0; /** @@ -194,45 +194,45 @@ class RS_Entity: public RS_Undoable virtual Vector getNearestSelectedRef(const Vector & coord, double * dist = NULL); /** - * Must be overwritten to get the shortest distance between this - * entity and a coordinate. - * - * @param coord Coordinate (typically a mouse coordinate) - * @param entity Pointer which will contain the (sub-)entity which is - * closest to the given point or NULL if the caller is not - * interested in this information. - * @param level The resolve level. - * - * @sa RS2::ResolveLevel - * - * @return The measured distance between \p coord and the entity. - */ + * Must be overwritten to get the shortest distance between this + * entity and a coordinate. + * + * @param coord Coordinate (typically a mouse coordinate) + * @param entity Pointer which will contain the (sub-)entity which is + * closest to the given point or NULL if the caller is not + * interested in this information. + * @param level The resolve level. + * + * @sa RS2::ResolveLevel + * + * @return The measured distance between \p coord and the entity. + */ virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE) = 0; virtual bool isPointOnEntity(const Vector & coord, double tolerance = RS_TOLERANCE); /** - * Implementations must move the entity by the given vector. - */ + * Implementations must move the entity by the given vector. + */ virtual void move(Vector offset) = 0; /** - * Implementations must rotate the entity by the given angle around - * the given center. - */ + * Implementations must rotate the entity by the given angle around + * the given center. + */ virtual void rotate(Vector center, double angle) = 0; /** - * Implementations must scale the entity by the given factors. - */ + * Implementations must scale the entity by the given factors. + */ virtual void scale(Vector center, Vector factor) = 0; virtual void scale(Vector center, double factor); /** - * Implementations must mirror the entity by the given axis. - */ + * Implementations must mirror the entity by the given axis. + */ virtual void mirror(Vector axisPoint1, Vector axisPoint2) = 0; virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset); @@ -240,12 +240,11 @@ class RS_Entity: public RS_Undoable virtual void moveSelectedRef(const Vector & /*ref*/, const Vector & /*offset*/); /** - * Implementations must draw the entity on the given device. - */ -// virtual void draw(RS_Painter* painter, RS_GraphicView* view, - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0) = 0; + * Implementations must draw the entity on the given device. + */ + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0) = 0; - double getStyleFactor(RS_GraphicView * view); + double getStyleFactor(GraphicView * view); QString * getUserDefVar(QString key); QStringList getAllKeys(); diff --git a/src/base/rs_entitycontainer.cpp b/src/base/rs_entitycontainer.cpp index 85a38b5..8434b9c 100644 --- a/src/base/rs_entitycontainer.cpp +++ b/src/base/rs_entitycontainer.cpp @@ -24,7 +24,7 @@ #include "rs_insert.h" #include "rs_spline.h" #include "rs_information.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "paintintf.h" bool RS_EntityContainer::autoUpdateBorders = true; @@ -1680,8 +1680,7 @@ void RS_EntityContainer::moveSelectedRef(const Vector & ref, const Vector & offs calculateBorders(); } -//void RS_EntityContainer::draw(RS_Painter* painter, RS_GraphicView* view, -void RS_EntityContainer::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/) +void RS_EntityContainer::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/) { if (painter == NULL || view == NULL) return; diff --git a/src/base/rs_entitycontainer.h b/src/base/rs_entitycontainer.h index 9d968bb..4e4cf22 100644 --- a/src/base/rs_entitycontainer.h +++ b/src/base/rs_entitycontainer.h @@ -99,9 +99,7 @@ class RS_EntityContainer: public RS_Entity virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset); virtual void moveRef(const Vector & ref, const Vector & offset); virtual void moveSelectedRef(const Vector & ref, const Vector & offset); - -// virtual void draw(RS_Painter* painter, RS_GraphicView* view, double patternOffset=0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); friend std::ostream & operator<<(std::ostream & os, RS_EntityContainer & ec); diff --git a/src/base/rs_eventhandler.cpp b/src/base/rs_eventhandler.cpp index 260998a..20e7484 100644 --- a/src/base/rs_eventhandler.cpp +++ b/src/base/rs_eventhandler.cpp @@ -19,13 +19,13 @@ #include "rs_commandevent.h" #include "rs_debug.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_math.h" /** * Constructor. */ -RS_EventHandler::RS_EventHandler(RS_GraphicView * graphicView) +RS_EventHandler::RS_EventHandler(GraphicView * graphicView) { this->graphicView = graphicView; actionIndex = -1; @@ -91,7 +91,7 @@ void RS_EventHandler::enter() } /** - * Called by RS_GraphicView + * Called by GraphicView */ void RS_EventHandler::mousePressEvent(QMouseEvent * e) { @@ -116,7 +116,7 @@ void RS_EventHandler::mousePressEvent(QMouseEvent * e) } /** - * Called by RS_GraphicView + * Called by GraphicView */ void RS_EventHandler::mouseReleaseEvent(QMouseEvent * e) { @@ -140,7 +140,7 @@ void RS_EventHandler::mouseReleaseEvent(QMouseEvent * e) } /** - * Called by RS_GraphicView + * Called by GraphicView */ void RS_EventHandler::mouseMoveEvent(QMouseEvent * e) { @@ -164,7 +164,7 @@ void RS_EventHandler::mouseMoveEvent(QMouseEvent * e) } /** - * Called by RS_GraphicView + * Called by GraphicView */ void RS_EventHandler::mouseLeaveEvent() { @@ -182,7 +182,7 @@ void RS_EventHandler::mouseLeaveEvent() } /** - * Called by RS_GraphicView + * Called by GraphicView */ void RS_EventHandler::mouseEnterEvent() { @@ -199,7 +199,7 @@ void RS_EventHandler::mouseEnterEvent() } /** - * Called by RS_GraphicView + * Called by GraphicView */ void RS_EventHandler::keyPressEvent(QKeyEvent * e) { @@ -220,7 +220,7 @@ void RS_EventHandler::keyPressEvent(QKeyEvent * e) } /** - * Called by RS_GraphicView + * Called by GraphicView */ void RS_EventHandler::keyReleaseEvent(QKeyEvent * e) { @@ -527,7 +527,7 @@ void RS_EventHandler::setCurrentAction(RS_ActionInterface * action) RS_DEBUG->print("RS_EventHandler::setCurrentAction: debugging actions"); debugActions(); - RS_DEBUG->print("RS_GraphicView::setCurrentAction: OK"); + RS_DEBUG->print("GraphicView::setCurrentAction: OK"); } /** diff --git a/src/base/rs_eventhandler.h b/src/base/rs_eventhandler.h index ff92d5d..601bba7 100644 --- a/src/base/rs_eventhandler.h +++ b/src/base/rs_eventhandler.h @@ -6,6 +6,7 @@ #define RS_MAXACTIONS 16 class RS_ActionInterface; +class GraphicView; /** * The event handler owns and manages all actions that are currently @@ -15,7 +16,7 @@ class RS_ActionInterface; class RS_EventHandler { public: - RS_EventHandler(RS_GraphicView * graphicView); + RS_EventHandler(GraphicView * graphicView); ~RS_EventHandler(); void back(); @@ -50,7 +51,7 @@ class RS_EventHandler void setSnapRestriction(RS2::SnapRestriction sr); protected: - RS_GraphicView * graphicView; + GraphicView * graphicView; RS_ActionInterface * defaultAction; RS_ActionInterface * currentActions[RS_MAXACTIONS]; int actionIndex; diff --git a/src/base/rs_grid.cpp b/src/base/rs_grid.cpp index 3f2252a..c2f43e0 100644 --- a/src/base/rs_grid.cpp +++ b/src/base/rs_grid.cpp @@ -14,10 +14,15 @@ #include "rs_grid.h" -#include "rs_units.h" #include "drawing.h" +#include "graphicview.h" +//#include "rs_graphicview.h" #include "settings.h" +#include "rs_units.h" +#include "vector.h" +#warning "!!! Clean out all references to RS_GraphicView here and in header !!!" +#if 0 /** * Constructor. */ @@ -25,6 +30,15 @@ RS_Grid::RS_Grid(RS_GraphicView * gv): graphicView(gv), pt(NULL), number(0), metaX(NULL), numMetaX(0), metaY(NULL), numMetaY(0) { } +#endif + +/** + * Constructor II. + */ +RS_Grid::RS_Grid(GraphicView * gv): graphicView(gv), pt(NULL), number(0), + metaX(NULL), numMetaX(0), metaY(NULL), numMetaY(0) +{ +} /** * Destructor. diff --git a/src/base/rs_grid.h b/src/base/rs_grid.h index 67b3625..d2ba69a 100644 --- a/src/base/rs_grid.h +++ b/src/base/rs_grid.h @@ -1,8 +1,11 @@ #ifndef RS_GRID_H #define RS_GRID_H -#include "rs_graphicview.h" -#include "vector.h" +#include + +//class RS_GraphicView; +class GraphicView; +class Vector; /** * This class represents a grid. Grids can be drawn on graphic @@ -13,7 +16,8 @@ class RS_Grid { public: - RS_Grid(RS_GraphicView *); +// RS_Grid(RS_GraphicView *); + RS_Grid(GraphicView *); ~RS_Grid(); void update(); @@ -28,7 +32,8 @@ class RS_Grid protected: //! Graphic view this grid is connected to. - RS_GraphicView * graphicView; +// RS_GraphicView * graphicView; + GraphicView * graphicView; //! Current grid spacing double spacing; diff --git a/src/base/rs_hatch.cpp b/src/base/rs_hatch.cpp index 36237db..2a7b5a7 100644 --- a/src/base/rs_hatch.cpp +++ b/src/base/rs_hatch.cpp @@ -15,12 +15,12 @@ #include "rs_hatch.h" #include -#include "rs_graphicview.h" #include "drawing.h" +#include "graphicview.h" #include "rs_information.h" +#include "paintintf.h" #include "rs_pattern.h" #include "rs_patternlist.h" -#include "paintintf.h" /** * Constructor. @@ -576,8 +576,7 @@ void RS_Hatch::activateContour(bool on) /** * Overrides drawing of subentities. This is only ever called for solid fills. */ -//void RS_Hatch::draw(RS_Painter* painter, RS_GraphicView* view, -void RS_Hatch::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/) +void RS_Hatch::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/) { if (!data.solid) { diff --git a/src/base/rs_hatch.h b/src/base/rs_hatch.h index 9fea88f..ba560ed 100644 --- a/src/base/rs_hatch.h +++ b/src/base/rs_hatch.h @@ -74,10 +74,7 @@ class RS_Hatch: public RS_EntityContainer virtual void calculateBorders(); void update(); void activateContour(bool on); - - // virtual void draw(RS_Painter* painter, RS_GraphicView* view, - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); - + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); virtual double getLength(); virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); diff --git a/src/base/rs_image.cpp b/src/base/rs_image.cpp index bf0e1c4..a92297f 100644 --- a/src/base/rs_image.cpp +++ b/src/base/rs_image.cpp @@ -16,7 +16,8 @@ #include "rs_constructionline.h" #include "rs_debug.h" -#include "rs_graphicview.h" +#include "graphicview.h" +#include "rs_line.h" #include "paintintf.h" /** @@ -35,8 +36,8 @@ RS_Image::RS_Image(RS_EntityContainer * parent, const RS_ImageData & d): RS_Image::~RS_Image() { /*if (img!=NULL) { - delete[] img; - }*/ + delete[] img; + }*/ } RS_Entity * RS_Image::clone() @@ -48,6 +49,12 @@ RS_Entity * RS_Image::clone() return i; } +/** @return RS2::EntityImage */ +/*virtual*/ RS2::EntityType RS_Image::rtti() const +{ + return RS2::EntityImage; +} + void RS_Image::update() { RS_DEBUG->print("RS_Image::update"); @@ -62,38 +69,154 @@ void RS_Image::update() RS_DEBUG->print("RS_Image::update: OK"); /* - // number of small images: - nx = image.width()/100; - ny = image.height()/100; - - // create small images: - img = new QImage*[nx]; - RS_Pixmap pm; - int w,h; - for (int x = 0; xgetHeight(); Vector scale = Vector(view->toGuiDX(data.uVector.magnitude()), - view->toGuiDY(data.vVector.magnitude())); + view->toGuiDY(data.vVector.magnitude())); double angle = data.uVector.angle(); int startX, stopX, startY, stopY; if (data.uVector.x > 1.0e-6 && data.vVector.y > 1.0e-6) { - startX = (int)((view->toGraphX(ox)-data.insertionPoint.x) / data.uVector.x) - 1; + startX = (int)((view->toGraphX(ox) - data.insertionPoint.x) / data.uVector.x) - 1; if (startX < 0) - { startX = 0; - } - stopX = (int)((view->toGraphX(width)-data.insertionPoint.x) / data.uVector.x) + 1; + stopX = (int)((view->toGraphX(width) - data.insertionPoint.x) / data.uVector.x) + 1; if (stopX > (int)data.size.x) - { stopX = (int)data.size.x; - } - startY = -(int)((view->toGraphY(oy) - (data.insertionPoint.y+getImageHeight())) / - data.vVector.y) - 1; + startY = -(int)((view->toGraphY(oy) - (data.insertionPoint.y + getImageHeight())) + / data.vVector.y) - 1; - if (startY<0) - { + if (startY < 0) startY = 0; - } - stopY = -(int)((view->toGraphY(height) - (data.insertionPoint.y+getImageHeight())) / - data.vVector.y) + 1; + stopY = -(int)((view->toGraphY(height) - (data.insertionPoint.y + getImageHeight())) + / data.vVector.y) + 1; - if (stopY>(int)data.size.y) - { + if (stopY > (int)data.size.y) stopY = (int)data.size.y; - } } else { @@ -310,7 +413,7 @@ void RS_Image::draw(PaintInterface * painter, RS_GraphicView * view, double /*pa } painter->drawImg(img, view->toGui(data.insertionPoint), angle, scale, - startX, startY, stopX-startX, stopY-startY); + startX, startY, stopX - startX, stopY - startY); if (isSelected()) { @@ -331,4 +434,3 @@ std::ostream & operator<<(std::ostream & os, const RS_Image & i) os << " Image: " << i.getData() << "\n"; return os; } - diff --git a/src/base/rs_image.h b/src/base/rs_image.h index 3c16c77..5076a3e 100644 --- a/src/base/rs_image.h +++ b/src/base/rs_image.h @@ -9,216 +9,107 @@ */ class RS_ImageData { -public: - /** - * Default constructor. Leaves the data object uninitialized. - */ - RS_ImageData() {} - - RS_ImageData(int handle, - const Vector& insertionPoint, - const Vector& uVector, - const Vector& vVector, - const Vector& size, - const QString& file, - int brightness, - int contrast, - int fade) { - - this->handle = handle; - this->insertionPoint = insertionPoint; - this->uVector = uVector; - this->vVector = vVector; - this->size = size; - this->file = file; - this->brightness = brightness; - this->contrast = contrast; - this->fade = fade; - } - - friend std::ostream& operator << (std::ostream& os, const RS_ImageData& ld) { - os << "(" << ld.insertionPoint << ")"; - return os; - } - -public: - /** Handle of image definition. */ - int handle; - /** Insertion point. */ - Vector insertionPoint; - /** u vector. Points along visual bottom of image. */ - Vector uVector; - /** v vector. Points along visual left of image. */ - Vector vVector; - /** Image size in pixel. */ - Vector size; - /** Path to image file. */ - QString file; - /** Brightness (0..100, default: 50). */ - int brightness; - /** Contrast (0..100, default: 50). */ - int contrast; - /** Fade (0..100, default: 0). */ - int fade; + public: + /** + * Default constructor. Leaves the data object uninitialized. + */ + RS_ImageData() + { + } + + RS_ImageData(int handle, const Vector & insertionPoint, const Vector & uVector, const Vector & vVector, const Vector & size, const QString & file, int brightness, int contrast, int fade) + { + this->handle = handle; + this->insertionPoint = insertionPoint; + this->uVector = uVector; + this->vVector = vVector; + this->size = size; + this->file = file; + this->brightness = brightness; + this->contrast = contrast; + this->fade = fade; + } + + friend std::ostream & operator<<(std::ostream & os, const RS_ImageData & ld) + { + os << "(" << ld.insertionPoint << ")"; + return os; + } + + public: + /** Handle of image definition. */ + int handle; + /** Insertion point. */ + Vector insertionPoint; + /** u vector. Points along visual bottom of image. */ + Vector uVector; + /** v vector. Points along visual left of image. */ + Vector vVector; + /** Image size in pixel. */ + Vector size; + /** Path to image file. */ + QString file; + /** Brightness (0..100, default: 50). */ + int brightness; + /** Contrast (0..100, default: 50). */ + int contrast; + /** Fade (0..100, default: 0). */ + int fade; }; - - /** - * Class for a line entity. + * Class for a bitmap image entity. * * @author Andrew Mustun */ -class RS_Image : public RS_AtomicEntity +class RS_Image: public RS_AtomicEntity { -public: - RS_Image(RS_EntityContainer* parent, - const RS_ImageData& d); - - virtual RS_Entity* clone(); - - virtual ~RS_Image(); - - /** @return RS2::EntityImage */ - virtual RS2::EntityType rtti() const { - return RS2::EntityImage; - } - - virtual void update(); - - /** @return Copy of data that defines the image. */ - RS_ImageData getData() const { - return data; - } - - /** @return Insertion point of the entity */ - virtual Vector getInsertionPoint() const { - return data.insertionPoint; - } - /** Sets the insertion point for the image. */ - void setInsertionPoint(Vector ip) { - data.insertionPoint = ip; - calculateBorders(); - } - - /** @return File name of the image. */ - QString getFile() const { - return data.file; - } - - /** Sets the file name of the image. */ - void setFile(const QString& file) { - data.file = file; - } - - /** @return u Vector. Points along bottom, 1 pixel long. */ - Vector getUVector() const { - return data.uVector; - } - /** @return v Vector. Points along left, 1 pixel long. */ - Vector getVVector() const { - return data.vVector; - } - /** @return Width of image in pixels. */ - int getWidth() const { - return (int)data.size.x; - } - /** @return Height of image in pixels. */ - int getHeight() const { - return (int)data.size.y; - } - /** @return Brightness. */ - int getBrightness() const { - return data.brightness; - } - /** @return Contrast. */ - int getContrast() const { - return data.contrast; - } - /** @return Fade. */ - int getFade() const { - return data.fade; - } - /** @return Image definition handle. */ - int getHandle() const { - return data.handle; - } - /** Sets the image definition handle. */ - void setHandle(int h) { - data.handle = h; - } - - - /** @return The four corners. **/ - VectorSolutions getCorners() { - VectorSolutions sol(4); - - sol.set(0, data.insertionPoint); - sol.set(1, - data.insertionPoint + data.uVector*RS_Math::round(data.size.x)); - sol.set(3, - data.insertionPoint + data.vVector*RS_Math::round(data.size.y)); - sol.set(2, sol.get(3) + data.uVector*RS_Math::round(data.size.x)); - - return sol; - } - - /** - * @return image with in graphic units. - */ - double getImageWidth() { - return data.size.x * data.uVector.magnitude(); - } - - /** - * @return image height in graphic units. - */ - double getImageHeight() { - return data.size.y * data.vVector.magnitude(); - } - - - virtual Vector getNearestEndpoint(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestPointOnEntity(const Vector& coord, - bool onEntity=true, double* dist = NULL, RS_Entity** entity=NULL); - virtual Vector getNearestCenter(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestMiddle(const Vector& coord, - double* dist = NULL); - virtual Vector getNearestDist(double distance, - const Vector& coord, - double* dist = NULL); - virtual double getDistanceToPoint(const Vector& coord, - RS_Entity** entity=NULL, - RS2::ResolveLevel level=RS2::ResolveNone, - double solidDist = RS_MAXDOUBLE); - - virtual double getLength() { - return -1.0; - } - - virtual void move(Vector offset); - virtual void rotate(Vector center, double angle); - virtual void scale(Vector center, Vector factor); - virtual void mirror(Vector axisPoint1, Vector axisPoint2); - /*virtual void stretch(Vector firstCorner, - Vector secondCorner, - Vector offset);*/ - -// virtual void draw(RS_Painter* painter, RS_GraphicView* view, double patternOffset=0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); - - friend std::ostream & operator<<(std::ostream & os, const RS_Image & l); - - virtual void calculateBorders(); - -protected: - RS_ImageData data; - QImage img; - //RS_Img** img; - //int nx; - //int ny; + public: + RS_Image(RS_EntityContainer * parent, const RS_ImageData & d); + virtual ~RS_Image(); + + virtual RS_Entity * clone(); + virtual RS2::EntityType rtti() const; + virtual void update(); + RS_ImageData getData() const; + virtual Vector getInsertionPoint() const; + void setInsertionPoint(Vector ip); + QString getFile() const; + void setFile(const QString & file); + Vector getUVector() const; + Vector getVVector() const; + int getWidth() const; + int getHeight() const; + int getBrightness() const; + int getContrast() const; + int getFade() const; + int getHandle() const; + void setHandle(int h); + VectorSolutions getCorners(); + double getImageWidth(); + double getImageHeight(); + + virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL); + virtual Vector getNearestPointOnEntity(const Vector & coord, bool onEntity = true, double * dist = NULL, RS_Entity * * entity = NULL); + virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL); + virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL); + virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL); + virtual double getDistanceToPoint(const Vector & coord, RS_Entity * * entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); + virtual double getLength(); + virtual void move(Vector offset); + virtual void rotate(Vector center, double angle); + virtual void scale(Vector center, Vector factor); + virtual void mirror(Vector axisPoint1, Vector axisPoint2); + /*virtual void stretch(Vector firstCorner,Vector secondCorner, Vector offset);*/ + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); + + friend std::ostream & operator<<(std::ostream & os, const RS_Image & l); + + virtual void calculateBorders(); + + protected: + RS_ImageData data; + QImage img; }; #endif diff --git a/src/base/rs_line.cpp b/src/base/rs_line.cpp index 8813b3e..f67d108 100644 --- a/src/base/rs_line.cpp +++ b/src/base/rs_line.cpp @@ -15,8 +15,9 @@ #include "rs_line.h" #include "rs_debug.h" -#include "rs_graphicview.h" #include "drawing.h" +#include "graphicview.h" +#include "rs_linetypepattern.h" #include "paintintf.h" /** @@ -484,8 +485,7 @@ void RS_Line::moveRef(const Vector& ref, const Vector& offset) } } -//void RS_Line::draw(RS_Painter * painter, RS_GraphicView * view, double patternOffset) -void RS_Line::draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset) +void RS_Line::draw(PaintInterface * painter, GraphicView * view, double patternOffset) { if (painter == NULL || view == NULL) //{ diff --git a/src/base/rs_line.h b/src/base/rs_line.h index 04a4c86..7b3cdcd 100644 --- a/src/base/rs_line.h +++ b/src/base/rs_line.h @@ -78,8 +78,7 @@ class RS_Line: public RS_AtomicEntity virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL); virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL); virtual Vector getNearestDist(double distance, bool startp); - //virtual Vector getNearestRef(const Vector& coord, - // double* dist = NULL); + //virtual Vector getNearestRef(const Vector& coord, double* dist = NULL); virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL, RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); @@ -90,9 +89,7 @@ class RS_Line: public RS_AtomicEntity virtual void mirror(Vector axisPoint1, Vector axisPoint2); virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset); virtual void moveRef(const Vector & ref, const Vector & offset); - -// virtual void draw(RS_Painter * painter, RS_GraphicView * view, double patternOffset = 0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); friend std::ostream & operator<<(std::ostream & os, const RS_Line & l); @@ -100,8 +97,6 @@ class RS_Line: public RS_AtomicEntity protected: RS_LineData data; - //Vector startpoint; - //Vector endpoint; }; #endif diff --git a/src/base/rs_mainwindowinterface.h b/src/base/rs_mainwindowinterface.h index e3e0bdb..e1ad32f 100644 --- a/src/base/rs_mainwindowinterface.h +++ b/src/base/rs_mainwindowinterface.h @@ -1,7 +1,7 @@ #ifndef RS_MAINWINDOWINTERFACE_H #define RS_MAINWINDOWINTERFACE_H -class RS_GraphicView; +class GraphicView; class RS_Document; /** @@ -13,7 +13,7 @@ public: RS_MainWindowInterface() {} virtual ~RS_MainWindowInterface() {} - virtual RS_GraphicView * getGraphicView() = 0; + virtual GraphicView * getGraphicView() = 0; virtual RS_Document * getDocument() = 0; virtual void createNewDocument(const QString & fileName = QString::null, RS_Document * doc = NULL) = 0; diff --git a/src/base/rs_modification.cpp b/src/base/rs_modification.cpp index 29179b9..f452583 100644 --- a/src/base/rs_modification.cpp +++ b/src/base/rs_modification.cpp @@ -35,7 +35,7 @@ * @param handleUndo true: Handle undo functionalitiy. */ RS_Modification::RS_Modification(RS_EntityContainer & container, - RS_GraphicView * graphicView, bool handleUndo) + GraphicView * graphicView, bool handleUndo) { this->container = &container; this->graphicView = graphicView; diff --git a/src/base/rs_modification.h b/src/base/rs_modification.h index 28cdb84..41fb026 100644 --- a/src/base/rs_modification.h +++ b/src/base/rs_modification.h @@ -2,7 +2,7 @@ #define RS_MODIFICATION_H #include "rs_entitycontainer.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_line.h" /** @@ -174,7 +174,7 @@ class RS_Modification { public: RS_Modification(RS_EntityContainer & entityContainer, - RS_GraphicView * graphicView = NULL, bool handleUndo = true); + GraphicView * graphicView = NULL, bool handleUndo = true); void remove(); bool changeAttributes(RS_AttributesData& data); @@ -235,7 +235,7 @@ class RS_Modification RS_EntityContainer * container; Drawing * graphic; RS_Document * document; - RS_GraphicView * graphicView; + GraphicView * graphicView; bool handleUndo; }; diff --git a/src/base/rs_point.cpp b/src/base/rs_point.cpp index be98cc5..de32daa 100644 --- a/src/base/rs_point.cpp +++ b/src/base/rs_point.cpp @@ -14,8 +14,7 @@ #include "rs_point.h" -#include "rs_graphicview.h" -//#include "rs_painter.h" +#include "graphicview.h" #include "paintintf.h" /** @@ -168,8 +167,7 @@ void RS_Point::mirror(Vector axisPoint1, Vector axisPoint2) calculateBorders(); } -//void RS_Point::draw(RS_Painter * painter, RS_GraphicView * view, double /*patternOffset*/) -void RS_Point::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/) +void RS_Point::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/) { if (painter == NULL || view == NULL) return; diff --git a/src/base/rs_point.h b/src/base/rs_point.h index be314e0..e25c25b 100644 --- a/src/base/rs_point.h +++ b/src/base/rs_point.h @@ -56,9 +56,7 @@ class RS_Point: public RS_AtomicEntity virtual void rotate(Vector center, double angle); virtual void scale(Vector center, Vector factor); virtual void mirror(Vector axisPoint1, Vector axisPoint2); - -// virtual void draw(RS_Painter * painter, RS_GraphicView * view, double patternOffset = 0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); friend std::ostream & operator<<(std::ostream & os, const RS_Point & p); diff --git a/src/base/rs_polyline.cpp b/src/base/rs_polyline.cpp index 80a0232..c0ca2e5 100644 --- a/src/base/rs_polyline.cpp +++ b/src/base/rs_polyline.cpp @@ -17,7 +17,7 @@ #include "rs_debug.h" #include "rs_line.h" #include "rs_arc.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "paintintf.h" /** @@ -488,10 +488,9 @@ void RS_Polyline::stretch(Vector firstCorner, Vector secondCorner, Vector offset /** * Slightly optimized drawing for polylines. */ -//void RS_Polyline::draw(RS_Painter * painter, RS_GraphicView * view, double /*patternOffset*/) -void RS_Polyline::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/) +void RS_Polyline::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/) { - if (painter == NULL || view == NULL) + if (!painter || !view) return; // draw first entity and set correct pen: diff --git a/src/base/rs_polyline.h b/src/base/rs_polyline.h index 778700f..0066847 100644 --- a/src/base/rs_polyline.h +++ b/src/base/rs_polyline.h @@ -56,35 +56,28 @@ class RS_Polyline: public RS_EntityContainer Vector getStartpoint(); void setEndpoint(Vector & v); Vector getEndpoint(); - double getClosingBulge(); void updateEndpoints(); - bool isClosed() const; void setClosed(bool cl); virtual VectorSolutions getRefPoints(); virtual Vector getNearestRef(const Vector & coord, double * dist = NULL); virtual Vector getNearestSelectedRef(const Vector & coord, double * dist = NULL); - virtual RS_Entity * addVertex(const Vector & v, double bulge = 0.0, bool prepend = false); virtual void setNextBulge(double bulge); virtual void addEntity(RS_Entity * entity); //virtual void addSegment(RS_Entity* entity); virtual void removeLastVertex(); virtual void endPolyline(); - //virtual void reorder(); - virtual void move(Vector offset); virtual void rotate(Vector center, double angle); virtual void scale(Vector center, Vector factor); virtual void mirror(Vector axisPoint1, Vector axisPoint2); virtual void moveRef(const Vector& ref, const Vector& offset); virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset); - - // virtual void draw(RS_Painter* painter, RS_GraphicView* view, double patternOffset=0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); friend std::ostream & operator<<(std::ostream & os, const RS_Polyline & l); diff --git a/src/base/rs_previewactioninterface.cpp b/src/base/rs_previewactioninterface.cpp index b35fed1..1f59867 100644 --- a/src/base/rs_previewactioninterface.cpp +++ b/src/base/rs_previewactioninterface.cpp @@ -15,7 +15,7 @@ #include "rs_previewactioninterface.h" #include "rs_debug.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" /** @@ -25,7 +25,7 @@ * from this interface operates. */ RS_PreviewActionInterface::RS_PreviewActionInterface(const char * name, - RS_EntityContainer & container, RS_GraphicView & graphicView): + RS_EntityContainer & container, GraphicView & graphicView): RS_ActionInterface(name, container, graphicView) { RS_DEBUG->print("RS_PreviewActionInterface::RS_PreviewActionInterface: Setting up action with preview: \"%s\"", name); @@ -104,7 +104,6 @@ void RS_PreviewActionInterface::deletePreview() xorPreview(); } -//#include "qg_graphicview.h" /** * Draws / deletes the current preview. */ diff --git a/src/base/rs_previewactioninterface.h b/src/base/rs_previewactioninterface.h index f29c3a9..529fb0c 100644 --- a/src/base/rs_previewactioninterface.h +++ b/src/base/rs_previewactioninterface.h @@ -16,7 +16,7 @@ class RS_PreviewActionInterface: public RS_ActionInterface { public: RS_PreviewActionInterface(const char * name, - RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_EntityContainer & container, GraphicView & graphicView); virtual ~RS_PreviewActionInterface(); virtual void init(int status = 0); diff --git a/src/base/rs_selection.cpp b/src/base/rs_selection.cpp index 046775b..f610193 100644 --- a/src/base/rs_selection.cpp +++ b/src/base/rs_selection.cpp @@ -26,7 +26,7 @@ * entities. Usually that's an Drawing entity but * it can also be a polyline, text, ... */ -RS_Selection::RS_Selection(RS_EntityContainer & container, RS_GraphicView * graphicView) +RS_Selection::RS_Selection(RS_EntityContainer & container, GraphicView * graphicView) { this->container = &container; this->graphicView = graphicView; diff --git a/src/base/rs_selection.h b/src/base/rs_selection.h index d1239e1..e0dfea6 100644 --- a/src/base/rs_selection.h +++ b/src/base/rs_selection.h @@ -2,7 +2,7 @@ #define RS_SELECTION_H #include "rs_entitycontainer.h" -#include "rs_graphicview.h" +#include "graphicview.h" /** * API Class for selecting entities. @@ -16,7 +16,7 @@ class RS_Selection { public: RS_Selection(RS_EntityContainer & entityContainer, - RS_GraphicView * graphicView = NULL); + GraphicView * graphicView = NULL); void selectSingle(RS_Entity * e); void selectAll(bool select = true); @@ -36,7 +36,7 @@ class RS_Selection protected: RS_EntityContainer * container; Drawing * graphic; - RS_GraphicView * graphicView; + GraphicView * graphicView; }; #endif diff --git a/src/base/rs_snapper.cpp b/src/base/rs_snapper.cpp index 016b48d..9505d6b 100644 --- a/src/base/rs_snapper.cpp +++ b/src/base/rs_snapper.cpp @@ -17,7 +17,7 @@ #include "rs_dialogfactory.h" #include "drawing.h" #include "rs_entitycontainer.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_grid.h" #include "rs_information.h" #include "settings.h" @@ -25,7 +25,7 @@ /** * Constructor. */ -RS_Snapper::RS_Snapper(RS_EntityContainer & c, RS_GraphicView & gv): +RS_Snapper::RS_Snapper(RS_EntityContainer & c, GraphicView & gv): container(&c), graphicView(&gv), finished(false) { init(); diff --git a/src/base/rs_snapper.h b/src/base/rs_snapper.h index 89351d6..30e4a0c 100644 --- a/src/base/rs_snapper.h +++ b/src/base/rs_snapper.h @@ -7,7 +7,7 @@ class RS_Entity; class RS_EntityContainer; -class RS_GraphicView; +class GraphicView; /** * This class is used for snapping functions in a graphic view. @@ -22,7 +22,7 @@ class RS_GraphicView; class RS_Snapper { public: - RS_Snapper(RS_EntityContainer & container, RS_GraphicView & graphicView); + RS_Snapper(RS_EntityContainer & container, GraphicView & graphicView); virtual ~RS_Snapper(); void init(); @@ -66,7 +66,7 @@ class RS_Snapper protected: RS_EntityContainer * container; - RS_GraphicView * graphicView; + GraphicView * graphicView; RS_Entity * keyEntity; Vector snapCoord; Vector snapSpot; diff --git a/src/base/rs_solid.cpp b/src/base/rs_solid.cpp index 2badd75..100dcc0 100644 --- a/src/base/rs_solid.cpp +++ b/src/base/rs_solid.cpp @@ -14,27 +14,66 @@ #include "rs_solid.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "paintintf.h" /** * Default constructor. */ -RS_Solid::RS_Solid(RS_EntityContainer * parent, const RS_SolidData& d): +RS_Solid::RS_Solid(RS_EntityContainer * parent, const RS_SolidData & d): RS_AtomicEntity(parent), data(d) { calculateBorders(); } +/*virtual*/ RS_Entity * RS_Solid::clone() +{ + RS_Solid * s = new RS_Solid(*this); + s->initId(); + return s; +} + +/** @return RS_ENTITY_POINT */ +/*virtual*/ RS2::EntityType RS_Solid::rtti() const +{ + return RS2::EntitySolid; +} + +/** + * @return Start point of the entity. + */ +/*virtual*/ Vector RS_Solid::getStartpoint() const +{ + return Vector(false); +} + +/** + * @return End point of the entity. + */ +/*virtual*/ Vector RS_Solid::getEndpoint() const +{ + return Vector(false); +} + +/** @return Copy of data that defines the point. */ +RS_SolidData RS_Solid::getData() const +{ + return data; +} + +/** @return true if this is a triangle. */ +bool RS_Solid::isTriangle() +{ + return !data.corner[3].valid; +} + /** * @return Corner number 'num'. */ Vector RS_Solid::getCorner(int num) { if (num >= 0 && num < 4) - { return data.corner[num]; - } else { RS_DEBUG->print("Illegal corner requested from Solid", RS_Debug::D_WARNING); @@ -52,12 +91,12 @@ Vector RS_Solid::getCorner(int num) void RS_Solid::shapeArrow(const Vector & point, double angle, double arrowSize) { double cosv1, sinv1, cosv2, sinv2; - double arrowSide = arrowSize/cos(0.165); + double arrowSide = arrowSize / cos(0.165); - cosv1 = cos(angle+0.165)*arrowSide; - sinv1 = sin(angle+0.165)*arrowSide; - cosv2 = cos(angle-0.165)*arrowSide; - sinv2 = sin(angle-0.165)*arrowSide; + cosv1 = cos(angle + 0.165) * arrowSide; + sinv1 = sin(angle + 0.165) * arrowSide; + cosv2 = cos(angle - 0.165) * arrowSide; + sinv2 = sin(angle - 0.165) * arrowSide; data.corner[0] = point; data.corner[1] = Vector(point.x - cosv1, point.y - sinv1); @@ -87,7 +126,7 @@ Vector RS_Solid::getNearestEndpoint(const Vector & coord, double * dist) double curDist; Vector ret; - for (int i=0; i<4; ++i) + for(int i=0; i<4; ++i) { if (data.corner[i].valid) { @@ -101,7 +140,7 @@ Vector RS_Solid::getNearestEndpoint(const Vector & coord, double * dist) } } - if (dist != NULL) + if (dist) *dist = minDist; return ret; @@ -110,8 +149,8 @@ Vector RS_Solid::getNearestEndpoint(const Vector & coord, double * dist) /** * @todo Implement this. */ -Vector RS_Solid::getNearestPointOnEntity(const Vector & /*coord*/, - bool /*onEntity*/, double * /*dist*/, RS_Entity ** /*entity*/) +Vector RS_Solid::getNearestPointOnEntity(const Vector & /*coord*/, bool /*onEntity*/, + double * /*dist*/, RS_Entity ** /*entity*/) { Vector ret(false); return ret; @@ -119,7 +158,7 @@ Vector RS_Solid::getNearestPointOnEntity(const Vector & /*coord*/, Vector RS_Solid::getNearestCenter(const Vector & /*coord*/, double * dist) { - if (dist != NULL) + if (dist) *dist = RS_MAXDOUBLE; return Vector(false); @@ -127,16 +166,16 @@ Vector RS_Solid::getNearestCenter(const Vector & /*coord*/, double * dist) Vector RS_Solid::getNearestMiddle(const Vector & /*coord*/, double * dist) { - if (dist != NULL) - *dist = RS_MAXDOUBLE; + if (dist) + *dist = RS_MAXDOUBLE; return Vector(false); } Vector RS_Solid::getNearestDist(double /*distance*/, const Vector & /*coord*/, double * dist) { - if (dist != NULL) - *dist = RS_MAXDOUBLE; + if (dist) + *dist = RS_MAXDOUBLE; return Vector(false); } @@ -184,10 +223,9 @@ void RS_Solid::mirror(Vector axisPoint1, Vector axisPoint2) calculateBorders(); } -//void RS_Solid::draw(RS_Painter* painter, RS_GraphicView* view, double /*patternOffset*/) -void RS_Solid::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/) +void RS_Solid::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/) { - if (painter == NULL || view == NULL) + if (!painter || !view) return; RS_SolidData d = getData(); diff --git a/src/base/rs_solid.h b/src/base/rs_solid.h index ab7a543..d2f8761 100644 --- a/src/base/rs_solid.h +++ b/src/base/rs_solid.h @@ -9,57 +9,53 @@ */ class RS_SolidData { -public: - /** - * Default constructor. Leaves the data object uninitialized. - */ - RS_SolidData() { - for (int i=0; i<4; ++i) { - corner[i] = Vector(false); - } - } - - /** - * Constructor for a solid with 3 corners. - */ - RS_SolidData(const Vector& corner1, - const Vector& corner2, - const Vector& corner3) { - - corner[0] = corner1; - corner[1] = corner2; - corner[2] = corner3; - corner[3] = Vector(false); - } - - /** - * Constructor for a solid with 4 corners. - */ - RS_SolidData(const Vector& corner1, - const Vector& corner2, - const Vector& corner3, - const Vector& corner4) { - - corner[0] = corner1; - corner[1] = corner2; - corner[2] = corner3; - corner[3] = corner4; - } - - friend class RS_Solid; - - friend std::ostream& operator << (std::ostream& os, - const RS_SolidData& pd) { - os << "("; - for (int i=0; i<4; i++) { - os << pd.corner[i]; - } - os << ")"; - return os; - } - -private: - Vector corner[4]; + public: + /** + * Default constructor. Leaves the data object uninitialized. + */ + RS_SolidData() + { + for(int i=0; i<4; ++i) + corner[i] = Vector(false); + } + + /** + * Constructor for a solid with 3 corners. + */ + RS_SolidData(const Vector & corner1, const Vector & corner2, const Vector & corner3) + { + corner[0] = corner1; + corner[1] = corner2; + corner[2] = corner3; + corner[3] = Vector(false); + } + + /** + * Constructor for a solid with 4 corners. + */ + RS_SolidData(const Vector & corner1, const Vector & corner2, const Vector & corner3, const Vector & corner4) + { + corner[0] = corner1; + corner[1] = corner2; + corner[2] = corner3; + corner[3] = corner4; + } + + friend class RS_Solid; + + friend std::ostream & operator<<(std::ostream & os, const RS_SolidData & pd) + { + os << "("; + + for(int i=0; i<4; i++) + os << pd.corner[i]; + + os << ")"; + return os; + } + + private: + Vector corner[4]; }; /** @@ -69,75 +65,39 @@ private: */ class RS_Solid: public RS_AtomicEntity { -public: - RS_Solid(RS_EntityContainer* parent, - const RS_SolidData& d); - - virtual RS_Entity* clone() { - RS_Solid* s = new RS_Solid(*this); - s->initId(); - return s; - } - - /** @return RS_ENTITY_POINT */ - virtual RS2::EntityType rtti() const { - return RS2::EntitySolid; - } - - /** - * @return Start point of the entity. - */ - virtual Vector getStartpoint() const { - return Vector(false); - } - /** - * @return End point of the entity. - */ - virtual Vector getEndpoint() const { - return Vector(false); - } - - - /** @return Copy of data that defines the point. */ - RS_SolidData getData() const { - return data; - } - - /** @return true if this is a triangle. */ - bool isTriangle() { - return !data.corner[3].valid; - } - - Vector getCorner(int num); - - void shapeArrow(const Vector & point, double angle, double arrowSize); - - virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL); - virtual Vector getNearestPointOnEntity(const Vector & coord, - bool onEntity = true, double * dist = NULL, RS_Entity ** entity = NULL); - virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL); - virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL); - virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL); - - virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL, - RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); - - virtual void move(Vector offset); - virtual void rotate(Vector center, double angle); - virtual void scale(Vector center, Vector factor); - virtual void mirror(Vector axisPoint1, Vector axisPoint2); - -// virtual void draw(RS_Painter* painter, RS_GraphicView* view, double patternOffset=0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); - - friend std::ostream & operator<<(std::ostream & os, const RS_Solid & p); - - /** Recalculates the borders of this entity. */ - virtual void calculateBorders (); - -protected: - RS_SolidData data; - //Vector point; + public: + RS_Solid(RS_EntityContainer * parent, const RS_SolidData & d); + + virtual RS_Entity * clone(); + virtual RS2::EntityType rtti() const; + virtual Vector getStartpoint() const; + virtual Vector getEndpoint() const; + RS_SolidData getData() const; + bool isTriangle(); + Vector getCorner(int num); + void shapeArrow(const Vector & point, double angle, double arrowSize); + + virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL); + virtual Vector getNearestPointOnEntity(const Vector & coord, bool onEntity = true, + double * dist = NULL, RS_Entity ** entity = NULL); + virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL); + virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL); + virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL); + virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL, + RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE); + virtual void move(Vector offset); + virtual void rotate(Vector center, double angle); + virtual void scale(Vector center, Vector factor); + virtual void mirror(Vector axisPoint1, Vector axisPoint2); + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); + + friend std::ostream & operator<<(std::ostream & os, const RS_Solid & p); + + /** Recalculates the borders of this entity. */ + virtual void calculateBorders (); + + protected: + RS_SolidData data; }; #endif diff --git a/src/base/rs_spline.cpp b/src/base/rs_spline.cpp index 8b4c3a5..27ede78 100644 --- a/src/base/rs_spline.cpp +++ b/src/base/rs_spline.cpp @@ -15,7 +15,7 @@ #include "rs_spline.h" #include "rs_debug.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "drawing.h" #include "paintintf.h" @@ -353,8 +353,7 @@ void RS_Spline::moveRef(const Vector & ref, const Vector & offset) update(); } -//void RS_Spline::draw(RS_Painter* painter, RS_GraphicView* view, double /*patternOffset*/) -void RS_Spline::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/) +void RS_Spline::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/) { if (painter == NULL || view == NULL) return; @@ -381,7 +380,7 @@ void RS_Spline::draw(PaintInterface * painter, RS_GraphicView * view, double /*p * Todo: draw the spline, user patterns. */ /* -void RS_Spline::draw(RS_Painter* painter, RS_GraphicView* view) { +void RS_Spline::draw(RS_Painter* painter, GraphicView* view) { if (painter==NULL || view==NULL) { return; } diff --git a/src/base/rs_spline.h b/src/base/rs_spline.h index 5927ddf..30e613a 100644 --- a/src/base/rs_spline.h +++ b/src/base/rs_spline.h @@ -58,30 +58,22 @@ public: int getNumberOfControlPoints(); bool isClosed(); void setClosed(bool c); - virtual VectorSolutions getRefPoints(); virtual Vector getNearestRef(const Vector & coord, double * dist = NULL); virtual Vector getNearestSelectedRef(const Vector & coord, double * dist = NULL); - void update(); - virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL); virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL); virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL); virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL); - virtual void addControlPoint(const Vector & v); virtual void removeLastControlPoint(); - virtual void move(Vector offset); virtual void rotate(Vector center, double angle); virtual void scale(Vector center, Vector factor); virtual void mirror(Vector axisPoint1, Vector axisPoint2); virtual void moveRef(const Vector & ref, const Vector & offset); - -// virtual void draw(RS_Painter* painter, RS_GraphicView* view, double patternOffset=0.0); - virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0); -// Q3ValueList getControlPoints(); + virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0); QList getControlPoints(); friend std::ostream & operator<<(std::ostream & os, const RS_Spline & l); diff --git a/src/base/rs_staticgraphicview.h b/src/base/rs_staticgraphicview.h index 508ebb6..6347c19 100644 --- a/src/base/rs_staticgraphicview.h +++ b/src/base/rs_staticgraphicview.h @@ -1,7 +1,7 @@ #ifndef RS_STATICGRAPHICVIEW_H #define RS_STATICGRAPHICVIEW_H -#include "rs_graphicview.h" +#include "graphicview.h" class PaintInterface; @@ -9,7 +9,7 @@ class PaintInterface; * This is an implementation of a graphic viewer with a fixed size * for drawing onto fixed devices (such as bitmaps). */ -class RS_StaticGraphicView: public RS_GraphicView +class RS_StaticGraphicView: public GraphicView { public: RS_StaticGraphicView(int w, int h, PaintInterface * p); diff --git a/src/forms/cadtoolbararcs.cpp b/src/forms/cadtoolbararcs.cpp index 5ee2eb8..35cb974 100644 --- a/src/forms/cadtoolbararcs.cpp +++ b/src/forms/cadtoolbararcs.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarArcs::CadToolBarArcs(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbarcircles.cpp b/src/forms/cadtoolbarcircles.cpp index a6d63e1..b6ebd27 100644 --- a/src/forms/cadtoolbarcircles.cpp +++ b/src/forms/cadtoolbarcircles.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarCircles::CadToolBarCircles(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbardim.cpp b/src/forms/cadtoolbardim.cpp index 03aaee7..f7dd4c8 100644 --- a/src/forms/cadtoolbardim.cpp +++ b/src/forms/cadtoolbardim.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarDim::CadToolBarDim(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbarellipses.cpp b/src/forms/cadtoolbarellipses.cpp index 3531c1f..d764528 100644 --- a/src/forms/cadtoolbarellipses.cpp +++ b/src/forms/cadtoolbarellipses.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarEllipses::CadToolBarEllipses(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbarinfo.cpp b/src/forms/cadtoolbarinfo.cpp index 882b900..e0f4143 100644 --- a/src/forms/cadtoolbarinfo.cpp +++ b/src/forms/cadtoolbarinfo.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarInfo::CadToolBarInfo(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbarlines.cpp b/src/forms/cadtoolbarlines.cpp index 9e515e1..cd75a1e 100644 --- a/src/forms/cadtoolbarlines.cpp +++ b/src/forms/cadtoolbarlines.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarLines::CadToolBarLines(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbarmain.cpp b/src/forms/cadtoolbarmain.cpp index 3cc4aa2..38d598f 100644 --- a/src/forms/cadtoolbarmain.cpp +++ b/src/forms/cadtoolbarmain.cpp @@ -16,8 +16,8 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" - #include "createqtactions.h" +#include "rs_debug.h" CadToolBarMain::CadToolBarMain(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags) diff --git a/src/forms/cadtoolbarmodify.cpp b/src/forms/cadtoolbarmodify.cpp index ad986db..f8129bb 100644 --- a/src/forms/cadtoolbarmodify.cpp +++ b/src/forms/cadtoolbarmodify.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarModify::CadToolBarModify(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbarpoints.cpp b/src/forms/cadtoolbarpoints.cpp index e8f1d3f..5f1245e 100644 --- a/src/forms/cadtoolbarpoints.cpp +++ b/src/forms/cadtoolbarpoints.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarPoints::CadToolBarPoints(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbarpolylines.cpp b/src/forms/cadtoolbarpolylines.cpp index 3755a89..0b75c2b 100644 --- a/src/forms/cadtoolbarpolylines.cpp +++ b/src/forms/cadtoolbarpolylines.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarPolylines::CadToolBarPolylines(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbarselect.cpp b/src/forms/cadtoolbarselect.cpp index 5a8d3a1..3f03ab8 100644 --- a/src/forms/cadtoolbarselect.cpp +++ b/src/forms/cadtoolbarselect.cpp @@ -16,6 +16,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" #include "rs_actioninterface.h" +#include "rs_debug.h" CadToolBarSelect::CadToolBarSelect(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL), selectAction(NULL), diff --git a/src/forms/cadtoolbarsnap.cpp b/src/forms/cadtoolbarsnap.cpp index b95ae15..90800f0 100644 --- a/src/forms/cadtoolbarsnap.cpp +++ b/src/forms/cadtoolbarsnap.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarSnap::CadToolBarSnap(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/cadtoolbarsplines.cpp b/src/forms/cadtoolbarsplines.cpp index 755f3e3..7fcd384 100644 --- a/src/forms/cadtoolbarsplines.cpp +++ b/src/forms/cadtoolbarsplines.cpp @@ -15,6 +15,7 @@ #include "cadtoolbar.h" #include "qg_actionhandler.h" +#include "rs_debug.h" CadToolBarSplines::CadToolBarSplines(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): QWidget(parent, flags), actionHandler(NULL), cadToolBar(NULL) diff --git a/src/forms/dlghatch.cpp b/src/forms/dlghatch.cpp index 1b5d578..b1a8b01 100644 --- a/src/forms/dlghatch.cpp +++ b/src/forms/dlghatch.cpp @@ -14,9 +14,6 @@ #include "dlghatch.h" -//#include "rs_ellipse.h" -//#include "drawing.h" -//#include "rs_math.h" #include "rs_entitycontainer.h" #include "rs_hatch.h" #include "rs_pattern.h" diff --git a/src/mainapp/applicationwindow.cpp b/src/mainapp/applicationwindow.cpp index e91576f..326854e 100644 --- a/src/mainapp/applicationwindow.cpp +++ b/src/mainapp/applicationwindow.cpp @@ -48,6 +48,7 @@ #include "qg_colorbox.h" #include "qg_filedialog.h" #include "qg_pentoolbar.h" +#include "recentfiles.h" #include "cadtoolbar.h" #include "cadtoolbarmain.h" #include "coordinatewidget.h" @@ -251,7 +252,7 @@ void ApplicationWindow::slotInsertBlock(const QString & name) statusBar()->showMessage(tr("Inserting block '%1'").arg(name), 2000); - RS_GraphicView * graphicView = getGraphicView(); + GraphicView * graphicView = getGraphicView(); RS_Document * document = getDocument(); if (graphicView != NULL && document != NULL) @@ -1262,7 +1263,7 @@ void ApplicationWindow::initMenuBar() // menuBar()->insertItem(tr("De&bugging"), testMenu); menuBar()->addMenu(testMenu); - recentFiles = new QG_RecentFiles(this, fileMenu); + recentFiles = new RecentFiles(this, fileMenu); } /** @@ -1544,43 +1545,12 @@ void ApplicationWindow::initView() } }*/ -#warning "!!! ApplicationWindow::updateRecentFilesMenu() is DEPRECATED !!!" -/** - * Updates the recent file list in the file menu. - */ -void ApplicationWindow::updateRecentFilesMenu() -{ - RS_DEBUG->print("ApplicationWindow::updateRecentFilesMenu()"); - RS_DEBUG->print("Updating recent file menu..."); - -#if 0 - for(int i=0; igetNumber(); ++i) - { - QString label = QString("&%1 %2").arg(i + 1).arg(recentFiles->get(i)); - - if (fileMenu->findItem(i)) - { - RS_DEBUG->print("Changeing item %d", i); - fileMenu->changeItem(i, label); - } - else if (i < int(recentFiles->count())) - { - RS_DEBUG->print("Adding item %d", i); - fileMenu->insertItem(label, this, SLOT(slotFileOpenRecent(int)), 0, i); - } - } -#else -//#warning "!!! Need to fix ApplicationWindow::updateRecentFilesMenu() !!!" - recentFiles->UpdateGUI(); -#endif -} - /** * Goes back to the previous menu or one step in the current action. */ void ApplicationWindow::slotBack() { - RS_GraphicView * graphicView = getGraphicView(); + GraphicView * graphicView = getGraphicView(); if (graphicView != NULL) graphicView->back(); @@ -1602,7 +1572,7 @@ void ApplicationWindow::slotEnter() cadToolBar->forceNext(); else { - RS_GraphicView * graphicView = getGraphicView(); + GraphicView * graphicView = getGraphicView(); if (graphicView != NULL) graphicView->enter(); @@ -3508,7 +3478,7 @@ void ApplicationWindow::slotTestInsertBlock() ins->update(); graphic->addEntity(ins); - RS_GraphicView * v = getGraphicView(); + GraphicView * v = getGraphicView(); if (v != NULL) v->redraw(); @@ -3650,7 +3620,7 @@ void ApplicationWindow::slotTestInsertEllipse() } */ - RS_GraphicView * v = getGraphicView(); + GraphicView * v = getGraphicView(); if (v != NULL) v->redraw(); @@ -3752,7 +3722,7 @@ void ApplicationWindow::slotTestInsertText() RS2::SolidLine)); graphic->addEntity(s); - RS_GraphicView* v = getGraphicView(); + GraphicView* v = getGraphicView(); if (v!=NULL) { v->redraw(); } @@ -3902,7 +3872,7 @@ void ApplicationWindow::slotTestMath01() // Vector(6.0,cos(x_0)-sin(x_0)*(6.0-x_0)))); - RS_GraphicView* v = getGraphicView(); + GraphicView* v = getGraphicView(); if (v!=NULL) { v->redraw(); } @@ -4011,7 +3981,7 @@ void ApplicationWindow::keyPressEvent(QKeyEvent * e) QMainWindow::keyPressEvent(e); // forward to actions: - RS_GraphicView * graphicView = getGraphicView(); + GraphicView * graphicView = getGraphicView(); if (graphicView != NULL) graphicView->keyPressEvent(e); @@ -4101,7 +4071,7 @@ void ApplicationWindow::keyReleaseEvent(QKeyEvent * e) QMainWindow::keyReleaseEvent(e); // forward to actions: - RS_GraphicView * graphicView = getGraphicView(); + GraphicView * graphicView = getGraphicView(); if (graphicView != NULL) graphicView->keyReleaseEvent(e); @@ -4155,7 +4125,7 @@ MDIWindow * ApplicationWindow::getMDIWindow() * @return Pointer to the graphic view of the currently active document * window or NULL if no window is available. */ -/*virtual*/ RS_GraphicView * ApplicationWindow::getGraphicView() +/*virtual*/ GraphicView * ApplicationWindow::getGraphicView() { MDIWindow * m = getMDIWindow(); diff --git a/src/mainapp/applicationwindow.h b/src/mainapp/applicationwindow.h index 79ca2c1..bb1b0f6 100644 --- a/src/mainapp/applicationwindow.h +++ b/src/mainapp/applicationwindow.h @@ -11,7 +11,6 @@ #include "qg_blockwidget.h" #include "qg_layerwidget.h" #include "qg_mainwindowinterface.h" -#include "qg_recentfiles.h" #include "qg_pentoolbar.h" #include "cadtoolbar.h" #include "commandwidget.h" @@ -26,6 +25,8 @@ #include "rs_simulationcontrols.h" #endif +class RecentFiles; + /** * Main application window. Hold together document, view and controls. * @@ -46,7 +47,6 @@ class ApplicationWindow: public QMainWindow, public QG_MainWindowInterface void initStatusBar(); void initSettings(); void storeSettings(); - void updateRecentFilesMenu(); void initMDI(); void initView(); bool queryExit(bool force); @@ -177,7 +177,7 @@ class ApplicationWindow: public QMainWindow, public QG_MainWindowInterface static ApplicationWindow * getAppWindow(); QMdiArea * getWorkspace(); MDIWindow * getMDIWindow(); - virtual RS_GraphicView * getGraphicView(); + virtual GraphicView * getGraphicView(); virtual RS_Document * getDocument(); virtual void createNewDocument(const QString & fileName = QString::null, RS_Document * doc = NULL); virtual QMainWindow * GetMainWindow(); @@ -253,7 +253,7 @@ class ApplicationWindow: public QMainWindow, public QG_MainWindowInterface QToolBar * optionWidget; /** Recent files list */ - QG_RecentFiles * recentFiles; + RecentFiles * recentFiles; /** Action handler. */ QG_ActionHandler * actionHandler; diff --git a/src/base/rs_graphicview.cpp b/src/mainapp/graphicview.cpp similarity index 80% rename from src/base/rs_graphicview.cpp rename to src/mainapp/graphicview.cpp index a2dcb73..69efb10 100644 --- a/src/base/rs_graphicview.cpp +++ b/src/mainapp/graphicview.cpp @@ -1,4 +1,4 @@ -// rs_graphicview.cpp +// graphicview.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -9,31 +9,25 @@ // // Who When What // --- ---------- ----------------------------------------------------------- -// JLH 05/21/2010 Added this text. :-) +// JLH 06/16/2010 Created this file. :-) // -#include "rs_graphicview.h" +#include "graphicview.h" -#include -#include "rs_actioninterface.h" -#include "rs_block.h" #include "rs_dialogfactory.h" #include "drawing.h" #include "rs_eventhandler.h" #include "rs_grid.h" -#include "rs_insert.h" -#include "rs_layer.h" -#include "rs_line.h" -#include "rs_solid.h" -#include "rs_text.h" -#include "rs_units.h" +#include "rs_linetypepattern.h" #include "paintintf.h" #include "settings.h" +#include "rs_text.h" +#include "rs_units.h" /** * Constructor. */ -RS_GraphicView::RS_GraphicView(): background(), foreground(), previewMode(false), +GraphicView::GraphicView(): background(), foreground(), previewMode(false), previewOffset(Vector(0, 0)), snapperDraw(false) { drawingMode = RS2::ModeFull; @@ -91,7 +85,7 @@ RS_GraphicView::RS_GraphicView(): background(), foreground(), previewMode(false) /** * Destructor. */ -RS_GraphicView::~RS_GraphicView() +GraphicView::~GraphicView() { //delete eventHandler; if (painter != NULL) @@ -103,7 +97,7 @@ RS_GraphicView::~RS_GraphicView() /** * Must be called by any derrived class in the destructor. */ -void RS_GraphicView::cleanUp() +void GraphicView::cleanUp() { delete eventHandler; } @@ -113,7 +107,7 @@ void RS_GraphicView::cleanUp() * connected to this view is a graphic and valid. * NULL otherwise. */ -Drawing * RS_GraphicView::getGraphic() +Drawing * GraphicView::getGraphic() { if (container != NULL && container->rtti() == RS2::EntityGraphic) return (Drawing*)container; @@ -124,7 +118,7 @@ Drawing * RS_GraphicView::getGraphic() /** * Sets the drawing mode. */ -void RS_GraphicView::setDrawingMode(RS2::DrawingMode m) +void GraphicView::setDrawingMode(RS2::DrawingMode m) { drawingMode = m; } @@ -132,7 +126,7 @@ void RS_GraphicView::setDrawingMode(RS2::DrawingMode m) /** * @return Current drawing mode. */ -RS2::DrawingMode RS_GraphicView::getDrawingMode() +RS2::DrawingMode GraphicView::getDrawingMode() { return drawingMode; } @@ -140,7 +134,7 @@ RS2::DrawingMode RS_GraphicView::getDrawingMode() /** * Activates or deactivates the delete mode. */ -void RS_GraphicView::setDeleteMode(bool m) +void GraphicView::setDeleteMode(bool m) { deleteMode = m; } @@ -149,28 +143,28 @@ void RS_GraphicView::setDeleteMode(bool m) * @reval true Deleting instead of drawing. * false Normal drawing mode. */ -bool RS_GraphicView::getDeleteMode() +bool GraphicView::getDeleteMode() { return deleteMode; } /** This virtual method must be overwritten and is then called whenever the view changed */ -void RS_GraphicView::adjustOffsetControls() +void GraphicView::adjustOffsetControls() { } /** This virtual method must be overwritten and is then called whenever the view changed */ -void RS_GraphicView::adjustZoomControls() +void GraphicView::adjustZoomControls() { } /** * Sets an external painter device. */ -//void RS_GraphicView::setPainter(RS_Painter * p) -void RS_GraphicView::setPainter(PaintInterface * p) +//void GraphicView::setPainter(RS_Painter * p) +void GraphicView::setPainter(PaintInterface * p) { painter = p; } @@ -179,7 +173,7 @@ void RS_GraphicView::setPainter(PaintInterface * p) * Sets the background color. Note that applying the background * color for the widget is up to the implementing class. */ -void RS_GraphicView::setBackground(const RS_Color & bg) +void GraphicView::setBackground(const RS_Color & bg) { background = bg; @@ -195,7 +189,7 @@ void RS_GraphicView::setBackground(const RS_Color & bg) /** * @return Current background color. */ -RS_Color RS_GraphicView::getBackground() +RS_Color GraphicView::getBackground() { return background; } @@ -203,7 +197,7 @@ RS_Color RS_GraphicView::getBackground() /** * @return Current foreground color. */ -RS_Color RS_GraphicView::getForeground() +RS_Color GraphicView::getForeground() { return foreground; } @@ -211,7 +205,7 @@ RS_Color RS_GraphicView::getForeground() /** * Sets the grid color. */ -void RS_GraphicView::setGridColor(const RS_Color & c) +void GraphicView::setGridColor(const RS_Color & c) { gridColor = c; } @@ -219,7 +213,7 @@ void RS_GraphicView::setGridColor(const RS_Color & c) /** * Sets the meta grid color. */ -void RS_GraphicView::setMetaGridColor(const RS_Color & c) +void GraphicView::setMetaGridColor(const RS_Color & c) { metaGridColor = c; } @@ -227,7 +221,7 @@ void RS_GraphicView::setMetaGridColor(const RS_Color & c) /** * Sets the selection color. */ -void RS_GraphicView::setSelectedColor(const RS_Color & c) +void GraphicView::setSelectedColor(const RS_Color & c) { selectedColor = c; } @@ -235,7 +229,7 @@ void RS_GraphicView::setSelectedColor(const RS_Color & c) /** * Sets the highlight color. */ -void RS_GraphicView::setHighlightedColor(const RS_Color & c) +void GraphicView::setHighlightedColor(const RS_Color & c) { highlightedColor = c; } @@ -244,22 +238,22 @@ void RS_GraphicView::setHighlightedColor(const RS_Color & c) * This virtual method can be overwritten to set the mouse * cursor to the given type. */ -void RS_GraphicView::setMouseCursor(RS2::CursorType /*c*/) +void GraphicView::setMouseCursor(RS2::CursorType /*c*/) { } -RS_EntityContainer * RS_GraphicView::getContainer() +RS_EntityContainer * GraphicView::getContainer() { return container; } -void RS_GraphicView::setFactor(double f) +void GraphicView::setFactor(double f) { setFactorX(f); setFactorY(f); } -Vector RS_GraphicView::getFactor() +Vector GraphicView::getFactor() { return factor; } @@ -267,28 +261,28 @@ Vector RS_GraphicView::getFactor() /** * Sets the offset of the graphic. */ -void RS_GraphicView::setOffset(int ox, int oy) +void GraphicView::setOffset(int ox, int oy) { setOffsetX(ox); setOffsetY(oy); } -void RS_GraphicView::setOffsetX(int ox) +void GraphicView::setOffsetX(int ox) { offsetX = ox; } -void RS_GraphicView::setOffsetY(int oy) +void GraphicView::setOffsetY(int oy) { offsetY = oy; } -int RS_GraphicView::getOffsetX() +int GraphicView::getOffsetX() { return offsetX; } -int RS_GraphicView::getOffsetY() +int GraphicView::getOffsetY() { return offsetY; } @@ -298,7 +292,7 @@ int RS_GraphicView::getOffsetY() * specifies how far the user can scroll outside the graphic * area. */ -void RS_GraphicView::setBorders(int left, int top, int right, int bottom) +void GraphicView::setBorders(int left, int top, int right, int bottom) { borderLeft = left; borderTop = top; @@ -306,47 +300,47 @@ void RS_GraphicView::setBorders(int left, int top, int right, int bottom) borderBottom = bottom; } -int RS_GraphicView::getBorderLeft() +int GraphicView::getBorderLeft() { return borderLeft; } -int RS_GraphicView::getBorderTop() +int GraphicView::getBorderTop() { return borderTop; } -int RS_GraphicView::getBorderRight() +int GraphicView::getBorderRight() { return borderRight; } -int RS_GraphicView::getBorderBottom() +int GraphicView::getBorderBottom() { return borderBottom; } -void RS_GraphicView::disableUpdate() +void GraphicView::disableUpdate() { updateEnabled--; } -void RS_GraphicView::enableUpdate() +void GraphicView::enableUpdate() { updateEnabled++; } -bool RS_GraphicView::isUpdateEnabled() +bool GraphicView::isUpdateEnabled() { return (updateEnabled == 0); } -void RS_GraphicView::freezeZoom(bool freeze) +void GraphicView::freezeZoom(bool freeze) { zoomFrozen = freeze; } -bool RS_GraphicView::isZoomFrozen() +bool GraphicView::isZoomFrozen() { return zoomFrozen; } @@ -355,7 +349,7 @@ bool RS_GraphicView::isZoomFrozen() * Sets the pointer to the graphic which contains the entities * which are visualized by this widget. */ -void RS_GraphicView::setContainer(RS_EntityContainer * container) +void GraphicView::setContainer(RS_EntityContainer * container) { this->container = container; //adjustOffsetControls(); @@ -364,7 +358,7 @@ void RS_GraphicView::setContainer(RS_EntityContainer * container) /** * Sets the zoom factor in X for this visualization of the graphic. */ -void RS_GraphicView::setFactorX(double f) +void GraphicView::setFactorX(double f) { if (!zoomFrozen) factor.x = fabs(f); @@ -373,7 +367,7 @@ void RS_GraphicView::setFactorX(double f) /** * Sets the zoom factor in Y for this visualization of the graphic. */ -void RS_GraphicView::setFactorY(double f) +void GraphicView::setFactorY(double f) { if (!zoomFrozen) factor.y = fabs(f); @@ -382,7 +376,7 @@ void RS_GraphicView::setFactorY(double f) /** * @return true if the grid is switched on. */ -bool RS_GraphicView::isGridOn() +bool GraphicView::isGridOn() { if (container != NULL) { @@ -398,7 +392,7 @@ bool RS_GraphicView::isGridOn() /** * Centers the drawing in x-direction. */ -void RS_GraphicView::centerOffsetX() +void GraphicView::centerOffsetX() { if (container != NULL && !zoomFrozen) offsetX = (int)(((getWidth() - borderLeft - borderRight) @@ -409,7 +403,7 @@ void RS_GraphicView::centerOffsetX() /** * Centers the drawing in y-direction. */ -void RS_GraphicView::centerOffsetY() +void GraphicView::centerOffsetY() { if (container != NULL && !zoomFrozen) offsetY = (int)((getHeight() - borderTop - borderBottom @@ -420,7 +414,7 @@ void RS_GraphicView::centerOffsetY() /** * Centers the given coordinate in the view in x-direction. */ -void RS_GraphicView::centerX(double v) +void GraphicView::centerX(double v) { if (!zoomFrozen) offsetX = (int)((v * factor.x) - (double)(getWidth() - borderLeft - borderRight) / 2.0); @@ -429,13 +423,13 @@ void RS_GraphicView::centerX(double v) /** * Centers the given coordinate in the view in y-direction. */ -void RS_GraphicView::centerY(double v) +void GraphicView::centerY(double v) { if (!zoomFrozen) offsetY = (int)((v * factor.y) - (double)(getHeight() - borderTop - borderBottom) / 2.0); } -void RS_GraphicView::updateView() +void GraphicView::updateView() { static int running = 0; running++; @@ -455,7 +449,7 @@ void RS_GraphicView::updateView() /** * @return Current action or NULL. */ -RS_ActionInterface * RS_GraphicView::getDefaultAction() +RS_ActionInterface * GraphicView::getDefaultAction() { if (eventHandler != NULL) return eventHandler->getDefaultAction(); @@ -466,7 +460,7 @@ RS_ActionInterface * RS_GraphicView::getDefaultAction() /** * Sets the default action of the event handler. */ -void RS_GraphicView::setDefaultAction(RS_ActionInterface * action) +void GraphicView::setDefaultAction(RS_ActionInterface * action) { if (eventHandler != NULL) eventHandler->setDefaultAction(action); @@ -475,7 +469,7 @@ void RS_GraphicView::setDefaultAction(RS_ActionInterface * action) /** * @return Current action or NULL. */ -RS_ActionInterface * RS_GraphicView::getCurrentAction() +RS_ActionInterface * GraphicView::getCurrentAction() { if (eventHandler != NULL) return eventHandler->getCurrentAction(); @@ -486,21 +480,21 @@ RS_ActionInterface * RS_GraphicView::getCurrentAction() /** * Sets the current action of the event handler. */ -void RS_GraphicView::setCurrentAction(RS_ActionInterface * action) +void GraphicView::setCurrentAction(RS_ActionInterface * action) { - RS_DEBUG->print("RS_GraphicView::setCurrentAction"); + RS_DEBUG->print("GraphicView::setCurrentAction"); if (eventHandler != NULL) eventHandler->setCurrentAction(action); - RS_DEBUG->print("RS_GraphicView::setCurrentAction: OK"); + RS_DEBUG->print("GraphicView::setCurrentAction: OK"); } /** * Kills all running selection actions. Called when a selection action * is launched to reduce confusion. */ -void RS_GraphicView::killSelectActions() +void GraphicView::killSelectActions() { if (eventHandler) eventHandler->killSelectActions(); @@ -509,7 +503,7 @@ void RS_GraphicView::killSelectActions() /** * Kills all running actions. */ -void RS_GraphicView::killAllActions() +void GraphicView::killAllActions() { if (eventHandler) eventHandler->killAllActions(); @@ -518,7 +512,7 @@ void RS_GraphicView::killAllActions() /** * Go back in menu or current action. */ -void RS_GraphicView::back() +void GraphicView::back() { if (eventHandler && eventHandler->hasAction()) eventHandler->back(); @@ -529,29 +523,29 @@ void RS_GraphicView::back() /** * Go forward with the current action. */ -void RS_GraphicView::enter() +void GraphicView::enter() { if (eventHandler && eventHandler->hasAction()) eventHandler->enter(); } /** - * Called by the actual GUI class which implements the RS_GraphicView + * Called by the actual GUI class which implements the GraphicView * interface to notify qcadlib about mouse events. */ -void RS_GraphicView::mousePressEvent(QMouseEvent * e) +void GraphicView::mousePressEvent(QMouseEvent * e) { if (eventHandler) eventHandler->mousePressEvent(e); } /** - * Called by the actual GUI class which implements the RS_GraphicView + * Called by the actual GUI class which implements the GraphicView * interface to notify qcadlib about mouse events. */ -void RS_GraphicView::mouseReleaseEvent(QMouseEvent * e) +void GraphicView::mouseReleaseEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_GraphicView::mouseReleaseEvent"); + RS_DEBUG->print("GraphicView::mouseReleaseEvent"); if (!eventHandler) return; @@ -567,23 +561,23 @@ void RS_GraphicView::mouseReleaseEvent(QMouseEvent * e) e->accept(); } - RS_DEBUG->print("RS_GraphicView::mouseReleaseEvent: OK"); + RS_DEBUG->print("GraphicView::mouseReleaseEvent: OK"); } /** - * Called by the actual GUI class which implements the RS_GraphicView + * Called by the actual GUI class which implements the GraphicView * interface to notify qcadlib about mouse events. */ -void RS_GraphicView::mouseMoveEvent(QMouseEvent * e) +void GraphicView::mouseMoveEvent(QMouseEvent * e) { - RS_DEBUG->print("RS_GraphicView::mouseMoveEvent begin"); + RS_DEBUG->print("GraphicView::mouseMoveEvent begin"); Drawing * graphic = NULL; if (container->rtti() == RS2::EntityGraphic) graphic = (Drawing *)container; - RS_DEBUG->print("RS_GraphicView::mouseMoveEvent 001"); + RS_DEBUG->print("GraphicView::mouseMoveEvent 001"); if (e) { @@ -591,12 +585,12 @@ void RS_GraphicView::mouseMoveEvent(QMouseEvent * e) my = e->y(); } - RS_DEBUG->print("RS_GraphicView::mouseMoveEvent 002"); + RS_DEBUG->print("GraphicView::mouseMoveEvent 002"); if (eventHandler) eventHandler->mouseMoveEvent(e); - RS_DEBUG->print("RS_GraphicView::mouseMoveEvent 003"); + RS_DEBUG->print("GraphicView::mouseMoveEvent 003"); if (!eventHandler || !eventHandler->hasAction() && graphic) { @@ -607,44 +601,44 @@ void RS_GraphicView::mouseMoveEvent(QMouseEvent * e) RS_DIALOGFACTORY->updateCoordinateWidget(mouse, relMouse); } - RS_DEBUG->print("RS_GraphicView::mouseMoveEvent end"); + RS_DEBUG->print("GraphicView::mouseMoveEvent end"); } /** - * Called by the actual GUI class which implements the RS_GraphicView + * Called by the actual GUI class which implements the GraphicView * interface to notify qcadlib about mouse events. */ -void RS_GraphicView::mouseLeaveEvent() +void GraphicView::mouseLeaveEvent() { if (eventHandler) eventHandler->mouseLeaveEvent(); } /** - * Called by the actual GUI class which implements the RS_GraphicView + * Called by the actual GUI class which implements the GraphicView * interface to notify qcadlib about mouse events. */ -void RS_GraphicView::mouseEnterEvent() +void GraphicView::mouseEnterEvent() { if (eventHandler) eventHandler->mouseEnterEvent(); } /** - * Called by the actual GUI class which implements the RS_GraphicView + * Called by the actual GUI class which implements the GraphicView * interface to notify qcadlib about key events. */ -void RS_GraphicView::keyPressEvent(QKeyEvent * e) +void GraphicView::keyPressEvent(QKeyEvent * e) { if (eventHandler) eventHandler->keyPressEvent(e); } /** - * Called by the actual GUI class which implements the RS_GraphicView + * Called by the actual GUI class which implements the GraphicView * interface to notify qcadlib about key events. */ -void RS_GraphicView::keyReleaseEvent(QKeyEvent * e) +void GraphicView::keyReleaseEvent(QKeyEvent * e) { if (eventHandler) eventHandler->keyReleaseEvent(e); @@ -653,7 +647,7 @@ void RS_GraphicView::keyReleaseEvent(QKeyEvent * e) /** * Called by the actual GUI class which implements a command line. */ -void RS_GraphicView::commandEvent(RS_CommandEvent * e) +void GraphicView::commandEvent(RS_CommandEvent * e) { if (eventHandler) eventHandler->commandEvent(e); @@ -662,7 +656,7 @@ void RS_GraphicView::commandEvent(RS_CommandEvent * e) /** * Enables coordinate input in the command line. */ -void RS_GraphicView::enableCoordinateInput() +void GraphicView::enableCoordinateInput() { if (eventHandler) eventHandler->enableCoordinateInput(); @@ -671,7 +665,7 @@ void RS_GraphicView::enableCoordinateInput() /** * Disables coordinate input in the command line. */ -void RS_GraphicView::disableCoordinateInput() +void GraphicView::disableCoordinateInput() { if (eventHandler) eventHandler->disableCoordinateInput(); @@ -680,11 +674,11 @@ void RS_GraphicView::disableCoordinateInput() /** * zooms in by factor f */ -void RS_GraphicView::zoomIn(double f, const Vector & center) +void GraphicView::zoomIn(double f, const Vector & center) { if (f < 1.0e-6) { - RS_DEBUG->print(RS_Debug::D_WARNING, "RS_GraphicView::zoomIn: invalid factor"); + RS_DEBUG->print(RS_Debug::D_WARNING, "GraphicView::zoomIn: invalid factor"); return; } @@ -708,7 +702,7 @@ void RS_GraphicView::zoomIn(double f, const Vector & center) /** * zooms in by factor f in x */ -void RS_GraphicView::zoomInX(double f) +void GraphicView::zoomInX(double f) { if (simulationRunning) return; @@ -724,7 +718,7 @@ void RS_GraphicView::zoomInX(double f) /** * zooms in by factor f in y */ -void RS_GraphicView::zoomInY(double f) +void GraphicView::zoomInY(double f) { if (simulationRunning) return; @@ -740,12 +734,12 @@ void RS_GraphicView::zoomInY(double f) /** * zooms out by factor f */ -void RS_GraphicView::zoomOut(double f, const Vector & center) +void GraphicView::zoomOut(double f, const Vector & center) { if (f < 1.0e-6) { RS_DEBUG->print(RS_Debug::D_WARNING, - "RS_GraphicView::zoomOut: invalid factor"); + "GraphicView::zoomOut: invalid factor"); return; } @@ -758,12 +752,12 @@ void RS_GraphicView::zoomOut(double f, const Vector & center) /** * zooms out by factor f in x */ -void RS_GraphicView::zoomOutX(double f) +void GraphicView::zoomOutX(double f) { if (f < 1.0e-6) { RS_DEBUG->print(RS_Debug::D_WARNING, - "RS_GraphicView::zoomOutX: invalid factor"); + "GraphicView::zoomOutX: invalid factor"); return; } @@ -779,14 +773,13 @@ void RS_GraphicView::zoomOutX(double f) } /** - * zooms out by factor f y + * zooms out by factor of y */ -void RS_GraphicView::zoomOutY(double f) +void GraphicView::zoomOutY(double f) { if (f < 1.0e-6) { - RS_DEBUG->print(RS_Debug::D_WARNING, - "RS_GraphicView::zoomOutY: invalid factor"); + RS_DEBUG->print(RS_Debug::D_WARNING, "GraphicView::zoomOutY: invalid factor"); return; } @@ -808,9 +801,9 @@ void RS_GraphicView::zoomOutY(double f) * @param keepAspectRatio true: keep aspect ratio 1:1 * false: factors in x and y are stretched to the max */ -void RS_GraphicView::zoomAuto(bool axis, bool keepAspectRatio) +void GraphicView::zoomAuto(bool axis, bool keepAspectRatio) { - RS_DEBUG->print("RS_GraphicView::zoomAuto"); + RS_DEBUG->print("GraphicView::zoomAuto"); if (simulationRunning) return; @@ -873,20 +866,20 @@ void RS_GraphicView::zoomAuto(bool axis, bool keepAspectRatio) redraw(); } - RS_DEBUG->print("RS_GraphicView::zoomAuto OK"); + RS_DEBUG->print("GraphicView::zoomAuto OK"); } /** * Shows previous view. */ -void RS_GraphicView::zoomPrevious() +void GraphicView::zoomPrevious() { - RS_DEBUG->print("RS_GraphicView::zoomPrevious"); + RS_DEBUG->print("GraphicView::zoomPrevious"); if (simulationRunning) return; - if (container != NULL) + if (container) restoreView(); } @@ -894,7 +887,7 @@ void RS_GraphicView::zoomPrevious() * Saves the current view as previous view to which we can * switch back later with @see restoreView(). */ -void RS_GraphicView::saveView() +void GraphicView::saveView() { previousOffsetX = offsetX; previousOffsetY = offsetY; @@ -905,7 +898,7 @@ void RS_GraphicView::saveView() * Restores the view previously saved with * @see saveView(). */ -void RS_GraphicView::restoreView() +void GraphicView::restoreView() { int pox = previousOffsetX; int poy = previousOffsetY; @@ -928,7 +921,7 @@ void RS_GraphicView::restoreView() * * @param axis include axis in zoom */ -void RS_GraphicView::zoomAutoY(bool axis) +void GraphicView::zoomAutoY(bool axis) { if (simulationRunning) return; @@ -1000,7 +993,7 @@ void RS_GraphicView::zoomAutoY(bool axis) * false: zooms exactly the selected range to the * current graphic view */ -void RS_GraphicView::zoomWindow(Vector v1, Vector v2, bool keepAspectRatio) +void GraphicView::zoomWindow(Vector v1, Vector v2, bool keepAspectRatio) { if (simulationRunning) return; @@ -1082,7 +1075,7 @@ void RS_GraphicView::zoomWindow(Vector v1, Vector v2, bool keepAspectRatio) /** * Centers the point v1. */ -void RS_GraphicView::zoomPan(int dx, int dy) +void GraphicView::zoomPan(int dx, int dy) { //offsetX+=(int)toGuiDX(v1.x); //offsetY+=(int)toGuiDY(v1.y); @@ -1103,7 +1096,7 @@ void RS_GraphicView::zoomPan(int dx, int dy) /** * Scrolls in the given direction. */ -void RS_GraphicView::zoomScroll(RS2::Direction direction) +void GraphicView::zoomScroll(RS2::Direction direction) { if (simulationRunning) return; @@ -1133,9 +1126,9 @@ void RS_GraphicView::zoomScroll(RS2::Direction direction) /** * Zooms to page extends. */ -void RS_GraphicView::zoomPage() +void GraphicView::zoomPage() { - RS_DEBUG->print("RS_GraphicView::zoomPage"); + RS_DEBUG->print("GraphicView::zoomPage"); if (container == NULL) return; @@ -1188,9 +1181,9 @@ void RS_GraphicView::zoomPage() /** * Draws the entities within the given range. */ -void RS_GraphicView::drawWindow(Vector v1, Vector v2) +void GraphicView::drawWindow(Vector v1, Vector v2) { - RS_DEBUG->print("RS_GraphicView::drawWindow() begin"); + RS_DEBUG->print("GraphicView::drawWindow() begin"); if (simulationRunning) return; @@ -1205,24 +1198,24 @@ void RS_GraphicView::drawWindow(Vector v1, Vector v2) } } - RS_DEBUG->print("RS_GraphicView::drawWindow() end"); + RS_DEBUG->print("GraphicView::drawWindow() end"); } /** * Draws the entities. If painter is NULL a new painter will * be created and destroyed. */ -void RS_GraphicView::drawIt() +void GraphicView::drawIt() { if (!isUpdateEnabled()) //{ -//printf("RS_GraphicView::drawIt(): isUpdateEnabled() == false!\n"); +//printf("GraphicView::drawIt(): isUpdateEnabled() == false!\n"); return; //} if (simulationRunning) //{ -//printf("RS_GraphicView::drawIt(): simulationRunning == true!\n"); +//printf("GraphicView::drawIt(): simulationRunning == true!\n"); return; //} @@ -1232,7 +1225,7 @@ void RS_GraphicView::drawIt() if (!painter) // { -//printf("RS_GraphicView::drawIt(): painter == NULL!\n"); +//printf("GraphicView::drawIt(): painter == NULL!\n"); return; // } @@ -1266,13 +1259,13 @@ void RS_GraphicView::drawIt() * Sets the pen of the painter object to the suitable pen for the given * entity. */ -void RS_GraphicView::setPenForEntity(RS_Entity * e) +void GraphicView::setPenForEntity(RS_Entity * e) { if (drawingMode == RS2::ModePreview /*|| draftMode==true*/) return; // set color of entity - if (painter != NULL && !painter->isPreviewMode()) + if (painter && !painter->isPreviewMode()) { // Getting pen from entity (or layer) RS_Pen pen = e->getPen(true); @@ -1345,16 +1338,16 @@ void RS_GraphicView::setPenForEntity(RS_Entity * e) * lines e.g. in splines). * @param db Double buffering on (recommended) / off */ -void RS_GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db) +void GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db) { - //RS_DEBUG->print("RS_GraphicView::drawEntity() begin"); + //RS_DEBUG->print("GraphicView::drawEntity() begin"); // update is diabled: if (!isUpdateEnabled()) return; // given entity is NULL: - if (e == NULL) + if (!e) return; // entity is not visible: @@ -1363,11 +1356,11 @@ void RS_GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db) // test if the entity is in the viewport if (!e->isContainer() && !isPrinting() - && (painter == NULL || !painter->isPreviewMode()) + && (!painter || !painter->isPreviewMode()) && (toGuiX(e->getMax().x) < 0 || toGuiX(e->getMin().x) > getWidth() || toGuiY(e->getMin().y) < 0 || toGuiY(e->getMax().y) > getHeight())) //{ -//printf("RS_GraphicView::drawEntity(): Bailing out of big test!!!\n"); +//printf("GraphicView::drawEntity(): Bailing out of big test!!!\n"); return; //} @@ -1442,15 +1435,16 @@ void RS_GraphicView::drawEntity(RS_Entity * e, double patternOffset, bool db) } //RS_DEBUG->print("draw plain OK"); - //RS_DEBUG->print("RS_GraphicView::drawEntity() end"); + //RS_DEBUG->print("GraphicView::drawEntity() end"); } /** * Deletes an entity with the background color. * Might be recusively called e.g. for polylines. */ -void RS_GraphicView::deleteEntity(RS_Entity * e) +void GraphicView::deleteEntity(RS_Entity * e) { +#warning "!!! This is part of obsolete rendering !!!" setDeleteMode(true); drawEntity(e); setDeleteMode(false); @@ -1460,22 +1454,24 @@ void RS_GraphicView::deleteEntity(RS_Entity * e) * Draws an entity. * The painter must be initialized and all the attributes (pen) must be set. */ -void RS_GraphicView::drawEntityPlain(RS_Entity * e, double patternOffset) +void GraphicView::drawEntityPlain(RS_Entity * e, double patternOffset) { - if (e == NULL) +//Problems can still occur here when passing in a deleted object... It won't be +//NULL, but it will cause a segfault here... + if (!e) //{ -//printf("RS_GraphicView::drawEntityPlain(): Entity passed in is NULL!\n"); +//printf("GraphicView::drawEntityPlain(): Entity passed in is NULL!\n"); return; //} -//printf("RS_GraphicView::drawEntityPlain(): Passing in painter=%08X, view=%08X\n", painter, this); +//printf("GraphicView::drawEntityPlain(): Passing in painter=%08X, view=%08X\n", painter, this); e->draw(painter, this, patternOffset); } /** * Simulates this drawing in slow motion. */ -void RS_GraphicView::simulateIt() +void GraphicView::simulateIt() { if (simulationRunning) return; @@ -1522,7 +1518,7 @@ void RS_GraphicView::simulateIt() //RS_DEBUG->print(" draw grid.."); //RS_DEBUG->timestamp(); - //RS_DEBUG->print("RS_GraphicView::drawIt() end"); + //RS_DEBUG->print("GraphicView::drawIt() end"); //if (painterCreated==true) { //jlh destroyPainter(); //} @@ -1534,7 +1530,7 @@ void RS_GraphicView::simulateIt() * * @param smooth If true, the entity will be drawn slowly (pixel by pixel). */ -void RS_GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen) +void GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen) { if (painter == NULL || e == NULL) return; @@ -1628,7 +1624,7 @@ void RS_GraphicView::simulateEntity(RS_Entity * e, const RS_Pen & pen) * * @param step true: stepping mode (entity by entity simulation). adds a delay. */ -void RS_GraphicView::simulationDelay(bool step) +void GraphicView::simulationDelay(bool step) { int delay; settings.beginGroup("CAM"); @@ -1672,7 +1668,7 @@ void RS_GraphicView::simulationDelay(bool step) /** * Draws a line slowly from (x1, y1) to (x2, y2). This is used for simulation only. */ -void RS_GraphicView::drawLineSmooth(const Vector & p1, const Vector & p2, const RS_Pen & pen) +void GraphicView::drawLineSmooth(const Vector & p1, const Vector & p2, const RS_Pen & pen) { double alpha = p1.angleTo(p2); double xStep, yStep; @@ -1748,7 +1744,7 @@ void RS_GraphicView::drawLineSmooth(const Vector & p1, const Vector & p2, const || (!xIsOne && ((ly >= p1.y && ly <= p2.y) || (ly >= p2.y && ly <= p1.y)))); } -void RS_GraphicView::drawArcSmooth(const Vector & center, double radius, double a1, double a2, bool rev, +void GraphicView::drawArcSmooth(const Vector & center, double radius, double a1, double a2, bool rev, const RS_Pen & pen) { //int icx = graphic->realToScreenX(cx); @@ -1873,7 +1869,7 @@ void RS_GraphicView::drawArcSmooth(const Vector & center, double radius, double * @return Pointer to the static pattern struct that belongs to the * given pattern type or NULL. */ -RS_LineTypePattern * RS_GraphicView::getPattern(RS2::LineType t) +RS_LineTypePattern * GraphicView::getPattern(RS2::LineType t) { switch (t) { @@ -1965,7 +1961,7 @@ RS_LineTypePattern * RS_GraphicView::getPattern(RS2::LineType t) * * @see drawIt() */ -void RS_GraphicView::drawAbsoluteZero() +void GraphicView::drawAbsoluteZero() { if (!painter) return; @@ -1994,7 +1990,7 @@ void RS_GraphicView::drawAbsoluteZero() * * @see drawIt() */ -void RS_GraphicView::drawRelativeZero() +void GraphicView::drawRelativeZero() { if (!relativeZero.valid || !painter) return; @@ -2023,20 +2019,20 @@ void RS_GraphicView::drawRelativeZero() * * @see drawIt() */ -void RS_GraphicView::drawPaper() +void GraphicView::drawPaper() { - if (container == NULL) + if (!container) return; Drawing * graphic = container->getGraphic(); - if (graphic == NULL) + if (!graphic) return; if (graphic->getPaperScale() < 1.0e-6) return; - if (painter == NULL) + if (!painter) return; // draw paper: @@ -2054,18 +2050,15 @@ void RS_GraphicView::drawPaper() // shadow painter->fillRect((int)(v1.x) + 6, (int)(v1.y) + 6, - (int)((v2.x - v1.x)), (int)((v2.y - v1.y)), - RS_Color(64, 64, 64)); + (int)((v2.x - v1.x)), (int)((v2.y - v1.y)), RS_Color(64, 64, 64)); // border: painter->fillRect((int)(v1.x), (int)(v1.y), - (int)((v2.x - v1.x)), (int)((v2.y - v1.y)), - RS_Color(64, 64, 64)); + (int)((v2.x - v1.x)), (int)((v2.y - v1.y)), RS_Color(64, 64, 64)); // paper painter->fillRect((int)(v1.x) + 1, (int)(v1.y) - 1, - (int)((v2.x - v1.x)) - 2, (int)((v2.y - v1.y)) + 2, - RS_Color(255, 255, 255)); + (int)((v2.x - v1.x)) - 2, (int)((v2.y - v1.y)) + 2, RS_Color(255, 255, 255)); } /** @@ -2073,37 +2066,30 @@ void RS_GraphicView::drawPaper() * * @see drawIt() */ -void RS_GraphicView::drawGrid() +void GraphicView::drawGrid() { - if (grid == NULL || isGridOn() == false) + if (!grid || isGridOn() == false) // { -// printf("RS_GraphicView::drawGrid(): Aborting: grid=%08X, isGridOn=%s\n", grid, (isGridOn() ? "true" : "false")); +// printf("GraphicView::drawGrid(): Aborting: grid=%08X, isGridOn=%s\n", grid, (isGridOn() ? "true" : "false")); return; // } // draw grid: - //painter->setPen(Qt::gray); painter->setPen(gridColor); -// painter->setPen(RS_Pen(RS_Color(128, 128, 128), RS2::Width00, RS2::SolidLine)); //Problem here: pts is NULL! Vector * pts = grid->getPoints(); - if (pts != NULL) + if (pts) { for(int i=0; icount(); ++i) painter->drawGridPoint(toGui(pts[i])); } // else -// printf("RS_GraphicView::drawGrid(): pts == NULL!\n"); +// printf("GraphicView::drawGrid(): pts == NULL!\n"); // draw grid info: - //painter->setPen(Qt::white); QString info = grid->getInfo(); - //info = QString("%1 / %2") - // .arg(grid->getSpacing()) - // .arg(grid->getMetaSpacing()); - updateGridStatusWidget(info); } @@ -2112,12 +2098,12 @@ void RS_GraphicView::drawGrid() * * @see drawIt() */ -void RS_GraphicView::drawMetaGrid() +void GraphicView::drawMetaGrid() { - if (grid == NULL || isGridOn() == false /*|| grid->getMetaSpacing()<0.0*/) + if (!grid || isGridOn() == false /*|| grid->getMetaSpacing()<0.0*/) return; - if (painter == NULL) + if (!painter) return; RS_Pen pen(metaGridColor, RS2::Width00, RS2::DotLine); @@ -2143,27 +2129,27 @@ void RS_GraphicView::drawMetaGrid() /** * Updates the grid if there is one. */ -void RS_GraphicView::updateGrid() +void GraphicView::updateGrid() { - if (grid != NULL) + if (grid) grid->update(); } -RS_Grid * RS_GraphicView::getGrid() +RS_Grid * GraphicView::getGrid() { return grid; } -void RS_GraphicView::updateGridStatusWidget(const QString & /*text*/) +void GraphicView::updateGridStatusWidget(const QString & /*text*/) { } -RS2::SnapMode RS_GraphicView::getDefaultSnapMode() +RS2::SnapMode GraphicView::getDefaultSnapMode() { return defaultSnapMode; } -RS2::SnapRestriction RS_GraphicView::getSnapRestriction() +RS2::SnapRestriction GraphicView::getSnapRestriction() { return defaultSnapRes; } @@ -2171,7 +2157,7 @@ RS2::SnapRestriction RS_GraphicView::getSnapRestriction() /** * Sets the default snap mode used by newly created actions. */ -void RS_GraphicView::setDefaultSnapMode(RS2::SnapMode sm) +void GraphicView::setDefaultSnapMode(RS2::SnapMode sm) { defaultSnapMode = sm; @@ -2182,7 +2168,7 @@ void RS_GraphicView::setDefaultSnapMode(RS2::SnapMode sm) /** * Sets a snap restriction (e.g. orthogonal). */ -void RS_GraphicView::setSnapRestriction(RS2::SnapRestriction sr) +void GraphicView::setSnapRestriction(RS2::SnapRestriction sr) { defaultSnapRes = sr; @@ -2193,7 +2179,7 @@ void RS_GraphicView::setSnapRestriction(RS2::SnapRestriction sr) /** * Translates a vector in real coordinates to a vector in screen coordinates. */ -Vector RS_GraphicView::toGui(Vector v) +Vector GraphicView::toGui(Vector v) { return Vector(toGuiX(v.x), toGuiY(v.y), 0.0); } @@ -2203,7 +2189,7 @@ Vector RS_GraphicView::toGui(Vector v) * @param visible Pointer to a boolean which will contain true * after the call if the coordinate is within the visible range. */ -double RS_GraphicView::toGuiX(double x, bool * visible) +double GraphicView::toGuiX(double x, bool * visible) { if (visible != NULL) { @@ -2221,7 +2207,7 @@ double RS_GraphicView::toGuiX(double x, bool * visible) /** * Translates a real coordinate in Y to a screen coordinate Y. */ -double RS_GraphicView::toGuiY(double y) +double GraphicView::toGuiY(double y) { return -y * factor.y + getHeight() - offsetY; } @@ -2229,7 +2215,7 @@ double RS_GraphicView::toGuiY(double y) /** * Translates a real coordinate distance to a screen coordinate distance. */ -double RS_GraphicView::toGuiDX(double d) +double GraphicView::toGuiDX(double d) { return d * factor.x; } @@ -2237,7 +2223,7 @@ double RS_GraphicView::toGuiDX(double d) /** * Translates a real coordinate distance to a screen coordinate distance. */ -double RS_GraphicView::toGuiDY(double d) +double GraphicView::toGuiDY(double d) { return d * factor.y; } @@ -2245,7 +2231,7 @@ double RS_GraphicView::toGuiDY(double d) /** * Translates a vector in screen coordinates to a vector in real coordinates. */ -Vector RS_GraphicView::toGraph(Vector v) +Vector GraphicView::toGraph(Vector v) { return Vector(toGraphX(RS_Math::round(v.x)), toGraphY(RS_Math::round(v.y)), 0.0); } @@ -2253,7 +2239,7 @@ Vector RS_GraphicView::toGraph(Vector v) /** * Translates two screen coordinates to a vector in real coordinates. */ -Vector RS_GraphicView::toGraph(int x, int y) +Vector GraphicView::toGraph(int x, int y) { return Vector(toGraphX(x), toGraphY(y), 0.0); } @@ -2261,7 +2247,7 @@ Vector RS_GraphicView::toGraph(int x, int y) /** * Translates a screen coordinate in X to a real coordinate X. */ -double RS_GraphicView::toGraphX(int x) +double GraphicView::toGraphX(int x) { return (x - offsetX) / factor.x; } @@ -2269,7 +2255,7 @@ double RS_GraphicView::toGraphX(int x) /** * Translates a screen coordinate in Y to a real coordinate Y. */ -double RS_GraphicView::toGraphY(int y) +double GraphicView::toGraphY(int y) { return -(y - getHeight() + offsetY) / factor.y; } @@ -2277,7 +2263,7 @@ double RS_GraphicView::toGraphY(int y) /** * Translates a screen coordinate distance to a real coordinate distance. */ -double RS_GraphicView::toGraphDX(int d) +double GraphicView::toGraphDX(int d) { return d / factor.x; } @@ -2285,7 +2271,7 @@ double RS_GraphicView::toGraphDX(int d) /** * Translates a screen coordinate distance to a real coordinate distance. */ -double RS_GraphicView::toGraphDY(int d) +double GraphicView::toGraphDY(int d) { return d / factor.y; } @@ -2295,16 +2281,16 @@ double RS_GraphicView::toGraphDY(int d) * * @param lock true: lock, false: unlock */ -void RS_GraphicView::lockRelativeZero(bool lock) +void GraphicView::lockRelativeZero(bool lock) { - relativeZeroLocked=lock; + relativeZeroLocked = lock; } /** * @return true if the position of the realtive zero point is * locked. */ -bool RS_GraphicView::isRelativeZeroLocked() +bool GraphicView::isRelativeZeroLocked() { return relativeZeroLocked; } @@ -2312,7 +2298,7 @@ bool RS_GraphicView::isRelativeZeroLocked() /** * @return Relative zero coordinate. */ -Vector RS_GraphicView::getRelativeZero() +Vector GraphicView::getRelativeZero() { return relativeZero; } @@ -2321,7 +2307,7 @@ Vector RS_GraphicView::getRelativeZero() * Sets the relative zero coordinate (if not locked) * without deleting / drawing the point. */ -void RS_GraphicView::setRelativeZero(const Vector & pos) +void GraphicView::setRelativeZero(const Vector & pos) { if (!relativeZeroLocked) relativeZero = pos; @@ -2331,9 +2317,9 @@ void RS_GraphicView::setRelativeZero(const Vector & pos) * Sets the relative zero coordinate, deletes the old position * on the screen and draws the new one. */ -void RS_GraphicView::moveRelativeZero(const Vector & pos) +void GraphicView::moveRelativeZero(const Vector & pos) { -#warning "!!! RS_GraphicView::moveRelativeZero(): Bad render path !!!" +#warning "!!! GraphicView::moveRelativeZero(): Bad render path !!!" if (!painter) return; @@ -2343,7 +2329,7 @@ void RS_GraphicView::moveRelativeZero(const Vector & pos) drawRelativeZero(); } -RS_EventHandler * RS_GraphicView::getEventHandler() +RS_EventHandler * GraphicView::getEventHandler() { return eventHandler; } @@ -2351,7 +2337,7 @@ RS_EventHandler * RS_GraphicView::getEventHandler() /** * Enables or disables print preview. */ -void RS_GraphicView::setPrintPreview(bool pv) +void GraphicView::setPrintPreview(bool pv) { printPreview = pv; } @@ -2360,7 +2346,7 @@ void RS_GraphicView::setPrintPreview(bool pv) * @retval true This is a print preview graphic view. * @retval false Otherwise. */ -bool RS_GraphicView::isPrintPreview() +bool GraphicView::isPrintPreview() { return printPreview; } @@ -2368,7 +2354,7 @@ bool RS_GraphicView::isPrintPreview() /** * Enables or disables printing. */ -void RS_GraphicView::setPrinting(bool p) +void GraphicView::setPrinting(bool p) { printing = p; } @@ -2377,7 +2363,7 @@ void RS_GraphicView::setPrinting(bool p) * @retval true This is a a graphic view for printing. * @retval false Otherwise. */ -bool RS_GraphicView::isPrinting() +bool GraphicView::isPrinting() { return printing; } @@ -2386,7 +2372,7 @@ bool RS_GraphicView::isPrinting() * @retval true Draft mode is on for this view (all lines with 1 pixel / no style scaling). * @retval false Otherwise. */ -bool RS_GraphicView::isDraftMode() +bool GraphicView::isDraftMode() { return draftMode; } @@ -2394,7 +2380,7 @@ bool RS_GraphicView::isDraftMode() /** * Sets the simulation speed in percentage. */ -void RS_GraphicView::setSimulationSpeed(int s) +void GraphicView::setSimulationSpeed(int s) { simulationSpeed = s; } @@ -2402,7 +2388,7 @@ void RS_GraphicView::setSimulationSpeed(int s) /** * @return the simulation speed in percentage. */ -int RS_GraphicView::getSimulationSpeed() +int GraphicView::getSimulationSpeed() { return simulationSpeed; } @@ -2410,14 +2396,14 @@ int RS_GraphicView::getSimulationSpeed() /** * Sets the simulation smooth mode. */ -void RS_GraphicView::setSimulationSmooth(bool s) +void GraphicView::setSimulationSmooth(bool s) { simulationSmooth = s; } /** * Sets the simulation rapid mode. */ -void RS_GraphicView::setSimulationRapid(bool r) +void GraphicView::setSimulationRapid(bool r) { simulationRapid = r; } @@ -2425,34 +2411,34 @@ void RS_GraphicView::setSimulationRapid(bool r) /** * @return the simulation rapid mode. */ -bool RS_GraphicView::getSimulationRapid() +bool GraphicView::getSimulationRapid() { return simulationRapid; } // These functions are here because of the focacta way that this // program set up its rendering... -void RS_GraphicView::SetPreviewMode(bool mode/*= true*/) +void GraphicView::SetPreviewMode(bool mode/*= true*/) { previewMode = mode; } -void RS_GraphicView::SetPreviewEntity(RS_Preview * p) +void GraphicView::SetPreviewEntity(RS_Preview * p) { previewEntity = p; } -void RS_GraphicView::SetPreviewOffset(Vector o) +void GraphicView::SetPreviewOffset(Vector o) { previewOffset = o; } -void RS_GraphicView::SetSnapperDraw(bool mode) +void GraphicView::SetSnapperDraw(bool mode) { snapperDraw = mode; } -void RS_GraphicView::SetSnapperVars(Vector snapSpot, Vector snapCoord, bool showCrosshairs) +void GraphicView::SetSnapperVars(Vector snapSpot, Vector snapCoord, bool showCrosshairs) { snapSpot1 = snapSpot; snapCoord1 = snapCoord; diff --git a/src/base/rs_graphicview.h b/src/mainapp/graphicview.h similarity index 72% rename from src/base/rs_graphicview.h rename to src/mainapp/graphicview.h index dafc78e..96e1626 100644 --- a/src/base/rs_graphicview.h +++ b/src/mainapp/graphicview.h @@ -1,34 +1,29 @@ -#ifndef RS_GRAPHICVIEW_H -#define RS_GRAPHICVIEW_H +#ifndef __GRAPHICVIEW_H__ +#define __GRAPHICVIEW_H__ -#include -#include +#include #include "rs.h" -#include "rs_blocklist.h" #include "rs_color.h" -#include "rs_linetypepattern.h" -#include "rs_commandevent.h" -#include "rs_entitycontainer.h" +#include "vector.h" +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_Grid; +class RS_Pen; class RS_EventHandler; -class RS_Preview; -class PaintInterface; -/** - * This class is a common GUI interface for the graphic viewer - * widget which has to be implementet by real GUI classes such - * as the Qt graphical view. - * - * Note that this is just an interface used as a slot to - * communicate with the qcadlib from a GUI level. - */ -class RS_GraphicView +class GraphicView { public: - RS_GraphicView(); - virtual ~RS_GraphicView(); + GraphicView(); + ~GraphicView(); void cleanUp(); @@ -47,6 +42,7 @@ class RS_GraphicView /** This virtual method must be overwritten to redraw the widget. */ virtual void redraw() = 0; + /** This virtual method must be overwritten and is then called whenever the view changed */ virtual void adjustOffsetControls(); @@ -58,25 +54,6 @@ class RS_GraphicView */ virtual void setPainter(PaintInterface * p); -// We're removing this crap... -#if 0 - /** This virtual method must be overwritten and must return - the painter device for the buffer of this widget */ -// virtual PaintInterface * createPainter() = 0; - /** - * This virtual method must be overwritten and must return - * the direct painter device for this widget - */ -// virtual PaintInterface * createDirectPainter() = 0; - /** - * This virtual method must be overwritten and must destroy - * the painter device and point 'painter' to NULL. If the painter - * is static during the whole life of the application, it might - * just do nothing. - */ -// virtual void destroyPainter() = 0; -#endif - virtual void setBackground(const RS_Color & bg); RS_Color getBackground(); RS_Color getForeground(); @@ -235,7 +212,6 @@ class RS_GraphicView int mx; //!< Last known mouse cursor position int my; //!< Last known mouse cursor position - // RS_Painter * painter; PaintInterface * painter; /** background color (any color) */ RS_Color background; @@ -275,7 +251,6 @@ class RS_GraphicView private: int updateEnabled; bool zoomFrozen; - //bool gridVisible; bool draftMode; Vector factor; @@ -297,7 +272,6 @@ class RS_GraphicView bool printPreview; //! Active when printing only: bool printing; - //int drawRecursion; //! Simulation speed in percentage int simulationSpeed; @@ -317,6 +291,109 @@ class RS_GraphicView Vector snapSpot1; Vector snapCoord1; bool showCrosshairs1; + +//QG + + +//QC +}; + +#endif // __GRAPHICVIEW_H__ + +#if 0 +class QG_GraphicView: public QWidget, public RS_GraphicView, //public Q3FilePreview, + public RS_LayerListListener, public RS_BlockListListener +{ + Q_OBJECT + + public: + QG_GraphicView(QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = 0); + virtual ~QG_GraphicView(); + + virtual int getWidth(); + virtual int getHeight(); + virtual void redraw(); + virtual void adjustOffsetControls(); + virtual void adjustZoomControls(); +// virtual RS_Painter * createPainter(); +// virtual RS_Painter * createDirectPainter(); +#warning "!!! Need to scrub out all instances of createPainter and createDirectPainter !!!" +// virtual PaintInterface * createPainter(); +// virtual PaintInterface * createDirectPainter(); +// virtual void destroyPainter(); + virtual void setBackground(const RS_Color & bg); + virtual void setMouseCursor(RS2::CursorType c); + virtual void updateGridStatusWidget(const QString & text); + + // Methods from RS_LayerListListener Interface: + virtual void layerEdited(RS_Layer *); + virtual void layerRemoved(RS_Layer *); + virtual void layerToggled(RS_Layer *); + + protected: + virtual void emulateMouseMoveEvent(); + virtual void mousePressEvent(QMouseEvent * e); + virtual void mouseReleaseEvent(QMouseEvent * e); + virtual void mouseMoveEvent(QMouseEvent * e); + virtual void tabletEvent(QTabletEvent * e); + virtual void leaveEvent(QEvent *); + virtual void enterEvent(QEvent *); + virtual void focusInEvent(QFocusEvent *); + virtual void focusOutEvent(QFocusEvent *); + virtual void wheelEvent(QWheelEvent * e); + virtual void keyPressEvent(QKeyEvent * e); + virtual void keyReleaseEvent(QKeyEvent * e); + + void paintEvent(QPaintEvent *); + virtual void resizeEvent(QResizeEvent * e); + +#warning "!!! File preview needs porting to Qt4 !!!" +// void previewUrl(const Q3Url &u); + + private slots: + void slotHScrolled(int value); + void slotVScrolled(int value); + + private: +#warning "!!! Double buffering is not necessary anymore !!!" + //! Buffer for double-buffering + QPixmap * buffer; +// int refCount; + + protected: + int lastWidth; + int lastHeight; + //! Horizontal scrollbar. + QG_ScrollBar * hScrollBar; + //! Vertical scrollbar. + QG_ScrollBar * vScrollBar; + //! Layout used to fit in the view and the scrollbars. + QGridLayout * layout; + //! Label for grid spacing. + QLabel * gridStatus; + //! CAD mouse cursor + QCursor * curCad; + //! Delete mouse cursor + QCursor * curDel; + //! Select mouse cursor + QCursor * curSelect; + //! Magnifying glass mouse cursor + QCursor * curMagnifier; + //! Hand mouse cursor + QCursor * curHand; }; +#endif + +#if 0 +class QC_GraphicView: public QG_GraphicView +{ + public: + QC_GraphicView(RS_Document * doc, QWidget * parent = 0); + virtual ~QC_GraphicView(); + + virtual void drawIt(); + private: + //RS_Document* document; +}; #endif diff --git a/src/mainapp/mdiwindow.h b/src/mainapp/mdiwindow.h index 0f5ddad..8335ba2 100644 --- a/src/mainapp/mdiwindow.h +++ b/src/mainapp/mdiwindow.h @@ -4,7 +4,6 @@ #include #include "qc_graphicview.h" #include "qg_layerwidget.h" -#include "qg_recentfiles.h" #include "qg_pentoolbar.h" #include "rs_document.h" diff --git a/src/mainapp/qc_graphicview.cpp b/src/mainapp/qc_graphicview.cpp index 799d4ad..33cf23a 100644 --- a/src/mainapp/qc_graphicview.cpp +++ b/src/mainapp/qc_graphicview.cpp @@ -45,5 +45,5 @@ void QC_GraphicView::drawIt() if (!isUpdateEnabled()) return; - RS_GraphicView::drawIt(); + GraphicView::drawIt(); } diff --git a/src/mainapp/qc_graphicview.h b/src/mainapp/qc_graphicview.h index 2cc2822..066f06f 100644 --- a/src/mainapp/qc_graphicview.h +++ b/src/mainapp/qc_graphicview.h @@ -17,8 +17,6 @@ class RS_Document; */ class QC_GraphicView: public QG_GraphicView { -// Q_OBJECT - public: QC_GraphicView(RS_Document * doc, QWidget * parent = 0); virtual ~QC_GraphicView(); diff --git a/src/widgets/qg_actionhandler.cpp b/src/widgets/qg_actionhandler.cpp index 5e86279..d0d6210 100644 --- a/src/widgets/qg_actionhandler.cpp +++ b/src/widgets/qg_actionhandler.cpp @@ -14,6 +14,7 @@ #include "qg_actionhandler.h" +#include "rs_commandevent.h" #include "commands.h" #include "rs_actionblocksadd.h" #include "rs_actionblocksattributes.h" @@ -67,6 +68,7 @@ #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" @@ -172,7 +174,7 @@ QG_ActionHandler::~QG_ActionHandler() */ void QG_ActionHandler::killSelectActions() { - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); if (gv != NULL) gv->killSelectActions(); @@ -183,7 +185,7 @@ void QG_ActionHandler::killSelectActions() */ RS_ActionInterface * QG_ActionHandler::getCurrentAction() { - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); if (gv) return gv->getCurrentAction(); @@ -195,7 +197,7 @@ RS_ActionInterface * QG_ActionHandler::getCurrentAction() Instead of the following giant switch statement, you could something like the following: RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS_ActionInterface * action) { - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); RS_Document * doc = mainWindow->getDocument(); // only global options are allowed without a document: @@ -231,7 +233,7 @@ RS_ActionInterface * QG_ActionHandler::setCurrentAction(RS2::ActionType id) { RS_DEBUG->print("QG_ActionHandler::setCurrentAction()"); - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); RS_Document * doc = mainWindow->getDocument(); RS_ActionInterface * a = NULL; @@ -816,7 +818,7 @@ bool QG_ActionHandler::keycode(const QString & code) // pass keycode on to running action: //RS_keycodeEvent e(cmd); - //RS_GraphicView* gv = mainWindow->getGraphicView(); + //GraphicView* gv = mainWindow->getGraphicView(); //if (gv!=NULL) { // gv->keycodeEvent(&e); //} @@ -897,7 +899,7 @@ bool QG_ActionHandler::command(const QString & cmd) if (c == "\n") { - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); if (gv != NULL) gv->back(); @@ -909,7 +911,7 @@ bool QG_ActionHandler::command(const QString & cmd) // pass command on to running action: RS_CommandEvent e(cmd); - RS_GraphicView * gv = mainWindow->getGraphicView(); + GraphicView * gv = mainWindow->getGraphicView(); if (gv != NULL) { diff --git a/src/widgets/qg_actionhandler.h b/src/widgets/qg_actionhandler.h index 69cc5e6..d5d68c2 100644 --- a/src/widgets/qg_actionhandler.h +++ b/src/widgets/qg_actionhandler.h @@ -2,11 +2,11 @@ #define QG_ACTIONHANDLER_H #include -#include "rs_document.h" -#include "qg_graphicview.h" +#include "rs.h" class QG_MainWindowInterface; class CadToolBarSnap; +class RS_ActionInterface; /** * This class can trigger actions (from menus, buttons, ...). diff --git a/src/widgets/qg_dialogfactory.cpp b/src/widgets/qg_dialogfactory.cpp index b30b5de..9c857a0 100644 --- a/src/widgets/qg_dialogfactory.cpp +++ b/src/widgets/qg_dialogfactory.cpp @@ -14,10 +14,12 @@ #include "qg_dialogfactory.h" +#include "graphicview.h" #include "qg_layerwidget.h" #include "qg_mainwindowinterface.h" #include "rs_actiondimlinear.h" #include "rs_actioninterface.h" +#include "rs_blocklist.h" #include "rs_document.h" #include "rs_hatch.h" #include "rs_patternlist.h" @@ -207,7 +209,7 @@ void QG_DialogFactory::requestWarningDialog(const QString & warning) /** * Requests a new document from the main window. */ -RS_GraphicView * QG_DialogFactory::requestNewDocument(const QString & fileName, RS_Document * doc) +GraphicView * QG_DialogFactory::requestNewDocument(const QString & fileName, RS_Document * doc) { if (mainWindow != NULL) { diff --git a/src/widgets/qg_dialogfactory.h b/src/widgets/qg_dialogfactory.h index a4d6cb0..8696e99 100644 --- a/src/widgets/qg_dialogfactory.h +++ b/src/widgets/qg_dialogfactory.h @@ -10,6 +10,7 @@ class CadToolBar; class CommandWidget; class CoordinateWidget; class RS_Document; +class GraphicView; class QG_MainWindowInterface; class MouseWidget; class SelectionWidget; @@ -41,7 +42,7 @@ class QG_DialogFactory: public RS_DialogFactoryInterface virtual void setMainWindow(QG_MainWindowInterface * mw); virtual void requestWarningDialog(const QString& warning); - virtual RS_GraphicView * requestNewDocument(const QString& fileName = QString::null, + virtual GraphicView * requestNewDocument(const QString & fileName = QString::null, RS_Document * doc = NULL); virtual void requestSimulationControls(); diff --git a/src/widgets/qg_graphicview.cpp b/src/widgets/qg_graphicview.cpp index 96cdebf..7c0b632 100644 --- a/src/widgets/qg_graphicview.cpp +++ b/src/widgets/qg_graphicview.cpp @@ -20,7 +20,7 @@ #include "rs_actionmodifydelete.h" #include "rs_actionselectsingle.h" #include "rs_dialogfactory.h" -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_preview.h" #include "drawing.h" #include "settings.h" @@ -36,7 +36,7 @@ * Constructor. */ QG_GraphicView::QG_GraphicView(QWidget * parent, const char */*name*/, Qt::WindowFlags f): - QWidget(parent, f), RS_GraphicView()//, refCount(0) + QWidget(parent, f), GraphicView()//, refCount(0) { setBackground(background); buffer = NULL; @@ -178,7 +178,7 @@ int QG_GraphicView::getHeight() */ void QG_GraphicView::setBackground(const RS_Color & bg) { - RS_GraphicView::setBackground(bg); + GraphicView::setBackground(bg); // setBackgroundColor(bg); QPalette palette; @@ -361,14 +361,14 @@ void QG_GraphicView::mousePressEvent(QMouseEvent * e) if (e->button() == Qt::MidButton /*|| (e->state()==Qt::LeftButton|Qt::AltButton)*/) setCurrentAction(new RS_ActionZoomPan(*container, *this)); - RS_GraphicView::mousePressEvent(e); + GraphicView::mousePressEvent(e); QWidget::mousePressEvent(e); } void QG_GraphicView::mouseReleaseEvent(QMouseEvent * e) { RS_DEBUG->print("QG_GraphicView::mouseReleaseEvent"); - RS_GraphicView::mouseReleaseEvent(e); + GraphicView::mouseReleaseEvent(e); //QWidget::mouseReleaseEvent(e); if (!e->isAccepted()) @@ -388,7 +388,7 @@ void QG_GraphicView::mouseMoveEvent(QMouseEvent * e) //RS_DEBUG->print("QG_GraphicView::mouseMoveEvent begin"); //QMouseEvent rsm = QG_Qt2Rs::mouseEvent(e); - RS_GraphicView::mouseMoveEvent(e); + GraphicView::mouseMoveEvent(e); QWidget::mouseMoveEvent(e); //What kind of cacamamie crap is this??? @@ -479,13 +479,13 @@ void QG_GraphicView::tabletEvent(QTabletEvent * e) void QG_GraphicView::leaveEvent(QEvent * e) { - RS_GraphicView::mouseLeaveEvent(); + GraphicView::mouseLeaveEvent(); QWidget::leaveEvent(e); } void QG_GraphicView::enterEvent(QEvent * e) { - RS_GraphicView::mouseEnterEvent(); + GraphicView::mouseEnterEvent(); QWidget::enterEvent(e); } @@ -497,7 +497,7 @@ void QG_GraphicView::focusOutEvent(QFocusEvent * e) void QG_GraphicView::focusInEvent(QFocusEvent * e) { //printf("-->QG_GraphicView::focusInEvent(): Start. this %s focus...\n", (hasFocus() ? "has" : "DOES NOT HAVE")); - RS_GraphicView::mouseEnterEvent(); + GraphicView::mouseEnterEvent(); QWidget::focusInEvent(e); //printf("-->QG_GraphicView::focusInEvent(): End. this %s focus...\n", (hasFocus() ? "has" : "DOES NOT HAVE")); } @@ -594,12 +594,12 @@ void QG_GraphicView::keyPressEvent(QKeyEvent * e) if (scroll) setCurrentAction(new RS_ActionZoomScroll(direction, *container, *this)); - RS_GraphicView::keyPressEvent(e); + GraphicView::keyPressEvent(e); } void QG_GraphicView::keyReleaseEvent(QKeyEvent * e) { - RS_GraphicView::keyReleaseEvent(e); + GraphicView::keyReleaseEvent(e); } /** diff --git a/src/widgets/qg_graphicview.h b/src/widgets/qg_graphicview.h index 09a4333..af3528c 100644 --- a/src/widgets/qg_graphicview.h +++ b/src/widgets/qg_graphicview.h @@ -2,7 +2,7 @@ #define QG_GRAPHICVIEW_H #include -#include "rs_graphicview.h" +#include "graphicview.h" #include "rs_layerlistlistener.h" #include "rs_blocklistlistener.h" #include "qg_scrollbar.h" @@ -17,7 +17,8 @@ class PaintInterface; * Instances of this class can be linked to layer lists using * addLayerListListener(). */ -class QG_GraphicView: public QWidget, public RS_GraphicView, //public Q3FilePreview, +//class QG_GraphicView: public QWidget, public RS_GraphicView, //public Q3FilePreview, +class QG_GraphicView: public QWidget, public GraphicView, //public Q3FilePreview, public RS_LayerListListener, public RS_BlockListListener { Q_OBJECT @@ -31,12 +32,6 @@ class QG_GraphicView: public QWidget, public RS_GraphicView, //public Q3FilePrev virtual void redraw(); virtual void adjustOffsetControls(); virtual void adjustZoomControls(); -// virtual RS_Painter * createPainter(); -// virtual RS_Painter * createDirectPainter(); -#warning "!!! Need to scrub out all instances of createPainter and createDirectPainter !!!" -// virtual PaintInterface * createPainter(); -// virtual PaintInterface * createDirectPainter(); -// virtual void destroyPainter(); virtual void setBackground(const RS_Color & bg); virtual void setMouseCursor(RS2::CursorType c); virtual void updateGridStatusWidget(const QString & text); diff --git a/src/widgets/qg_mainwindowinterface.h b/src/widgets/qg_mainwindowinterface.h index f98ba8d..4fbdf5c 100644 --- a/src/widgets/qg_mainwindowinterface.h +++ b/src/widgets/qg_mainwindowinterface.h @@ -1,12 +1,13 @@ #ifndef QG_MAINWINDOWINTERFACE_H #define QG_MAINWINDOWINTERFACE_H -#include "rs_document.h" +//#include "rs_document.h" #include "rs_mainwindowinterface.h" -#include "qg_graphicview.h" -#include "qg_actionhandler.h" +//#include "qg_graphicview.h" +//#include "qg_actionhandler.h" class QMainWindow; +class QG_ActionHandler; /** * Interface for main application windows. diff --git a/src/widgets/qg_qt2rs.h b/src/widgets/qg_qt2rs.h deleted file mode 100644 index bd512bb..0000000 --- a/src/widgets/qg_qt2rs.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** $Id: qg_qt2rs.h 1346 2003-06-11 06:58:22Z 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 QG_QT2RS_H -#define QG_QT2RS_H - -//#include -//#include "rs_mouseevent.h" -#warning "!!! QG_Qt2Rs is an empty class !!!" - -/** - * Translates Qt stuff into qcadlib stuff. - */ -class QG_Qt2Rs { - -public: - QG_Qt2Rs() {} - ~QG_Qt2Rs() {} - - /*static RS_MouseEvent mouseEvent(QMouseEvent* e) { - RS_MouseButton button; - switch (e->button()) { - case Qt::LeftButton: - button = LEFT; - break; - case Qt::RightButton: - button = RIGHT; - break; - case Qt::MidButton: - button = MIDDLE; - break; - default: - button = NONE; - break; - } - - return RS_MouseEvent(e->pos().x(), - e->pos().y(), - button ); -}*/ -} -; - -#endif - diff --git a/src/widgets/qg_recentfiles.cpp b/src/widgets/recentfiles.cpp similarity index 82% rename from src/widgets/qg_recentfiles.cpp rename to src/widgets/recentfiles.cpp index b8ad1cd..e5e6bc9 100644 --- a/src/widgets/qg_recentfiles.cpp +++ b/src/widgets/recentfiles.cpp @@ -1,4 +1,4 @@ -// qg_recentfiles.cpp +// recentfiles.cpp // // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun @@ -12,16 +12,16 @@ // JLH 05/11/2010 Added this text. :-) // -#include "qg_recentfiles.h" +#include "recentfiles.h" -#include "qc_applicationwindow.h" +#include "applicationwindow.h" #include "rs_debug.h" /** * Constructor * @param number Number of files that can be stored in the list at maximum */ -QG_RecentFiles::QG_RecentFiles(QWidget * parent, QMenu * menu, int num/*= 9*/): +RecentFiles::RecentFiles(QWidget * parent, QMenu * menu, int num/*= 9*/): QObject(), number(num) { // We make a separator that we can control the visibility of... @@ -43,7 +43,7 @@ QG_RecentFiles::QG_RecentFiles(QWidget * parent, QMenu * menu, int num/*= 9*/): /** * Destructor */ -QG_RecentFiles::~QG_RecentFiles() +RecentFiles::~RecentFiles() { while (!actionList.isEmpty()) delete actionList.takeFirst(); @@ -53,9 +53,9 @@ QG_RecentFiles::~QG_RecentFiles() * Adds a file to the list of recently loaded files if * it's not already in the list. */ -void QG_RecentFiles::add(const QString & filename) +void RecentFiles::add(const QString & filename) { - RS_DEBUG->print("QG_RecentFiles::add"); + RS_DEBUG->print("RecentFiles::add"); // Is the file already in the list? Bail out if so... if (files.indexOf(filename) != -1) @@ -67,14 +67,14 @@ void QG_RecentFiles::add(const QString & filename) if ((int)files.count() > number) files.pop_front(); - RS_DEBUG->print("QG_RecentFiles::add: OK"); + RS_DEBUG->print("RecentFiles::add: OK"); } /** * @return complete path and name of the file stored in the * list at index i */ -QString QG_RecentFiles::get(int i) +QString RecentFiles::get(int i) { if (i < (int)files.count()) return files[i]; @@ -83,18 +83,18 @@ QString QG_RecentFiles::get(int i) } /** @return number of files currently stored in the list */ -int QG_RecentFiles::count(void) +int RecentFiles::count(void) { return files.count(); } /** @return number of files that can be stored in the list at maximum */ -int QG_RecentFiles::Maximum(void) +int RecentFiles::Maximum(void) { return number; } -void QG_RecentFiles::UpdateGUI(void) +void RecentFiles::UpdateGUI(void) { int numRecentFiles = count(); diff --git a/src/widgets/qg_recentfiles.h b/src/widgets/recentfiles.h similarity index 62% rename from src/widgets/qg_recentfiles.h rename to src/widgets/recentfiles.h index 6dfc95f..5a8971e 100644 --- a/src/widgets/qg_recentfiles.h +++ b/src/widgets/recentfiles.h @@ -1,16 +1,16 @@ -#ifndef QG_RECENTFILES_H -#define QG_RECENTFILES_H +#ifndef __RECENTFILES_H__ +#define __RECENTFILES_H__ #include /** * This class can store recent files in a list. */ -class QG_RecentFiles: public QObject +class RecentFiles: public QObject { public: - QG_RecentFiles(QWidget * parent, QMenu * menu, int num = 9); - ~QG_RecentFiles(); + RecentFiles(QWidget * parent, QMenu * menu, int num = 9); + ~RecentFiles(); void add(const QString & filename); QString get(int i); @@ -25,4 +25,4 @@ class QG_RecentFiles: public QObject QAction * separator; }; -#endif +#endif // __RECENTFILES_H__ -- 2.37.2