Gazebo Rendering

API Reference

3.7.2
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 <gz/math/Matrix4.hh>
23 #include "gz/rendering/config.hh"
24 #include "gz/rendering/Geometry.hh"
25 #include "gz/rendering/Object.hh"
26 
27 namespace ignition
28 {
29  namespace rendering
30  {
31  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
32  //
35  class IGNITION_RENDERING_VISIBLE Mesh :
36  public virtual Geometry
37  {
39  public: virtual ~Mesh() { }
40 
43  public: virtual bool HasSkeleton() const = 0;
44 
51  SkeletonLocalTransforms() const = 0;
52 
59  public: virtual void SetSkeletonLocalTransforms(
61 
64  public: virtual unsigned int SubMeshCount() const = 0;
65 
69  public: virtual bool HasSubMesh(ConstSubMeshPtr _subMesh) const = 0;
70 
74  public: virtual bool HasSubMeshName(const std::string &_name) const = 0;
75 
79  public: virtual SubMeshPtr SubMeshByName(
80  const std::string &_name) const = 0;
81 
85  public: virtual SubMeshPtr SubMeshByIndex(
86  unsigned int _index) const = 0;
87  };
88 
91  class IGNITION_RENDERING_VISIBLE SubMesh :
92  public virtual Object
93  {
95  public: virtual ~SubMesh() { }
96 
99  public: virtual MaterialPtr Material() const = 0;
100 
106  public: virtual void SetMaterial(const std::string &_name,
107  bool _unique = true) = 0;
108 
112  public: virtual void SetMaterial(MaterialPtr _material,
113  bool _unique = true) = 0;
114  };
115  }
116  }
117 }
118 #endif
STL class.
STL class.
virtual std::map< std::string, math::Matrix4d > SkeletonLocalTransforms() const =0
Get the skeleton local transforms.
virtual bool HasSkeleton() const =0
Check whether the mesh has skeleton.
virtual ~SubMesh()
Deconstructor.
Definition: gz/rendering/Mesh.hh:95
virtual ~Mesh()
Destructor.
Definition: gz/rendering/Mesh.hh:39
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:35
virtual void SetSkeletonLocalTransforms(const std::map< std::string, math::Matrix4d > &_tfs)=0
Set transforms for the skeleton.
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:91
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 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
Represents a surface material of a Geometry.
Definition: gz/rendering/Material.hh:47
Represents a geometric shape to be rendered.
Definition: gz/rendering/Geometry.hh:34
virtual MaterialPtr Material() const =0
Get the currently assigned material.