Ignition Math

API Reference

6.10.0
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 IGNITION_MATH_ELLIPSOID_HH_
18 #define IGNITION_MATH_ELLIPSOID_HH_
19 
20 #include <optional>
23 
24 namespace ignition
25 {
26  namespace math
27  {
28  // Inline bracket to help doxygen filtering.
29  inline namespace IGNITION_MATH_VERSION_NAMESPACE {
30  //
38  template<typename Precision>
39  class Ellipsoid
40  {
43  public: Ellipsoid() = default;
44 
47  public: explicit Ellipsoid(const Vector3<Precision> &_radii);
48 
52  public: Ellipsoid(const Vector3<Precision> &_radii,
53  const Material &_mat);
54 
57  public: Vector3<Precision> Radii() const;
58 
61  public: void SetRadii(const Vector3<Precision> &_radii);
62 
65  public: const Material &Mat() const;
66 
69  public: void SetMat(const Material &_mat);
70 
77  public: std::optional< MassMatrix3<Precision> > MassMatrix() const;
78 
81  public: bool operator==(const Ellipsoid &_ellipsoid) const;
82 
85  public: Precision Volume() const;
86 
95  public: Precision DensityFromMass(const Precision _mass) const;
96 
109  public: bool SetDensityFromMass(const Precision _mass);
110 
113 
115  private: Material material;
116  };
117 
121 
125 
129  }
130  }
131 }
132 #include "ignition/math/detail/Ellipsoid.hh"
133 
134 #endif
Contains information about a single material.
Definition: Material.hh:65
A representation of a general ellipsoid.
Definition: Ellipsoid.hh:39
Ellipsoid< float > Ellipsoidf
Ellipsoid with float precision.
Definition: Ellipsoid.hh:128
Ellipsoid< int > Ellipsoidi
Ellipsoid with integer precision.
Definition: Ellipsoid.hh:120
Ellipsoid< double > Ellipsoidd
Ellipsoid with double precision.
Definition: Ellipsoid.hh:124
Definition: Angle.hh:42