Ocean
ObjectTracker.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_DEVICES_OBJECT_TRACKER_H
9 #define META_OCEAN_DEVICES_OBJECT_TRACKER_H
10 
11 #include "ocean/devices/Devices.h"
13 #include "ocean/devices/Tracker.h"
14 
15 #include "ocean/math/Vector3.h"
16 
17 namespace Ocean
18 {
19 
20 namespace Devices
21 {
22 
23 // Forward declaration.
24 class ObjectTracker;
25 
26 /**
27  * Definition of a smart object reference for an ObjectTracker.
28  * @see ObjectTracker.
29  * @ingroup devices
30  */
32 
33 /**
34  * This class is the base class for all tracker allowing to track an object or location.
35  * @ingroup devices
36  */
37 class OCEAN_DEVICES_EXPORT ObjectTracker : virtual public Tracker
38 {
39  public:
40 
41  /**
42  * Registers (adds) a new object to be tracked.
43  * The object can be e.g., a unique mark, an image, a feature map, or a location.
44  * @param description The information describing the object, e.g., a filename, or an id, or a location
45  * @param dimension The dimension of the object if known, e.g. a 1D or 2D sizeof of a marker, can be zero if unknown
46  * @return Object id associated with the defined object, an invalid object id if the function failed
47  * @see unregisterObject().
48  */
49  virtual ObjectId registerObject(const std::string& description, const Vector3& dimension = Vector3(0, 0, 0));
50 
51  /**
52  * Unregisters (removes) a previously registered object.
53  * @param objectId Unique object id of the object to be removed
54  * @return True, if succeeded
55  * @see registerObject().
56  */
57  virtual bool unregisterObject(const ObjectId objectId);
58 
59  protected:
60 
61  /**
62  * Creates a new object tracker object.
63  * @param name The name of the tracker
64  * @param type Major and minor device type of the device
65  */
66  ObjectTracker(const std::string& name, const DeviceType type);
67 
68  /**
69  * Destructs an object tracker object.
70  */
71  ~ObjectTracker() override;
72 };
73 
74 }
75 
76 }
77 
78 #endif // META_OCEAN_DEVICES_OBJECT_TRACKER_H
Definition of a class holding the major and minor device type.
Definition: devices/Device.h:62
unsigned int ObjectId
Definition of an object id.
Definition: Measurement.h:46
This class is the base class for all tracker allowing to track an object or location.
Definition: ObjectTracker.h:38
virtual bool unregisterObject(const ObjectId objectId)
Unregisters (removes) a previously registered object.
virtual ObjectId registerObject(const std::string &description, const Vector3 &dimension=Vector3(0, 0, 0))
Registers (adds) a new object to be tracked.
ObjectTracker(const std::string &name, const DeviceType type)
Creates a new object tracker object.
~ObjectTracker() override
Destructs an object tracker object.
This class implements a smart device reference.
Definition: DeviceRef.h:36
This class implements the base class for all tracker devices.
Definition: devices/Tracker.h:39
SmartDeviceRef< ObjectTracker > ObjectTrackerRef
Definition of a smart object reference for an ObjectTracker.
Definition: ObjectTracker.h:24
VectorT3< Scalar > Vector3
Definition of a 3D vector.
Definition: Vector3.h:22
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15