ModelMaker.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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 #ifndef GAZEBO_GUI_MODELMAKER_HH_
18 #define GAZEBO_GUI_MODELMAKER_HH_
19 
20 #include <list>
21 #include <memory>
22 #include <string>
23 #include <sdf/sdf.hh>
24 
26 #include "gazebo/util/system.hh"
27 
28 namespace gazebo
29 {
30  namespace gui
31  {
32  class ModelMakerPrivate;
33 
35  class GZ_GUI_VISIBLE ModelMaker : public EntityMaker
36  {
39  public: enum SimpleShapes {
41  BOX,
45  CYLINDER
46  };
47 
49  public: ModelMaker();
50 
52  public: ~ModelMaker();
53 
54  // Documentation inherited
55  public: virtual void Stop();
56 
60  public: bool InitFromModel(const std::string &_modelName);
61 
65  public: bool InitFromFile(const std::string &_filename);
66 
71  public: bool InitSimpleShape(SimpleShapes _shape);
72 
73  // Documentation inherited
74  public: virtual ignition::math::Vector3d EntityPosition() const;
75 
76  // Documentation inherited
77  protected: virtual void SetEntityPosition(
78  const ignition::math::Vector3d &_pos);
79 
81  private: bool Init();
82 
85  private: void CreateModelFromSDF(sdf::ElementPtr _modelElem);
86 
88  private: virtual void CreateTheEntity();
89 
92  private: std::unique_ptr<ModelMakerPrivate> dataPtr;
93  };
94  }
95 }
96 #endif
Box.
Definition: ModelMaker.hh:41
Used to insert new models into the scene.
Definition: ModelMaker.hh:35
Sphere.
Definition: ModelMaker.hh:43
To make an entity, base class.
Definition: EntityMaker.hh:39
SimpleShapes
Unique identifiers for each simple shape supported.
Definition: ModelMaker.hh:39
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.