OsgSceneryRepresentation.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_OSGSCENERYREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_OSGSCENERYREPRESENTATION_H
18 
21 
22 #include <osg/Node>
23 
24 #if defined(_MSC_VER)
25 #pragma warning(push)
26 #pragma warning(disable:4250)
27 #endif
28 
29 namespace SurgSim
30 {
31 namespace Graphics
32 {
33 SURGSIM_STATIC_REGISTRATION(OsgSceneryRepresentation);
34 
37 {
38 public:
40 
43  explicit OsgSceneryRepresentation(const std::string& name);
44 
46 
49  std::string getFileName() const override;
52  void setFileName(const std::string& fileName) override;
53 
54 
55 private:
56  virtual bool doInitialize() override;
57 
59  osg::ref_ptr<osg::Node> m_sceneryRepresentation;
60 
63 };
64 
65 }; // namespace Graphics
66 
67 }; // namespace SurgSim
68 
69 #if defined(_MSC_VER)
70 #pragma warning(pop)
71 #endif
72 
73 #endif // SURGSIM_GRAPHICS_OSGSCENERYREPRESENTATION_H
Definition: DriveElementFromInputBehavior.cpp:27
OsgSceneryRepresentation(const std::string &name)
Constructor.
Definition: OsgSceneryRepresentation.cpp:30
SURGSIM_STATIC_REGISTRATION(OsgBoxRepresentation)
std::string m_fileName
Name of the object file to be loaded.
Definition: OsgSceneryRepresentation.h:62
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgSceneryRepresentation)
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
Base class defining the interface for a Graphics Scenery Object.
Definition: SceneryRepresentation.h:30
osg::ref_ptr< osg::Node > m_sceneryRepresentation
A osg::Node to hold the objet loaded from file.
Definition: OsgSceneryRepresentation.h:59
void setFileName(const std::string &fileName) override
Set file name of the object to be loaded.
Definition: OsgSceneryRepresentation.cpp:60
friend class OsgSceneryRepresentationTest
Definition: OsgSceneryRepresentation.h:39
A OsgSceneryRepresentation is used to load osg object/node from file.
Definition: OsgSceneryRepresentation.h:36
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:42
std::string getFileName() const override
Return file name of the object.
Definition: OsgSceneryRepresentation.cpp:55
virtual bool doInitialize() override
Interface to be implemented by derived classes.
Definition: OsgSceneryRepresentation.cpp:39