Gazebo Rendering

API Reference

7.4.2
gz/rendering/ogre2/Ogre2MeshFactory.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Open Source Robotics Foundation
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  */
17 #ifndef GZ_RENDERING_OGRE2_OGRE2MESHFACTORY_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2MESHFACTORY_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include "gz/rendering/config.hh"
28 #include "gz/rendering/ogre2/Export.hh"
29 
30 namespace Ogre
31 {
32  class Item;
33 }
34 
35 namespace gz
36 {
37  namespace rendering
38  {
39  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
40  //
41  // forward declaration
42  class Ogre2MeshFactoryPrivate;
43  class Ogre2SubMeshStoreFactoryPrivate;
44 
46  class GZ_RENDERING_OGRE2_VISIBLE Ogre2MeshFactory
47  {
50  public: explicit Ogre2MeshFactory(Ogre2ScenePtr _scene);
51 
53  public: virtual ~Ogre2MeshFactory();
54 
58  public: virtual Ogre2MeshPtr Create(const MeshDescriptor &_desc);
59 
62  public: virtual void Clear();
63 
66  protected: virtual Ogre::Item *OgreItem(
67  const MeshDescriptor &_desc);
68 
71  protected: virtual bool Load(const MeshDescriptor &_desc);
72 
76  protected: virtual bool IsLoaded(const MeshDescriptor &_desc);
77 
80  protected: virtual bool LoadImpl(const MeshDescriptor &_desc);
81 
84  protected: virtual std::string MeshName(const MeshDescriptor &_desc);
85 
89  protected: virtual bool Validate(const MeshDescriptor &_desc);
90 
93 
95  protected: Ogre2ScenePtr scene;
96 
98  public: void ClearMaterialsCache(const std::string &_name);
99 
102  };
103 
105  class GZ_RENDERING_OGRE2_VISIBLE Ogre2SubMeshStoreFactory
106  {
111  Ogre::Item *_item);
112 
114  public: virtual ~Ogre2SubMeshStoreFactory();
115 
118  public: virtual Ogre2SubMeshStorePtr Create();
119 
123  protected: virtual Ogre2SubMeshPtr CreateSubMesh(unsigned int _index);
124 
126  protected: virtual void CreateNameList();
127 
129  protected: virtual void PopulateDefaultNames();
130 
133  protected: virtual void PopulateGivenNames();
134 
136  protected: Ogre2ScenePtr scene;
137 
139  protected: Ogre::Item *ogreItem = nullptr;
140 
143 
146  };
147  }
148  }
149 }
150 #endif