Gazebo Msgs

API Reference

10.3.1
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 
21 
22 // Message Headers
23 #include "gz/msgs/axis_aligned_box.pb.h"
24 
25 // Data Headers
26 #include <gz/math/AxisAlignedBox.hh>
27 
28 namespace gz::msgs {
29 // Inline bracket to help doxygen filtering.
30 inline namespace GZ_MSGS_VERSION_NAMESPACE {
31 
33 inline void Set(gz::msgs::AxisAlignedBox *_msg,
34  const gz::math::AxisAlignedBox &_data)
35 {
36  Set(_msg->mutable_min_corner(), _data.Min());
37  Set(_msg->mutable_max_corner(), _data.Max());
38 }
39 
40 inline void Set(gz::math::AxisAlignedBox *_data,
41  const gz::msgs::AxisAlignedBox &_msg)
42 {
43  Set(&_data->Min(), _msg.min_corner());
44  Set(&_data->Max(), _msg.max_corner());
45 }
46 
47 inline gz::msgs::AxisAlignedBox Convert(const gz::math::AxisAlignedBox &_data)
48 {
49  gz::msgs::AxisAlignedBox ret;
50  Set(&ret, _data);
51  return ret;
52 }
53 
54 inline gz::math::AxisAlignedBox Convert(const gz::msgs::AxisAlignedBox &_msg)
55 {
57  Set(&ret, _msg);
58  return ret;
59 }
60 } // namespce
61 } // namespace gz::msgs
62 
63 #endif // GZ_MSGS_CONVERT_VECTOR3_HH_