OsgSphereRepresentation.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_OSGSPHEREREPRESENTATION_H
#define SURGSIM_GRAPHICS_OSGSPHEREREPRESENTATION_H
#include "SurgSim/Graphics/SphereRepresentation.h"
#include "SurgSim/Graphics/OsgRepresentation.h"
#include "SurgSim/Framework/SharedInstance.h"
#include "SurgSim/Math/RigidTransform.h"
#include <osg/PositionAttitudeTransform>
#include <osg/Switch>
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#endif
namespace SurgSim
{
namespace Graphics
{
class OsgUnitSphere;
SURGSIM_STATIC_REGISTRATION(OsgSphereRepresentation);
class OsgSphereRepresentation : public OsgRepresentation, public SphereRepresentation
{
public:
explicit OsgSphereRepresentation(const std::string& name);
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgSphereRepresentation);
virtual void setRadius(double radius);
virtual double getRadius() const;
private:
std::shared_ptr<OsgUnitSphere> m_sharedUnitSphere;
static std::shared_ptr<OsgUnitSphere> getSharedUnitSphere();
};
}; // namespace Graphics
}; // namespace SurgSim
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
#endif // SURGSIM_GRAPHICS_OSGSPHEREREPRESENTATION_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::OsgSphereRepresentation::OsgSphereRepresentation
OsgSphereRepresentation(const std::string &name)
Constructor.
Definition: OsgSphereRepresentation.cpp:32
SphereRepresentation.h
SurgSim::Graphics::OsgSphereRepresentation::getRadius
virtual double getRadius() const
Returns the radius of the sphere.
Definition: OsgSphereRepresentation.cpp:46
SurgSim::Graphics::OsgSphereRepresentation::m_sharedUnitSphere
std::shared_ptr< OsgUnitSphere > m_sharedUnitSphere
Shared unit sphere, so that the geometry can be instanced rather than having multiple copies...
Definition: OsgSphereRepresentation.h:61
RigidTransform.h
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
SharedInstance.h
SurgSim::Graphics::OsgSphereRepresentation::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgSphereRepresentation)
OsgRepresentation.h
SurgSim::Graphics::SphereRepresentation
Base graphics sphere representation class, which defines the basic interface for a sphere that can be...
Definition: SphereRepresentation.h:29
SurgSim::Graphics::OsgSphereRepresentation
OSG implementation of a graphics sphere representation.
Definition: OsgSphereRepresentation.h:42
SurgSim::Graphics::OsgSphereRepresentation::setRadius
virtual void setRadius(double radius)
Sets the radius of the sphere.
Definition: OsgSphereRepresentation.cpp:41
SurgSim::Graphics::OsgRepresentation
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55
SurgSim::Graphics::OsgSphereRepresentation::getSharedUnitSphere
static std::shared_ptr< OsgUnitSphere > getSharedUnitSphere()
Returns the shared unit sphere.
Definition: OsgSphereRepresentation.cpp:54