Ignition Physics

API Reference

2.3.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 IGNITION_PHYSICS_SDF_CONSTRUCTNESTEDMODEL_HH_
19 #define IGNITION_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
Construct nested models. Note this is a partial implementation and the behavior may change once the m...
Definition: ConstructNestedModel.hh:32
ModelPtrType ConstructNestedModel(const ::sdf::Model &_model)
Definition: ConstructNestedModel.hh:60
ModelPtr< PolicyT, FeaturesT > ModelPtrType
Definition: ConstructNestedModel.hh:45
This class defines the concept of a Feature. It should be inherited by classes that define some plugi...
Definition: Feature.hh:35
ModelPtrType ConstructNestedModel(const ::sdf::Model &_model)
Definition: ConstructNestedModel.hh:70
Identity identity
This field contains information to identify the entity.
Definition: Entity.hh:292
Placeholder class in case a Feature does not define its own World API.
Definition: Feature.hh:49
ModelPtr< PolicyT, FeaturesT > ModelPtrType
Definition: ConstructNestedModel.hh:37
Placeholder class in case a Feature does not define its own Model API.
Definition: Feature.hh:58
Definition: ConstructNestedModel.hh:35
Definition: ConstructNestedModel.hh:43
std::shared_ptr< Pimpl > pimpl
This is a pointer to the physics engine implementation, and it can be used by the object features to ...
Definition: Entity.hh:289