ModelMaker.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 _MODEL_MAKER_HH_
18 #define _MODEL_MAKER_HH_
19 
20 #include <list>
21 #include <string>
22 #include <sdf/sdf.hh>
23 
25 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
29  namespace msgs
30  {
31  class Visual;
32  }
33 
34  namespace gui
35  {
37  {
38  public: ModelMaker();
39  public: virtual ~ModelMaker();
40 
44  public: bool InitFromModel(const std::string &_modelName);
45 
46  public: bool InitFromSDFString(const std::string &_data);
47  public: bool InitFromFile(const std::string &_filename);
48 
49  public: virtual void Start(const rendering::UserCameraPtr _camera);
50 
51  public: virtual void Stop();
52  public: virtual bool IsActive() const;
53 
54  public: virtual void OnMousePush(const common::MouseEvent &_event);
55  public: virtual void OnMouseRelease(const common::MouseEvent &_event);
56  public: virtual void OnMouseDrag(const common::MouseEvent &_event);
57  public: virtual void OnMouseMove(const common::MouseEvent &_event);
58 
60  private: bool Init();
61 
62  private: virtual void CreateTheEntity();
63  private: int state;
64  private: bool leftMousePressed;
65  private: math::Vector2i mousePushPos, mouseReleasePos;
66 
67  private: rendering::VisualPtr modelVisual;
68  private: std::list<rendering::VisualPtr> visuals;
69  private: sdf::SDFPtr modelSDF;
70 
71  private: bool clone;
72  };
73  }
74 }
75 #endif
Generic description of a mouse event.
Definition: MouseEvent.hh:35
Definition: ModelMaker.hh:36
Generic integer x, y vector.
Definition: Vector2i.hh:36
to make an entity base class
Definition: EntityMaker.hh:41
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:107
boost::shared_ptr< UserCamera > UserCameraPtr
Definition: RenderTypes.hh:91
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66