@@ -31,50 +31,55 @@ class uPoint;
3131}
3232
3333
34-
34+ // ! Graphics: Strokes and straight line segments
3535namespace QEntity {
3636
3737using Uncertain::uPoint;
3838
39- class
40- QSegment : public QGraphicsItem
39+ // ! Graphics: Base class for straight line segments
40+ class QSegment : public QGraphicsItem
4141{
4242public:
4343 QSegment ( const uPoint & ux,
44- const uPoint & uy);
45- QSegment ( const QSegment & other) = delete ;
44+ const uPoint & uy); // !< Value constructor (two uncorrelated uncertain points)
45+ QSegment ( const QSegment & other) = delete ; // !< Copy constructor
4646
47- enum {Type = UserType +164 };
48- int type () const override { return Type; }
47+ enum {Type = UserType +164 }; // !< Definition graphics type (id)
48+ int type () const override { return Type; } // !< get graphics type (id)
4949
50- void setColor ( const QColor & c) { pen_.setColor (c); }
51- void setLineWidth ( const int w) { pen_.setWidth (w); }
52- void setLineStyle ( const int s) { pen_.setStyle ( Qt::PenStyle (s)); }
50+ void setColor ( const QColor & c) { pen_.setColor (c); } // !< Set color
51+ void setLineWidth ( const int w) { pen_.setWidth (w); } // !< Set line width
52+ void setLineStyle ( const int s) { pen_.setStyle ( Qt::PenStyle (s)); } // !< Set line style
5353
5454protected:
5555 QSegment ();
5656 ~QSegment () override = default ;
5757
58- QPainterPath shape () const override ;
59- void mousePressEvent ( QGraphicsSceneMouseEvent * /* event */ ) override ;
58+ QPainterPath shape () const override ; // !< Get bounding shape
59+ void mousePressEvent ( QGraphicsSceneMouseEvent * /* event */ ) override ; // !< Handle mouse press event
6060
61- QPen pen () const { return pen_;}
62- void setPen ( const QPen & p) { pen_ = p;}
61+ QPen pen () const { return pen_;} // !< Get pen
62+ void setPen ( const QPen & p) { pen_ = p;} // !< Set pen
6363
6464public:
6565 // QSegment & operator= ( const QSegment & other );
6666
67- virtual void serialize ( QDataStream & out ) const ;
68- bool deserialize ( QDataStream &in );
67+ virtual void serialize ( QDataStream & out ) const ; // !< serialization
68+ bool deserialize ( QDataStream &in ); // !< deserialization
6969
70+ // ! Toggle visibility confidence regions
7071 static void toggleShowUncertainty () { s_showUncertainty = !s_showUncertainty; }
72+
73+ // ! Get status visibility confidence regions
7174 static bool showUncertainty () { return s_showUncertainty; }
7275
7376protected:
74- QRectF boundingRect () const override ;
77+ QRectF boundingRect () const override ; // !< Get axis-aligned bounding box
78+
79+ // ! Plot uncertain straight line segment (base class)
7580 void paint ( QPainter *painter,
7681 const QStyleOptionGraphicsItem *option,
77- QWidget *widget) override ; // !< plot tracked positions
82+ QWidget *widget) override ;
7883
7984private:
8085 void createSelectionPolygon ( qreal halfWidth );
@@ -96,30 +101,30 @@ class
96101};
97102
98103
104+ // ! Graphics: Constrained straight line segment
99105class QConstrained : public QSegment
100106{
101107public:
102108 QConstrained ();
103109 QConstrained ( const uPoint & ux,
104- const uPoint & uy);
110+ const uPoint & uy); // !< Value constructor
105111
106112 // using QSegment::operator=;
107113
108- void setAltColor ( const QColor &);
114+ void setAltColor ( const QColor &); // !< Set color for automatic colorization (subtasks)
109115
110- static bool show () { return s_show; }
111- static void toggleShow () { s_show = !s_show; }
112-
113- static bool showColor () { return s_showColor; }
114- static void toogleShowColor () { s_showColor = !s_showColor;}
115-
116- static void setPenDefault ( const QPen & p) { s_defaultPen = p; }
117- static QPen defaultPen () { return s_defaultPen; }
116+ static bool show () { return s_show; } // !< Get status of visibility
117+ static void toggleShow () { s_show = !s_show; } // !< Toggle visibility
118+ static bool showColor () { return s_showColor; } // !< Get status colorization
119+ static void toogleShowColor () { s_showColor = !s_showColor;} // !< Toggle colorization / no colorization
120+ static void setPenDefault ( const QPen & p) { s_defaultPen = p; } // !< Set default pen
121+ static QPen defaultPen () { return s_defaultPen; } // !< Get current default pen
118122
119123protected:
124+ // ! Plot uncertain constrained straight line segment
120125 void paint ( QPainter *painter,
121126 const QStyleOptionGraphicsItem *option,
122- QWidget *widget) override ; // !< plot tracked positions
127+ QWidget *widget) override ;
123128
124129private:
125130 QColor altColor;
@@ -129,25 +134,28 @@ class QConstrained : public QSegment
129134 static QPen s_defaultPen;
130135};
131136
137+
138+ // ! Graphics: Unconstrained straight line segment
132139class QUnconstrained : public QSegment
133140{
134141public:
135- QUnconstrained ();
142+ QUnconstrained (); // !< Standard Constructor
136143 QUnconstrained ( const uPoint & ux,
137- const uPoint & uy);
144+ const uPoint & uy); // !< Value constructor (two uncorrelated uncertain points)
138145
139146 // using QSegment::operator=;
140147
141- static void toggleShow () { s_show = !s_show; }
142- static bool show () { return s_show; }
148+ static void toggleShow () { s_show = !s_show; } // !< Toggle visibility
149+ static bool show () { return s_show; } // !< Get status visibility
143150
144- static void setPenDefault ( const QPen &p) { s_defaultPen = p; }
145- static QPen defaultPen () { return s_defaultPen; }
151+ static void setPenDefault ( const QPen &p) { s_defaultPen = p; } // !< Set default pen
152+ static QPen defaultPen () { return s_defaultPen; } // !< Get current default pen
146153protected:
147154 // QRectF boundingRect() const override { return QSegment::boundingRect(); }
155+ // ! Plot unconstrained uncertain straight line segment
148156 void paint ( QPainter *painter,
149157 const QStyleOptionGraphicsItem *option,
150- QWidget *widget) override ; // !< plot tracked positions
158+ QWidget *widget) override ;
151159
152160private:
153161 static bool s_show;
0 commit comments