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
30namespace Ogre
31{
32 class Item;
33}
34
35namespace 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
99 public: void ClearMaterialsCache(const std::string &_name);
100
103 };
104
106 class GZ_RENDERING_OGRE2_VISIBLE Ogre2SubMeshStoreFactory
107 {
112 Ogre::Item *_item);
113
115 public: virtual ~Ogre2SubMeshStoreFactory();
116
119 public: virtual Ogre2SubMeshStorePtr Create();
120
124 protected: virtual Ogre2SubMeshPtr CreateSubMesh(unsigned int _index);
125
127 protected: virtual void CreateNameList();
128
130 protected: virtual void PopulateDefaultNames();
131
134 protected: virtual void PopulateGivenNames();
135
138
140 protected: Ogre::Item *ogreItem = nullptr;
141
144
147 };
148 }
149 }
150}
151#endif