Ocean
TrackerEvent.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_TRACKING_OFFLINE_TRACKER_EVENT_H
9 #define META_OCEAN_TRACKING_OFFLINE_TRACKER_EVENT_H
10 
13 
14 #include "ocean/base/Event.h"
16 
19 #include "ocean/math/Plane3.h"
20 
21 namespace Ocean
22 {
23 
24 namespace Tracking
25 {
26 
27 namespace Offline
28 {
29 
30 /**
31  * Definition of individual tracker event types.
32  * @ingroup trackingoffline
33  */
35 {
36  /// An invalid event type.
38  /// A component event.
40  /// A progress event.
42  /// A state event for changed states.
43  ET_STATE
44 };
45 
46 /**
47  * This class implements the base class for all tracker events.
48  * @ingroup trackingoffline
49  */
50 class OCEAN_TRACKING_OFFLINE_EXPORT TrackerEvent : public Event
51 {
52  public:
53 
54  /**
55  * Returns the unique id of the tracker that sent this event.
56  * @return Unique tracker id
57  */
58  inline unsigned int trackerId() const;
59 
60  /**
61  * Returns the type name of this event.
62  * @return Event type name
63  */
64  std::string typeName() const;
65 
66  /**
67  * Returns the sub-type name of this event object.
68  * @return Event sub-type name
69  */
70  virtual std::string subtypeName() const = 0;
71 
72  protected:
73 
74  /**
75  * Creates a new tracker event object.
76  * @param type The type of the event
77  * @param subtype The subtype of the event
78  * @param trackerId Id of the tracker that is sending this event
79  */
80  TrackerEvent(const unsigned int type, const unsigned int subtype, const unsigned int trackerId);
81 
82  protected:
83 
84  /// The unique tracker id of the tracker that sent this event.
85  unsigned int trackerId_ = 0u;
86 };
87 
88 /**
89  * Definition of a smart object reference for tracker event.
90  * @see TrackerEvent.
91  * @ingroup trackingoffline
92  */
94 
95 /**
96  * Definition of a scoped event for tracker events.
97  * @ingroup trackingoffline
98  */
100 
101 /**
102  * This class implements the base class for all component events.
103  * Component events are sent whenever an individual component is started, finished or if the component fails.
104  * @ingroup trackingoffline
105  */
106 class OCEAN_TRACKING_OFFLINE_EXPORT ComponentEvent : public TrackerEvent
107 {
108  public:
109 
110  /**
111  * Definition of individual component event sub-types.
112  */
114  {
115  /// An invalid event sub-type.
116  CEST_INVALID = 0,
117  /// An tracker process sub-type event.
119  /// An analysis sub-type event.
121  /// A tracking sub-type event.
122  CEST_TRACKING
123  };
124 
125  /**
126  * Definition of individual component states.
127  */
129  {
130  /// The component started.
132  /// The component finished.
134  /// The component failed.
136  /// The component broke due to an external request.
137  CS_BROKE
138  };
139 
140  /**
141  * Returns the sub-type name of this event object.
142  * @see TrackerEvent::subtypeName().
143  */
144  std::string subtypeName() const override;
145 
146  /**
147  * Returns the state of the component event.
148  * @return Component state
149  */
150  inline ComponentState state() const;
151 
152  /**
153  * Returns the state of this event.
154  * @return Component state
155  */
156  std::string stateName() const;
157 
158  /**
159  * Sets or changes the state of this component event.
160  * @param state New state to be set
161  */
162  inline void setState(const ComponentState state);
163 
164  protected:
165 
166  /**
167  * Creates a new component event object.
168  * @param subtype The subtype of the event
169  * @param trackerId Unique id of the tracker that sent this event
170  * @param state The state of the component that sent this event
171  */
172  inline ComponentEvent(const unsigned int subtype, const unsigned int trackerId, const ComponentState state);
173 
174  protected:
175 
176  /// The state of the component that sent this event.
178 };
179 
180 /**
181  * Definition of a smart object reference for component events.
182  * @see ComponentEvent.
183  * @ingroup trackingoffline
184  */
186 
187 /**
188  * This class implements a component event for the entire tracker process.
189  * @ingroup trackingoffline
190  */
191 class OCEAN_TRACKING_OFFLINE_EXPORT TrackerProcessComponentEvent : public ComponentEvent
192 {
193  public:
194 
195  /**
196  * Creates a new event object.
197  * @param trackerId Unique id of the tracker that sent this event
198  * @param state The state of the component that sent this event
199  */
200  inline TrackerProcessComponentEvent(const unsigned int trackerId, const ComponentState state);
201 
202  /**
203  * Creates a new event reference object.
204  * @param trackerId Unique id of the tracker that sent this event
205  * @param state The state of the component that sent this event
206  * @return The new event object
207  */
208  static inline EventRef createEvent(const unsigned int trackerId, const ComponentState state);
209 };
210 
211 /**
212  * Definition of a smart object reference for tracker process events.
213  * @see TrackerProcessComponentEvent.
214  * @ingroup trackingoffline
215  */
217 
218 /**
219  * This class implements a component event for the analysis components
220  * @ingroup trackingoffline
221  */
222 class OCEAN_TRACKING_OFFLINE_EXPORT AnalysisComponentEvent : public ComponentEvent
223 {
224  public:
225 
226  /**
227  * Creates a new event object.
228  * @param trackerId Unique id of the tracker that sent this event
229  * @param state The state of the component that sent this event
230  */
231  inline AnalysisComponentEvent(const unsigned int trackerId, const ComponentState state);
232 
233  /**
234  * Creates a new event reference object.
235  * @param trackerId Unique id of the tracker that sent this event
236  * @param state The state of the component that sent this event
237  * @return The new event object
238  */
239  static inline EventRef createEvent(const unsigned int trackerId, const ComponentState state);
240 };
241 
242 /**
243  * Definition of a smart object reference for analysis component events.
244  * @see AnalysisComponentEvent.
245  * @ingroup trackingoffline
246  */
248 
249 /**
250  * This class implements a component event for the tracking components
251  * @ingroup trackingoffline
252  */
253 class OCEAN_TRACKING_OFFLINE_EXPORT TrackingComponentEvent : public ComponentEvent
254 {
255  public:
256 
257  /**
258  * Creates a new event object.
259  * @param trackerId Unique id of the tracker that sent this event
260  * @param state The state of the component that sent this event
261  */
262  inline TrackingComponentEvent(const unsigned int trackerId, const ComponentState state);
263 
264  /**
265  * Creates a new event reference object.
266  * @param trackerId Unique id of the tracker that sent this event
267  * @param state The state of the component that sent this event
268  * @return The new event object
269  */
270  static inline EventRef createEvent(const unsigned int trackerId, const ComponentState state);
271 };
272 
273 /**
274  * Definition of a smart object reference for tracking component events.
275  * @see TrackingComponentEvent.
276  * @ingroup trackingoffline
277  */
279 
280 /**
281  * This class implements the base class for all progress events.
282  * Progress events are sent whenever the progress of a component changes.<br>
283  * @ingroup trackingoffline
284  */
285 class OCEAN_TRACKING_OFFLINE_EXPORT ProgressEvent : public TrackerEvent
286 {
287  public:
288 
289  /**
290  * Definition of individual progress event sub-types.
291  */
293  {
294  /// An invalid event sub-type.
295  PEST_INVALID = 0,
296  /// An tracker process sub-type event.
298  /// An analysis sub-type event.
300  /// A tracking sub-type event.
301  PEST_TRACKING
302  };
303 
304  public:
305 
306  /**
307  * Returns the sub-type name of this event object.
308  * @see TrackerEvent::subtypeName().
309  */
310  std::string subtypeName() const override;
311 
312  /**
313  * Returns the progress of a component in percent.
314  * @return Component progress, with range [0, 100]
315  */
316  inline unsigned int componentProgress() const;
317 
318  protected:
319 
320  /**
321  * Creates a new progress event object.
322  * @param subtype The subtype of the event
323  * @param trackerId Unique id of the tracker that sent this event
324  * @param componentProgress The progress of the component that sent this event, with range [0, 100]
325  */
326  inline ProgressEvent(const unsigned int subtype, const unsigned int trackerId, const unsigned int componentProgress);
327 
328  protected:
329 
330  /// The component progress in percent.
331  unsigned int componentProgress_ = 0u;
332 };
333 
334 /**
335  * Definition of a smart object reference for progress events.
336  * @see ProgressEvent.
337  * @ingroup trackingoffline
338  */
340 
341 /**
342  * This class implements a progress event for tracker processes.
343  * @ingroup trackingoffline
344  */
345 class OCEAN_TRACKING_OFFLINE_EXPORT TrackerProcessProgressEvent : public ProgressEvent
346 {
347  public:
348 
349  /**
350  * Creates a new progress event object.
351  * @param trackerId Unique id of the tracker that sent this event
352  * @param componentProgress Progress of the sending component in percent, with range [0, 100]
353  */
354  inline TrackerProcessProgressEvent(const unsigned int trackerId, const unsigned int componentProgress);
355 
356  /**
357  * Creates a new event reference object.
358  * @param trackerId Unique id of the tracker that sent this event
359  * @param componentProgress Progress of the sending component in percent, with range [0, 100]
360  * @return The new event object
361  */
362  static inline EventRef createEvent(const unsigned int trackerId, const unsigned int componentProgress);
363 };
364 
365 /**
366  * Definition of a smart object reference for tracker process progress events.
367  * @see TrackerProcessProgressEvent.
368  * @ingroup trackingoffline
369  */
371 
372 /**
373  * This class implements a progress event for analysis components.
374  * @ingroup trackingoffline
375  */
376 class OCEAN_TRACKING_OFFLINE_EXPORT AnalysisProgressEvent : public ProgressEvent
377 {
378  public:
379 
380  /**
381  * Creates a new progress event object.
382  * @param trackerId Unique id of the tracker that sent this event
383  * @param componentProgress Progress of the sending component in percent, with range [0, 100]
384  */
385  inline AnalysisProgressEvent(const unsigned int trackerId, const unsigned int componentProgress);
386 
387  /**
388  * Creates a new event reference object.
389  * @param trackerId Unique id of the tracker that sent this event
390  * @param componentProgress Progress of the sending component in percent, with range [0, 100]
391  * @return The new event object
392  */
393  static inline EventRef createEvent(const unsigned int trackerId, const unsigned int componentProgress);
394 };
395 
396 /**
397  * Definition of a smart object reference for analysis progress events.
398  * @see AnalysisProgressEvent.
399  * @ingroup trackingoffline
400  */
402 
403 /**
404  * This class implements a progress event for tracking components.
405  * @ingroup trackingoffline
406  */
407 class OCEAN_TRACKING_OFFLINE_EXPORT TrackingProgressEvent : public ProgressEvent
408 {
409  public:
410 
411  /**
412  * Creates a new progress event object.
413  * @param trackerId Unique id of the tracker that sent this event
414  * @param componentProgress Progress of the sending component in percent, with range [0, 100]
415  */
416  inline TrackingProgressEvent(const unsigned int trackerId, const unsigned int componentProgress);
417 
418  /**
419  * Creates a new event reference object.
420  * @param trackerId Unique id of the tracker that sent this event
421  * @param componentProgress Progress of the sending component in percent, with range [0, 100]
422  * @return The new event object
423  */
424  static inline EventRef createEvent(const unsigned int trackerId, const unsigned int componentProgress);
425 };
426 
427 /**
428  * Definition of a smart object reference for tracking progress events.
429  * @see TrackingProgressEvent.
430  * @ingroup trackingoffline
431  */
433 
434 /**
435  * This class is the base class for all state events.
436  * @ingroup trackingoffline
437  */
438 class OCEAN_TRACKING_OFFLINE_EXPORT StateEvent : public TrackerEvent
439 {
440  public:
441 
442  /**
443  * Definition of individual state event sub-types.
444  */
446  {
447  /// An invalid event sub-type.
448  SEST_INVALID = 0,
449  /// A camera calibration sub-type event.
451  /// A tracker transformation sub-type event.
453  /// A tracker pose sub-type event.
455  /// A tracker poses sub-type event.
457  /// A tracker plane sub-type event.
458  SEST_TRACKER_PLANE
459  };
460 
461  public:
462 
463  /**
464  * Returns the sub-type name of this event object.
465  * @see TrackerEvent::subtypeName().
466  */
467  std::string subtypeName() const override;
468 
469  protected:
470 
471  /**
472  * Creates a new state event object.
473  * @param subtype The subtype of the event
474  * @param trackerId Unique id of the tracker that sent this event
475  */
476  inline explicit StateEvent(const unsigned int subtype, const unsigned int trackerId);
477 };
478 
479 /**
480  * Definition of a smart object reference for state events.
481  * @see StateEvent.
482  * @ingroup trackingoffline
483  */
485 
486 /**
487  * This class implements a camera state event that provides a camera profile.
488  * @ingroup trackingoffline
489  */
490 class OCEAN_TRACKING_OFFLINE_EXPORT CameraCalibrationStateEvent : public StateEvent
491 {
492  public:
493 
494  /**
495  * Creates a new camera state event object.
496  * @param trackerId Unique id of the tracker that sent this event
497  * @param pinholeCamera The pinhole camera profile of the sender
498  */
499  explicit inline CameraCalibrationStateEvent(const unsigned int trackerId, const PinholeCamera& pinholeCamera);
500 
501  /**
502  * Returns the camera profile of this event.
503  * @return The pinhole camera profile
504  */
505  inline const PinholeCamera& camera() const;
506 
507  /**
508  * Creates a new event reference object.
509  * @param trackerId Unique id of the tracker that sent this event
510  * @param pinholeCamera The pinhole camera profile of the sender
511  * @return The new event object
512  */
513  static inline EventRef createEvent(const unsigned int trackerId, const PinholeCamera& pinholeCamera);
514 
515  protected:
516 
517  /// The camera profile of this event.
519 };
520 
521 /**
522  * Definition of a smart object reference for camera calibration state events.
523  * @see CameraCalibrationStateEvent.
524  * @ingroup trackingoffline
525  */
527 
528 /**
529  * This class implements a tracker pose state event that provides a tracker pose.
530  * @ingroup trackingoffline
531  */
532 class OCEAN_TRACKING_OFFLINE_EXPORT TrackerPoseStateEvent : public StateEvent
533 {
534  public:
535 
536  /**
537  * Creates a new pose state event object.
538  * @param trackerId Unique id of the tracker that sent this event
539  * @param pose Offline pose of the sender
540  */
541  explicit inline TrackerPoseStateEvent(const unsigned int trackerId, const OfflinePose& pose);
542 
543  /**
544  * Returns the pose of this event object.
545  * @return Event pose
546  */
547  inline const OfflinePose& pose() const;
548 
549  /**
550  * Creates a new event reference object.
551  * @param trackerId Unique id of the tracker that sent this event
552  * @param pose Offline pose of the sender
553  * @return The new event object
554  */
555  static inline EventRef createEvent(const unsigned int trackerId, const OfflinePose& pose);
556 
557  protected:
558 
559  /// The pose of this event.
561 };
562 
563 /**
564  * Definition of a smart object reference for pose state events.
565  * @see TrackerPoseStateEvent.
566  * @ingroup trackingoffline
567  */
569 
570 /**
571  * This class implements a tracker poses state event that provides the all determined tracker poses.
572  * @ingroup trackingoffline
573  */
574 class OCEAN_TRACKING_OFFLINE_EXPORT TrackerPosesStateEvent : public StateEvent
575 {
576  public:
577 
578  /**
579  * Creates a new poses state event object.
580  * @param trackerId Unique id of the tracker that sent this event
581  * @param poses Offline poses of the sender that will be copied
582  */
583  explicit inline TrackerPosesStateEvent(const unsigned int trackerId, const OfflinePoses& poses);
584 
585  /**
586  * Returns the poses of this object.
587  * @return Event poses
588  */
589  inline const OfflinePoses& poses() const;
590 
591  /**
592  * Creates a new event reference object.
593  * @param trackerId Unique id of the tracker that sent this event
594  * @param poses Offline poses of the sender that will be copied
595  * @return The new event object
596  */
597  static inline EventRef createEvent(const unsigned int trackerId, const OfflinePoses& poses);
598 
599  protected:
600 
601  /// The poses of this event.
603 };
604 
605 /**
606  * Definition of a smart object reference for tracker poses state events.
607  * @see TrackerPosesStateEvent.
608  * @ingroup trackingoffline
609  */
611 
612 /**
613  * This class implements an tracker transformation state event that provides the transformation between world coordinate system and tracker coordinate system.
614  * @ingroup trackingoffline
615  */
616 class OCEAN_TRACKING_OFFLINE_EXPORT TrackerTransformationStateEvent : public StateEvent
617 {
618  public:
619 
620  /**
621  * Creates a new tracker transformation event object.
622  * @param trackerId Unique id of the tracker that sent this event
623  * @param transformation Tracker transformation of the sender
624  * @param isSuggestion Flag to indicate whether the transformation is a suggestion
625  */
626  explicit inline TrackerTransformationStateEvent(const unsigned int trackerId, const HomogenousMatrix4& transformation, const bool isSuggestion = false);
627 
628  /**
629  * Returns the tracker transformation of this object.
630  * @return Event transformation
631  */
632  inline const HomogenousMatrix4& transformation() const;
633 
634  /**
635  * Returns whether the tracker transformation of this object is a suggestion.
636  * @return Suggestion flag
637  */
638  inline bool isTransformationASuggestion() const;
639 
640  /**
641  * Creates a new event reference object.
642  * @param trackerId Unique id of the tracker that sent this event
643  * @param transformation Tracker transformation of the sender
644  * @param isSuggestion Flag to indicate whether the transformation is a suggestion
645  * @return The new event object
646  */
647  static inline EventRef createEvent(const unsigned int trackerId, const HomogenousMatrix4& transformation, const bool isSuggestion = false);
648 
649  protected:
650 
651  /// The transformation of this event.
653 
654  /// Flag to indicate whether the transformation of this event is a suggestion.
656 };
657 
658 /**
659  * Definition of a smart object reference for tracker transformation state events.
660  * @see TrackerTransformationStateEvent.
661  * @ingroup trackingoffline
662  */
664 
665 /**
666  * This class implements a tracker plane state event that provides the detected plane of a tracker.
667  * @ingroup trackingoffline
668  */
669 class OCEAN_TRACKING_OFFLINE_EXPORT TrackerPlaneStateEvent : public StateEvent
670 {
671  public:
672 
673  /**
674  * Creates a new plane state event object.
675  * @param trackerId Unique id of the tracker that sent this event
676  * @param plane Tracker plane of the sender
677  */
678  explicit inline TrackerPlaneStateEvent(const unsigned int trackerId, const Plane3& plane);
679 
680  /**
681  * Returns the plane of this object.
682  * @return Event plane
683  */
684  inline const Plane3& plane() const;
685 
686  /**
687  * Creates a new event reference object.
688  * @param trackerId Unique id of the tracker that sent this event
689  * @param plane Tracker plane of the sender
690  * @return The new event object
691  */
692  static inline EventRef createEvent(const unsigned int trackerId, const Plane3& plane);
693 
694  protected:
695 
696  /// The plane of this event.
697  const Plane3 plane_;
698 };
699 
700 /**
701  * Definition of a smart object reference for tracker plane state events.
702  * @see TrackerPlaneStateEvent.
703  * @ingroup trackingoffline
704  */
706 
707 inline unsigned int TrackerEvent::trackerId() const
708 {
709  return trackerId_;
710 }
711 
712 inline ComponentEvent::ComponentEvent(const unsigned int subtype, const unsigned int trackerId, const ComponentState state) :
713  TrackerEvent(ET_COMPONENT, subtype, trackerId),
714  eventState(state)
715 {
716  // nothing to do here
717 }
718 
720 {
721  return eventState;
722 }
723 
724 inline void ComponentEvent::setState(const ComponentState state)
725 {
726  eventState = state;
727 }
728 
729 inline TrackerProcessComponentEvent::TrackerProcessComponentEvent(const unsigned int trackerId, const ComponentState state) :
730  ComponentEvent(CEST_TRACKER_PROCESS, trackerId, state)
731 {
732  // nothing to do here
733 }
734 
735 inline EventRef TrackerProcessComponentEvent::createEvent(const unsigned int trackerId, const ComponentState state)
736 {
738 }
739 
740 inline AnalysisComponentEvent::AnalysisComponentEvent(const unsigned int trackerId, const ComponentState state) :
741  ComponentEvent(CEST_ANALYSIS, trackerId, state)
742 {
743  // nothing to do here
744 }
745 
746 inline EventRef AnalysisComponentEvent::createEvent(const unsigned int trackerId, const ComponentState state)
747 {
749 }
750 
751 inline TrackingComponentEvent::TrackingComponentEvent(const unsigned int trackerId, const ComponentState state) :
752  ComponentEvent(CEST_TRACKING, trackerId, state)
753 {
754  // nothing to do here
755 }
756 
757 inline EventRef TrackingComponentEvent::createEvent(const unsigned int trackerId, const ComponentState state)
758 {
760 }
761 
762 inline ProgressEvent::ProgressEvent(const unsigned int subtype, const unsigned int trackerId, const unsigned int componentProgress) :
763  TrackerEvent(ET_PROGRESS, subtype, trackerId),
764  componentProgress_(componentProgress)
765 {
766  ocean_assert(componentProgress <= 100u);
767 }
768 
769 inline unsigned int ProgressEvent::componentProgress() const
770 {
771  return componentProgress_;
772 }
773 
774 inline TrackerProcessProgressEvent::TrackerProcessProgressEvent(const unsigned int trackerId, const unsigned int componentProgress) :
775  ProgressEvent(PEST_TRACKER_PROCESS, trackerId, componentProgress)
776 {
777  // nothing to do here
778 }
779 
780 inline EventRef TrackerProcessProgressEvent::createEvent(const unsigned int trackerId, const unsigned int componentProgress)
781 {
783 }
784 
785 inline AnalysisProgressEvent::AnalysisProgressEvent(const unsigned int trackerId, const unsigned int componentProgress) :
786  ProgressEvent(PEST_ANALYSIS, trackerId, componentProgress)
787 {
788  // nothing to do here
789 }
790 
791 inline EventRef AnalysisProgressEvent::createEvent(const unsigned int trackerId, const unsigned int componentProgress)
792 {
794 }
795 
796 inline TrackingProgressEvent::TrackingProgressEvent(const unsigned int trackerId, const unsigned int componentProgress) :
797  ProgressEvent(PEST_TRACKING, trackerId, componentProgress)
798 {
799  // nothing to do here
800 }
801 
802 inline EventRef TrackingProgressEvent::createEvent(const unsigned int trackerId, const unsigned int componentProgress)
803 {
805 }
806 
807 inline StateEvent::StateEvent(const unsigned int subtype, const unsigned int trackerId) :
808  TrackerEvent(ET_STATE, subtype, trackerId)
809 {
810  // nothing to do here
811 }
812 
813 inline CameraCalibrationStateEvent::CameraCalibrationStateEvent(const unsigned int trackerId, const PinholeCamera& pinholeCamera) :
814  StateEvent(SEST_CAMERA_CALIBRATION, trackerId),
815  camera_(pinholeCamera)
816 {
817  // nothing to do here
818 }
819 
821 {
822  return camera_;
823 }
824 
825 inline EventRef CameraCalibrationStateEvent::createEvent(const unsigned int trackerId, const PinholeCamera& pinholeCamera)
826 {
827  return EventRef(new CameraCalibrationStateEvent(trackerId, pinholeCamera));
828 }
829 
830 inline TrackerPoseStateEvent::TrackerPoseStateEvent(const unsigned int trackerId, const OfflinePose& pose) :
831  StateEvent(SEST_TRACKER_POSE, trackerId),
832  pose_(pose)
833 {
834  // nothing to do here
835 }
836 
838 {
839  return pose_;
840 }
841 
842 inline EventRef TrackerPoseStateEvent::createEvent(const unsigned int trackerId, const OfflinePose& pose)
843 {
845 }
846 
847 inline TrackerPosesStateEvent::TrackerPosesStateEvent(const unsigned int trackerId, const OfflinePoses& poses) :
848  StateEvent(SEST_TRACKER_POSES, trackerId),
849  poses_(poses)
850 {
851  // nothing to do here
852 }
853 
855 {
856  return poses_;
857 }
858 
859 inline EventRef TrackerPosesStateEvent::createEvent(const unsigned int trackerId, const OfflinePoses& poses)
860 {
862 }
863 
864 inline TrackerTransformationStateEvent::TrackerTransformationStateEvent(const unsigned int trackerId, const HomogenousMatrix4& transformation, const bool isSuggestion) :
865  StateEvent(SEST_TRACKER_TRANSFORMATION, trackerId),
866  transformation_(transformation),
867  transformationSuggestion_(isSuggestion)
868 {
869  // nothing to do here
870 }
871 
873 {
874  return transformation_;
875 }
876 
878 {
880 }
881 
882 inline EventRef TrackerTransformationStateEvent::createEvent(const unsigned int trackerId, const HomogenousMatrix4& transformation, const bool isSuggestion)
883 {
885 }
886 
887 inline TrackerPlaneStateEvent::TrackerPlaneStateEvent(const unsigned int trackerId, const Plane3& plane) :
888  StateEvent(SEST_TRACKER_PLANE, trackerId),
889  plane_(plane)
890 {
891  // nothing to do here
892 }
893 
895 {
896  return plane_;
897 }
898 
899 inline EventRef TrackerPlaneStateEvent::createEvent(const unsigned int trackerId, const Plane3& plane)
900 {
902 }
903 
904 }
905 
906 }
907 
908 }
909 
910 #endif // META_OCEAN_TRACKING_OFFLINE_TRACKER_EVENT_H
This class implements the base class for all event classes.
Definition: Event.h:41
This template class implements a object reference with an internal reference counter.
Definition: base/ObjectRef.h:58
This template class implements a smart object reference which is a specialization of an ObjectRef obj...
Definition: SmartObjectRef.h:90
This class implements a component event for the analysis components.
Definition: TrackerEvent.h:223
static EventRef createEvent(const unsigned int trackerId, const ComponentState state)
Creates a new event reference object.
Definition: TrackerEvent.h:746
AnalysisComponentEvent(const unsigned int trackerId, const ComponentState state)
Creates a new event object.
Definition: TrackerEvent.h:740
This class implements a progress event for analysis components.
Definition: TrackerEvent.h:377
static EventRef createEvent(const unsigned int trackerId, const unsigned int componentProgress)
Creates a new event reference object.
Definition: TrackerEvent.h:791
AnalysisProgressEvent(const unsigned int trackerId, const unsigned int componentProgress)
Creates a new progress event object.
Definition: TrackerEvent.h:785
This class implements a camera state event that provides a camera profile.
Definition: TrackerEvent.h:491
const PinholeCamera & camera() const
Returns the camera profile of this event.
Definition: TrackerEvent.h:820
CameraCalibrationStateEvent(const unsigned int trackerId, const PinholeCamera &pinholeCamera)
Creates a new camera state event object.
Definition: TrackerEvent.h:813
const PinholeCamera camera_
The camera profile of this event.
Definition: TrackerEvent.h:518
static EventRef createEvent(const unsigned int trackerId, const PinholeCamera &pinholeCamera)
Creates a new event reference object.
Definition: TrackerEvent.h:825
This class implements the base class for all component events.
Definition: TrackerEvent.h:107
ComponentEventSubType
Definition of individual component event sub-types.
Definition: TrackerEvent.h:114
@ CEST_ANALYSIS
An analysis sub-type event.
Definition: TrackerEvent.h:120
@ CEST_TRACKER_PROCESS
An tracker process sub-type event.
Definition: TrackerEvent.h:118
ComponentState eventState
The state of the component that sent this event.
Definition: TrackerEvent.h:177
ComponentState state() const
Returns the state of the component event.
Definition: TrackerEvent.h:719
std::string stateName() const
Returns the state of this event.
void setState(const ComponentState state)
Sets or changes the state of this component event.
Definition: TrackerEvent.h:724
std::string subtypeName() const override
Returns the sub-type name of this event object.
ComponentState
Definition of individual component states.
Definition: TrackerEvent.h:129
@ CS_STARTED
The component started.
Definition: TrackerEvent.h:131
@ CS_FAILED
The component failed.
Definition: TrackerEvent.h:135
@ CS_FINISHED
The component finished.
Definition: TrackerEvent.h:133
ComponentEvent(const unsigned int subtype, const unsigned int trackerId, const ComponentState state)
Creates a new component event object.
Definition: TrackerEvent.h:712
This class encapsulates the tracking pose data.
Definition: OfflinePose.h:41
This class implements the base class for all progress events.
Definition: TrackerEvent.h:286
unsigned int componentProgress() const
Returns the progress of a component in percent.
Definition: TrackerEvent.h:769
ProgressEvent(const unsigned int subtype, const unsigned int trackerId, const unsigned int componentProgress)
Creates a new progress event object.
Definition: TrackerEvent.h:762
unsigned int componentProgress_
The component progress in percent.
Definition: TrackerEvent.h:331
ProgressEventSubType
Definition of individual progress event sub-types.
Definition: TrackerEvent.h:293
@ PEST_ANALYSIS
An analysis sub-type event.
Definition: TrackerEvent.h:299
@ PEST_TRACKER_PROCESS
An tracker process sub-type event.
Definition: TrackerEvent.h:297
std::string subtypeName() const override
Returns the sub-type name of this event object.
This class is the base class for all state events.
Definition: TrackerEvent.h:439
StateEventSubType
Definition of individual state event sub-types.
Definition: TrackerEvent.h:446
@ SEST_TRACKER_POSES
A tracker poses sub-type event.
Definition: TrackerEvent.h:456
@ SEST_TRACKER_TRANSFORMATION
A tracker transformation sub-type event.
Definition: TrackerEvent.h:452
@ SEST_CAMERA_CALIBRATION
A camera calibration sub-type event.
Definition: TrackerEvent.h:450
@ SEST_TRACKER_POSE
A tracker pose sub-type event.
Definition: TrackerEvent.h:454
std::string subtypeName() const override
Returns the sub-type name of this event object.
StateEvent(const unsigned int subtype, const unsigned int trackerId)
Creates a new state event object.
Definition: TrackerEvent.h:807
This class implements the base class for all tracker events.
Definition: TrackerEvent.h:51
TrackerEvent(const unsigned int type, const unsigned int subtype, const unsigned int trackerId)
Creates a new tracker event object.
virtual std::string subtypeName() const =0
Returns the sub-type name of this event object.
unsigned int trackerId() const
Returns the unique id of the tracker that sent this event.
Definition: TrackerEvent.h:707
unsigned int trackerId_
The unique tracker id of the tracker that sent this event.
Definition: TrackerEvent.h:85
std::string typeName() const
Returns the type name of this event.
This class implements a tracker plane state event that provides the detected plane of a tracker.
Definition: TrackerEvent.h:670
static EventRef createEvent(const unsigned int trackerId, const Plane3 &plane)
Creates a new event reference object.
Definition: TrackerEvent.h:899
TrackerPlaneStateEvent(const unsigned int trackerId, const Plane3 &plane)
Creates a new plane state event object.
Definition: TrackerEvent.h:887
const Plane3 & plane() const
Returns the plane of this object.
Definition: TrackerEvent.h:894
const Plane3 plane_
The plane of this event.
Definition: TrackerEvent.h:697
This class implements a tracker pose state event that provides a tracker pose.
Definition: TrackerEvent.h:533
const OfflinePose & pose() const
Returns the pose of this event object.
Definition: TrackerEvent.h:837
TrackerPoseStateEvent(const unsigned int trackerId, const OfflinePose &pose)
Creates a new pose state event object.
Definition: TrackerEvent.h:830
static EventRef createEvent(const unsigned int trackerId, const OfflinePose &pose)
Creates a new event reference object.
Definition: TrackerEvent.h:842
OfflinePose pose_
The pose of this event.
Definition: TrackerEvent.h:560
This class implements a tracker poses state event that provides the all determined tracker poses.
Definition: TrackerEvent.h:575
static EventRef createEvent(const unsigned int trackerId, const OfflinePoses &poses)
Creates a new event reference object.
Definition: TrackerEvent.h:859
const OfflinePoses & poses() const
Returns the poses of this object.
Definition: TrackerEvent.h:854
TrackerPosesStateEvent(const unsigned int trackerId, const OfflinePoses &poses)
Creates a new poses state event object.
Definition: TrackerEvent.h:847
const OfflinePoses poses_
The poses of this event.
Definition: TrackerEvent.h:602
This class implements a component event for the entire tracker process.
Definition: TrackerEvent.h:192
static EventRef createEvent(const unsigned int trackerId, const ComponentState state)
Creates a new event reference object.
Definition: TrackerEvent.h:735
TrackerProcessComponentEvent(const unsigned int trackerId, const ComponentState state)
Creates a new event object.
Definition: TrackerEvent.h:729
This class implements a progress event for tracker processes.
Definition: TrackerEvent.h:346
TrackerProcessProgressEvent(const unsigned int trackerId, const unsigned int componentProgress)
Creates a new progress event object.
Definition: TrackerEvent.h:774
static EventRef createEvent(const unsigned int trackerId, const unsigned int componentProgress)
Creates a new event reference object.
Definition: TrackerEvent.h:780
This class implements an tracker transformation state event that provides the transformation between ...
Definition: TrackerEvent.h:617
const HomogenousMatrix4 transformation_
The transformation of this event.
Definition: TrackerEvent.h:652
const bool transformationSuggestion_
Flag to indicate whether the transformation of this event is a suggestion.
Definition: TrackerEvent.h:655
const HomogenousMatrix4 & transformation() const
Returns the tracker transformation of this object.
Definition: TrackerEvent.h:872
TrackerTransformationStateEvent(const unsigned int trackerId, const HomogenousMatrix4 &transformation, const bool isSuggestion=false)
Creates a new tracker transformation event object.
Definition: TrackerEvent.h:864
static EventRef createEvent(const unsigned int trackerId, const HomogenousMatrix4 &transformation, const bool isSuggestion=false)
Creates a new event reference object.
Definition: TrackerEvent.h:882
bool isTransformationASuggestion() const
Returns whether the tracker transformation of this object is a suggestion.
Definition: TrackerEvent.h:877
This class implements a component event for the tracking components.
Definition: TrackerEvent.h:254
static EventRef createEvent(const unsigned int trackerId, const ComponentState state)
Creates a new event reference object.
Definition: TrackerEvent.h:757
TrackingComponentEvent(const unsigned int trackerId, const ComponentState state)
Creates a new event object.
Definition: TrackerEvent.h:751
This class implements a progress event for tracking components.
Definition: TrackerEvent.h:408
static EventRef createEvent(const unsigned int trackerId, const unsigned int componentProgress)
Creates a new event reference object.
Definition: TrackerEvent.h:802
TrackingProgressEvent(const unsigned int trackerId, const unsigned int componentProgress)
Creates a new progress event object.
Definition: TrackerEvent.h:796
ObjectRef< Event > EventRef
Definition of an object reference holding an event object.
Definition: Event.h:23
SmartObjectRef< ComponentEvent, Event > ComponentEventRef
Definition of a smart object reference for component events.
Definition: TrackerEvent.h:185
SmartObjectRef< TrackerProcessComponentEvent, Event > TrackerProcessComponentEventRef
Definition of a smart object reference for tracker process events.
Definition: TrackerEvent.h:216
SmartObjectRef< StateEvent, Event > StateEventRef
Definition of a smart object reference for state events.
Definition: TrackerEvent.h:484
SmartObjectRef< AnalysisComponentEvent, Event > AnalysisComponentEventRef
Definition of a smart object reference for analysis component events.
Definition: TrackerEvent.h:247
SmartObjectRef< ProgressEvent, Event > ProgressEventRef
Definition of a smart object reference for progress events.
Definition: TrackerEvent.h:339
SmartObjectRef< TrackingProgressEvent, Event > TrackingProgressEventRef
Definition of a smart object reference for tracking progress events.
Definition: TrackerEvent.h:432
SmartObjectRef< AnalysisProgressEvent, Event > AnalysisProgressEventRef
Definition of a smart object reference for analysis progress events.
Definition: TrackerEvent.h:401
SmartObjectRef< TrackerEvent, Event > TrackerEventRef
Definition of a smart object reference for tracker event.
Definition: TrackerEvent.h:93
SmartObjectRef< TrackerPlaneStateEvent, Event > TrackerPlaneStateEventRef
Definition of a smart object reference for tracker plane state events.
Definition: TrackerEvent.h:705
SmartObjectRef< TrackerProcessProgressEvent, Event > TrackerProcessProgressEventRef
Definition of a smart object reference for tracker process progress events.
Definition: TrackerEvent.h:370
SmartObjectRef< TrackerTransformationStateEvent, Event > TrackerTransformationStateEventRef
Definition of a smart object reference for tracker transformation state events.
Definition: TrackerEvent.h:663
SmartObjectRef< TrackerPoseStateEvent, Event > TrackerPoseStateEventRef
Definition of a smart object reference for pose state events.
Definition: TrackerEvent.h:568
EventType
Definition of individual tracker event types.
Definition: TrackerEvent.h:35
SmartObjectRef< CameraCalibrationStateEvent, Event > CameraCalibrationStateEventRef
Definition of a smart object reference for camera calibration state events.
Definition: TrackerEvent.h:526
SmartObjectRef< TrackingComponentEvent, Event > TrackingComponentEventRef
Definition of a smart object reference for tracking component events.
Definition: TrackerEvent.h:278
ScopedEvent< TrackerEvent > ScopedEvent
Definition of a scoped event for tracker events.
Definition: TrackerEvent.h:99
SmartObjectRef< TrackerPosesStateEvent, Event > TrackerPosesStateEventRef
Definition of a smart object reference for tracker poses state events.
Definition: TrackerEvent.h:610
@ ET_COMPONENT
A component event.
Definition: TrackerEvent.h:39
@ ET_PROGRESS
A progress event.
Definition: TrackerEvent.h:41
@ ET_INVALID
An invalid event type.
Definition: TrackerEvent.h:37
@ ET_STATE
A state event for changed states.
Definition: TrackerEvent.h:43
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15