Ignition Rendering

API Reference

5.1.0
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 IGNITION_RENDERING_OGRE2_OGRE2MESHFACTORY_HH_
18 #define IGNITION_RENDERING_OGRE2_OGRE2MESHFACTORY_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 #include "ignition/rendering/config.hh"
28 #include "ignition/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 
99  };
100 
102  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2SubMeshStoreFactory
103  {
108  Ogre::Item *_item);
109 
111  public: virtual ~Ogre2SubMeshStoreFactory();
112 
115  public: virtual Ogre2SubMeshStorePtr Create();
116 
120  protected: virtual Ogre2SubMeshPtr CreateSubMesh(unsigned int _index);
121 
123  protected: virtual void CreateNameList();
124 
126  protected: virtual void PopulateDefaultNames();
127 
130  protected: virtual void PopulateGivenNames();
131 
133  protected: Ogre2ScenePtr scene;
134 
136  protected: Ogre::Item *ogreItem = nullptr;
137 
140 
143  };
144  }
145  }
146 }
147 #endif
Ogre2ScenePtr scene
Pointer to the scene object.
Definition: Ogre2MeshFactory.hh:133
Describes how a Mesh should be loaded.
Definition: MeshDescriptor.hh:44
STL class.
Ogre2.x implementation of the mesh factory class.
Definition: Ogre2MeshFactory.hh:46
std::vector< std::string > names
A list of names associated with each ogre subitem / submesh.
Definition: Ogre2MeshFactory.hh:139
Definition: OgreCamera.hh:27
std::vector< std::string > ogreMeshes
A list of ogre meshes created by this factory.
Definition: Ogre2MeshFactory.hh:92
Ogre2ScenePtr scene
Pointer to the scene object.
Definition: Ogre2MeshFactory.hh:95
Ogre2.x implementation of a submesh store factory class.
Definition: Ogre2MeshFactory.hh:102