Ignition Rendering

API Reference

5.1.0
Ogre2Mesh.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_OGRE2MESH_HH_
18 #define IGNITION_RENDERING_OGRE2_OGRE2MESH_HH_
19 
20 #include <map>
21 #include <memory>
22 #include <string>
23 #include <unordered_map>
24 #include <vector>
29 
30 namespace Ogre
31 {
32  class Item;
33  class SubItem;
34 }
35 
36 namespace ignition
37 {
38  namespace rendering
39  {
40  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
41  //
42  // forward declaration
43  class Ogre2MeshPrivate;
44 
46  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2Mesh :
47  public BaseMesh<Ogre2Geometry>
48  {
50  protected: Ogre2Mesh();
51 
53  public: virtual ~Ogre2Mesh();
54 
55  // Documentation inherited
56  public: virtual void Destroy() override;
57 
58  // Documentation inherited.
59  public: virtual bool HasSkeleton() const override;
60 
61  // Documentation inherited.
63  SkeletonLocalTransforms() const override;
64 
65  // Documentation inherited.
66  public: virtual void SetSkeletonLocalTransforms(
67  const std::map<std::string, math::Matrix4d> &_tfs) override;
68 
69  // Documentation inherited.
71  SkeletonWeights() const override;
72 
73  // Documentation inherited.
74  public: virtual void SetSkeletonWeights(
75  const std::unordered_map<std::string, float> &_weights) override;
76 
77  // Documentation inherited.
78  public: virtual void SetSkeletonAnimationEnabled(const std::string &_name,
79  bool _enabled, bool _loop = true, float _weight = 1.0) override;
80 
81  // Documentation inherited.
82  public: virtual bool SkeletonAnimationEnabled(const std::string &_name)
83  const override;
84 
85  // Documentation inherited.
86  public: virtual void UpdateSkeletonAnimation(
87  std::chrono::steady_clock::duration _time) override;
88 
89  // Documentation inherited
90  public: virtual Ogre::MovableObject *OgreObject() const override;
91 
93  protected: virtual SubMeshStorePtr SubMeshes() const override;
94 
97 
99  protected: Ogre::Item *ogreItem = nullptr;
100 
102  private: friend class Ogre2Scene;
103 
105  private: friend class Ogre2MeshFactory;
106 
108  private: std::unique_ptr<Ogre2MeshPrivate> dataPtr;
109  };
110 
112  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2SubMesh :
113  public BaseSubMesh<Ogre2Object>
114  {
116  protected: Ogre2SubMesh();
117 
119  public: virtual ~Ogre2SubMesh();
120 
122  public: virtual Ogre::SubItem *Ogre2SubItem() const;
123 
126  protected: virtual void SetMaterialImpl(MaterialPtr _material);
127 
129  protected: virtual void Init();
130 
132  protected: Ogre::SubItem *ogreSubItem = nullptr;
133 
135  private: friend class Ogre2Scene;
136 
139  private: friend class Ogre2SubMeshStoreFactory;
140  };
141  }
142  }
143 }
144 #endif
Definition: BaseMesh.hh:118
Ogre2.x implementation of the mesh class.
Definition: Ogre2Mesh.hh:46
Ogre2.x implementation of the scene class.
Definition: Ogre2Scene.hh:56
STL class.
STL class.
Ogre2.x implementation of the submesh class.
Definition: Ogre2Mesh.hh:112
Ogre2SubMeshStorePtr subMeshes
Store containing all the submeshes.
Definition: Ogre2Mesh.hh:96
Ogre2.x implementation of the mesh factory class.
Definition: Ogre2MeshFactory.hh:46
Definition: OgreObject.hh:32
Definition: BaseMesh.hh:36
Definition: OgreCamera.hh:27
Ogre2.x implementation of a submesh store factory class.
Definition: Ogre2MeshFactory.hh:102