Ignition Rendering

API Reference

6.3.1
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 IGNITION_RENDERING_MESH_HH_
18 #define IGNITION_RENDERING_MESH_HH_
19 
20 #include <map>
21 #include <string>
22 #include <unordered_map>
23 #include <ignition/math/Matrix4.hh>
24 #include "ignition/rendering/config.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 
60  public: virtual void SetSkeletonLocalTransforms(
62 
68  public: virtual std::unordered_map<std::string, float> SkeletonWeights()
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 IGNITION_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
virtual ~SubMesh()
Destructor.
Definition: Mesh.hh:139
Describes how a Mesh should be loaded.
Definition: MeshDescriptor.hh:44
virtual ~Mesh()
Destructor.
Definition: Mesh.hh:41
STL class.
STL class.
Represents a collection of mesh geometries.
Definition: Mesh.hh:37
Represents a geometric shape to be rendered.
Definition: Geometry.hh:35
Represents a surface material of a Geometry.
Definition: Material.hh:47
Represents an object present in the scene graph. This includes sub-meshes, materials, render targets, as well as posable nodes.
Definition: Object.hh:34
Represents a single mesh geometry.
Definition: Mesh.hh:135