Gazebo Physics

API Reference

5.3.2
gz/physics/sdf/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 
25 namespace ignition {
26 namespace physics {
27 namespace sdf {
28 
32 class 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 
59 template <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 
69 template <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
ModelPtr< PolicyT, FeaturesT > ModelPtrType
Definition: gz/physics/sdf/ConstructNestedModel.hh:45
Definition: gz/physics/sdf/ConstructNestedModel.hh:43
ModelPtr< PolicyT, FeaturesT > ModelPtrType
Definition: gz/physics/sdf/ConstructNestedModel.hh:37
ModelPtrType ConstructNestedModel(const ::sdf::Model &_model)
Definition: gz/physics/sdf/ConstructNestedModel.hh:60
Definition: gz/physics/Feature.hh:92
This class defines the concept of a Feature. It should be inherited by classes that define some plugi...
Definition: gz/physics/Feature.hh:35
ModelPtrType ConstructNestedModel(const ::sdf::Model &_model)
Definition: gz/physics/sdf/ConstructNestedModel.hh:70
Placeholder class in case a Feature does not define its own Model API.
Definition: gz/physics/Feature.hh:58
Placeholder class in case a Feature does not define its own World API.
Definition: gz/physics/Feature.hh:49
Construct nested models. Note this is a partial implementation and the behavior may change once the m...
Definition: gz/physics/sdf/ConstructNestedModel.hh:32
virtual Identity ConstructSdfNestedModel(const Identity &_modelId, const ::sdf::Model &_model)=0
Definition: gz/physics/sdf/ConstructNestedModel.hh:51
Definition: gz/physics/sdf/ConstructNestedModel.hh:35