OSVR-Core
Viewer.h
Go to the documentation of this file.
1 
11 // Copyright 2015 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_Viewer_h_GUID_40CF2CEC_DB9F_4D94_3F1C_329AD0489EF7
26 #define INCLUDED_Viewer_h_GUID_40CF2CEC_DB9F_4D94_3F1C_329AD0489EF7
27 
28 // Internal Includes
29 #include <osvr/Client/Export.h>
32 #include <osvr/Client/ViewerEye.h>
35 
36 // Library/third-party includes
37 // - none
38 
39 // Standard includes
40 #include <utility>
41 
42 namespace osvr {
43 namespace client {
44  class DisplayConfigFactory;
45  namespace detail {
46  typedef util::ContainerWrapper<
47  std::vector<ViewerEye>, util::container_policies::const_iterators,
48  util::container_policies::subscript> ViewerEyeContainerBase;
49  } // namespace detail
50  class Viewer : public detail::ViewerEyeContainerBase {
51  public:
52  Viewer(Viewer const &) = delete;
53  Viewer &operator=(Viewer const &) = delete;
54  Viewer(Viewer &&other) : m_head(std::move(other.m_head)) {}
55 
56  inline OSVR_EyeCount size() const {
57  return static_cast<OSVR_EyeCount>(container().size());
58  }
59 
60  OSVR_CLIENT_EXPORT OSVR_Pose3 getPose() const;
61  OSVR_CLIENT_EXPORT bool hasPose() const;
62 
63  private:
64  friend class DisplayConfigFactory;
65  Viewer(OSVR_ClientContext ctx, const char path[]);
67  };
68 
69 } // namespace client
70 } // namespace osvr
71 
72 #endif // INCLUDED_Viewer_h_GUID_40CF2CEC_DB9F_4D94_3F1C_329AD0489EF7
Header.
Header declaring opaque types used by Client and ClientKit.
Header providing a class template suitable for inheritance that wraps an arbitrary STL-like container...
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Class that should be used for all internally-used client interface objects as it handles ownership wi...
Definition: InternalInterfaceOwner.h:45
Definition: Viewer.h:50
detail::size< coerce_list< Ts... >> size
Get the size of a list (number of elements.)
Definition: Size.h:56
Definition: DisplayConfig.h:50
Definition: newuoa.h:1888
Definition: ClientContext.h:50
uint8_t OSVR_EyeCount
The integer type specifying the number of eyes (viewpoints) of a viewer.
Definition: RenderingTypesC.h:92
A structure defining a 3D (6DOF) rigid body pose: translation and rotation.
Definition: Pose3C.h:54
detail::ContainerWrapper_t< Container, Args... > ContainerWrapper
Parent class to inherit from to get a container with some functionality exposed.
Definition: ContainerWrapper.h:232