RaycastData.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 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 
18 #ifndef GZ_SIM_COMPONENTS_RAYCASTDATA_HH_
19 #define GZ_SIM_COMPONENTS_RAYCASTDATA_HH_
20 
21 #include <gz/math/Vector3.hh>
25 #include <gz/sim/config.hh>
26 
27 #include <istream>
28 #include <ostream>
29 #include <vector>
30 
31 namespace gz
32 {
33 namespace sim
34 {
35 // Inline bracket to help doxygen filtering.
36 inline namespace GZ_SIM_VERSION_NAMESPACE {
37 namespace components
38 {
40 struct RayInfo
41 {
44 
47 };
48 
51 {
54 
56  double fraction;
57 
60 };
61 
64 {
67 
70 };
71 }
72 
73 namespace serializers
74 {
76  template<> class DefaultSerializer<components::RaycastDataInfo>
77  {
78  public: static std::ostream &Serialize(
80  {
81  return _out;
82  }
83 
84  public: static std::istream &Deserialize(
86  {
87  return _in;
88  }
89  };
90 }
91 
92 namespace components
93 {
100 using RaycastData = Component<RaycastDataInfo, class RaycastDataTag,
101  serializers::DefaultSerializer<RaycastDataInfo>>;
102 
103 GZ_SIM_REGISTER_COMPONENT("gz_sim_components.RaycastData", RaycastData)
104 }
105 }
106 }
107 }
108 #endif // GZ_SIM_COMPONENTS_RAYCASTDATA_HH_