Gazebo Rendering

API Reference

6.6.3
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 ignition
36 {
37  namespace rendering
38  {
39  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
40  //
41  // forward declaration
42  class Ogre2MeshFactoryPrivate;
43  class Ogre2SubMeshStoreFactoryPrivate;
44 
46  class IGNITION_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 IGNITION_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
Ogre2ScenePtr scene
Pointer to the scene object.
Definition: gz/rendering/ogre2/Ogre2MeshFactory.hh:95
Definition: gz/rendering/ogre/OgreCamera.hh:27
STL class.
STL class.
Describes how a Mesh should be loaded.
Definition: gz/rendering/MeshDescriptor.hh:44
std::vector< std::string > names
A list of names associated with each ogre subitem / submesh.
Definition: gz/rendering/ogre2/Ogre2MeshFactory.hh:142
Ogre2.x implementation of a submesh store factory class.
Definition: gz/rendering/ogre2/Ogre2MeshFactory.hh:105
Ogre2.x implementation of the mesh factory class.
Definition: gz/rendering/ogre2/Ogre2MeshFactory.hh:46
Ogre2ScenePtr scene
Pointer to the scene object.
Definition: gz/rendering/ogre2/Ogre2MeshFactory.hh:136
std::vector< std::string > ogreMeshes
A list of ogre meshes created by this factory.
Definition: gz/rendering/ogre2/Ogre2MeshFactory.hh:92