Gazebo Rendering

API Reference

6.6.3
gz/rendering/Mesh.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_MESH_HH_
18 #define GZ_RENDERING_MESH_HH_
19 
20 #include <map>
21 #include <string>
22 #include <unordered_map>
23 #include <gz/math/Matrix4.hh>
24 #include "gz/rendering/config.hh"
25 #include "gz/rendering/Geometry.hh"
27 #include "gz/rendering/Object.hh"
28 
29 namespace ignition
30 {
31  namespace rendering
32  {
33  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
34  //
37  class IGNITION_RENDERING_VISIBLE Mesh :
38  public virtual Geometry
39  {
41  public: virtual ~Mesh() { }
42 
45  public: virtual bool HasSkeleton() const = 0;
46 
53  SkeletonLocalTransforms() const = 0;
54 
61  public: virtual void SetSkeletonLocalTransforms(
63 
69  public: virtual std::unordered_map<std::string, float> SkeletonWeights()
70  const = 0;
71 
77  public: virtual void SetSkeletonWeights(
78  const std::unordered_map<std::string, float> &_weights) = 0;
79 
85  public: virtual void SetSkeletonAnimationEnabled(const std::string &_name,
86  bool _enabled, bool _loop = true, float _weight = 1.0) = 0;
87 
91  public: virtual bool SkeletonAnimationEnabled(const std::string &_name)
92  const = 0;
93 
96  public: virtual void UpdateSkeletonAnimation(
97  std::chrono::steady_clock::duration _time) = 0;
98 
101  public: virtual unsigned int SubMeshCount() const = 0;
102 
106  public: virtual bool HasSubMesh(ConstSubMeshPtr _subMesh) const = 0;
107 
111  public: virtual bool HasSubMeshName(const std::string &_name) const = 0;
112 
116  public: virtual SubMeshPtr SubMeshByName(
117  const std::string &_name) const = 0;
118 
122  public: virtual SubMeshPtr SubMeshByIndex(
123  unsigned int _index) const = 0;
124 
127  public: virtual void SetDescriptor(const MeshDescriptor &_desc) = 0;
128 
131  public: virtual const MeshDescriptor &Descriptor() const = 0;
132  };
133 
136  class IGNITION_RENDERING_VISIBLE SubMesh :
137  public virtual Object
138  {
140  public: virtual ~SubMesh() { }
141 
144  public: virtual MaterialPtr Material() const = 0;
145 
151  public: virtual void SetMaterial(const std::string &_name,
152  bool _unique = true) = 0;
153 
157  public: virtual void SetMaterial(MaterialPtr _material,
158  bool _unique = true) = 0;
159  };
160  }
161  }
162 }
163 #endif
STL class.
STL class.
virtual std::map< std::string, math::Matrix4d > SkeletonLocalTransforms() const =0
Get the skeleton local transforms.
Describes how a Mesh should be loaded.
Definition: gz/rendering/MeshDescriptor.hh:44
virtual const MeshDescriptor & Descriptor() const =0
Get the mesh's mesh descriptor.
virtual bool HasSkeleton() const =0
Check whether the mesh has skeleton.
virtual void SetDescriptor(const MeshDescriptor &_desc)=0
Set the mesh's mesh descriptor.
virtual ~SubMesh()
Deconstructor.
Definition: gz/rendering/Mesh.hh:140
virtual ~Mesh()
Destructor.
Definition: gz/rendering/Mesh.hh:41
virtual bool HasSubMeshName(const std::string &_name) const =0
Determine if has sub-mesh with given name.
virtual SubMeshPtr SubMeshByIndex(unsigned int _index) const =0
Get sub-mesh at given index.
Represents a collection of mesh geometries.
Definition: gz/rendering/Mesh.hh:37
virtual void SetSkeletonLocalTransforms(const std::map< std::string, math::Matrix4d > &_tfs)=0
Set transforms for the skeleton.
virtual std::unordered_map< std::string, float > SkeletonWeights() const =0
Get skeleton node weight.
virtual SubMeshPtr SubMeshByName(const std::string &_name) const =0
Get sub-mesh with given name.
Represents a single mesh geometry.
Definition: gz/rendering/Mesh.hh:136
virtual unsigned int SubMeshCount() const =0
Get the sub-mesh count.
STL class.
virtual bool HasSubMesh(ConstSubMeshPtr _subMesh) const =0
Determine if has given sub-mesh.
virtual void SetSkeletonAnimationEnabled(const std::string &_name, bool _enabled, bool _loop=true, float _weight=1.0)=0
Set whether a skeleton animation should be enabled or not.
virtual void SetMaterial(const std::string &_name, bool _unique=true)=0
Set the materials of this SubMesh. The specified material will be retrieved from the parent Scene....
Represents an object present in the scene graph. This includes sub-meshes, materials,...
Definition: gz/rendering/Object.hh:34
virtual bool SkeletonAnimationEnabled(const std::string &_name) const =0
Get whether a skeleton animation is enabled or not.
Represents a surface material of a Geometry.
Definition: gz/rendering/Material.hh:47
virtual void UpdateSkeletonAnimation(std::chrono::steady_clock::duration _time)=0
Play the active skeleton animation to the specified time.
Represents a geometric shape to be rendered.
Definition: gz/rendering/Geometry.hh:34
virtual MaterialPtr Material() const =0
Get the currently assigned material.
virtual void SetSkeletonWeights(const std::unordered_map< std::string, float > &_weights)=0
Set skeleton node weight.