OsgSphereRepresentation.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_GRAPHICS_OSGSPHEREREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_OSGSPHEREREPRESENTATION_H
18 
21 
24 
25 #include <osg/PositionAttitudeTransform>
26 #include <osg/Switch>
27 
28 #if defined(_MSC_VER)
29 #pragma warning(push)
30 #pragma warning(disable:4250)
31 #endif
32 
33 namespace SurgSim
34 {
35 namespace Graphics
36 {
37 class OsgUnitSphere;
38 
39 SURGSIM_STATIC_REGISTRATION(OsgSphereRepresentation);
40 
43 {
44 public:
47  explicit OsgSphereRepresentation(const std::string& name);
48 
50 
53  virtual void setRadius(double radius);
54 
57  virtual double getRadius() const;
58 
59 private:
61  std::shared_ptr<OsgUnitSphere> m_sharedUnitSphere;
62 
64  static std::shared_ptr<OsgUnitSphere> getSharedUnitSphere();
65 };
66 
67 }; // namespace Graphics
68 
69 }; // namespace SurgSim
70 
71 #if defined(_MSC_VER)
72 #pragma warning(pop)
73 #endif
74 
75 #endif // SURGSIM_GRAPHICS_OSGSPHEREREPRESENTATION_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
SphereRepresentation.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::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgSphereRepresentation)
SurgSim
Definition: CompoundShapeToGraphics.cpp: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::OsgSphereRepresentation::getSharedUnitSphere
static std::shared_ptr< OsgUnitSphere > getSharedUnitSphere()
Returns the shared unit sphere.
Definition: OsgSphereRepresentation.cpp:54
RigidTransform.h
SurgSim::Graphics::OsgSphereRepresentation::OsgSphereRepresentation
OsgSphereRepresentation(const std::string &name)
Constructor.
Definition: OsgSphereRepresentation.cpp:32
SharedInstance.h
OsgRepresentation.h
SurgSim::Graphics::OsgRepresentation
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55