]> Shamusworld >> Repos - architektonas/commitdiff
Refactoring: Moved RS_GraphicView to GraphicView.
authorShamus Hammons <jlhamm@acm.org>
Fri, 18 Jun 2010 02:47:05 +0000 (02:47 +0000)
committerShamus Hammons <jlhamm@acm.org>
Fri, 18 Jun 2010 02:47:05 +0000 (02:47 +0000)
290 files changed:
architektonas.pro
src/actions/rs_actionblocksadd.cpp
src/actions/rs_actionblocksadd.h
src/actions/rs_actionblocksattributes.cpp
src/actions/rs_actionblocksattributes.h
src/actions/rs_actionblockscreate.cpp
src/actions/rs_actionblockscreate.h
src/actions/rs_actionblocksedit.cpp
src/actions/rs_actionblocksedit.h
src/actions/rs_actionblocksexplode.cpp
src/actions/rs_actionblocksexplode.h
src/actions/rs_actionblocksfreezeall.cpp
src/actions/rs_actionblocksfreezeall.h
src/actions/rs_actionblocksinsert.cpp
src/actions/rs_actionblocksinsert.h
src/actions/rs_actionblocksremove.cpp
src/actions/rs_actionblocksremove.h
src/actions/rs_actionblockstoggleview.cpp
src/actions/rs_actionblockstoggleview.h
src/actions/rs_actiondefault.cpp
src/actions/rs_actiondefault.h
src/actions/rs_actiondimaligned.cpp
src/actions/rs_actiondimaligned.h
src/actions/rs_actiondimangular.cpp
src/actions/rs_actiondimangular.h
src/actions/rs_actiondimdiametric.cpp
src/actions/rs_actiondimdiametric.h
src/actions/rs_actiondimension.cpp
src/actions/rs_actiondimension.h
src/actions/rs_actiondimleader.cpp
src/actions/rs_actiondimleader.h
src/actions/rs_actiondimlinear.cpp
src/actions/rs_actiondimlinear.h
src/actions/rs_actiondimradial.cpp
src/actions/rs_actiondimradial.h
src/actions/rs_actiondrawarc.cpp
src/actions/rs_actiondrawarc.h
src/actions/rs_actiondrawarc3p.cpp
src/actions/rs_actiondrawarc3p.h
src/actions/rs_actiondrawarctangential.cpp
src/actions/rs_actiondrawarctangential.h
src/actions/rs_actiondrawcircle.cpp
src/actions/rs_actiondrawcircle.h
src/actions/rs_actiondrawcircle2p.cpp
src/actions/rs_actiondrawcircle2p.h
src/actions/rs_actiondrawcircle3p.cpp
src/actions/rs_actiondrawcircle3p.h
src/actions/rs_actiondrawcirclecr.cpp
src/actions/rs_actiondrawcirclecr.h
src/actions/rs_actiondrawellipseaxis.cpp
src/actions/rs_actiondrawellipseaxis.h
src/actions/rs_actiondrawhatch.cpp
src/actions/rs_actiondrawhatch.h
src/actions/rs_actiondrawimage.cpp
src/actions/rs_actiondrawimage.h
src/actions/rs_actiondrawline.cpp
src/actions/rs_actiondrawline.h
src/actions/rs_actiondrawlineangle.cpp
src/actions/rs_actiondrawlineangle.h
src/actions/rs_actiondrawlinebisector.cpp
src/actions/rs_actiondrawlinebisector.h
src/actions/rs_actiondrawlinefree.cpp
src/actions/rs_actiondrawlinefree.h
src/actions/rs_actiondrawlinehorvert.cpp
src/actions/rs_actiondrawlinehorvert.h
src/actions/rs_actiondrawlineparallel.cpp
src/actions/rs_actiondrawlineparallel.h
src/actions/rs_actiondrawlineparallelthrough.cpp
src/actions/rs_actiondrawlineparallelthrough.h
src/actions/rs_actiondrawlinepolygon.cpp
src/actions/rs_actiondrawlinepolygon.h
src/actions/rs_actiondrawlinepolygon2.cpp
src/actions/rs_actiondrawlinepolygon2.h
src/actions/rs_actiondrawlinerectangle.cpp
src/actions/rs_actiondrawlinerectangle.h
src/actions/rs_actiondrawlinerelangle.cpp
src/actions/rs_actiondrawlinerelangle.h
src/actions/rs_actiondrawlinetangent1.cpp
src/actions/rs_actiondrawlinetangent1.h
src/actions/rs_actiondrawlinetangent2.cpp
src/actions/rs_actiondrawlinetangent2.h
src/actions/rs_actiondrawpoint.cpp
src/actions/rs_actiondrawpoint.h
src/actions/rs_actiondrawspline.cpp
src/actions/rs_actiondrawspline.h
src/actions/rs_actiondrawtext.cpp
src/actions/rs_actiondrawtext.h
src/actions/rs_actioneditcopy.cpp
src/actions/rs_actioneditcopy.h
src/actions/rs_actioneditpaste.cpp
src/actions/rs_actioneditpaste.h
src/actions/rs_actioneditundo.cpp
src/actions/rs_actioneditundo.h
src/actions/rs_actionfilenew.cpp
src/actions/rs_actionfilenew.h
src/actions/rs_actionfileopen.cpp
src/actions/rs_actionfileopen.h
src/actions/rs_actionfilesave.cpp
src/actions/rs_actionfilesave.h
src/actions/rs_actionfilesaveas.cpp
src/actions/rs_actionfilesaveas.h
src/actions/rs_actioninfoangle.cpp
src/actions/rs_actioninfoangle.h
src/actions/rs_actioninfoarea.cpp
src/actions/rs_actioninfoarea.h
src/actions/rs_actioninfodist.cpp
src/actions/rs_actioninfodist.h
src/actions/rs_actioninfodist2.cpp
src/actions/rs_actioninfodist2.h
src/actions/rs_actioninfoinside.cpp
src/actions/rs_actioninfoinside.h
src/actions/rs_actioninfototallength.cpp
src/actions/rs_actioninfototallength.h
src/actions/rs_actionlayersadd.cpp
src/actions/rs_actionlayersadd.h
src/actions/rs_actionlayersedit.cpp
src/actions/rs_actionlayersedit.h
src/actions/rs_actionlayersfreezeall.cpp
src/actions/rs_actionlayersfreezeall.h
src/actions/rs_actionlayersremove.cpp
src/actions/rs_actionlayersremove.h
src/actions/rs_actionlayerstogglelock.cpp
src/actions/rs_actionlayerstogglelock.h
src/actions/rs_actionlayerstoggleview.cpp
src/actions/rs_actionlayerstoggleview.h
src/actions/rs_actionlibraryinsert.cpp
src/actions/rs_actionlibraryinsert.h
src/actions/rs_actionlockrelativezero.cpp
src/actions/rs_actionlockrelativezero.h
src/actions/rs_actionmodifyattributes.cpp
src/actions/rs_actionmodifyattributes.h
src/actions/rs_actionmodifybevel.cpp
src/actions/rs_actionmodifybevel.h
src/actions/rs_actionmodifycut.cpp
src/actions/rs_actionmodifycut.h
src/actions/rs_actionmodifydelete.cpp
src/actions/rs_actionmodifydelete.h
src/actions/rs_actionmodifydeletefree.cpp
src/actions/rs_actionmodifydeletefree.h
src/actions/rs_actionmodifydeletequick.cpp
src/actions/rs_actionmodifydeletequick.h
src/actions/rs_actionmodifyentity.cpp
src/actions/rs_actionmodifyentity.h
src/actions/rs_actionmodifyexplodetext.cpp
src/actions/rs_actionmodifyexplodetext.h
src/actions/rs_actionmodifymirror.cpp
src/actions/rs_actionmodifymirror.h
src/actions/rs_actionmodifymove.cpp
src/actions/rs_actionmodifymove.h
src/actions/rs_actionmodifymoverotate.cpp
src/actions/rs_actionmodifymoverotate.h
src/actions/rs_actionmodifyrotate.cpp
src/actions/rs_actionmodifyrotate.h
src/actions/rs_actionmodifyrotate2.cpp
src/actions/rs_actionmodifyrotate2.h
src/actions/rs_actionmodifyround.cpp
src/actions/rs_actionmodifyround.h
src/actions/rs_actionmodifyscale.cpp
src/actions/rs_actionmodifyscale.h
src/actions/rs_actionmodifystretch.cpp
src/actions/rs_actionmodifystretch.h
src/actions/rs_actionmodifytrim.cpp
src/actions/rs_actionmodifytrim.h
src/actions/rs_actionmodifytrimamount.cpp
src/actions/rs_actionmodifytrimamount.h
src/actions/rs_actionoptionsdrawing.cpp
src/actions/rs_actionoptionsdrawing.h
src/actions/rs_actionprintpreview.cpp
src/actions/rs_actionprintpreview.h
src/actions/rs_actionselect.cpp
src/actions/rs_actionselect.h
src/actions/rs_actionselectall.cpp
src/actions/rs_actionselectall.h
src/actions/rs_actionselectbase.cpp
src/actions/rs_actionselectbase.h
src/actions/rs_actionselectcontour.cpp
src/actions/rs_actionselectcontour.h
src/actions/rs_actionselectintersected.cpp
src/actions/rs_actionselectintersected.h
src/actions/rs_actionselectinvert.cpp
src/actions/rs_actionselectinvert.h
src/actions/rs_actionselectlayer.cpp
src/actions/rs_actionselectlayer.h
src/actions/rs_actionselectsingle.cpp
src/actions/rs_actionselectsingle.h
src/actions/rs_actionselectwindow.cpp
src/actions/rs_actionselectwindow.h
src/actions/rs_actionsetrelativezero.cpp
src/actions/rs_actionsetrelativezero.h
src/actions/rs_actionsetsnapmode.cpp
src/actions/rs_actionsetsnapmode.h
src/actions/rs_actionsetsnaprestriction.cpp
src/actions/rs_actionsetsnaprestriction.h
src/actions/rs_actionsnapintersectionmanual.cpp
src/actions/rs_actionsnapintersectionmanual.h
src/actions/rs_actiontoolregeneratedimensions.cpp
src/actions/rs_actiontoolregeneratedimensions.h
src/actions/rs_actionzoomauto.cpp
src/actions/rs_actionzoomauto.h
src/actions/rs_actionzoomautoy.cpp
src/actions/rs_actionzoomautoy.h
src/actions/rs_actionzoomin.cpp
src/actions/rs_actionzoomin.h
src/actions/rs_actionzoompan.cpp
src/actions/rs_actionzoompan.h
src/actions/rs_actionzoomprevious.cpp
src/actions/rs_actionzoomprevious.h
src/actions/rs_actionzoomredraw.cpp
src/actions/rs_actionzoomredraw.h
src/actions/rs_actionzoomscroll.cpp
src/actions/rs_actionzoomscroll.h
src/actions/rs_actionzoomwindow.cpp
src/actions/rs_actionzoomwindow.h
src/base/rs_actioninterface.cpp
src/base/rs_actioninterface.h
src/base/rs_arc.cpp
src/base/rs_arc.h
src/base/rs_circle.cpp
src/base/rs_circle.h
src/base/rs_constructionline.cpp
src/base/rs_constructionline.h
src/base/rs_creation.cpp
src/base/rs_creation.h
src/base/rs_dialogfactoryadapter.h
src/base/rs_dialogfactoryinterface.h
src/base/rs_ellipse.cpp
src/base/rs_ellipse.h
src/base/rs_entity.cpp
src/base/rs_entity.h
src/base/rs_entitycontainer.cpp
src/base/rs_entitycontainer.h
src/base/rs_eventhandler.cpp
src/base/rs_eventhandler.h
src/base/rs_grid.cpp
src/base/rs_grid.h
src/base/rs_hatch.cpp
src/base/rs_hatch.h
src/base/rs_image.cpp
src/base/rs_image.h
src/base/rs_line.cpp
src/base/rs_line.h
src/base/rs_mainwindowinterface.h
src/base/rs_modification.cpp
src/base/rs_modification.h
src/base/rs_point.cpp
src/base/rs_point.h
src/base/rs_polyline.cpp
src/base/rs_polyline.h
src/base/rs_previewactioninterface.cpp
src/base/rs_previewactioninterface.h
src/base/rs_selection.cpp
src/base/rs_selection.h
src/base/rs_snapper.cpp
src/base/rs_snapper.h
src/base/rs_solid.cpp
src/base/rs_solid.h
src/base/rs_spline.cpp
src/base/rs_spline.h
src/base/rs_staticgraphicview.h
src/forms/cadtoolbararcs.cpp
src/forms/cadtoolbarcircles.cpp
src/forms/cadtoolbardim.cpp
src/forms/cadtoolbarellipses.cpp
src/forms/cadtoolbarinfo.cpp
src/forms/cadtoolbarlines.cpp
src/forms/cadtoolbarmain.cpp
src/forms/cadtoolbarmodify.cpp
src/forms/cadtoolbarpoints.cpp
src/forms/cadtoolbarpolylines.cpp
src/forms/cadtoolbarselect.cpp
src/forms/cadtoolbarsnap.cpp
src/forms/cadtoolbarsplines.cpp
src/forms/dlghatch.cpp
src/mainapp/applicationwindow.cpp
src/mainapp/applicationwindow.h
src/mainapp/graphicview.cpp [moved from src/base/rs_graphicview.cpp with 80% similarity]
src/mainapp/graphicview.h [moved from src/base/rs_graphicview.h with 72% similarity]
src/mainapp/mdiwindow.h
src/mainapp/qc_graphicview.cpp
src/mainapp/qc_graphicview.h
src/widgets/qg_actionhandler.cpp
src/widgets/qg_actionhandler.h
src/widgets/qg_dialogfactory.cpp
src/widgets/qg_dialogfactory.h
src/widgets/qg_graphicview.cpp
src/widgets/qg_graphicview.h
src/widgets/qg_mainwindowinterface.h
src/widgets/qg_qt2rs.h [deleted file]
src/widgets/recentfiles.cpp [moved from src/widgets/qg_recentfiles.cpp with 82% similarity]
src/widgets/recentfiles.h [moved from src/widgets/qg_recentfiles.h with 62% similarity]

