TrackIRThread.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DEVICES_TRACKIR_TRACKIRTHREAD_H
#define SURGSIM_DEVICES_TRACKIR_TRACKIRTHREAD_H
#include "SurgSim/Framework/BasicThread.h"
#include "SurgSim/Devices/TrackIR/TrackIRScaffold.h"
namespace SurgSim
{
namespace Devices
{
class TrackIRThread : public SurgSim::Framework::BasicThread
{
public:
TrackIRThread(TrackIRScaffold* scaffold, TrackIRScaffold::DeviceData* deviceData);
virtual ~TrackIRThread();
protected:
bool doInitialize() override;
bool doStartUp() override;
bool doUpdate(double dt) override;
private:
// Pointer to the scaffold which will be updated by this thread.
TrackIRScaffold* m_scaffold;
// Pointer to the DeviceData object which will be updated by the scaffold.
TrackIRScaffold::DeviceData* m_deviceData;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_TRACKIR_TRACKIRTHREAD_H
SurgSim::Devices::TrackIRThread::m_deviceData
TrackIRScaffold::DeviceData * m_deviceData
Definition: TrackIRThread.h:58
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::TrackIRThread::doInitialize
bool doInitialize() override
Initialize this thread.
Definition: TrackIRThread.cpp:37
TrackIRScaffold.h
SurgSim::Devices::TrackIRScaffold
A class that manages Natural Point TRACKIR devices.
Definition: TrackIRScaffold.h:38
SurgSim::Devices::TrackIRThread::~TrackIRThread
virtual ~TrackIRThread()
Destructor.
Definition: TrackIRThread.cpp:33
SurgSim::Devices::TrackIRThread::doStartUp
bool doStartUp() override
Start up this thread.
Definition: TrackIRThread.cpp:42
SurgSim::Devices::TrackIRThread::doUpdate
bool doUpdate(double dt) override
Update work of this thread.
Definition: TrackIRThread.cpp:47
SurgSim::Devices::TrackIRScaffold::DeviceData
Definition: TrackIRScaffold.cpp:49
SurgSim::Devices::TrackIRThread::TrackIRThread
TrackIRThread(TrackIRScaffold *scaffold, TrackIRScaffold::DeviceData *deviceData)
Constructor TrackIR sample rate: 120FPS.
Definition: TrackIRThread.cpp:25
SurgSim::Devices::TrackIRThread::m_scaffold
TrackIRScaffold * m_scaffold
Definition: TrackIRThread.h:56
SurgSim::Framework::BasicThread
Basic thread implementation, tries to maintain a constant rate, supplies startup an initialization...
Definition: BasicThread.h:48
SurgSim::Devices::TrackIRThread
A class implementing the thread context for sampling TrackIR devices.
Definition: TrackIRThread.h:29
BasicThread.h