OsgViewElement.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_GRAPHICS_OSGVIEWELEMENT_H
#define SURGSIM_GRAPHICS_OSGVIEWELEMENT_H
#include <osg/ref_ptr>
#include "SurgSim/Graphics/ViewElement.h"
#include "SurgSim/Math/Vector.h"
namespace SurgSim
{
namespace Input
{
class CommonDevice;
}
namespace Graphics
{
class OsgViewElement : public Graphics::ViewElement
{
public:
explicit OsgViewElement(const std::string& name);
virtual ~OsgViewElement();
bool setView(std::shared_ptr<View> view) override;
void enableManipulator(bool val);
void setManipulatorParameters(const SurgSim::Math::Vector3d& position, const SurgSim::Math::Vector3d& lookat);
std::shared_ptr<SurgSim::Input::CommonDevice> getKeyboardDevice() override;
void enableKeyboardDevice(bool val) override;
std::shared_ptr<SurgSim::Input::CommonDevice> getMouseDevice() override;
void enableMouseDevice(bool val) override;
private:
bool m_keyboardEnabled;
bool m_mouseEnabled;
};
}; // namespace Graphics
}; // namespace SurgSim
#endif // SURGSIM_GRAPHICS_OSGVIEWELEMENT_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::OsgViewElement::m_keyboardEnabled
bool m_keyboardEnabled
Indicate if a keyboard device is enabled.
Definition: OsgViewElement.h:84
SurgSim::Graphics::OsgViewElement
OSG-based implementation of graphics view element.
Definition: OsgViewElement.h:41
SurgSim::Graphics::ViewElement
Basic SceneElement that wraps a View so that it can be added to the Scene.
Definition: ViewElement.h:39
Vector.h
Definitions of small fixed-size vector types.
SurgSim::Graphics::OsgViewElement::m_mouseEnabled
bool m_mouseEnabled
Indicate if a mouse device is enabled.
Definition: OsgViewElement.h:86
ViewElement.h
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57