Gazebo Math

API Reference

7.5.1
gz/math/Ellipsoid.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 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_MATH_ELLIPSOID_HH_
18 #define GZ_MATH_ELLIPSOID_HH_
19 
20 #include <optional>
21 #include "gz/math/MassMatrix3.hh"
22 #include "gz/math/Material.hh"
23 
24 namespace gz::math
25 {
26  // Inline bracket to help doxygen filtering.
27  inline namespace GZ_MATH_VERSION_NAMESPACE {
28  //
36  template<typename Precision>
37  class Ellipsoid
38  {
41  public: Ellipsoid() = default;
42 
45  public: explicit Ellipsoid(const Vector3<Precision> &_radii);
46 
50  public: Ellipsoid(const Vector3<Precision> &_radii,
51  const Material &_mat);
52 
55  public: Vector3<Precision> Radii() const;
56 
59  public: void SetRadii(const Vector3<Precision> &_radii);
60 
63  public: const Material &Mat() const;
64 
67  public: void SetMat(const Material &_mat);
68 
75  public: std::optional< MassMatrix3<Precision> > MassMatrix() const;
76 
79  public: bool operator==(const Ellipsoid &_ellipsoid) const;
80 
83  public: Precision Volume() const;
84 
93  public: Precision DensityFromMass(const Precision _mass) const;
94 
107  public: bool SetDensityFromMass(const Precision _mass);
108 
111 
113  private: Material material;
114  };
115 
119 
123 
127  } // namespace GZ_MATH_VERSION_NAMESPACE
128 } // namespace gz::math
129 #include "gz/math/detail/Ellipsoid.hh"
130 #endif // GZ_MATH_ELLIPSOID_HH_