Ignition Math

API Reference

6.4.0
Sphere.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_SPHERE_HH_
18 #define IGNITION_MATH_SPHERE_HH_
19 
23 
24 namespace ignition
25 {
26  namespace math
27  {
28  // Foward declarations
29  class SpherePrivate;
30 
31  // Inline bracket to help doxygen filtering.
32  inline namespace IGNITION_MATH_VERSION_NAMESPACE {
33  //
40  template<typename Precision>
41  class Sphere
42  {
44  public: Sphere() = default;
45 
48  public: explicit Sphere(const Precision _radius);
49 
53  public: Sphere(const Precision _radius, const Material &_mat);
54 
56  public: ~Sphere() = default;
57 
60  public: Precision Radius() const;
61 
64  public: void SetRadius(const Precision _radius);
65 
68  public: const ignition::math::Material &Material() const;
69 
72  public: void SetMaterial(const ignition::math::Material &_mat);
73 
80  public: bool MassMatrix(MassMatrix3d &_massMat) const;
81 
84  public: bool operator==(const Sphere &_sphere) const;
85 
88  public: bool operator!=(const Sphere &_sphere) const;
89 
92  public: Precision Volume() const;
93 
102  public: Precision DensityFromMass(const Precision _mass) const;
103 
116  public: bool SetDensityFromMass(const Precision _mass);
117 
119  private: Precision radius = 0.0;
120 
122  private: ignition::math::Material material;
123  };
124 
128 
132 
136  }
137  }
138 }
139 #include "ignition/math/detail/Sphere.hh"
140 
141 #endif
Sphere< double > Sphered
Sphere with double precision.
Definition: Sphere.hh:131
A class for inertial information about a rigid body consisting of the scalar mass and a 3x3 symmetric...
Definition: MassMatrix3.hh:45
Contains information about a single material.
Definition: Material.hh:65
A representation of a sphere.
Definition: Sphere.hh:41
Sphere< float > Spheref
Sphere with float precision.
Definition: Sphere.hh:135
Sphere< int > Spherei
Sphere with integer precision.
Definition: Sphere.hh:127
Definition: Angle.hh:42