index 877884a67367aafe0c015a007ba18e4eb256c054..9e63187f7c0c63a5f99d19c4e5b33d9328ad3f2e 100644 (file)
@@ -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 \
index a0ca3d69d040790986b7bfc116e76c2ace2dda89..d8b197fbb323ba0269ed70297b8856ac87e20978 100644 (file)
@@ -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)
 {
 }
index c2b2e0c49351b0baaf46aec434ef88485a11d8bf..5bb31b901bcab3b3c1c2b3831ee2ff3d25e2a33b 100644 (file)
@@ -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()
                {
                }
index 67ef48b36a2b97800c6db3f2c7dc1c3fad39571c..a4e084bc89096c0cd1f1c499a39cdeeb5aced119 100644 (file)
@@ -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)
 {
 }
index 80dc698a8177e8a809a8dcf72a73ba5f7a1775df..5945bde71e8b2fb2dee58ad7de200c1b19cbd928 100644 (file)
@@ -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()
                {
                }
index 70f57d0e5b8bb95c16deeef9d9df3e02c8545ce3..30e7a397c7abdfc82c94992e64ea174ff844329d 100644 (file)
 
 #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);
 }
index 021c47c61b1fe4c63594300c5dc161ee3e23a730..dacd03c2d541a133ad762ef4823761c2e02d0be0 100644 (file)
@@ -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();
index c8b163cf4cbe774ee1e74d411fa23f20a5dff2a6..33836480c6620b6b4d3e0e6daafd1cd2c2e20054 100644 (file)
@@ -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)
 {
 }
index 764e036f8b369434752d0c9c1b351371cb6ad663..0a0780e33ea555bd781cf36229545c5459efc257 100644 (file)
@@ -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()
                {
                }
index f0de0d69570a9c4b03db5c81dea44f29b22f2037..a86808349a47b1dd6c8a876f2c3c7c1baf1b5320 100644 (file)
@@ -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)
 {
index ed2de134ac8df130839a16d9fafa812d8645b47a..d5fae5173265ad0916c44bf64b6e2f85c4774bf1 100644 (file)
@@ -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*/);
index 90313f75046b1fe6cf4d3c6c98a1238a38df3d0e..ef5f7793e2693e8a97b2914dfdcc042da1ee5489 100644 (file)
@@ -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;
index 32a04b708d723a6edc8fa6b071030cd7c189d846..6f75d9e6bb9252289c5f97c6018f7c92fb07362f 100644 (file)
@@ -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);
index 390485c369794cae00726d92d5033be98700dc03..8e70dfba8bb5c036865feab7132fee7b6e134ff7 100644 (file)
@@ -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)
 {
 }
index 5ef409566843f150dabcdaf586c53b3de701cada..7e3fb94967d0511762ae07de89e76baff3c45b93 100644 (file)
@@ -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();
index 0fae7c73e801b43138fed581c92e8e2bf996fd4d..f1aa15b5d71f11d31b92ca2f7e5c76fac0437737 100644 (file)
 #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)
 {
 }
index 4ad441ebc44de40da9cdeb41d13ebfe9406bc047..ed0faf8687d874f562f0e276fe9d1493e9e520e9 100644 (file)
@@ -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);
index f596ceb31f30b2e09285def4e6d2c66332087b17..3b8c84d459dfdfc06e4c23a2430cd281ef4acffc 100644 (file)
@@ -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)
 {
 }
index 9009d346d3b971460061d509ce230a9cbfabe327..f48d90ddbc6952e7c6751b7984db7bead19fbca5 100644 (file)
@@ -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);
index 7ae500b2d8e257c13641b2967a1fbf61268ad5db..e49edd8f877c09da642442a17cedaf8789d34b4b 100644 (file)
@@ -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");
index 53e56ab8a407fd055227463eeb67a4c15d21409d..a3290986ceabb48876f81b04307c71ebcad98d35 100644 (file)
@@ -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*/);
index 90401f4541d3949b78f53f84e93d2477d4096863..02be819c23e0b10621900138cb5ed20a91ba597e 100644 (file)
 
 #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();
index 8e6b958ae9e01972511fb165821aea93200ba4bb..b7bf152dbc1a886aa7373e8af115ddff5c865140 100644 (file)
@@ -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();
index 9ebb5681c7c64184ce67833838f25fc66674751f..3442ad73702331508bb1896cc533bf7293dcdd6a 100644 (file)
 
 #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();
index a8e9a52afd41b2976130f97d3211a2ea7d310380..5f02dbaa8896cd6d7f996d362a1113e6e59b66bb 100644 (file)
@@ -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();
index ce4757055d41e86f7be761f56fd7062537aa8dea..80264c5439740745c36942a8352ee2f668886090 100644 (file)
 
 #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();
index 1515b02d68f1e54b4639d6b72fe3d36ee9fe060f..e4b37c17d32c1c693aada48f1c8432d7ec413716 100644 (file)
@@ -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();
index 89af7a5b0586e76e91297115403683f66c8d556a..864b771065123aeeda2e805def4154259dfe87e5 100644 (file)
@@ -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();
index 1c4735b354c2152abb24dd735c22382f7b1d0e97..910bfc0a7a491ae5602b5aed26e5167ed54ddf9d 100644 (file)
@@ -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();
index 8d625d9d894b16bd019d4990202c455d60b87fe2..31d2995557b451ae39faee5b8506189cadfff457 100644 (file)
 
 #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();
index 545bff6e8194fff6deed118dcd9a195fdf6ba410..91f5e3e1926f18eef837ff1079c2e3aeda9a0ef0 100644 (file)
@@ -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*/);
index efa3be0412b5f6890e877e5b93a4b1c5793d944d..9fe8faba15d3830c5cfb54c1634b4d92515d5b9a 100644 (file)
 
 #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;
index 471c03be2ceffc0d3fd4f4721bc65ac87a2eacec..289d2430948a99b8ec64ce455f6d464e46ae6468 100644 (file)
@@ -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();
index f9b86412e258e824271c7300d3a47e850c98175d..6248e5b33c3f1875a908c9e0caf2bac6b7868012 100644 (file)
 
 #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();
index 475aa949121fd22c497caf5a0706e917c582c0f8..04ff60fa6d5faab4e893db2b789aa987057337e6 100644 (file)
@@ -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();
index 671d3cde3d2999b1f28c8b5acce0fb216b4d29f4..e47f1bd23e526d803acd9e4ba67f125cefa03c1e 100644 (file)
 
 #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();
index 6edc795168ca8ac1ca5bdda42ba14480405efe16..90fec85d52f96351a74c0c5da956f3618d802b44 100644 (file)
@@ -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();
index bf1c49332be3dd52564a72f7eb72afb2a838970c..2450e76dbf7798829e4c3a79b92ac111b336569f 100644 (file)
 #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();
index 052c09556fbc25fb03fefec6cff557266c325c65..54026318f7012e2cafec5fcc6b3d341e642591dd 100644 (file)
@@ -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();
index 1f639dce1989cc21067ffc02fb8b43f68735da35..1bdc1350e51a0f41310145ee70aff16650c72101 100644 (file)
 
 #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();
index bca26bdf222ed4b6d8cab120ee742beec2e36ef9..1d56f14495409fbd826dde6f2ff232f54bc1c6f2 100644 (file)
@@ -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();
index 7b1d50be8c2fab0c995c85c4a280fe9ac43c18c7..cf20b47424cdb33ef05256e876e4f4a6b5b6ca72 100644 (file)
 
 #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();
index 87572750ed3aa1ee5f8b8d75e61927c43671c426..c5ca1fdd1621c05a567e4c981ad52c1ef8d4a195 100644 (file)
@@ -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();
index 71c410abe56d2dc52620a5f1c999c97e0036fc0a..d9425550c8c0ab2dada58c3ebf4a384f2ee18ee9 100644 (file)
 
 #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();
index 97c0ef5f64a452bab117a8e2b0cc3ef9f4d671d9..aebbbae912844d64e61cbd8d22058afaf555c6fd 100644 (file)
@@ -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();
index a65954354af1b5616a5a73c1ac1a01b963e04e99..1d01eff928040b31520eb4d585aaddc4acc9652c 100644 (file)
 
 #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();
index 695cc2f4d0e2ce30f1155799a965421b1ed6103e..a00e04b87c3fd3f62e8367285980b9be057ed663 100644 (file)
@@ -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();
index 1825b4fb79b40387718876b3c3a36182ddc1df0c..9e9d49a2b00cfb1f89708d5344cb2fa12c9a2c34 100644 (file)
 
 #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();
