Ignition Physics

API Reference

2.3.0
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 IGNITION_PHYSICS_GETBOUNDINGBOX_HH_
19 #define IGNITION_PHYSICS_GETBOUNDINGBOX_HH_
20 
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 <ignition/physics/detail/GetBoundingBox.hh>
104 
105 #endif
This feature retrieves the axis aligned bounding box for the shapes attached to this link in the requ...
Definition: GetBoundingBox.hh:40
If your feature is known to require any other features, then you should have your feature class inher...
Definition: FeatureList.hh:108
static const FrameID & World()
Get a reference to the world Frame.
This struct is used to conveniently convert from a policy to a geometric type. Example usage: ...
Definition: Geometry.hh:69
Definition: GetEntities.hh:222
This feature will apply frame semantics to Model objects.
Definition: FrameSemantics.hh:190
Definition: GetBoundingBox.hh:79
typename FromPolicy< PolicyT >::template Use< AlignedBox > AlignedBoxType
Definition: GetBoundingBox.hh:83
This feature retrieves the link pointer from the model by specifying model index and link index/name...
Definition: GetEntities.hh:219
FeatureList< GetShapeBoundingBox, GetShapeFromLink, LinkFrameSemantics > GetLinkBoundingBoxRequiredFeatures
Definition: GetBoundingBox.hh:34
Use a FeatureList to aggregate a list of Features.
Definition: FeatureList.hh:51
This feature retrieves the axis aligned bounding box for the model in the requested frame...
Definition: GetBoundingBox.hh:74
Container for specifying Frame IDs. We do not want to use a generic integer type for this...
Definition: FrameID.hh:46
This feature will apply frame semantics to Link objects.
Definition: FrameSemantics.hh:164