Gazebo Msgs

API Reference

11.0.0~pre1
AxisAlignedBox.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 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_MSGS_CONVERT_AXISALIGNEDBOX_HH_
18#define GZ_MSGS_CONVERT_AXISALIGNEDBOX_HH_
19
20#include <gz/msgs/config.hh>
22
23// Message Headers
24#include "gz/msgs/axis_aligned_box.pb.h"
25
26// Data Headers
28
29namespace gz::msgs {
30// Inline bracket to help doxygen filtering.
31inline namespace GZ_MSGS_VERSION_NAMESPACE {
32
34inline void Set(gz::msgs::AxisAlignedBox *_msg,
35 const gz::math::AxisAlignedBox &_data)
36{
37 Set(_msg->mutable_min_corner(), _data.Min());
38 Set(_msg->mutable_max_corner(), _data.Max());
39}
40
41inline void Set(gz::math::AxisAlignedBox *_data,
42 const gz::msgs::AxisAlignedBox &_msg)
43{
44 Set(&_data->Min(), _msg.min_corner());
45 Set(&_data->Max(), _msg.max_corner());
46}
47
48inline gz::msgs::AxisAlignedBox Convert(const gz::math::AxisAlignedBox &_data)
49{
50 gz::msgs::AxisAlignedBox ret;
51 Set(&ret, _data);
52 return ret;
53}
54
55inline gz::math::AxisAlignedBox Convert(const gz::msgs::AxisAlignedBox &_msg)
56{
58 Set(&ret, _msg);
59 return ret;
60}
61} // namespce
62} // namespace gz::msgs
63
64#endif // GZ_MSGS_CONVERT_VECTOR3_HH_