index f60f461de4ace9141dff686f2c03f1d48b731938..8bd35ec25a069d2d6df99878263839b7eccddade 100644 (file)
@@ -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();
index a262fa12482efedac4e2050ac51d4d21520865a0..f1c72616d015acefefbf5b9d444c07497a747fd0 100644 (file)
@@ -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;
index 67796f7312f45d1c971b1152a9017de96b88c07f..2aacd5006b07ebb7c18d8eda7b8888c554d72ee4 100644 (file)
@@ -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);
index 096d959eb9fae2217ea3a4219c4d3d703cda67cc..0fd90c2240533db7378a4a070d169cc8611091cd 100644 (file)
 #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;
index c632753e2d435080765d5ed355c39cf8c5204aea..295456464dfedd426201a96a44f55a5d0df933a8 100644 (file)
@@ -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);
index 2ba383db2481ef504262bc95cd54129004007eef..b80cfd574e0b89c16768c8fa643b9583ba4985d1 100644 (file)
 
 #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)
 {
 }
index 284208deadd857da4070dc8fd2b2847eb3e64879..47a330714c8cd2809a85ae002208b3f76d8cc628 100644 (file)
@@ -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();
index 8a3d4f5d54d074afe2e4f689892d90544130cfa7..ce6ccdf8fdbe9078bb531800404ce9ab4d7ed41e 100644 (file)
 #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");
index ef3d668742ef4a0235569a8829af5b2ec2c109c0..b059d6e583a87c33bcd804236bedb5155dbf454b 100644 (file)
@@ -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();
index cf2540150ce9afd28ebfbb1db8fe7c2e63fe1f3b..a71dbe8fb9797dace278e341d0abacab411cc1e5 100644 (file)
 
 #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)
 {
index 71c5ec46dde1541dbc5a56bb6696e199cc80818f..49b1c3cdbd9b46986611152d9a29ad28c28367aa 100644 (file)
@@ -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();
index e06ebf933708518a84b8c971c44e4950de5b2b84..285be69174dac58fa36b60c4b3bcb6f5056c33d1 100644 (file)
 
 #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;
index 2caf564b3de61eb3e13e8e86f3c97d220dd369e7..d524b2d410fc8742ec4a5cea3ed9feb87635c447 100644 (file)
@@ -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();
index f2d18e7c32cd7323f453f2fca294333b0ea4b3cf..8c36b103afd9297d0a903e292f713eab1d7e85b4 100644 (file)
 #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);
index b8e01ed2373ab35d25ccc7a8fb4345d086424d8f..97c781c16f07fcfba75bb3535acdd0266b4e0c19 100644 (file)
@@ -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();
index 67be5e2e34752c1bf2cb4cac27aed6ab882a89f2..71f650f2d899cb5b96e7baaa6e7eead239934af2 100644 (file)
 #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();
index 618ed84accb0318851e9b9e2b27657c43b728bec..5a88b906ae6141d91c44c5b39520f0f3b78b0ffe 100644 (file)
@@ -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();
index 03ab2682e229a6643d21c87b913138b24b85855c..a9e687ce2441f7692564a337b652313e93dd94b6 100644 (file)
 #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;
index 162e2deb0ef31704a57121b795e7d0f9144966de..f3666cdaf37898321d78041c06a1906766fe9de9 100644 (file)
@@ -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();
index aa9db00cb0de92c8faba12b4998b2fc7f985f82e..81a9bcec053d6f30e415f3a0a0f69fe24871872f 100644 (file)
 
 #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;
index 4963bc87f23fa425abb314553f6b8c216d3a4df1..8a6acd3a07611867e32d058199e0777614899b15 100644 (file)
@@ -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();
index c9761a634cb10b9495d4ed42c78340a81ed717cb..7bfe2bc810885467f64107630bd796a7866172e3 100644 (file)
 
 #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);
index 13a377ef5642f9477c1c7459298100712e6dbfa6..8f787a6e6e1f374face1329fcb51df34b8df313d 100644 (file)
@@ -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();
index 8e260612bbab92ff3a9fd93972d7efe79e921608..fb783d61f98746b37c4151a6708c295a6e8372dd 100644 (file)
 
 #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);
index e8569768a51ef04c6b1e5e9e6522a254ab32f94b..243a56f027dc845acfd133740312c67341c8fb5f 100644 (file)
@@ -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();
index 455eeeb42c79ecf732871b3269c88551c7700a6d..db82d0188dcc004b3ff31c1400a41f27b655d25f 100644 (file)
 
 #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();
index 6097a155000d8bb1d16067b4efcae1eca06d2dd2..2bf88a007a77ece19ccf1bde43e5e760e531f3b7 100644 (file)
@@ -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();
index 1ecd4c0639078b27ec6884e4b899a7635919f42a..911a16510e7f60ef290697d60c264f70485244d1 100644 (file)
 
 #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)
 {
index 6908afad7402809b4a8c8319c93a2ca9f447578c..beaf461460a3e172acf14109159fc80337db4b4d 100644 (file)
@@ -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();
index d6f0770b4d0cc0b62e217be602c73a925e024b99..ed3703d2ca5286e6380f07a82f2d5021318aec03 100644 (file)
 
 #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;
index 0269434c6f06cfb9bcdb044c95cc3a43ffbebd61..b772f74ca7a1bc9b138088f20c017fb4bdfdd08f 100644 (file)
@@ -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();
index a284560dc528aff25f20a40a3cb8c7ec2b44ff8f..f4bcf99db927b66280c49f5885c9924dbd60a9df 100644 (file)
 
 #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;
index 7b7cd5cefc8b5b38bfd1ee60b18cc89eee125953..374e3041572edc52b2334d2af064b4e14fce12ae 100644 (file)
@@ -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();
index 0a3d48ddd7685338a26b3815a0c086f81dd8edfc..820863903028762de03d75cfbb1f82d7c72e44d6 100644 (file)
 
 #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)
 {
 }
index be4fb01956d45da52d3d304848ba7168c9ca66d1..e7efb203c6b80f5fb5d22685f553db0735358669 100644 (file)
@@ -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();
index faa11ebf88e55bd2f800f73c75345cd615fef61c..91fa9a1b5ef89b04713ce135ddb97dbc7ee3dbe8 100644 (file)
 
 #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();
index 4e484ca889d936d3897814acff21a142e955a9dd..928db1e91379b316474bf37b15844b133dd792f8 100644 (file)
@@ -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();
index 55b9ae64587c2760e3763b2523013e46fc3152c2..1d3eb7c4c885253de8b6a385ee70e3f3d16ff6a8 100644 (file)
 
 #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;
index dcafd561ca8441e8d5df62268974fd478f22a8ec..a8e9c467337d51d5d5f73534ef62d41bc5c8a41e 100644 (file)
@@ -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();
index 02f0e2cd74f8f3139cd1a8bb79688f38cb44cf34..e174d428e0c025b43f2b165711f9ecafd0cae078 100644 (file)
@@ -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;
index 98033ac5f015d5dfbd8aa3cd0994ca4b0b8f0d23..5f97a2f12ec067a5f66637602af91e8a8cb0be8a 100644 (file)
@@ -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);
index e52a7d171e4ad6707b50f8150377130b52cbfa48..40f3110b19831df128803df135a12eef97680ca9 100644 (file)
@@ -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)
 {
 }
index decb09d0b08d1c05a8dfe967f5cc883df58e878d..d910bf4dbc5f1553a506862e955968a8769b55dc 100644 (file)
@@ -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);
index 3a9cfeac6578dfa63705b14eae8653315d2b4caf..5380adcc2c05980c38f56f3cf0827f8742ff023b 100644 (file)
 #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;
 }
index 6ae1c625f2d17a50cab1194210b188a83c3b4a51..9b9720a78502c521121ceeba1d1701b2c555e32a 100644 (file)
@@ -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);
index 980e4b9bb87a3f872e8be0ef22c932c4a5f40214..6ed300a995850277967e460862c77a37da6a8331 100644 (file)
@@ -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)
 {
 }
index fe8ddc6c814e2a212df41e9ee50942d44710a235..43ecc2ecf959feab521bda6380afdeb903cc37b3 100644 (file)
@@ -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);
index 517670f17b5492fc5e12c43ed7b6b140b8b687ca..a8d1fa80874d3944e6db1bdb881122b86d7de69e 100644 (file)
@@ -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)
 {
 }
index 110a30cbb3a03d3b932df811f31713517b9c9e3a..eb478b181ae3771a63cfb924eb7366e1e3117baa 100644 (file)
@@ -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);
index dc040c8ee8a518a5ad075999ed8222538d9fcc35..06274c48ea215fbbb2179f17d179a8adf9fdbc4c 100644 (file)
@@ -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)
 {
 }
index c5463fdfdd138d60c8fdb43d2f9e73b6ef2aee80..a2a119d4a9eb038f8c1ea236ffe7578fe30934ab 100644 (file)
@@ -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);
index 6f2b65622adb358dba31682f3437cec607cee780..000546aa9369af13252216b53e3a333545d73add 100644 (file)
@@ -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)
 {
 }
index 8df2c4f10f90d941c073e7aab39b19fc7c13ff29..33a609d8d84c31f8d6dd1fe386fbba75ad27f357 100644 (file)
@@ -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);
index 3dc6cb8b03c39b02f0f0599da93244477866c9db..31aa8fbff8560fe4fbc1c71fd59209b31e6d4b5b 100644 (file)
 #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)
 {
 }
index ca336877a14c4a958abccb31e068a7f79f725c5f..50bff9409095d30bc24fbc3605ede87759d83880 100644 (file)
@@ -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);
index ffb506354897d9b0936b89f8cc92720e46c97411..ae2c2c3fb26e7915c8596f72be132de17b67c031 100644 (file)
 #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)
 {
 }
index 0f701acb60f2064eeccf64f40ce5f421de9dcb6d..1d1bcd48b6e8b4f7597ccabf925962302557787e 100644 (file)
@@ -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);
index a63ea037d9f3d2da821e360f11a3097755ae5445..af59d52643b37869107c1abc77db714ad7becf0d 100644 (file)
 #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)
 {
 }
index 91e02cbad07dc271ce6395cdb1fda26877328263..9209de474df2bc62e4da80bd5bd433e245888eac 100644 (file)
@@ -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);
index 84859d87f4a2218749a1fd678e65f272236b0453..c8cea153c7e6ae599a98c9dd81d0260c749cb6f6 100644 (file)
 #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)
 {
 }
index a5de1ab8aff2b4e28eb4b978aea0239aa7e04d19..c33dfe577c5a768760a754e6a8a2086334ea9a22 100644 (file)
@@ -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);
index 7012a93d3c47e01bcca7f917641ddfc47a287e2d..5edbf63a91423e997f0abccfda4bcb18fd39aa6c 100644 (file)
 #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);
index a1f1a0821c23b93ba8a02a9713afa9590355e7fd..eaa7bfcfb24ca7d45713ffb77edb2e962d74946b 100644 (file)
@@ -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();
index 5b96dac41fe11452bfbda618335c1b3ae4d26ac8..40b2605e1d971e02e34bd778e51a31264991d9ee 100644 (file)
@@ -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)
 {
 }
