Gazebo Physics

API Reference

8.0.0
ConstructNestedModel.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_SDF_CONSTRUCTNESTEDMODEL_HH_
19#define GZ_PHYSICS_SDF_CONSTRUCTNESTEDMODEL_HH_
20
21#include <sdf/Model.hh>
22
24
25namespace gz {
26namespace physics {
27namespace sdf {
28
32class ConstructSdfNestedModel : public virtual Feature
33{
34 public: template <typename PolicyT, typename FeaturesT>
35 class Model: public virtual Feature::Model<PolicyT, FeaturesT>
36 {
37 public: using ModelPtrType = ModelPtr<PolicyT, FeaturesT>;
38
39 public: ModelPtrType ConstructNestedModel(const ::sdf::Model &_model);
40 };
41
42 public: template <typename PolicyT, typename FeaturesT>
43 class World: public virtual Feature::World<PolicyT, FeaturesT>
44 {
45 public: using ModelPtrType = ModelPtr<PolicyT, FeaturesT>;
46
47 public: ModelPtrType ConstructNestedModel(const ::sdf::Model &_model);
48 };
49
50 public: template <typename PolicyT>
51 class Implementation : public virtual Feature::Implementation<PolicyT>
52 {
53 public: virtual Identity ConstructSdfNestedModel(
54 const Identity &_modelId, const ::sdf::Model &_model) = 0;
55 };
56};
57
59template <typename PolicyT, typename FeaturesT>
61 const ::sdf::Model &_model) -> ModelPtrType
62{
63 return ModelPtrType(this->pimpl,
64 this->template Interface<ConstructSdfNestedModel>()
65 ->ConstructSdfNestedModel(this->identity, _model));
66}
67
69template <typename PolicyT, typename FeaturesT>
71 const ::sdf::Model &_model) -> ModelPtrType
72{
73 return ModelPtrType(this->pimpl,
74 this->template Interface<ConstructSdfNestedModel>()
75 ->ConstructSdfNestedModel(this->identity, _model));
76}
77}
78}
79}
80
81#endif