OSVR-Core
AdditionalReports.h
Go to the documentation of this file.
1 
11 // Copyright 2016 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_AdditionalReports_h_GUID_40CC5604_776C_45A1_FAE6_70CABB8A630E
26 #define INCLUDED_AdditionalReports_h_GUID_40CC5604_776C_45A1_FAE6_70CABB8A630E
27 
28 // Internal Includes
29 // - none
30 
31 // Library/third-party includes
32 // - none
33 
34 // Standard includes
35 #include <cstddef>
36 
37 // configuration section - define or undefine here.
38 #define OSVR_OUTPUT_CAMERA_POSE
39 #undef OSVR_OUTPUT_IMU
40 #undef OSVR_OUTPUT_IMU_CAM
41 #undef OSVR_OUTPUT_HMD_CAM
42 
43 // Past this point, we consume those definitions.
44 
45 namespace osvr {
46 namespace vbtracker {
47  namespace extra_outputs {
48  using IndexOffset = int;
49  static const IndexOffset outputIndexBase = -1;
50 
51 #ifdef OSVR_OUTPUT_CAMERA_POSE
52  static const bool outputCam = true;
53  static const IndexOffset outputCamIndex = outputIndexBase + 1;
54 #else
55  static const bool outputCam = false;
56  static const IndexOffset outputCamIndex = outputIndexBase;
57 #endif
58 
59 #ifdef OSVR_OUTPUT_IMU
60  static const bool outputImu = true;
61  static const IndexOffset outputImuIndex = outputCamIndex + 1;
62 #else
63  static const bool outputImu = false;
64  static const IndexOffset outputImuIndex = outputCamIndex;
65 #endif
66 
67 #ifdef OSVR_OUTPUT_IMU_CAM
68  static const bool outputImuCam = true;
69  static const IndexOffset outputImuCamIndex = outputImuIndex + 1;
70 #else
71  static const bool outputImuCam = false;
72  static const IndexOffset outputImuCamIndex = outputImuIndex;
73 #endif
74 
75 #ifdef OSVR_OUTPUT_HMD_CAM
76  static const bool outputHMDCam = true;
77  static const IndexOffset outputHMDCamIndex = outputImuCamIndex + 1;
78 #else
79  static const bool outputHMDCam = false;
80  static const IndexOffset outputHMDCamIndex = outputImuCamIndex;
81 #endif
82 
83  static const std::size_t numExtraOutputs =
84  static_cast<std::size_t>(outputHMDCamIndex - outputIndexBase);
85 
87  static const bool haveHMDExtraOutputs =
88  outputImu || outputImuCam || outputHMDCam;
89 
92  static const bool haveHMDCameraSpaceExtraOutputs =
93  outputImuCam || outputHMDCam;
94  } // namespace extra_outputs
95 } // namespace vbtracker
96 } // namespace osvr
97 
98 #endif // INCLUDED_AdditionalReports_h_GUID_40CC5604_776C_45A1_FAE6_70CABB8A630E
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3