index cd75db9b68323c812750cd1eff781342defc8155..8225cb91a590f1b6cbc2fefdd9c990f2de5f0c4a 100644 (file)
@@ -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);
index 594e824a5ebd9a665ac2fb38210c0f2c2726e9a3..49196535fc789d5403458350c9eb7ce16cadaf5f 100644 (file)
@@ -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)
 {
 }
index d650279a26cb73185aee46c48bd967a54c1af9dd..0c1b37e24787d2f7179f9c34e6d0910f821ac1ee 100644 (file)
@@ -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);
index cd55b241b11ce282979bd6b4d3a74bcbba52ec49..85ebe069a540158703688bcb7ee5bc0c4802e524 100644 (file)
 #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)
 {
 }
index 415afdcd0761d41475d822dfcb3fa8913320f7ef..86f9adc16fd3c3c53a48f7295a4f54eed778a61a 100644 (file)
@@ -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);
index d94ffc89f8c022510a4912b9d04527caccea0ff5..62308d0c9554171a77d4d84653841fb5e08aeb41 100644 (file)
@@ -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;
index ac6c29d02c3bc95ac742831d4d2ed957ab1c2dbc..11b9290ac879475b2f55191baa90dd79fdc30395 100644 (file)
@@ -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);
index 82aaa473eaecec69ce9536d9a7d943c8816e5fcf..ba4daefa6c4835782a6c94d67eef8b0df9356ebb 100644 (file)
@@ -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)
 {
 }
index a73770339bc66aeb820fb96e81c114e3e4d5eb66..f0be5cad8a5f3add11ec0ec3cff715a1f19e3360 100644 (file)
@@ -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);
index b8ac38965d77a0efbf4c4d792b31081647011969..578be160f2d7d66f5d11141045c2e01de462dcb3 100644 (file)
 
 #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)
 {
 }
index b27c9e28b092fd523b8b3818ec017530a5bc895d..80f60b086e37edea443f71490db603f7a85b367a 100644 (file)
@@ -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);
index e61ce40e0a91acb334aef2022e5fa1768fbd8616..1e824d6c7ed557a96a710e3bb21823ccc68e08f3 100644 (file)
@@ -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)
 {
 }
index 202a769487217323028cb4ff69a98dcbc9217b16..95e737d9468218c6bbde2162a190634ba6a10e89 100644 (file)
@@ -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);
index 2447d8f9d89a63aa76e5eda436359ec6b01cb352..b1a5757acd554a8fa4fc4486ae08ada8718ad460 100644 (file)
 
 #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)
 {
 }
index c64f8db3dabd833ec89fb06e48fa1b8e61730866..51e3e442d87ffe386d64a51870ea94f4d67d671b 100644 (file)
@@ -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();
index 6f7f641823db3c3301423c3179f4a0cc3ddbb0ef..68ccadaaa8956330b5a3b2be8116278502e24839 100644 (file)
 
 #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;
index 146d65414fe90854045ffe85d8860294177fb8e9..36bc65ccedbcb8fb2fd29a67693b39a5c350efbd 100644 (file)
@@ -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);
index 50b54a67998e43abb3d1a0f39c4854a05f49299b..ee8468513b97fc4a5d207bebcb2e662343095b2b 100644 (file)
 
 #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)
 {
 }
index af0858d35875d36d3d961e817486bd583ef6f567..6337e0e5e130511e0bbff73dbc449678b4de1bd9 100644 (file)
@@ -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);
index 652e447356fc8165e81729bb4b00f8467b2ed85b..1949c8107b8ebd3943d50247208ed29613ac5a8c 100644 (file)
 
 #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;
index 8a6d05e7e0d93bb77560048d70db31c8e945c74b..997993d5585655945603fca07dac45245ee84c85 100644 (file)
@@ -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();
index fb59aac1010d6e6d9fd02ce8552a8dc4340a200d..1fa53a6261d8fd2c46adcb4fd45a3dec237a40cd 100644 (file)
 #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;
index 041f3bee7973c41fdafda7dff3786765a2017475..61c73b1d1781301a265b62e4e3f8e6222f45cf1e 100644 (file)
@@ -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);
index 15668e7d9a34b7598a7ccb69432cae253698ed1c..abfd500edd6640c50da0a41b0ba80b52d0902d1b 100644 (file)
 #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)
 {
 }
index dafa14ce6a5a3fac1f1084e3394a060a2a0dbfaf..49c388adc244c43268a88c01a1bfa48f0eed3a89 100644 (file)
@@ -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);
index dabac671af6927f1786119e63a1b58b0492d4738..2a4c8bb72dc6a2ec4515724c2584267ca47efeb5 100644 (file)
 #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)
 {
index c7fd4fe92bf5053502c88792ee79c0d493ce17cd..c88c6ee011a7f601827fddd500a2bcec71de742a 100644 (file)
@@ -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);
index f8dc8af0e21bb4f1c261eb6cd4006491caa7716e..737c30a83bde73c1117abfc770e8be681fd53964 100644 (file)
 #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;
index 25b732d86885092197caa7c55a89239e9353a37f..b97efd9704a0fd2c6c0f8eb3550d63af81ff40fd 100644 (file)
@@ -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();
index 63b22998265e4fa73b0110ffe3beb0e01f9a4470..7aaaae48d46adb511d96b0292874deaeaecfb60e 100644 (file)
 #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;
index f790bc4e079560fd3d54d4970bd1f74d3c36de1e..c38477b2f28bab796ffa272da64f79ba61d92015 100644 (file)
@@ -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();
index a5037a2b5f6a5742d5f27da13e42b3c4b8ecea32..62a263c10456f5eb6dca69937c7fc3c600176783 100644 (file)
@@ -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)
 {
 }
index d0ebe749a06092c8c4386e1f975555309e0a1656..f4e7c7194d6a26a48e79c8630fb49deb2e054b1d 100644 (file)
@@ -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();
index 437de4b860e876a81f1e4b2e03d919f85bae6e51..ea2cd260efc9fef07cb7a340f7147a118b5bc8af 100644 (file)
@@ -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)
 {
 }
index 83aeb56da3ee12a7a8733859dec3d275121b56c6..feb5398a6effe5df800fc45765e2728dc95f1650 100644 (file)
@@ -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);
index 542129829421094633a95ee5b8958c80782628c9..5a966f7a3d6d903a0844369ad0c862faa7d8c82b 100644 (file)
@@ -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)
 {
 }
index 2610aabe3f76c42749f042a637d7605713232bf3..ebdda4c483afd36fa358ac27afd197625b65c2d9 100644 (file)
@@ -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);
index 2480d927de7654ce38ed4dfcb01dbe61369a9149..706c9d2b82e2cc9bb199b81bba30ec54b5669255 100644 (file)
 
 #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)
 {
 }
index f370566cdc6b844e6bc1ba7daa18117eb073f0db..ad09386142b04e31cbcff6912c4ec4c6ca690c9d 100644 (file)
@@ -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();
index 224a07e18a852d62896acf726aa1464b1bf351f4..41efd58bf6f7e75a8e6a410cade968a7e52737d6 100644 (file)
@@ -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)
 {
index ef99098a7d84982958459ad5caa5ce10ba0465d3..1569dc2eb06dec4d8c2fddc925840a4e1f878a66 100644 (file)
@@ -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);
index 41912348253889a32db29858bef45e30bedb924a..0bdabab68526acfb4cb1cfc442b73e04bafbecbc 100644 (file)
@@ -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)
 {
 }
index af0a254d325b1db17f8321de63a4bca90baeba4d..c74074a01dc8b40a18fbf690fc7be3c2ef4e88c1 100644 (file)
@@ -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);
index 8b6eaf389cf1de1a7d9521217544de939fc12993..530ddfab42e48a283af7e8493b4e9eaf52e3d1fc 100644 (file)
 
 #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;
index 37f79c27bc931612606777a1aa4c0e4de4f98427..27efe84079acc84bf3344bdeaf5e762fedc16037 100644 (file)
@@ -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();
index 5ab6499e47a0d303df161ff5c5c8995f1f121bc3..c8168f6e8a96f59357d3643f09416a335efb9d32 100644 (file)
@@ -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)
 {
index 0b98a4a5a91fbf16425aba67654fa3aed742380f..099672ec9df3284bc3bc9f92f6e14559d6956782 100644 (file)
@@ -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);
index 7f391f85755fadb215fe067f64218cf97d7d5ec5..df7c9ae3a3665b645f3b34dbb00cd2a6285380ac 100644 (file)
@@ -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);
index f4c4849afec3e7c4124aa0605d1631fb2b6ad4e9..a6cd584c864fb56ee178bd32c6d9e47f27c9f23e 100644 (file)
@@ -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);
index a73ebfdc6854db89165a03cde1c17e6c4c0fd00c..6ba19eabfe88cb3de854b1de4e7b48d324c88bd6 100644 (file)
@@ -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;
index 5c374069b51e0f40260f0895039c48c6252b6a0e..f88156d6ef9347b50ddfe0774594644763146860 100644 (file)
@@ -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);
index c28031eed655e87f4bcbbbb563f01258d1640e31..94a3ad8aca6d3f8869b8d64828f9d4cd3b7939c0 100644 (file)
 
 #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)
 {
index 3cb02c0be9d8b5360be1f3a2349c51b97b23f53a..e77df4f60573e934e0a944f619b7262f66a31a8a 100644 (file)
@@ -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();
index 54c866fa702752d32e9819fea938fdd2006d2e8b..7e848680446b0bb08596ee0bd4f802a2b9cd36e0 100644 (file)
@@ -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)
 {
 }
index d9bfc58594be54b5d528606a1c097b02e09b3e22..27b5f7c0236b683d91004c786d4ee410adbce883 100644 (file)
@@ -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();
index b9c6d1f139ee2312ec222cf5c9cfe352e6b3a42d..c3f274c8546fdacc44f556d98fe66f82802e49b6 100644 (file)
 
 #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)
 {
index 3e94eacf699bafb27330c169576a461ef2403c1c..eb20194defabae1eca50d2bd40e8e65c4a4ad650 100644 (file)
@@ -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();
index 15afb6fbf44b413c7716f292e337febb0b5d07a9..1fe684a39549a57acbb3b7228d8d6be4d64d96fc 100644 (file)
@@ -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;
index eb400a493eda5076e097ba83a4b5e7b37ad2c982..c4fb4c3172abcb9a9782488d59a0254844b4ef87 100644 (file)
@@ -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);
index 9a58bfe2571f406e4c4f02cd9a584ce9c54cf8aa..912dce514d3b7cbdd06c8ed22a1031d76630586a 100644 (file)
@@ -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;
index c12d0289f8da73b98f7d85a193102886c34e4f9e..daef00f6496a35a1991b0ec449e1f18b8ee3ed46 100644 (file)
@@ -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();
index c065235ba9e885998bbfb95f8bec7557dfb556a2..d1bfb1e53693a060868f07dbbd513097cf6c5177 100644 (file)
 
 #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)
 {
 }
