Skip to content

Commit

Permalink
Add Doxygen comments to graph folder classes
Browse files Browse the repository at this point in the history
Document classes in the 'src/graph' directory
  • Loading branch information
gfgit committed Aug 25, 2021
1 parent 433216d commit 6e954c4
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/graph/model/linegraphmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@

class LineGraphScene;

/*!
* \brief Class for managing LineGraphScene instances
*
* The manager listens for changes on railway plan and
* decides which of the registered LineGraphScene needs
* to be updated.
*
* \sa LineGraphScene
*/
class LineGraphManager : public QObject
{
Q_OBJECT
Expand Down
19 changes: 15 additions & 4 deletions src/graph/model/linegraphscene.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,25 @@ namespace sqlite3pp {
class database;
}

/*!
* \brief Enum to describe view content type
*/
enum class LineGraphType
{
NoGraph = 0,
SingleStation,
RailwaySegment,
RailwayLine
NoGraph = 0, //!< No content displayed
SingleStation, //!< Show a single station
RailwaySegment, //!< Show two adjacent stations and the segment in between
RailwayLine //!< Show a complete railway line (multiple adjacent segments)
};

/*!
* \brief Class to store line information
*
* Stores information to draw railway content in a LineGraphView
*
* \sa LineGraphManager
* \sa LineGraphView
*/
class LineGraphScene : public QObject
{
Q_OBJECT
Expand Down
11 changes: 7 additions & 4 deletions src/graph/model/stationgraphobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
#include <QRgb>

/*!
* Graph of a railway station
* \brief Graph of a railway station
*
* Contains informations to draw station name, platforms and jobs
* \sa PlatformGraph
*/
class StationGraphObject
{
Expand All @@ -23,7 +24,7 @@ class StationGraphObject
utils::StationType stationType;

/*!
* Graph of the job while is stopping
* \brief Graph of the job while is stopping
*
* Contains informations to draw job line on top of the PlatformGraph
*/
Expand All @@ -38,7 +39,7 @@ class StationGraphObject
} JobStopGraph;

/*!
* Graph of the job while is moving
* \brief Graph of the job while is moving
*
* Contains informations to draw job line between two adjacent stations
*/
Expand All @@ -57,9 +58,11 @@ class StationGraphObject
} JobLineGraph;

/*!
* Graph of a station track (platform)
* \brief Graph of a station track (platform)
*
* Contains informations to draw platform line and header name
* \sa JobStopGraph
* \sa JobLineGraph
*/
typedef struct
{
Expand Down
9 changes: 9 additions & 0 deletions src/graph/view/backgroundhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ class QPainter;

class LineGraphScene;

/*!
* \brief Helper class to render LineGraphView contents
*
* Contains static helper functions to draw each part of the view
*
* \sa LineGraphView
* \sa HourPanel
* \sa StationLabelsHeader
*/
class BackgroundHelper
{
public:
Expand Down
9 changes: 9 additions & 0 deletions src/graph/view/hourpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@

#include <QWidget>

/*!
* \brief Helper widget to draw hour labels
*
* Draws hour labels on the view vertical header
*
* \sa LineGraphScene
* \sa LineGraphView
* \sa BackgroundHelper
*/
class HourPanel : public QWidget
{
Q_OBJECT
Expand Down
8 changes: 8 additions & 0 deletions src/graph/view/linegraphtoolbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ class CustomCompletionLineEdit;
class LineGraphScene;
class ISqlFKMatchModel;

/*!
* \brief Toolbar to select railway stations or lines
*
* Consist of a combobox and a line edit
* The combo box selects the content type (\sa LineGraphType)
* The line edit allows to choose which item of selected type
* should be shown.
*/
class LineGraphToolbar : public QWidget
{
Q_OBJECT
Expand Down
9 changes: 9 additions & 0 deletions src/graph/view/linegraphview.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ class LineGraphScene;
class StationLabelsHeader;
class HourPanel;

/*!
* \brief Widget to display a LineGraphScene
*
* A scrollable widget which renders LineGraphScene contents
* Moving the mouse cursor on the contents, tooltips will show
*
* \sa LineGraphWidget
* \sa BackgroundHelper
*/
class LineGraphView : public QAbstractScrollArea
{
Q_OBJECT
Expand Down
10 changes: 10 additions & 0 deletions src/graph/view/linegraphwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ class LineGraphScene;
class LineGraphView;
class LineGraphToolbar;

/*!
* \brief An all-in-one widget as a railway line view
*
* This widget encapsulate a toolbar to select which
* contents user wants to see (stations, segments or railway lines)
* and a view which renders the chosen contents
*
* \sa LineGraphToolbar
* \sa LineGraphView
*/
class LineGraphWidget : public QWidget
{
Q_OBJECT
Expand Down
10 changes: 10 additions & 0 deletions src/graph/view/stationlabelsheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@

class LineGraphScene;

/*!
* \brief Helper widget to draw station labels
*
* Draws station labels (with platform numbers below) on
* the view horizontal header
*
* \sa LineGraphScene
* \sa LineGraphView
* \sa BackgroundHelper
*/
class StationLabelsHeader : public QWidget
{
Q_OBJECT
Expand Down

0 comments on commit 6e954c4

Please sign in to comment.