TrackIRScaffold.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_TRACKIRSCAFFOLD_H
#define SURGSIM_DEVICES_TRACKIR_TRACKIRSCAFFOLD_H
#include <memory>
#include "SurgSim/Framework/Logger.h"
namespace SurgSim
{
namespace DataStructures
{
class DataGroup;
}
namespace Devices
{
class TrackIRDevice;
class TrackIRScaffold
{
public:
TrackIRScaffold();
~TrackIRScaffold();
static std::shared_ptr<TrackIRScaffold> getOrCreateSharedInstance();
private:
struct StateData;
struct DeviceData;
friend class TrackIRDevice;
friend class TrackIRThread;
friend struct StateData;
bool registerDevice(TrackIRDevice* device);
bool unregisterDevice(const TrackIRDevice* device);
void setPositionScale(const TrackIRDevice* device, double scale);
void setOrientationScale(const TrackIRDevice* device, double scale);
bool initializeSdk();
bool finalizeSdk();
bool startCamera(DeviceData* info);
bool stopCamera(DeviceData* info);
bool runInputFrame(DeviceData* info);
bool updateDevice(DeviceData* info);
bool createPerDeviceThread(DeviceData* data);
bool destroyPerDeviceThread(DeviceData* data);
static SurgSim::DataStructures::DataGroup buildDeviceInputData();
std::shared_ptr<SurgSim::Framework::Logger> m_logger;
std::unique_ptr<StateData> m_state;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_TRACKIR_TRACKIRSCAFFOLD_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::TrackIRScaffold
A class that manages Natural Point TRACKIR devices.
Definition: TrackIRScaffold.h:38
SurgSim::Devices::TrackIRDevice
A class implementing the communication with Natural Point TrackIR camera.
Definition: TrackIRDevice.h:44
SurgSim::Devices::TrackIRScaffold::DeviceData
Definition: TrackIRScaffold.cpp:49
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
Logger.h
SurgSim::Devices::TrackIRThread
A class implementing the thread context for sampling TrackIR devices.
Definition: TrackIRThread.h:29
SurgSim::Devices::TrackIRScaffold::m_state
std::unique_ptr< StateData > m_state
Internal scaffold state.
Definition: TrackIRScaffold.h:127
SurgSim::Devices::TrackIRScaffold::m_logger
std::shared_ptr< SurgSim::Framework::Logger > m_logger
Logger used by the scaffold and all devices.
Definition: TrackIRScaffold.h:124
SurgSim::Devices::TrackIRScaffold::StateData
Definition: TrackIRScaffold.cpp:80