MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrAnnotationBar.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2026 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #ifndef lgrAnnotationBar_H_
11 #define lgrAnnotationBar_H_
12 
13 #include <lgrAnnotations/lgrAnn.h>
14 #include <lgrGui/overlapSlider.h>
15 #include <lgrUtil/absoluteTime.h>
16 
17 #include <map>
18 #include <vector>
19 
20 class QContextMenuEvent;
21 class QFocusEvent;
22 class QKeyEvent;
23 class QShowEvent;
24 class QWheelEvent;
25 
26 namespace MAKLogger
27 {
28 
29  class DtLgrAnnotationComponent;
30  class DtLgrAnnotation;
31  class DtSliderBar;
32  class DtLgrAnnotationSliderBar;
33  class DtLgrAnnotationSlots;
34 
38  {
39  Q_OBJECT
40 
41  public:
43  QWidget* p);
44 
46  virtual ~DtLgrAnnotationBar();
47 
48  private:
52  DtLgrAnnotationBar& operator=(const DtLgrAnnotationBar&);
53  public:
54 
56  void connectSlots(DtLgrAnnotationSlots* annSlots);
57 
59  virtual void addAnnotation(DtLgrAnnotation* annotation);
60 
62  virtual void removeAnnotation(DtLgrAnnotation* annotation);
63 
65  virtual void updateAnnotation(DtLgrAnnotation* annotation);
66 
68  virtual void clearAnnotations();
69 
72  virtual DtLgrAnnotation* selectedAnnotation();
73 
75  virtual void selectBar(DtSliderBar* bar);
76 
78  virtual void selectBox(DtSliderBox* box);
79 
81  virtual void unselectAll();
82 
83  public slots:
84 
86  virtual void selectAnnotation(DtLgrAnnotation* annotation);
87 
89  virtual void timesChanged();
90 
92  virtual void barMoved(DtSliderBar*);
93 
95  virtual void barSizeChanged(DtSliderBar*);
96 
98  virtual void setOffsets(float left,float right);
99 
100  signals:
101 
102  virtual void attemptModifyAnnotation();
103 
104  // Signal emitted when the selected annotation changes. If no annotation
105  // is selected, the pointer will be null.
106  virtual void selectedAnnotationChanged(DtLgrAnnotation* annotation);
107 
108  protected:
109 
110  virtual void draw(QPainter& painter,QRect boundingRect);
111 
113  virtual void drawBox(QPainter& painter,DtSliderBox* box) const;
114 
116  void updateRanges();
117 
120  virtual void showAnnotationActionMenu(QPoint position);
121 
123  virtual void showSelectAnnotationMenu(QPoint position);
124 
126  virtual void mouseDoubleClickEvent( QMouseEvent * );
127 
128  virtual void contextMenuEvent(QContextMenuEvent* event);
129 
131  virtual void drawBar(QPainter& painter,DtSliderBar* bar) const;
132 
134  virtual void drawBars(QPainter& painter) const;
135 
137  virtual DtSliderBar* pickBar(QRectF viewport,QPoint pos);
139  virtual DtSliderBox* pickBox(QRectF viewport,QPoint pos);
141 
142  virtual bool event(QEvent* event);
143  virtual void mouseMoveEvent(QMouseEvent* event);
144  virtual void mouseReleaseEvent(QMouseEvent* event);
145  virtual void wheelEvent(QWheelEvent* event);
146  virtual void keyPressEvent(QKeyEvent* event);
147  virtual void focusInEvent(QFocusEvent* event);
148  virtual void focusOutEvent(QFocusEvent* event);
149  virtual void resizeEvent(QResizeEvent* event);
150  virtual void showEvent(QShowEvent* event);
151  virtual void changeEvent(QEvent* event);
152 
153  private:
155  void relayout();
156 
158  void recomputeLanes();
159 
161  bool boxPressed() const;
162 
164  QRect selectedBarRect() const;
165 
167  QRectF laneViewport() const;
168 
170  bool toLaneLocal(QPoint pos,int& lane,QPointF& local) const;
171 
173  int laneOf(const DtSliderBar* bar) const;
174 
176  int maxScroll() const;
177 
179  void ensureLaneVisible(int lane);
180 
182  bool handlesVisible(const DtSliderBar* bar) const;
183 
185  QRectF handleRect(const DtSliderBox* box,const QRectF& laneViewport) const;
186 
188  std::vector<DtLgrAnnotation*> annotationsByStart() const;
189 
191  DtLgrAnnotation* annotationInAdjacentLane(int laneDelta) const;
192 
193  struct LaneEntry
194  {
195  int lane;
196  unsigned long seq;
197  };
198 
199  std::map<DtSliderBar*,LaneEntry> myLanes;
200  unsigned long myNextSeq;
205 
206  protected:
207 
208 
209  virtual void barToTimes(const DtSliderBar* bar,DtAbsoluteTime& firstTime,
210  DtAbsoluteTime& lastTime);
211 
212  typedef std::map<DtLgrAnnotation*, DtLgrAnnotationSliderBar*> AnnotationBarMap;
213 
218  };
219 
220 }
221 
222 #endif
int myLaneCount
Definition: lgrAnnotationBar.h:201
DtLgrAnnotationComponent * myAnnotationComponent
Definition: lgrAnnotationBar.h:214
Definition: lgrAnnotationBar.h:193
A slider which allows multiple boxes that can overlap.
Definition: overlapSlider.h:27
Used to manage a bar between a start and an end of a slider bar.
Definition: sliderBar.h:25
Defines INPORT/EXPORT macros for lgrGui library.
std::map< DtLgrAnnotation *, DtLgrAnnotationSliderBar * > AnnotationBarMap
Definition: lgrAnnotationBar.h:212
Represents a box within a slider.
Definition: sliderBox.h:27
AnnotationBarMap myAnnotationBars
Definition: lgrAnnotationBar.h:215
std::map< DtSliderBar *, LaneEntry > myLanes
Definition: lgrAnnotationBar.h:199
int myScrollY
Definition: lgrAnnotationBar.h:203
The annotation bar displays Annotation sliders and allows for easy editing.
Definition: lgrAnnotationBar.h:37
Base annotation class defines interface for all annotations.
Definition: lgrAnnotation.h:31
Contains MAKLogger::DtOverlapSlider subclass of MAKLogger::DtZoomComponent and MAKLogger::DtMultiBoxS...
int lane
Definition: lgrAnnotationBar.h:195
Contains MAKLogger::DtAbsoluteTime and MAKLogger::DtRelativeTime classes.
unsigned long seq
Definition: lgrAnnotationBar.h:196
DtLgrAnnotationSlots * mySlots
Definition: lgrAnnotationBar.h:217
unsigned long myNextSeq
Definition: lgrAnnotationBar.h:200
DtLgrAnnotation * mySelectedAnnotation
Definition: lgrAnnotationBar.h:216
bool myLanesDirty
Definition: lgrAnnotationBar.h:202
Creates View and Slots, and implements standard Logger GUI Component methods.
Definition: lgrAnnotationComponent.h:24
int myWheelDelta
Definition: lgrAnnotationBar.h:204
Absolute Time, a particular measured instance in time, could be thought of as a set of relative times...
Definition: absoluteTime.h:82
Annotation slots connects menu bar and annotation control.
Definition: lgrAnnotationSlots.h:29
#define DT_DLL_LGRANN
Definition: lgrAnn.h:19

Document ID: Generated on Tue Nov 17 15:25:07 EST 2026 from SVN revision 298446
Copyright © 2026 MAK Technologies. All Rights Reserved (www.mak.com)