OpenNIScaffold.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_OPENNI_OPENNISCAFFOLD_H
#define SURGSIM_DEVICES_OPENNI_OPENNISCAFFOLD_H
#include <memory>
#include "SurgSim/DataStructures/DataGroup.h"
#include "SurgSim/Framework/BasicThread.h"
namespace SurgSim
{
namespace Framework
{
class Logger;
};
namespace Devices
{
class OpenNIDevice;
class OpenNIScaffold : public SurgSim::Framework::BasicThread
{
public:
virtual ~OpenNIScaffold();
protected:
bool doInitialize() override;
bool doStartUp() override;
bool doUpdate(double dt) override;
private:
struct StateData;
struct DeviceData;
friend class OpenNIDevice;
OpenNIScaffold();
static std::shared_ptr<OpenNIScaffold> getOrCreateSharedInstance();
bool registerDevice(OpenNIDevice* device);
bool unregisterDevice(const OpenNIDevice* device);
bool doRegisterDevice(DeviceData* info);
bool doUnregisterDevice(DeviceData* info);
static SurgSim::DataStructures::DataGroup buildDeviceInputData();
std::unique_ptr<StateData> m_state;
std::shared_ptr<SurgSim::Framework::Logger> m_logger;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_OPENNI_OPENNISCAFFOLD_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::OpenNIScaffold::m_logger
std::shared_ptr< SurgSim::Framework::Logger > m_logger
Logger used by the scaffold.
Definition: OpenNIScaffold.h:97
DataGroup.h
SurgSim::Devices::OpenNIScaffold
A class that manages OpenNI devices.
Definition: OpenNIScaffold.h:40
SurgSim::Devices::OpenNIScaffold::m_state
std::unique_ptr< StateData > m_state
Internal scaffold state.
Definition: OpenNIScaffold.h:94
SurgSim::Devices::OpenNIScaffold::StateData
Definition: OpenNIScaffold.cpp:52
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
SurgSim::Framework::BasicThread
Basic thread implementation, tries to maintain a constant rate, supplies startup an initialization...
Definition: BasicThread.h:48
SurgSim::Devices::OpenNIScaffold::DeviceData
Definition: OpenNIScaffold.cpp:35
BasicThread.h
SurgSim::Devices::OpenNIDevice
A class implementing the communication with one OpenNI compatible depth camera.
Definition: OpenNIDevice.h:41