]> Shamusworld >> Repos - architektonas/blobdiff - src/mainapp/graphicview.h
Still in the middle of fixing preview/snapper rendering...
[architektonas] / src / mainapp / graphicview.h
index 6e2ec159156379b4b7a8ff0afb81335eb5c98036..90e30b21208b64b3eb30105e0e3ccbb17504c06b 100644 (file)
@@ -134,7 +134,6 @@ class GraphicView
 
                virtual void drawWindow(Vector v1, Vector v2);
                virtual void drawIt();
-               virtual void deleteEntity(RS_Entity * e);
                virtual void drawEntity(RS_Entity * e, double patternOffset = 0.0, bool db = false);
                virtual void drawEntityPlain(RS_Entity * e, double patternOffset = 0.0);
                virtual void setPenForEntity(RS_Entity * e);
@@ -163,6 +162,20 @@ class GraphicView
                RS2::SnapRestriction getSnapRestriction();
                bool isGridOn();
 
+/*
+What to do about this shiatsu? This stuff is used in the snapper rendering
+code... Maybe move all the snapper rendering back into this class???
+Seems to make sense, though it kinda blows encapsulation. But it's already
+blown by the snapper class having to use these functions in the first place!
+
+How to fix???
+
+The snapper as a separate class makes sense, since it has several functions
+for finding various snapping points. But what about rendering???
+
+Having this class derive from that one *might* make sense... *Maybe*. Not sure.
+
+*/
                Vector toGui(Vector v);
                double toGuiX(double x, bool * visible = NULL);
                double toGuiY(double y);
@@ -197,79 +210,57 @@ class GraphicView
        protected:
                RS_EntityContainer * container;
                RS_EventHandler * eventHandler;
-
-               int mx;   //!< Last known mouse cursor position
-               int my;   //!< Last known mouse cursor position
-
+               int mx;                                                         //!< Last known mouse cursor position
+               int my;                                                         //!< Last known mouse cursor position
                PaintInterface * painter;
-               /** background color (any color) */
-               RS_Color background;
-               /** foreground color (black or white) */
-               RS_Color foreground;
-               /** grid color */
-               RS_Color gridColor;
-               /** meta grid color */
-               RS_Color metaGridColor;
-               /** selected color */
-               RS_Color selectedColor;
-               /** highlighted color */
-               RS_Color highlightedColor;
-               /** Grid */
-               RS_Grid * grid;
+               RS_Color background;                            //! background color (any color)
+               RS_Color foreground;                            //! foreground color (black or white)
+               RS_Color gridColor;                                     //! grid color
+               RS_Color metaGridColor;                         //! meta grid color
+               RS_Color selectedColor;                         //! selected color
+               RS_Color highlightedColor;                      //! highlighted color
+               RS_Grid * grid;                                         //! Grid
                /**
-               * Current default snap mode for this graphic view. Used for new
-               * actions.
-               */
+                * Current default snap mode for this graphic view. Used for new
+                * actions.
+                */
                RS2::SnapMode defaultSnapMode;
                /**
-               * Current default snap restriction for this graphic view. Used for new
-               * actions.
-               */
+                * Current default snap restriction for this graphic view. Used for new
+                * actions.
+                */
                RS2::SnapRestriction defaultSnapRes;
-
                RS2::DrawingMode drawingMode;
 
                /**
-               * Delete mode. If true, all drawing actions will delete in background color
-               * instead.
-               */
+                * Delete mode. If true, all drawing actions will delete in background color
+                * instead.
+                */
                bool deleteMode;
-               //! If true, the simulation is currectly running
-               bool simulationRunning;
+               bool simulationRunning;                         //! If true, the simulation is currectly running
 
        private:
                int updateEnabled;
                bool zoomFrozen;
                bool draftMode;
-
                Vector factor;
                int offsetX;
                int offsetY;
-
                Vector previousFactor;
                int previousOffsetX;
                int previousOffsetY;
-
                int borderLeft;
                int borderTop;
                int borderRight;
                int borderBottom;
-
                Vector relativeZero;
                bool relativeZeroLocked;
-               //! Print preview flag
-               bool printPreview;
-               //! Active when printing only:
-               bool printing;
-
-               //! Simulation speed in percentage
-               int simulationSpeed;
-               //! If true, the entity is drawn slowly (pixel by pixel).
-               bool simulationSmooth;
-               //! If true, the way between entities is also shown.
-               bool simulationRapid;
-               //! Last position (for rapid move)
-               Vector simulationLast;
+               bool printPreview;                              //! Print preview flag
+               bool printing;                                  //! Active when printing only:
+               int simulationSpeed;                    //! Simulation speed in percentage
+               bool simulationSmooth;                  //! If true, the entity is drawn slowly (pixel by pixel).
+               bool simulationRapid;                   //! If true, the way between entities is also shown.
+               Vector simulationLast;                  //! Last position (for rapid move)
 
        public://for now
                // We use this here instead of deriving ActionInterface from it because
@@ -281,22 +272,14 @@ class GraphicView
        protected:
                int lastWidth;
                int lastHeight;
-               //! Horizontal scrollbar.
-               QScrollBar * hScrollBar;
-               //! Vertical scrollbar.
-               QScrollBar * vScrollBar;
-               //! 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;
+               QScrollBar * hScrollBar;                        //! Horizontal scrollbar.
+               QScrollBar * vScrollBar;                        //! Vertical scrollbar.
+               QLabel * gridStatus;                            //! Label for grid spacing.
+               QCursor * curCad;                                       //! CAD mouse cursor
+               QCursor * curDel;                                       //! Delete mouse cursor
+               QCursor * curSelect;                            //! Select mouse cursor
+               QCursor * curMagnifier;                         //! Magnifying glass mouse cursor
+               QCursor * curHand;                                      //! Hand mouse cursor
 
 //QC was merged with QG
 };