ViewElement.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_VIEWELEMENT_H
#define SURGSIM_GRAPHICS_VIEWELEMENT_H
#include "SurgSim/Framework/BasicSceneElement.h"
namespace SurgSim
{
namespace Input
{
class CommonDevice;
}
namespace Graphics
{
class Camera;
class View;
class ViewElement : public Framework::BasicSceneElement
{
public:
explicit ViewElement(const std::string& name);
virtual ~ViewElement();
virtual bool setView(std::shared_ptr<View> view);
std::shared_ptr<View> getView();
void setCamera(std::shared_ptr<Camera> camera);
std::shared_ptr<Camera> getCamera();
virtual std::shared_ptr<SurgSim::Input::CommonDevice> getKeyboardDevice() = 0;
virtual void enableKeyboardDevice(bool val) = 0;
virtual std::shared_ptr<SurgSim::Input::CommonDevice> getMouseDevice() = 0;
virtual void enableMouseDevice(bool val) = 0;
protected:
bool doInitialize() override;
private:
std::shared_ptr<View> m_view;
std::shared_ptr<Camera> m_camera;
};
}; // namespace Graphics
}; // namespace SurgSim
#endif // SURGSIM_GRAPHICS_VIEWELEMENT_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::ViewElement::m_camera
std::shared_ptr< Camera > m_camera
Camera component connected to the view.
Definition: ViewElement.h:91
SurgSim::Framework::BasicSceneElement
Simple concrete implementation of a scene element that does not have any higher logic.
Definition: BasicSceneElement.h:29
BasicSceneElement.h
SurgSim::Graphics::ViewElement
Basic SceneElement that wraps a View so that it can be added to the Scene.
Definition: ViewElement.h:39
SurgSim::Graphics::ViewElement::m_view
std::shared_ptr< View > m_view
View component that provides the visualization of the graphics representations.
Definition: ViewElement.h:88