index 0908ffc7f8effc7a4d68c5cfda6c1e063d0e8c1e..6af7a6b47a18bc09a594aa0d1bee9b13a6b24dae 100644 (file)
@@ -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);
index 9f98a062f5074f8a8ec38768d8f91d6bdafe1f19..992474770b14561f6918366ad9132dd446793b38 100644 (file)
@@ -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;
index 7e32c54852b21f79781a7a1d5a49f47db06e0c9e..8ef6b53c45b9606fbc35e55d66d0921bf45b0817 100644 (file)
@@ -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();
index 7f73a75ecc6d19bea30ae1691d4bc4ab281df9b8..240c4da4faa04faa944d76884d3cafd02c0396e2 100644 (file)
@@ -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;
index 9697d1e5d6cca2559ebf79a9cda43fec6761a6e2..6dceec76ec2f622c7421da14f77282dfe7c0299e 100644 (file)
@@ -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();
index 8451e146aa63a9f54f01c147664e8375542faf85..b28542635341e4cb15b958b0f83465003410bc45 100644 (file)
@@ -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)
 {
 }
index 5a4a2bbdbf6177bae2db8dd42494b75b978dbb39..bcf7f828d832f5fdda47fc82a29c540af6d40c19 100644 (file)
@@ -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();
index 72306ec7fa27c98f0fc2de9634921bcab920a9f6..788e40376dd5ab601a9f6d49dafb14d1fa2e2427 100644 (file)
@@ -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;
index 6c6e714e519aed7e06e3670450fb710b07c3eb1d..743c997416c3628d9433ab378364bb3758f0da3a 100644 (file)
@@ -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();
index 33792d3998515dc86dcb1667b8569892a95c9bd5..28f966ae9cebbf9ee2906977850d21ca4fbd2d35 100644 (file)
@@ -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;
index 17e9547e71262be0f35fd651c35fd90e2640788d..bb003b6dcecc0eaa29fbb594ed66ca7df49e3b86 100644 (file)
@@ -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();
index 44416063bf0e785452e644c554c7c1ff61df8676..293ac982164e44a852bde84880a8857d5de305c1 100644 (file)
@@ -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;
index 856281de08f4128326a3517ea260513ae97f58e1..62aafc7a78dd3ad519a4e1205f27ed75ff92f0a4 100644 (file)
@@ -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();
index 46d22a48a6f348ee41939cfb0e354df88f5067d4..fc7484d4712d4775d17f75a23ab25d212555622d 100644 (file)
 #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)
 {
 }
index d79978e6891576f1ca878a8185111ec1e7c26566..801df0f34bdc12f434ae6ee0b3c1af8f024cec7f 100644 (file)
@@ -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();
index 3819e441de9cf9906489c7a0f465bdb4d9843a6e..49ddf886423481eba40dbfd17c6b52ea88658036 100644 (file)
 
 #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;
index ebe0c2cd14d3f43544866599729dcd706c2ece09..f9315b19fb48e2ce08f6a4350546e104d8edba70 100644 (file)
@@ -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);
index 8da558dfa241ed9d3c1870ea53545101481f37c8..d4805d019c03014ba4d9ad79900c59963abef54e 100644 (file)
@@ -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;
index 4d3f67d2af1eee76db1add6863ec33c1f1a5b77e..dc2a92e046278325ae0107893973475878dea7e0 100644 (file)
@@ -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);
index 319e7ed1da0f45679ab089653eba54c9011dd62e..d10c83096a918ae91f62961c81b283d8447433ee 100644 (file)
@@ -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;
index fca9b2576dfbd8b796df2f2498d1039b131917cd..10e6b3f1973e2e2a70d6c37fa17666421f0b8946 100644 (file)
@@ -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);
index 2ad2048b12a85cc0dad1893dad7c9b172f6b7fca..04827e6942a25181cee171b05198afae8d77886b 100644 (file)
 
 #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)
 {
 }
index 92dd955224485f4c9936f60de73001aad3e32fe7..905a8551c4061e037166343d9a9768b2195b3525 100644 (file)
@@ -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);
index 6d1942b6bc5725be14211947c336ba4a38516f61..1d57827bd64a2493b9413c40f007fe3a26a7390e 100644 (file)
@@ -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;
index 73d5437a378f907ac01dc0cb7452464c7199992a..2f7411a256bef3f60ced1d7db3ef92c34cf3cd97 100644 (file)
@@ -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);
index 01868f6b2c66854fecaaf649d9e62b982e511440..1705ff635a8d6b213c1d6cab22b2406e17548c5b 100644 (file)
@@ -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)
 {
 }
index c0a32e38028c638a2a91fcb91d39bd193e2b0180..7c85883c7b343cc46e41a3455812b70a26acbebf 100644 (file)
@@ -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);
index 56cb9efee47574c26d07fcd917f66e3b5471b2cc..dd3715934dbb4ac91318a1be4bf9887a3623ae91 100644 (file)
@@ -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;
index 68abaebb44640e5a55854ef71923db18c4f1dabc..4dbd693d323cc3d7051c2928809710a1d2d55e1a 100644 (file)
@@ -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);
index ac46efb81e7e3eae49276d605bc607cd8f830cac..2066442bd361d8277e9340785a1a4ed92f99e876 100644 (file)
@@ -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)
 {
 }
index d9019e9e143354355c571d85733f3a84cfc6e112..a2cc8394e1407081b709082e43582b1d696f43f0 100644 (file)
@@ -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);
index 3b6ee3bb87eee4f1c92ecfa799a7052f14e1e61c..eb0642bcbc0fdfe708ebf992aaa158b3d08d8fc3 100644 (file)
 
 #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)
 {
 }
index bc6b8ce1e118410e7789d1464a180045c5dcef02..ef82c90fbe8b748bc1e75bb82b4aace2ac578476 100644 (file)
@@ -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);
index f8845392b89f78f36c6ef9fe7837c496438921c0..3cd34d339233a4a51226fe7b6a4cac99808d709e 100644 (file)
@@ -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)
 {
 }
index 712c900fcdb01b089eac70a3eb0e05fff87ca09b..33b8c01d192078498e80f6ea1072cfb5668e4d5a 100644 (file)
@@ -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);
index 621e91613dcbf5ad742b728d044425e286f1f438..50779c400f134b1ab78aa53cc572109fe499ddc6 100644 (file)
@@ -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;
index f461d5f4e24cfe480e1b6bc465a21849b89dc56f..2832bc910c229ffaf36afc90677e9e1303cbcd18 100644 (file)
@@ -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);
index 4f370eb48a14b15f031e2361a4c833a76a879280..1c53bbbb4c308d5d9314637444b79cf0d3db2dd2 100644 (file)
@@ -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;
index aca5cd6b1f83532b7c36984a28dbfe93ab1c5854..f1f81659db52bc89f19e726ac376ad980282b427 100644 (file)
@@ -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);
index 9557d315219a61341a42f49a46cfdd1722f16b89..7a885f8f85f770b40868d69497ce4737a2fcc35d 100644 (file)
@@ -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);
index 8b16095d98e57255722a06c4c6a6a7d0ab15d4ec..c2daeb188d2e412db231691d8cbb950fb095d567 100644 (file)
@@ -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();
index 89a91e56ce13f30f9779e5092a5df9a5c4235764..f9bb52cc28f6253947afb3dc88e68de3548651ff 100644 (file)
@@ -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"
 #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 ((a1<M_PI && a2>M_PI) ||
