OsgModel.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_OSGMODEL_H
17 #define SURGSIM_GRAPHICS_OSGMODEL_H
18 
19 
21 #include "SurgSim/Graphics/Model.h"
22 #include <osg/ref_ptr>
23 
24 namespace osg
25 {
26 class Node;
27 }
28 
29 namespace SurgSim
30 {
31 namespace Graphics
32 {
33 
36 class OsgModel : public Model
37 {
38 public:
39 
41  OsgModel();
42 
43  virtual ~OsgModel();
44 
46 
48  osg::ref_ptr<osg::Node> getOsgNode();
49 
50 private:
51 
52  bool doLoad(const std::string& filePath) override;
53 
54  osg::ref_ptr<osg::Node> m_root;
55 };
56 
57 }
58 }
59 
60 #endif
SurgSim::Graphics::OsgModel::doLoad
bool doLoad(const std::string &filePath) override
Derived classes will overwrite this method to do actual loading.
Definition: OsgModel.cpp:43
SurgSim::Graphics::OsgModel
Osg implementation of the Model class, inheriting from Asset, this class knows how to load models tha...
Definition: OsgModel.h:36
Model.h
Macros.h
osg
Definition: OculusView.h:25
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::OsgModel::getOsgNode
osg::ref_ptr< osg::Node > getOsgNode()
Definition: OsgModel.cpp:38
SurgSim::Graphics::OsgModel::~OsgModel
virtual ~OsgModel()
Definition: OsgModel.cpp:33
SurgSim::Graphics::Model
Definition: Model.h:27
SurgSim::Graphics::OsgModel::m_root
osg::ref_ptr< osg::Node > m_root
Definition: OsgModel.h:54
SurgSim::Graphics::OsgModel::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Graphics::OsgModel)
SurgSim::Graphics::OsgModel::OsgModel
OsgModel()
Constructor.
Definition: OsgModel.cpp:29