Gazebo Math

API Reference

8.0.0
Box.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 GZ_MATH_BOX_HH_
18#define GZ_MATH_BOX_HH_
19
20#include <optional>
21#include <gz/math/config.hh>
23#include <gz/math/Material.hh>
24#include <gz/math/Plane.hh>
25#include <gz/math/Vector3.hh>
26
27#include "gz/math/detail/WellOrderedVector.hh"
28
29#include <set>
30
31namespace gz::math
32{
33 // Inline bracket to help doxygen filtering.
34 inline namespace GZ_MATH_VERSION_NAMESPACE {
37 template<typename T>
39
49 template<typename Precision>
50 class Box
51 {
53 public: Box() = default;
54
59 public: Box(const Precision _length,
60 const Precision _width,
61 const Precision _height);
62
68 public: Box(const Precision _length, const Precision _width,
69 const Precision _height,
71
79 public: explicit Box(const Vector3<Precision> &_size);
80
92
96
105
110 public: void SetSize(const Precision _length,
111 const Precision _width,
112 const Precision _height);
113
117 public: bool operator==(const Box<Precision> &_b) const;
118
122 public: bool operator!=(const Box<Precision> &_b) const;
123
126 public: const gz::math::Material &Material() const;
127
130 public: void SetMaterial(const gz::math::Material &_mat);
131
134 public: Precision Volume() const;
135
141
147 public: std::optional<Vector3<Precision>>
149
157
167
180 public: bool SetDensityFromMass(const Precision _mass);
181
190
197 public: std::optional< MassMatrix3<Precision> > MassMatrix() const;
198
205 const Plane<Precision> &_plane) const;
206
209
211 private: gz::math::Material material;
212 };
213
216 typedef Box<int> Boxi;
217
221
225 } // namespace GZ_MATH_VERSION_NAMESPACE
226} // namespace gz::math
227#include "gz/math/detail/Box.hh"
228#endif // GZ_MATH_BOX_HH_