-            (a1>a2-1.0e-12 && a2>M_PI) ||
-            (a1>a2-1.0e-12 && a1<M_PI) ) {
-
-        minX = std::min(data.center.x - data.radius, minX);
-    }
-
-    // check for right limit:
-    if (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 ((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) ) {
+       // check for right limit:
+       if (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 (dist2<dist1) {
-        if (dist!=NULL) {
-            *dist = dist2;
-        }
-        nearerPoint = &endpoint;
-    } else {
-        if (dist!=NULL) {
-            *dist = dist1;
-        }
-        nearerPoint = &startpoint;
-    }
+       if (dist2 < dist1)
+       {
+               if (dist != NULL)
+                       *dist = dist2;
+               nearerPoint = &endpoint;
+       }
+       else
+       {
+               if (dist != NULL)
+                       *dist = dist1;
+               nearerPoint = &startpoint;
+       }
 
-    return *nearerPoint;
+       return *nearerPoint;
 }
 
+Vector RS_Arc::getNearestPointOnEntity(const Vector & coord, bool onEntity, double * dist, RS_Entity * * entity)
+{
+       Vector vec(false);
 
+       if (entity != NULL)
+               *entity = this;
 
-Vector RS_Arc::getNearestPointOnEntity(const Vector& coord,
-        bool onEntity, double* dist, RS_Entity** entity) {
+       double angle = (coord - data.center).angle();
 
-    Vector vec(false);
-    if (entity!=NULL) {
-        *entity = this;
-    }
+       if (onEntity == false || RS_Math::isAngleBetween(angle,
+                   data.angle1, data.angle2, isReversed()))
+       {
+               vec.setPolar(data.radius, angle);
+               vec += data.center;
+       }
 
-    double angle = (coord-data.center).angle();
-    if (onEntity==false || RS_Math::isAngleBetween(angle,
-            data.angle1, data.angle2, isReversed())) {
-        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_Arc::getNearestCenter(const Vector& coord,
-                                   double* dist) {
-    if (dist!=NULL) {
-        *dist = coord.distanceTo(data.center);
-    }
-    return data.center;
+Vector RS_Arc::getNearestCenter(const Vector & coord, double * dist)
+{
+       if (dist != NULL)
+               *dist = coord.distanceTo(data.center);
+       return data.center;
 }
 
+Vector RS_Arc::getNearestMiddle(const Vector & coord, double * dist)
+{
+       Vector ret = getMiddlepoint();
 
-
-Vector RS_Arc::getNearestMiddle(const Vector& coord,
-                                   double* dist) {
-
-    Vector ret = getMiddlepoint();
-
-    if (dist!=NULL) {
-        *dist = coord.distanceTo(ret);
-    }
-    return ret;
+       if (dist != NULL)
+               *dist = coord.distanceTo(ret);
+       return ret;
 }
 
+Vector RS_Arc::getNearestDist(double distance, const Vector & coord, double * dist)
+{
+       if (data.radius < 1.0e-6)
+       {
+               if (dist != NULL)
+                       *dist = RS_MAXDOUBLE;
+               return Vector(false);
+       }
 
+       double a1, a2;
+       Vector p1, p2;
+       double aDist = distance / data.radius;
 
-Vector RS_Arc::getNearestDist(double distance,
-                                 const Vector& coord,
-                                 double* dist) {
-
-    if (data.radius<1.0e-6) {
-        if (dist!=NULL) {
-            *dist = RS_MAXDOUBLE;
-        }
-        return Vector(false);
-    }
-
-    double a1, a2;
-    Vector p1, p2;
-    double aDist = distance / data.radius;
-
-    if (isReversed()) {
-        a1 = data.angle1 - aDist;
-        a2 = data.angle2 + aDist;
-    } else {
-        a1 = data.angle1 + aDist;
-        a2 = data.angle2 - aDist;
-    }
+       if (isReversed())
+       {
+               a1 = data.angle1 - aDist;
+               a2 = data.angle2 + aDist;
+       }
+       else
+       {
+               a1 = data.angle1 + aDist;
+               a2 = data.angle2 - aDist;
+       }
 
-    p1.setPolar(data.radius, a1);
-    p1 += data.center;
-    p2.setPolar(data.radius, a2);
-    p2 += data.center;
+       p1.setPolar(data.radius, a1);
+       p1 += data.center;
+       p2.setPolar(data.radius, a2);
+       p2 += data.center;
 
-    double dist1, dist2;
-    Vector* nearerPoint;
+       double dist1, dist2;
+       Vector * nearerPoint;
 
-    dist1 = p1.distanceTo(coord);
-    dist2 = p2.distanceTo(coord);
+       dist1 = p1.distanceTo(coord);
+       dist2 = p2.distanceTo(coord);
 
-    if (dist2<dist1) {
-        if (dist!=NULL) {
-            *dist = dist2;
-        }
-        nearerPoint = &p2;
-    } else {
-        if (dist!=NULL) {
-            *dist = dist1;
-        }
-        nearerPoint = &p1;
-    }
+       if (dist2 < dist1)
+       {
+               if (dist != NULL)
+                       *dist = dist2;
+               nearerPoint = &p2;
+       }
+       else
+       {
+               if (dist != NULL)
+                       *dist = dist1;
+               nearerPoint = &p1;
+       }
 
-    return *nearerPoint;
+       return *nearerPoint;
 }
 
+Vector RS_Arc::getNearestDist(double distance, bool startp)
+{
+       if (data.radius < 1.0e-6)
+               return Vector(false);
+
+       double a;
+       Vector p;
+       double aDist = distance / data.radius;
+
+       if (isReversed())
+       {
+               if (startp)
+                       a = data.angle1 - aDist;
+               else
+                       a = data.angle2 + aDist;
+       }
+       else
+       {
+               if (startp)
+                       a = data.angle1 + aDist;
+               else
+                       a = data.angle2 - aDist;
+       }
 
+       p.setPolar(data.radius, a);
+       p += data.center;
 
-
-Vector RS_Arc::getNearestDist(double distance,
-                                 bool startp) {
-
-    if (data.radius<1.0e-6) {
-        return Vector(false);
-    }
-
-    double a;
-    Vector p;
-    double aDist = distance / data.radius;
-
-    if (isReversed()) {
-        if (startp) {
-            a = data.angle1 - aDist;
-        } else {
-            a = data.angle2 + aDist;
-        }
-    } else {
-        if (startp) {
-            a = data.angle1 + aDist;
-        } else {
-            a = data.angle2 - aDist;
-        }
-    }
-
-    p.setPolar(data.radius, a);
-    p += data.center;
-
-    return p;
+       return p;
 }
 
+double RS_Arc::getDistanceToPoint(const Vector & coord, RS_Entity * * entity, RS2::ResolveLevel, double)
+{
+       if (entity != NULL)
+               *entity = this;
 
+       // check endpoints first:
+       double dist = coord.distanceTo(getStartpoint());
 
-double RS_Arc::getDistanceToPoint(const Vector& coord,
-                                  RS_Entity** entity,
-                                  RS2::ResolveLevel,
-                                  double) {
-    if (entity!=NULL) {
-        *entity = this;
-    }
+       if (dist < 1.0e-4)
+               return dist;
+       dist = coord.distanceTo(getEndpoint());
 
-    // check endpoints first:
-    double dist = coord.distanceTo(getStartpoint());
-    if (dist<1.0e-4) {
-        return dist;
-    }
-    dist = coord.distanceTo(getEndpoint());
-    if (dist<1.0e-4) {
-        return dist;
-    }
+       if (dist < 1.0e-4)
+               return dist;
 
-    if (RS_Math::isAngleBetween(data.center.angleTo(coord),
-                                data.angle1, data.angle2,
-                                isReversed())) {
+       if (RS_Math::isAngleBetween(data.center.angleTo(coord),
+                   data.angle1, data.angle2,
+                   isReversed()))
 
-        return fabs((coord-data.center).magnitude() - data.radius);
-    } else {
-        return RS_MAXDOUBLE;
-    }
+               return fabs((coord - data.center).magnitude() - data.radius);
+       else
+               return RS_MAXDOUBLE;
 }
 
-
-
-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);
-    //}
+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; 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;
-    }
-}
+               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.angle1<data.angle2) {
-            ret = data.angle1+2*M_PI-data.angle2;
-        } else {
-            ret = data.angle1-data.angle2;
-        }
-    } else {
-        if (data.angle2<data.angle1) {
-            ret = data.angle2+2*M_PI-data.angle1;
-        } else {
-            ret = data.angle2-data.angle1;
-        }
-    }
+double RS_Arc::getAngleLength() const
+{
+       double ret = 0.0;
+
+       if (isReversed())
+       {
+               if (data.angle1 < data.angle2)
+                       ret = data.angle1 + 2 * M_PI - data.angle2;
+               else
+                       ret = data.angle1 - data.angle2;
+       }
+       else
+       {
+               if (data.angle2 < data.angle1)
+                       ret = data.angle2 + 2 * M_PI - data.angle1;
+               else
+                       ret = data.angle2 - data.angle1;
+       }
 
-    // full circle:
-    if (fabs(ret)<1.0e-6) {
-        ret = 2*M_PI;
-    }
+       // full circle:
+       if (fabs(ret) < 1.0e-6)
+               ret = 2 * M_PI;
 
-    return ret;
+       return ret;
 }
 
-
-
 /**
  * @return Length of the arc.
  */
-double RS_Arc::getLength() {
-    return getAngleLength()*data.radius;
+double RS_Arc::getLength()
+{
+       return getAngleLength() * data.radius;
 }
 
-
-
 /**
  * Gets the arc's bulge (tangens of angle length divided by 4).
  */
-double RS_Arc::getBulge() const {
-    double bulge = tan(fabs(getAngleLength())/4.0);
-    if (isReversed()) {
-        bulge*=-1;
-    }
-    return bulge;
-}
-
+double RS_Arc::getBulge() const
+{
+       double bulge = tan(fabs(getAngleLength()) / 4.0);
 
+       if (isReversed())
+               bulge *= -1;
+       return bulge;
+}
 
 /**
  * Dumps the point's data to stdout.
  */
-std::ostream& operator << (std::ostream& os, const RS_Arc& a) {
-    os << " Arc: " << a.data << "\n";
-    return os;
+std::ostream & operator<<(std::ostream & os, const RS_Arc & a)
+{
+       os << " Arc: " << a.data << "\n";
+       return os;
 }
 
index 50886af1a5a8fe2a4738572ae17c921aad6f2b22..974d97ee119471558434e0104b1bd82f08c091e9 100644 (file)
 #include "rs_atomicentity.h"
 
 class PaintInterface;
+class GraphicView;
 
 /**
  * Holds the data that defines an arc.
  */
-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 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
index 2f5532d778c0a28fd3430b6b8c04454d45b39685..5eebd9a6262479e72a1074ebfa6e15029ffb6e15 100644 (file)
@@ -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"
 
 /**
 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; 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);
-
-        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;
 }
 
index ce31de8d3c4471797650da50aa42cfc4001f0a77..d272ad8fea66d26b0f29e9663226aebfd987da8d 100644 (file)
  */
 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
index de542770ad82f9e0e6cb2f959cc94de55a2ae8ba..f598a4faccde8240b90cdadb0a3e04ea4ca64dab 100644 (file)
@@ -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.
  */
index 321d0e45aaaafcde19359c04477a060c46289d57..c5d797e6ae5a0a263b6270b7bce5b86bbb2b89aa 100644 (file)
@@ -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();
index a8a14e078afab4cc2a9b81f35a14e195547a88e4..e57b90342bbba225c1dfdd9531e96f232549f2de 100644 (file)
@@ -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;
index 7187add92087689ff698e782db9413a678f4aab8..4e8cab83d616a8b610d0ec952f9ab31dae97745f 100644 (file)
@@ -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;
 };
 
index cb376b420a49aca65510e2ed6cec5bceb38511d9..af67162304a3c04f141a1cece4268b67d04c959d 100644 (file)
@@ -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; }
index 14527f5fe19f3585cd8c767af4909a528f872a2a..2ea60114f996c6a462483448e365624aa3b27f03 100644 (file)
@@ -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;
 
        /**
index c3a5cf1c8d7bfb72797db2cfb32989464ea3364f..380df86f83358d323c0388728460fed898c6bbfa 100644 (file)
@@ -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 (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;
-    }
-
-    // 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);
-        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])<length)
-                                       {
+                                       if (tot + fabs(da[i]) < length)
                                                painter->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;
 }
 
index 2c3e83e1e07fefed4e943d323c1c88da0f0d5c15..dc0588c6b64418e3126a34f9d793e6ec961d89f3 100644 (file)
@@ -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
 
 /**
  * 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
index fc7dbeab804b20affd93e124d7c014da0d40151e..da69974e9f3dbf4406ff6a92988c7d3972b91f8b 100644 (file)
@@ -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;
 }
-
index 7764832ead6f708391134f0028d8e07d7b22fbaa..bd1060ec1d9ef2c44eb50f08c1a88045ed6757c4 100644 (file)
@@ -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 <b>atomic</b> entities in this entity.
-               */
+                * This method must be overwritten in subclasses and return the
+                * number of <b>atomic</b> entities in this entity.
+                */
                virtual unsigned long int count() = 0;
 
                /**
-               * This method must be overwritten in subclasses and return the
-               * number of <b>atomic</b> entities in this entity including sub containers.
-               */
+                * This method must be overwritten in subclasses and return the
+                * number of <b>atomic</b> 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();
index 85a38b5e8d629104fd6b0c06cec2dfec52771fdb..8434b9cc86a22e009e3e7c56f2470ca35c2af724 100644 (file)
@@ -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;
index 9d968bbc863aab277db830f06b7394589963c39e..4e4cf227edfe6e923b0793d69183b19284ceb5cb 100644 (file)
@@ -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);
 
index 260998a133aeefc59de93e64d784a2fb5c472f17..20e748461fc9e5a390f05125c7754145011c0bc7 100644 (file)
 #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");
 }
 
 /**
index ff92d5d81577b6addcd69dc99f91a2f309774281..601bba7c17bfed218dc37f43483ca674470c1534 100644 (file)
@@ -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;
index 3f2252a0378c4dcc0731ba14348318c0150d03d0..c2f43e078db7538595802ceaf35ba9d18d419a51 100644 (file)
 
 #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.
index 67b3625ab3641b34359b8d85731ad9b79cc8a3f8..d2ba69a76b157aca5b573412624454106e2637c8 100644 (file)
@@ -1,8 +1,11 @@
 #ifndef RS_GRID_H
 #define RS_GRID_H
 
-#include "rs_graphicview.h"
-#include "vector.h"
+#include <QtCore>
+
+//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;
index 36237db4eb51310c7aa8de1a376e4a838dee2bd4..2a7b5a76dc424bee25b9b44ce51dacf5528c8486 100644 (file)
 #include "rs_hatch.h"
 
 #include <QtCore>
-#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)
        {
index 9fea88f309fb5f43320c25bcdb01dc7af68a8426..ba560ed4b3a17ad86655d11f92424bbcc0f186d5 100644 (file)
@@ -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);
index bf0e1c496ca1f2fe13e912ecb88f3bfe0141db9c..a92297f2c3295d57b01947d964b72e0f3e20bb32 100644 (file)
@@ -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; x<nx; ++x) {
-               img[x] = new QImage[ny];
-               for (int y = 0; y<ny; ++y) {
-                       if (x<nx-1) {
-                               w = 100;
-                       }
-                       else {
-                               w = image.width()%100;
-                       }
-
-                       if (y<ny-1) {
-                               h = 100;
-                       }
-                       else {
-                               h = image.height()%100;
-                       }
-
-                       pm = RS_Pixmap(w, h);
-                       RS_PainterQt painter(&pm);
-                       painter.drawImage(-x*100, -y*100, image);
-                       img[x][y] = pm.convertToImage();
-               }
-       }
-       */
+          // 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; x<nx; ++x) {
+               img[x] = new QImage[ny];
+               for (int y = 0; y<ny; ++y) {
+                       if (x<nx-1) {
+                               w = 100;
+                       }
+                       else {
+                               w = image.width()%100;
+                       }
+
+                       if (y<ny-1) {
+                               h = 100;
+                       }
+                       else {
+                               h = image.height()%100;
+                       }
+
+                       pm = RS_Pixmap(w, h);
+                       RS_PainterQt painter(&pm);
+                       painter.drawImage(-x*100, -y*100, image);
+                       img[x][y] = pm.convertToImage();
+               }
+          }
+        */
+}
+
+/** @return Copy of data that defines the image. */
+RS_ImageData RS_Image::getData() const
+{
+       return data;
+}
+
+/** @return Insertion point of the entity */
+/*virtual*/ Vector RS_Image::getInsertionPoint() const
+{
+       return data.insertionPoint;
+}
+
+/** Sets the insertion point for the image. */
+void RS_Image::setInsertionPoint(Vector ip)
+{
+       data.insertionPoint = ip;
+       calculateBorders();
+}
+
+/** @return File name of the image. */
+QString RS_Image::getFile() const
+{
+       return data.file;
+}
+
+/** Sets the file name of the image.  */
+void RS_Image::setFile(const QString & file)
+{
+       data.file = file;
+}
+
+/** @return u Vector. Points along bottom, 1 pixel long. */
+Vector RS_Image::getUVector() const
+{
+       return data.uVector;
+}
+
+/** @return v Vector. Points along left, 1 pixel long. */
+Vector RS_Image::getVVector() const
+{
+       return data.vVector;
+}
+
+/** @return Width of image in pixels. */
+int RS_Image::getWidth() const
+{
+       return (int)data.size.x;
+}
+
+/** @return Height of image in pixels. */
+int RS_Image::getHeight() const
+{
+       return (int)data.size.y;
+}
+
+/** @return Brightness. */
+int RS_Image::getBrightness() const
+{
+       return data.brightness;
+}
+
+/** @return Contrast. */
+int RS_Image::getContrast() const
+{
+       return data.contrast;
+}
+
+/** @return Fade. */
+int RS_Image::getFade() const
+{
+       return data.fade;
+}
+
+/** @return Image definition handle. */
+int RS_Image::getHandle() const
+{
+       return data.handle;
+}
+
+/** Sets the image definition handle. */
+void RS_Image::setHandle(int h)
+{
+       data.handle = h;
+}
+
+/** @return The four corners. **/
+VectorSolutions RS_Image::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 RS_Image::getImageWidth()
+{
+       return data.size.x * data.uVector.magnitude();
+}
+
+/**
+ * @return image height in graphic units.
+ */
+double RS_Image::getImageHeight()
+{
+       return data.size.y * data.vVector.magnitude();
 }
 
 void RS_Image::calculateBorders()
@@ -101,7 +224,7 @@ void RS_Image::calculateBorders()
        resetBorders();
        VectorSolutions sol = getCorners();
 
-       for(int i=0; i<4; ++i)
+       for (int i = 0; i < 4; ++i)
        {
                minV = Vector::minimum(minV, sol.get(i));
                maxV = Vector::maximum(maxV, sol.get(i));
@@ -114,8 +237,7 @@ Vector RS_Image::getNearestEndpoint(const Vector & coord, double * dist)
        return corners.getClosest(coord, dist);
 }
 
-Vector RS_Image::getNearestPointOnEntity(const Vector & coord, bool onEntity, double * dist,
-       RS_Entity ** entity)
+Vector RS_Image::getNearestPointOnEntity(const Vector & coord, bool onEntity, double * dist, RS_Entity * * entity)
 {
        if (entity != NULL)
                *entity = this;
@@ -130,7 +252,7 @@ Vector RS_Image::getNearestPointOnEntity(const Vector & coord, bool onEntity, do
                RS_Line(NULL, RS_LineData(corners.get(3), corners.get(0)))
        };
 
-       for(int i=0; i<4; ++i)
+       for (int i = 0; i < 4; ++i)
                points.set(i, l[i].getNearestPointOnEntity(coord, onEntity));
 
        return points.getClosest(coord, dist);
@@ -141,113 +263,102 @@ Vector RS_Image::getNearestCenter(const Vector & coord, double * dist)
        VectorSolutions points(4);
        VectorSolutions corners = getCorners();
 
-       points.set(0, (corners.get(0) + corners.get(1))/2.0);
-       points.set(1, (corners.get(1) + corners.get(2))/2.0);
-       points.set(2, (corners.get(2) + corners.get(3))/2.0);
-       points.set(3, (corners.get(3) + corners.get(0))/2.0);
+       points.set(0, (corners.get(0) + corners.get(1)) / 2.0);
+       points.set(1, (corners.get(1) + corners.get(2)) / 2.0);
+       points.set(2, (corners.get(2) + corners.get(3)) / 2.0);
+       points.set(3, (corners.get(3) + corners.get(0)) / 2.0);
 
        return points.getClosest(coord, dist);
 }
 
-
-
-Vector RS_Image::getNearestMiddle(const Vector& coord,
-                                     double* dist) {
-    return getNearestCenter(coord, dist);
+Vector RS_Image::getNearestMiddle(const Vector & coord, double * dist)
+{
+       return getNearestCenter(coord, dist);
 }
 
+Vector RS_Image::getNearestDist(double distance, const Vector & coord, double * dist)
+{
+       VectorSolutions corners = getCorners();
+       VectorSolutions points(4);
 
+       RS_Line l[] =
+       {
+               RS_Line(NULL, RS_LineData(corners.get(0), corners.get(1))),
+               RS_Line(NULL, RS_LineData(corners.get(1), corners.get(2))),
+               RS_Line(NULL, RS_LineData(corners.get(2), corners.get(3))),
+               RS_Line(NULL, RS_LineData(corners.get(3), corners.get(0)))
+       };
 
-Vector RS_Image::getNearestDist(double distance,
-                                   const Vector& coord,
-                                   double* dist) {
-
-    VectorSolutions corners = getCorners();
-    VectorSolutions points(4);
-
-    RS_Line l[] =
-        {
-            RS_Line(NULL, RS_LineData(corners.get(0), corners.get(1))),
-            RS_Line(NULL, RS_LineData(corners.get(1), corners.get(2))),
-            RS_Line(NULL, RS_LineData(corners.get(2), corners.get(3))),
-            RS_Line(NULL, RS_LineData(corners.get(3), corners.get(0)))
-        };
-
-    for (int i=0; i<4; ++i) {
-        points.set(i, l[i].getNearestDist(distance, coord, dist));
-    }
+       for (int i = 0; i < 4; ++i)
+               points.set(i, l[i].getNearestDist(distance, coord, dist));
 
-    return points.getClosest(coord, dist);
+       return points.getClosest(coord, dist);
 }
 
+double RS_Image::getDistanceToPoint(const Vector & coord, RS_Entity * * entity, RS2::ResolveLevel /*level*/,        double /*solidDist*/)
+{
+       if (entity != NULL)
+               *entity = this;
 
+       VectorSolutions corners = getCorners();
+       double dist;
+       double minDist = RS_MAXDOUBLE;
 
-double RS_Image::getDistanceToPoint(const Vector& coord,
-                                    RS_Entity** entity,
-                                    RS2::ResolveLevel /*level*/,
-                                                                       double /*solidDist*/) {
-    if (entity!=NULL) {
-        *entity = this;
-    }
-
-    VectorSolutions corners = getCorners();
-    double dist;
-    double minDist = RS_MAXDOUBLE;
+       RS_Line l[] =
+       {
+               RS_Line(NULL, RS_LineData(corners.get(0), corners.get(1))),
+               RS_Line(NULL, RS_LineData(corners.get(1), corners.get(2))),
+               RS_Line(NULL, RS_LineData(corners.get(2), corners.get(3))),
+               RS_Line(NULL, RS_LineData(corners.get(3), corners.get(0)))
+       };
 
-    RS_Line l[] =
-        {
-            RS_Line(NULL, RS_LineData(corners.get(0), corners.get(1))),
-            RS_Line(NULL, RS_LineData(corners.get(1), corners.get(2))),
-            RS_Line(NULL, RS_LineData(corners.get(2), corners.get(3))),
-            RS_Line(NULL, RS_LineData(corners.get(3), corners.get(0)))
-        };
+       for (int i = 0; i < 4; ++i)
+       {
+               dist = l[i].getDistanceToPoint(coord, NULL);
 
-    for (int i=0; i<4; ++i) {
-        dist = l[i].getDistanceToPoint(coord, NULL);
-        if (dist<minDist) {
-            minDist = dist;
-        }
-    }
+               if (dist < minDist)
+                       minDist = dist;
+       }
 
-    return minDist;
+       return minDist;
 }
 
-
-
-void RS_Image::move(Vector offset) {
-    data.insertionPoint.move(offset);
-    calculateBorders();
+/*virtual*/ double RS_Image::getLength()
+{
+       return -1.0;
 }
 
-
-
-void RS_Image::rotate(Vector center, double angle) {
-    data.insertionPoint.rotate(center, angle);
-    data.uVector.rotate(angle);
-    data.vVector.rotate(angle);
-    calculateBorders();
+void RS_Image::move(Vector offset)
+{
+       data.insertionPoint.move(offset);
+       calculateBorders();
 }
 
-
-
-void RS_Image::scale(Vector center, Vector factor) {
-    data.insertionPoint.scale(center, factor);
-    data.uVector.scale(factor);
-    data.vVector.scale(factor);
-    calculateBorders();
+void RS_Image::rotate(Vector center, double angle)
+{
+       data.insertionPoint.rotate(center, angle);
+       data.uVector.rotate(angle);
+       data.vVector.rotate(angle);
+       calculateBorders();
 }
 
+void RS_Image::scale(Vector center, Vector factor)
+{
+       data.insertionPoint.scale(center, factor);
+       data.uVector.scale(factor);
+       data.vVector.scale(factor);
+       calculateBorders();
+}
 
-
-void RS_Image::mirror(Vector axisPoint1, Vector axisPoint2) {
-    data.insertionPoint.mirror(axisPoint1, axisPoint2);
-    data.uVector.mirror(Vector(0.0,0.0), axisPoint2-axisPoint1);
-    data.vVector.mirror(Vector(0.0,0.0), axisPoint2-axisPoint1);
-    calculateBorders();
+void RS_Image::mirror(Vector axisPoint1, Vector axisPoint2)
+{
+       data.insertionPoint.mirror(axisPoint1, axisPoint2);
+       data.uVector.mirror(Vector(0.0, 0.0), axisPoint2 - axisPoint1);
+       data.vVector.mirror(Vector(0.0, 0.0), axisPoint2 - axisPoint1);
+       calculateBorders();
 }
 
-//void RS_Image::draw(RS_Painter* painter, RS_GraphicView* view, double /*patternOffset*/) {
-void RS_Image::draw(PaintInterface * painter, RS_GraphicView * view, double /*patternOffset*/)
+void RS_Image::draw(PaintInterface * painter, GraphicView * view, double /*patternOffset*/)
 {
        if (painter == NULL || view == NULL || img.isNull())
                return;
@@ -264,42 +375,34 @@ void RS_Image::draw(PaintInterface * painter, RS_GraphicView * view, double /*pa
        int height = view->getHeight();
 
        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;
 }
-
index 3c16c779ca60354bc1c4c061ed0c9cb417d50f7d..5076a3e543098a6b503616e2d2f2ede7fab18488 100644 (file)
  */
 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
index 8813b3e699f43b34e078bd6b5a9ce9a1b16d8e40..f67d1089c056e101a979a17490f4cdedef5d22c2 100644 (file)
@@ -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)
 //{
index 04a4c8651ab1e0eddc24975fc8a9c0f533e57396..7b3cdcd4646fe9fcd027f6fac8c6a5667ceea2d9 100644 (file)
@@ -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
index e3e0bdb3a320050e98614f114a99c236c08f42ad..e1ad32f8e8658eda661ed2168dcd880422c623fa 100644 (file)
@@ -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;
index 29179b944dd01f436a9f3f971e82b68509de80f2..f452583ae40ffdc438453dfec811e2fcf97ee471 100644 (file)
@@ -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;
index 28cdb84c98bee86b3fad427794a04a40d98b0260..41fb0263bf1f1054e8bfcb7dfe3038f91054ff84 100644 (file)
@@ -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;
 };
 
index be98cc58deb38f4cae28475f8ea9de8e1bdc1cff..de32daa77b595f0acc0f6fafea3d32d7f5b3001d 100644 (file)
@@ -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;
index be314e0f42d942292a7b777aa3eff0c4426fd929..e25c25bf7a392c76631d01ed0645c74123ab8fc2 100644 (file)
@@ -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);
 
index 80a0232cb4d50290b7aece45c15d5cca7a111b18..c0ca2e5866c6df8e3a18a6848ee3ecd0d3ee9961 100644 (file)
@@ -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:
index 778700fae9c65f536a06ef109aeadd66e610d536..00668479a31a7fbee04cab2d47d3fd7941742e24 100644 (file)
@@ -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);
 
index b35fed1b1dcf1fc09fde3b185360e404a899a5f2..1f59867c121052e5ae06ff65d95ce5b1952c8cbb 100644 (file)
@@ -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.
  */
index f29c3a957a630b3c497a28b9852906deec6645a9..529fb0c342e8391825f46dc3d969755db286b2bf 100644 (file)
@@ -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);
index 046775b7375540cca4f04c325f7631f02fd7fd83..f610193241c8ca87ec2d22a4717396025d89fcf0 100644 (file)
@@ -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;
index d1239e11ec2f351f8c429e83c1304aea2f0e9a7f..e0dfea6b431522d3d9b93a7a6ffbc6d13bf5d255 100644 (file)
@@ -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
index 016b48db92b2e0350ca3565b19e59ddc56fb0d85..9505d6b3b8bc2993ebba465a7b2ca918a28d9082 100644 (file)
@@ -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();
index 89351d6ad3f6d5b7ce0e21e5c75d3dcb075dcde0..30e4a0cd0d55d0bef05efcf36cc7fcbc42093c03 100644 (file)
@@ -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;
index 2badd754754d78ee1a3e7974e7f75b4d45a1218b..100dcc01fce19c16a8adbc899575a72372eacef7 100644 (file)
 
 #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();
index ab7a543a9b41911e23beb7ab814b3f923a689964..d2f8761a020c36a131d685f9e35724f55d72f2b1 100644 (file)
@@ -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
index 8b4c3a516980618cb193428596e7594dabf69476..27ede786a967d97d52a51d00b4b307c15fde908d 100644 (file)
@@ -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;
    }
index 5927ddf308a3eb0dfb347994cfb02bc20ecbea7e..30e613a7792df0d135549d9498a0a8de6ba0e078 100644 (file)
@@ -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<Vector> getControlPoints();
+    virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0);
        QList<Vector> getControlPoints();
 
     friend std::ostream & operator<<(std::ostream & os, const RS_Spline & l);
index 508ebb6747a88548edbe92c38c302ade21d22eb5..6347c193c68a92b4852f308e639571def1282553 100644 (file)
@@ -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);
index 5ee2eb86091db0a3b29aa7f38212cc0044a0b6b2..35cb97492f4d1e4d92be0f45a83f50c7eacc78a9 100644 (file)
@@ -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)
index a6d63e121fbecf5cf72abeaf1d7c32a81111e8a3..b6ebd27f91637cc1ed01532e4353e8f2e3b89197 100644 (file)
@@ -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)
index 03aaee7e3814e5875724ff8afd7e5a27022516d1..f7dd4c8700624f5d5d7ee7e3301f5f39c302c7a5 100644 (file)
@@ -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)
index 3531c1f5a23b454f84ccd5696506db50d474f2b6..d7645287e660f307e675cbff3ecbcf31686ee417 100644 (file)
@@ -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)
index 882b900d6314feecb785f83dc40ce4ec28952a85..e0f4143984e12929f4585863496b0a81943f13e0 100644 (file)
@@ -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)
index 9e515e1511cbe101db4d0464472b3cc79b916f9d..cd75a1e3a05d097cf57347aeab1f3a60aa2e2ef1 100644 (file)
@@ -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)
index 3cc4aa22ad80572f456f8c7be436a72626629b89..38d598f4d12eea3fae2ce0adb8ecea4316e6cb07 100644 (file)
@@ -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)
index ad986db4e79f1a9d79e95b7304351ebea653bf6e..f8129bbaa0cfcf76f8759385bf260cf59f9fb66c 100644 (file)
@@ -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)
index e8f1d3f973a35fca4869c89e01a6a6b01c073016..5f1245eb344d9dd394f709c71f464ddf50a0f81f 100644 (file)
@@ -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)
index 3755a89c07edc628ef9e2759a37c3960003e4967..0b75c2bfb2f6009dd8c9bde469f929f2520165a4 100644 (file)
@@ -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)
index 5a8d3a1472000981b0cf5fbb733fa614bb28e145..3f03ab84c243b997da9d513997b0c792db58e0e1 100644 (file)
@@ -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),
index b95ae158057b5813b8c1bd5cbc12bab5f01dc20b..90800f05312305bbe6fc8f23bf29d5133141b601 100644 (file)
@@ -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)
index 755f3e34c2d35a7fac9a8c8fff71b162cd9c07c0..7fcd384ddac5c2c8b6b2d57dcd51e8706feaa428 100644 (file)
@@ -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)
index 1b5d578afe1dcdcfbe45c6e494248f3451114033..b1a8b01500b3aea623d5f92bce05bbb60741e3fb 100644 (file)
@@ -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"
index e91576fcfeb078a2e4a75823032e8651a75bb338..326854eee048c1c6526466da40e94d79f0150ecf 100644 (file)
@@ -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; i<recentFiles->getNumber(); ++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();
 
