Gazebo Rendering

API Reference

9.0.0
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"
28
29namespace gz
30{
31 namespace rendering
32 {
33 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
34 //
37 class GZ_RENDERING_VISIBLE Mesh :
38 public virtual Geometry
39 {
41 public: virtual ~Mesh();
42
45 public: virtual bool HasSkeleton() const = 0;
46
54
60 public: virtual void SetSkeletonLocalTransforms(
62
69 const = 0;
70
76 public: virtual void SetSkeletonWeights(
77 const std::unordered_map<std::string, float> &_weights) = 0;
78
84 public: virtual void SetSkeletonAnimationEnabled(const std::string &_name,
85 bool _enabled, bool _loop = true, float _weight = 1.0) = 0;
86
90 public: virtual bool SkeletonAnimationEnabled(const std::string &_name)
91 const = 0;
92
95 public: virtual void UpdateSkeletonAnimation(
96 std::chrono::steady_clock::duration _time) = 0;
97
100 public: virtual unsigned int SubMeshCount() const = 0;
101
105 public: virtual bool HasSubMesh(ConstSubMeshPtr _subMesh) const = 0;
106
110 public: virtual bool HasSubMeshName(const std::string &_name) const = 0;
111
115 public: virtual SubMeshPtr SubMeshByName(
116 const std::string &_name) const = 0;
117
121 public: virtual SubMeshPtr SubMeshByIndex(
122 unsigned int _index) const = 0;
123
126 public: virtual void SetDescriptor(const MeshDescriptor &_desc) = 0;
127
130 public: virtual const MeshDescriptor &Descriptor() const = 0;
131 };
132
135 class GZ_RENDERING_VISIBLE SubMesh :
136 public virtual Object
137 {
139 public: virtual ~SubMesh();
140
143 public: virtual MaterialPtr Material() const = 0;
144
150 public: virtual void SetMaterial(const std::string &_name,
151 bool _unique = true) = 0;
152
156 public: virtual void SetMaterial(MaterialPtr _material,
157 bool _unique = true) = 0;
158 };
159 }
160 }
161}
162#endif