OsgAxesRepresentation.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_OSGAXESREPRESENTATION_H
#define SURGSIM_GRAPHICS_OSGAXESREPRESENTATION_H
#include "SurgSim/Graphics/OsgRepresentation.h"
#include "SurgSim/Graphics/AxesRepresentation.h"
#include "SurgSim/Graphics/OsgUnitAxes.h"
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#endif
namespace SurgSim
{
namespace Graphics
{
SURGSIM_STATIC_REGISTRATION(OsgAxesRepresentation);
class OsgAxesRepresentation : public OsgRepresentation, public AxesRepresentation
{
public:
explicit OsgAxesRepresentation(const std::string& name);
~OsgAxesRepresentation();
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgAxesRepresentation);
void setSize(double val) override;
double getSize() override;
private:
std::shared_ptr<OsgUnitAxes> m_sharedUnitAxes;
static std::shared_ptr<OsgUnitAxes> getShareUnitAxes();
double m_size;
};
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
}; // Graphics
}; // SurgSim
#endif
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::OsgAxesRepresentation::m_sharedUnitAxes
std::shared_ptr< OsgUnitAxes > m_sharedUnitAxes
Shared unit axes, so that the geometry can be instanced rather than having multiple copies...
Definition: OsgAxesRepresentation.h:58
SurgSim::Graphics::OsgAxesRepresentation::getSize
double getSize() override
Gets the current size.
Definition: OsgAxesRepresentation.cpp:56
SurgSim::Graphics::OsgAxesRepresentation::OsgAxesRepresentation
OsgAxesRepresentation(const std::string &name)
Constructor.
Definition: OsgAxesRepresentation.cpp:29
SurgSim::Graphics::OsgAxesRepresentation::setSize
void setSize(double val) override
Sets the size of the shown axes.
Definition: OsgAxesRepresentation.cpp:50
AxesRepresentation.h
SurgSim::Graphics::OsgAxesRepresentation::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgAxesRepresentation)
OsgUnitAxes.h
SurgSim::Graphics::OsgAxesRepresentation::m_size
double m_size
Hold the size.
Definition: OsgAxesRepresentation.h:64
SurgSim::Graphics::AxesRepresentation
Displays the coordinate axes, as three lines from the origin default size is 1.0, the X/Y/Z axis are ...
Definition: AxesRepresentation.h:28
SurgSim::Graphics::OsgAxesRepresentation
Osg axes representation implementation for the AxesRepresentation interface in graphics.
Definition: OsgAxesRepresentation.h:37
OsgRepresentation.h
SurgSim::Graphics::OsgAxesRepresentation::~OsgAxesRepresentation
~OsgAxesRepresentation()
Definition: OsgAxesRepresentation.cpp:39
SurgSim::Graphics::OsgRepresentation
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55
SurgSim::Graphics::OsgAxesRepresentation::getShareUnitAxes
static std::shared_ptr< OsgUnitAxes > getShareUnitAxes()
Returns the shared unit axes.
Definition: OsgAxesRepresentation.cpp:44