@@ -33,27 +33,30 @@ class State;
3333
3434namespace GUI {
3535
36+ // ! Graphics scene
3637class MainScene : public QGraphicsScene
3738{
3839 Q_OBJECT
3940
4041public:
41- MainScene ( QObject *parent );
42+ MainScene ( QObject *parent ); // !< Value constructor
4243 ~MainScene () override = default ; // { qDebug() << Q_FUNC_INFO; }
4344
44- void mousePressEvent ( QGraphicsSceneMouseEvent *event) override ;
45- void mouseMoveEvent ( QGraphicsSceneMouseEvent *event) override ;
46- void mouseReleaseEvent ( QGraphicsSceneMouseEvent *event) override ;
47- void keyPressEvent ( QKeyEvent *event) override ;
45+ protected:
46+ void mousePressEvent ( QGraphicsSceneMouseEvent *event) override ; // !< Handle mouse press event
47+ void mouseMoveEvent ( QGraphicsSceneMouseEvent *event) override ; // !< Handle mouse moce event
48+ void mouseReleaseEvent ( QGraphicsSceneMouseEvent *event) override ; // !< Handle mouse release event
49+ void keyPressEvent ( QKeyEvent *event) override ; // !< Handle key press event
4850
49- void removeAllItems ();
50- void addGraphicItems ( const State *s);
51+ public:
52+ void removeAllItems (); // !< Remove all graphics from the scene but not an optional background imge
53+ void addGraphicItems ( const State *s); // !< Add graphics from state to scene
5154
52- void export_view_as_svg ( QString &fileName);
53- void export_view_as_pdf ( QString &fileName);
55+ void export_view_as_svg ( QString &fileName); // !< Export the current view as scalabel vector graphics
56+ void export_view_as_pdf ( QString &fileName); // !< Export the current view in portable document format
5457
55- static QPen scribblePen () { return s_scribblePen; }
56- static void setScribblePen ( const QPen & p) { s_scribblePen = p; }
58+ static QPen scribblePen () { return s_scribblePen; } // !< Get the scribble pen
59+ static void setScribblePen ( const QPen & p) { s_scribblePen = p; } // !< Set the scribble pen
5760
5861private:
5962 std::unique_ptr<QAction> actionExportSaveAs;
@@ -70,9 +73,9 @@ class MainScene : public QGraphicsScene
7073 static QPen s_scribblePen;
7174
7275Q_SIGNALS:
73- void signalCmdAddStroke ( QPainterPath * );
74- void signalCmdDeleteSelection ();
75- void signalUndoLastAction ();
76+ void signalCmdAddStroke ( QPainterPath * ); // !< Command: add a stroke, reasoning, and adjustment
77+ void signalCmdDeleteSelection (); // !< Command: delete selected items and reasoning
78+ void signalUndoLastAction (); // !< Command: und last action
7679};
7780
7881} // namespace GUI
0 commit comments