Gazebo Physics

API Reference

5.3.2
gz/physics/GetBoundingBox.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 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_PHYSICS_GETBOUNDINGBOX_HH_
19 #define GZ_PHYSICS_GETBOUNDINGBOX_HH_
20 
24 #include <gz/physics/Shape.hh>
25 
26 namespace ignition
27 {
28  namespace physics
29  {
31  using GetLinkBoundingBoxRequiredFeatures = FeatureList<
32  GetShapeBoundingBox,
33  GetShapeFromLink,
35 
40  class IGNITION_PHYSICS_VISIBLE GetLinkBoundingBox
41  : public virtual
42  FeatureWithRequirements<GetLinkBoundingBoxRequiredFeatures>
43  {
44  public: template <typename PolicyT, typename FeaturesT>
45  class Link
46  : public virtual GetShapeFromLink::Link<PolicyT, FeaturesT>
47  {
48  public: using AlignedBoxType =
49  typename FromPolicy<PolicyT>::template Use<AlignedBox>;
50 
60  public: AlignedBoxType GetAxisAlignedBoundingBox(
61  const FrameID &_referenceFrame = FrameID::World()) const;
62  };
63  };
64 
70 
74  class IGNITION_PHYSICS_VISIBLE GetModelBoundingBox
75  : public virtual
76  FeatureWithRequirements<GetModelBoundingBoxRequiredFeatures>
77  {
78  public: template <typename PolicyT, typename FeaturesT>
79  class Model
80  : public virtual GetLinkFromModel::Model<PolicyT, FeaturesT>
81  {
82  public: using AlignedBoxType =
83  typename FromPolicy<PolicyT>::template Use<AlignedBox>;
84 
94  public: AlignedBoxType GetAxisAlignedBoundingBox(
95  const FrameID &_referenceFrame = FrameID::World()) const;
96  };
97  };
98 
99  // see Shape.hh for GetShapeBoundingBox
100  }
101 }
102 
103 #include <gz/physics/detail/GetBoundingBox.hh>
104 
105 #endif
If your feature is known to require any other features, then you should have your feature class inher...
Definition: gz/physics/FeatureList.hh:118
typename FromPolicy< PolicyT >::template Use< AlignedBox > AlignedBoxType
Definition: gz/physics/GetBoundingBox.hh:83
This struct is used to conveniently convert from a policy to a geometric type. Example usage:
Definition: gz/physics/Geometry.hh:77
This feature retrieves the axis aligned bounding box for the shapes attached to this link in the requ...
Definition: gz/physics/GetBoundingBox.hh:40
FeatureList< GetShapeBoundingBox, GetShapeFromLink, LinkFrameSemantics > GetLinkBoundingBoxRequiredFeatures
Definition: gz/physics/GetBoundingBox.hh:34
This feature will apply frame semantics to Model objects.
Definition: gz/physics/FrameSemantics.hh:190
Container for specifying Frame IDs. We do not want to use a generic integer type for this,...
Definition: gz/physics/FrameID.hh:46
Use a FeatureList to aggregate a list of Features.
Definition: gz/physics/FeatureList.hh:61
This feature will apply frame semantics to Link objects.
Definition: gz/physics/FrameSemantics.hh:164
Definition: gz/physics/GetEntities.hh:274
This feature retrieves the axis aligned bounding box for the model in the requested frame....
Definition: gz/physics/GetBoundingBox.hh:74
AlignedBoxType GetAxisAlignedBoundingBox(const FrameID &_referenceFrame=FrameID::World()) const
Get the axis aligned bounding box for the model in the requested frame.
Definition: gz/physics/GetBoundingBox.hh:79
static const FrameID & World()
Get a reference to the world Frame.
This feature retrieves the link pointer from the model by specifying model index and link index/name.
Definition: gz/physics/GetEntities.hh:271