index 79ca2c15f44a719d492290748e2de8bf2a228c81..bb1b0f690a0bddfcebf1d79c2d09f12b3e805e90 100644 (file)
@@ -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;
similarity index 80%
rename from src/base/rs_graphicview.cpp
rename to src/mainapp/graphicview.cpp
index a2dcb73fd5e9e17747eb6feb1a7cf6477778fb3a..69efb100c08b92ab542c0ebc79cdfd2067cd8977 100644 (file)
@@ -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 <stdio.h>
-#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; i<grid->count(); ++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;
similarity index 72%
rename from src/base/rs_graphicview.h
rename to src/mainapp/graphicview.h
index dafc78e17e214407ce653422e0d62dea3cdb5de6..96e16260a9f4156bc34f15bda47de4db4ec075ce 100644 (file)
@@ -1,34 +1,29 @@
-#ifndef RS_GRAPHICVIEW_H
-#define RS_GRAPHICVIEW_H
+#ifndef __GRAPHICVIEW_H__
+#define __GRAPHICVIEW_H__
 
-#include <stdarg.h>
-#include <QtCore>
+#include <QtGui>
 #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
index 0f5ddadc35b5745908bf100b9f78a4b118539278..8335ba28dbfb0c8d5786f3037764940d5c18e274 100644 (file)
@@ -4,7 +4,6 @@
 #include <QtGui>
 #include "qc_graphicview.h"
 #include "qg_layerwidget.h"
