opensurgsim
OsgSceneryRepresentation.h
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 
19 #include "SurgSim/Graphics/OsgRepresentation.h"
20 #include "SurgSim/Graphics/SceneryRepresentation.h"
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 Framework
32 {
33 class Asset;
34 }
35 namespace Graphics
36 {
37 class Model;
38 
39 SURGSIM_STATIC_REGISTRATION(OsgSceneryRepresentation);
40 
43 {
44 public:
45  friend class OsgSceneryRepresentationTest;
46 
49  explicit OsgSceneryRepresentation(const std::string& name);
50 
52 
53  void loadModel(const std::string& fileName) override;
54 
55  void setModel(std::shared_ptr<SurgSim::Framework::Asset> model) override;
56 
57  std::shared_ptr<Model> getModel() const override;
58 
60  osg::ref_ptr<osg::Node> getModelNode() const;
61 
62  void setGenerateTangents(bool value) override;
63 
64 private:
65  bool doInitialize() override;
67  osg::ref_ptr<osg::Node> m_osgNode;
68 
69  std::shared_ptr<Model> m_model;
70 
72  std::string m_fileName;
73 };
74 
75 }; // namespace Graphics
76 
77 }; // namespace SurgSim
78 
79 #if defined(_MSC_VER)
80 #pragma warning(pop)
81 #endif
82 
83 #endif // SURGSIM_GRAPHICS_OSGSCENERYREPRESENTATION_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Model
The models of LabJack devices. Numbers come from LabJackUD.h.
Definition: LabJackDevice.h:117
Base class defining the interface for a Graphics Scenery Object.
Definition: SceneryRepresentation.h:36
A OsgSceneryRepresentation is used to load osg object/node from file.
Definition: OsgSceneryRepresentation.h:42
Definition: OsgSceneryRepresentationTests.cpp:39
Base OSG implementation of a graphics representation.
Definition: OsgRepresentation.h:55