opensurgsim
TrackIRThread.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_DEVICES_TRACKIR_TRACKIRTHREAD_H
17 #define SURGSIM_DEVICES_TRACKIR_TRACKIRTHREAD_H
18 
19 #include "SurgSim/Framework/BasicThread.h"
20 #include "SurgSim/Devices/TrackIR/TrackIRScaffold.h"
21 
22 namespace SurgSim
23 {
24 namespace Devices
25 {
26 
30 {
31 public:
38 
40  virtual ~TrackIRThread();
41 
42 protected:
45  bool doInitialize() override;
48  bool doStartUp() override;
52  bool doUpdate(double dt) override;
53 
54 private:
55  // Pointer to the scaffold which will be updated by this thread.
56  TrackIRScaffold* m_scaffold;
57  // Pointer to the DeviceData object which will be updated by the scaffold.
58  TrackIRScaffold::DeviceData* m_deviceData;
59 };
60 
61 }; // namespace Devices
62 }; // namespace SurgSim
63 
64 #endif // SURGSIM_DEVICES_TRACKIR_TRACKIRTHREAD_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
bool doInitialize() override
Initialize this thread.
Definition: TrackIRThread.cpp:37
A class that manages Natural Point TRACKIR devices.
Definition: TrackIRScaffold.h:38
virtual ~TrackIRThread()
Destructor.
Definition: TrackIRThread.cpp:33
bool doStartUp() override
Start up this thread.
Definition: TrackIRThread.cpp:42
bool doUpdate(double dt) override
Update work of this thread.
Definition: TrackIRThread.cpp:47
Definition: TrackIRScaffold.cpp:49
TrackIRThread(TrackIRScaffold *scaffold, TrackIRScaffold::DeviceData *deviceData)
Constructor TrackIR sample rate: 120FPS.
Definition: TrackIRThread.cpp:25
Basic thread implementation, tries to maintain a constant rate, supplies startup an initialization...
Definition: BasicThread.h:48
A class implementing the thread context for sampling TrackIR devices.
Definition: TrackIRThread.h:29