-#include "qg_recentfiles.h"
 #include "qg_pentoolbar.h"
 #include "rs_document.h"
 
index 799d4ad69ea752424a1a7ba6646a4cf976feb327..33cf23aef6e2af478ca658033e288190809326b9 100644 (file)
@@ -45,5 +45,5 @@ void QC_GraphicView::drawIt()
        if (!isUpdateEnabled())
                return;
 
-       RS_GraphicView::drawIt();
+       GraphicView::drawIt();
 }
index 2cc28228a92cc7e94dab43f967cc77e668bf4609..066f06f9168abb3937432e26783691df37c2af28 100644 (file)
@@ -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();
index 5e8627942363e2ff1b1bd4eab3e977331d3265a0..d0d6210f0244af98adce32e4e94a25d21eb0ef2a 100644 (file)
@@ -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)
        {
index 69cc5e616626115d40e3df16cb854fc7d34654ae..d5d68c234100a833d0029083a69af6bf3b57d6e9 100644 (file)
@@ -2,11 +2,11 @@
 #define QG_ACTIONHANDLER_H
 
 #include <QtGui>
-#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, ...).
index b30b5dec48d54b1e713984588fa31cb36d0297e7..9c857a0cac00177a1f0ff38749df33def91ee963 100644 (file)
 
 #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)
        {
index a4d6cb00dea0ed4f0dd395c61601997505b949d8..8696e997811fbe64b53836fbfec1a381cd478c2a 100644 (file)
@@ -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();
 
index 96cdebfe222c316cc5e705e8089826eff0859aca..7c0b632076f5eb2281be0f3a53edb0e20343c952 100644 (file)
@@ -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);
 }
 
 /**
index 09a4333fbcd3f3a0b510171b616e4d9c3f91d580..af3528c14be074f90dbbcd916cc46a4985d81c08 100644 (file)
@@ -2,7 +2,7 @@
 #define QG_GRAPHICVIEW_H
 
 #include <QtGui>
-#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);
index f98ba8de64f32968fb33c0050b5303095a598b7a..4fbdf5c4e6aded00136edc0fe065ee912e9d7739 100644 (file)
@@ -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 (file)
index bd512bb..0000000
+++ /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 <qnamespace.h>
-//#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
-
similarity index 82%
rename from src/widgets/qg_recentfiles.cpp
rename to src/widgets/recentfiles.cpp
index b8ad1cdb75e546dda0df1c2e4f67e2331701cd2a..e5e6bc9ff4d49322ed21fc58698ae2e02867864c 100644 (file)
@@ -1,4 +1,4 @@
-// qg_recentfiles.cpp
+// recentfiles.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
 // 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();
 
similarity index 62%
rename from src/widgets/qg_recentfiles.h
rename to src/widgets/recentfiles.h
index 6dfc95f8bdcf1a275cd1829ce52e1b9842c2612c..5a8971eab25a0edc3d7176a955d12f1b06f17512 100644 (file)
@@ -1,16 +1,16 @@
-#ifndef QG_RECENTFILES_H
-#define QG_RECENTFILES_H
+#ifndef __RECENTFILES_H__
+#define __RECENTFILES_H__
 
 #include <QtGui>
 
 /**
  * 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__