Ocean
ACFactory.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_ARCORE_AC_FACTORY_H
9 #define META_OCEAN_DEVICES_ARCORE_AC_FACTORY_H
10 
12 
13 #include "ocean/devices/Factory.h"
14 
15 namespace Ocean
16 {
17 
18 namespace Devices
19 {
20 
21 namespace ARCore
22 {
23 
24 /**
25  * This class implements a device factory for the ARCore tracking library.
26  * @ingroup devicesarcore
27  */
28 class OCEAN_DEVICES_ARCORE_EXPORT ACFactory : public Factory
29 {
30  public:
31 
32  /**
33  * Registers this factory at the manager.
34  * Beware: Unregister this factory if not needed anymore.
35  * @return True, if this factory hasn't been registered before
36  */
37  static bool registerFactory();
38 
39  /**
40  * Unregisters this factory at the manger.
41  * This unregistration should be done after all created devices have been released.
42  * @return True, if this factory chould be unregistered
43  */
44  static bool unregisterFactory();
45 
46  /**
47  * Updates the factory's trackers with the most recent tracking results from ARCore.
48  * This function must be called out of the main GL rendering thread.
49  * @param textureId The id of the texture in which the camera image will be copied, must be valid
50  */
51  static void update(unsigned int textureId);
52 
53  private:
54 
55  /**
56  * Creates a new factory.
57  */
59 
60  /**
61  * Registers all devices.
62  */
64 
65  /**
66  * Creates a new 6DOF tracker.
67  * The caller is responsible to release the sensor.
68  * @param name The name of the new device, must be valid
69  * @param deviceType The device type of the device, must be valid
70  * @return The new sensor, nullptr if the sensor could not be created
71  */
72  static Device* createACTracker6DOF(const std::string& name, const Device::DeviceType& deviceType);
73 };
74 
75 }
76 
77 }
78 
79 }
80 
81 #endif // META_OCEAN_DEVICES_ARCORE_AC_FACTORY_H
This class implements a device factory for the ARCore tracking library.
Definition: ACFactory.h:29
ACFactory()
Creates a new factory.
void registerDevices()
Registers all devices.
static void update(unsigned int textureId)
Updates the factory's trackers with the most recent tracking results from ARCore.
static bool registerFactory()
Registers this factory at the manager.
static bool unregisterFactory()
Unregisters this factory at the manger.
static Device * createACTracker6DOF(const std::string &name, const Device::DeviceType &deviceType)
Creates a new 6DOF tracker.
Definition of a class holding the major and minor device type.
Definition: devices/Device.h:62
This class is the base class for all devices of any type.
Definition: devices/Device.h:28
This class implements a factory able to create instances of devices.
Definition: devices/Factory.h:28
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15