Gazebo Rendering

API Reference

7.4.2
gz/rendering/ogre/OgreMesh.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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_OGRE_OGREMESH_HH_
18 #define GZ_RENDERING_OGRE_OGREMESH_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 Entity;
33  class SubEntity;
34 }
35 
36 namespace gz
37 {
38  namespace rendering
39  {
40  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
41  //
42  // forward declarations
43  class OgreMeshPrivate;
44 
45  class GZ_RENDERING_OGRE_VISIBLE OgreMesh :
46  public BaseMesh<OgreGeometry>
47  {
49 
50  protected: OgreMesh();
51 
52  public: virtual ~OgreMesh();
53 
54  // Documentation inherited.
55  public: virtual void Destroy() override;
56 
57  // Documentation inherited.
58  public: virtual bool HasSkeleton() const override;
59 
60  // Documentation inherited.
62  SkeletonLocalTransforms() const override;
63 
64  // Documentation inherited.
65  public: virtual void SetSkeletonLocalTransforms(
66  const std::map<std::string, math::Matrix4d> &_tfs) override;
67 
68  // Documentation inherited.
69  public: virtual std::unordered_map<std::string, float> SkeletonWeights()
70  const override;
71 
72  // Documentation inherited.
73  public: virtual void SetSkeletonWeights(
74  const std::unordered_map<std::string, float> &_weights) override;
75 
76  // Documentation inherited.
77  public: virtual void SetSkeletonAnimationEnabled(const std::string &_name,
78  bool _enabled, bool _loop = true, float _weight = 1.0) override;
79 
80  // Documentation inherited.
81  public: virtual bool SkeletonAnimationEnabled(const std::string &_name)
82  const override;
83 
84  // Documentation inherited.
85  public: virtual void UpdateSkeletonAnimation(
86  std::chrono::steady_clock::duration _time) override;
87 
88  public: virtual Ogre::MovableObject *OgreObject() const override;
89 
90  protected: virtual SubMeshStorePtr SubMeshes() const override;
91 
93 
94  protected: Ogre::Entity *ogreEntity = nullptr;
95 
96  private: friend class OgreScene;
97 
98  private: friend class OgreMeshFactory;
99 
101  private: std::unique_ptr<OgreMeshPrivate> dataPtr;
102  };
103 
104  class GZ_RENDERING_OGRE_VISIBLE OgreSubMesh :
105  public BaseSubMesh<OgreObject>
106  {
107  protected: OgreSubMesh();
108 
109  public: virtual ~OgreSubMesh();
110 
111  public: virtual Ogre::SubEntity *OgreSubEntity() const;
112 
113  public: virtual void Destroy() override;
114 
115  // Documentation inherited
116  protected: virtual void SetMaterialImpl(MaterialPtr _material) override;
117 
118  protected: virtual void Init() override;
119 
120  protected: Ogre::SubEntity *ogreSubEntity;
121 
122  private: friend class OgreScene;
123 
124  private: friend class OgreSubMeshStoreFactory;
125  };
126  }
127  }
128 }
129 #endif