Ignition Math

API Reference

6.8.0
Material.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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_MATH_MATERIAL_HH_
18 #define IGNITION_MATH_MATERIAL_HH_
19 
20 #include <limits>
21 #include <map>
22 #include <string>
23 #include <ignition/math/Export.hh>
24 #include <ignition/math/config.hh>
26 
27 namespace ignition
28 {
29  namespace math
30  {
31  // Inline bracket to help doxygen filtering.
32  inline namespace IGNITION_MATH_VERSION_NAMESPACE {
33  // Forward declarations
34  class MaterialPrivate;
35 
65  class IGNITION_MATH_VISIBLE Material
66  {
68  public: Material();
69 
72  public: explicit Material(const MaterialType _type);
73 
77  public: explicit Material(const std::string &_typename);
78 
81  public: explicit Material(const double _density);
82 
85  public: Material(const Material &_material);
86 
90  public: Material(Material &&_material);
91 
93  public: ~Material();
94 
98  public: static const std::map<MaterialType, Material> &Predefined();
99 
106  public: void SetToNearestDensity(
107  const double _value,
108  const double _epsilon = std::numeric_limits<double>::max());
109 
113  public: Material &operator=(const Material &_material);
114 
119  public: Material &operator=(Material &&_material);
120 
124  public: bool operator==(const Material &_material) const;
125 
129  public: bool operator!=(const Material &_material) const;
130 
133  public: MaterialType Type() const;
134 
138  public: void SetType(const MaterialType _type);
139 
145  public: std::string Name() const;
146 
150  public: void SetName(const std::string &_name);
151 
154  public: double Density() const;
155 
158  public: void SetDensity(const double _density);
159 
161  private: MaterialPrivate *dataPtr = nullptr;
162  };
163  }
164  }
165 }
166 #endif
STL class.
Contains information about a single material.
Definition: Material.hh:65
STL class.
MaterialType
This enum lists the supported material types. A value can be used to create a Material instance...
Definition: MaterialType.hh:37
Definition: Angle.hh:42