##

ModelMaker.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_GUI_MODELMAKER_HH_
#define GAZEBO_GUI_MODELMAKER_HH_
#include <list>
#include <memory>
#include <string>
#include <sdf/sdf.hh>
#include "gazebo/gui/EntityMaker.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
class ModelMakerPrivate;
class GZ_GUI_VISIBLE ModelMaker : public EntityMaker
{
public: enum SimpleShapes {
BOX,
SPHERE,
CYLINDER
};
public: ModelMaker();
public: ~ModelMaker();
// Documentation inherited
public: virtual void Stop();
public: bool InitFromModel(const std::string &_modelName);
public: bool InitFromFile(const std::string &_filename);
public: bool InitSimpleShape(SimpleShapes _shape);
// Documentation inherited
public: virtual ignition::math::Vector3d EntityPosition() const;
// Documentation inherited
protected: virtual void SetEntityPosition(
const ignition::math::Vector3d &_pos);
private: bool Init();
private: void CreateModelFromSDF(sdf::ElementPtr _modelElem);
private: virtual void CreateTheEntity();
private: std::unique_ptr<ModelMakerPrivate> dataPtr;
};
}
}
#endif
gazebo::gui::ModelMaker::~ModelMaker
~ModelMaker()
Destructor.
EntityMaker.hh
gazebo::gui::ModelMaker::SPHERE
Sphere.
Definition: ModelMaker.hh:43
gazebo::gui::EntityMaker
To make an entity, base class.
Definition: EntityMaker.hh:39
gazebo::gui::ModelMaker::ModelMaker
ModelMaker()
Constructor.
gazebo::gui::ModelMaker::InitFromFile
bool InitFromFile(const std::string &_filename)
Initialize the model maker from a file.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::gui::ModelMaker
Used to insert new models into the scene.
Definition: ModelMaker.hh:35
gazebo::gui::ModelMaker::CYLINDER
Cylinder.
Definition: ModelMaker.hh:45
system.hh
gazebo::gui::ModelMaker::SimpleShapes
SimpleShapes
Unique identifiers for each simple shape supported.
Definition: ModelMaker.hh:39
gazebo::gui::ModelMaker::EntityPosition
virtual ignition::math::Vector3d EntityPosition() const
Returns the entity world position.
gazebo::gui::ModelMaker::InitFromModel
bool InitFromModel(const std::string &_modelName)
Initialize the model maker with an existing model.
gazebo::gui::ModelMaker::InitSimpleShape
bool InitSimpleShape(SimpleShapes _shape)
Initialize the model maker to make one of the supported simple shapes.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::ModelMaker::BOX
Box.
Definition: ModelMaker.hh:41
gazebo::gui::ModelMaker::Stop
virtual void Stop()
Stop the maker.
gazebo::gui::ModelMaker::SetEntityPosition
virtual void SetEntityPosition(const ignition::math::Vector3d &_pos)
Sets the entity world position.