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
Definition: DriveElementFromInputBehavior.cpp:27
SURGSIM_STATIC_REGISTRATION(OsgBoxRepresentation)
OsgSphereRepresentation(const std::string &name)
Constructor.
Definition: OsgSphereRepresentation.cpp:32
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
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
virtual double getRadius() const
Returns the radius of the sphere.
Definition: OsgSphereRepresentation.cpp:46
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgSphereRepresentation)
Base graphics sphere representation class, which defines the basic interface for a sphere that can be...
Definition: SphereRepresentation.h:29
OSG implementation of a graphics sphere representation.
Definition: OsgSphereRepresentation.h:42
virtual void setRadius(double radius)
Sets the radius of the sphere.
Definition: OsgSphereRepresentation.cpp:41
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:42
static std::shared_ptr< OsgUnitSphere > getSharedUnitSphere()
Returns the shared unit sphere.
Definition: OsgSphereRepresentation.cpp:54