Create and manage 3D visuals of a building. More...
#include <BuildingMaker.hh>
Public Member Functions | |
BuildingMaker () | |
Constructor. More... | |
virtual | ~BuildingMaker () |
Destructor. More... | |
std::string | AddDoor (const QVector3D &_size, const QVector3D &_pos, double _angle) |
Add a door to the model. More... | |
std::string | AddFloor (const QVector3D &_size, const QVector3D &_pos, double _angle) |
Add a floor to the model. More... | |
std::string | AddPart (const std::string &_type, const QVector3D &_size, const QVector3D &_pos, double _angle) |
Add a building part to the model. More... | |
std::string | AddStairs (const QVector3D &_size, const QVector3D &_pos, double _angle, int _steps) |
Add a staircase to the model. More... | |
std::string | AddWall (const QVector3D &_size, const QVector3D &_pos, double _angle) |
Add a wall to the model. More... | |
std::string | AddWindow (const QVector3D &_size, const QVector3D &_pos, double _angle) |
Add a window to the model. More... | |
void | AttachManip (const std::string &_child, const std::string &_parent) |
Attach a building part to another, this is currently used for making holes in walls and floors. More... | |
void | BuildingChanged () |
Set save state upon a change to the building. More... | |
void | ConnectItem (const std::string &_partName, const EditorItem *_item) |
Connect the 2D editor item Qt signals to the 3D building part. More... | |
void | DetachAllChildren (const std::string &_manip) |
Detach all child building parts from the given manip. More... | |
void | DetachManip (const std::string &_child, const std::string &_parent) |
Detach a child building part from its parent. More... | |
void | FinishModel () |
Finish the model and create the entity on the gzserver. More... | |
void | GenerateConfig () |
Generate the config file. More... | |
void | GenerateSDF () |
Generate the SDF from building part visuals. More... | |
virtual bool | IsActive () const |
Checks if entity is active. More... | |
void | OnEdit (bool _checked) |
QT callback when entering or leaving building edit mode. More... | |
void | RemovePart (const std::string &_partName) |
Remove a building part from the model. More... | |
void | RemoveWall (const std::string &_wallName) |
Remove a wall from the model. More... | |
void | Reset () |
Reset the building maker and the SDF. More... | |
void | SaveToConfig (const std::string &_savePath) |
Save config file. More... | |
void | SaveToSDF (const std::string &_savePath) |
Save model to SDF format. More... | |
void | SetModelName (const std::string &_modelName) |
Set the name of this building model. More... | |
virtual void | Start (const rendering::UserCameraPtr _camera) |
virtual void | Stop () |
Public Member Functions inherited from gazebo::gui::EntityMaker | |
EntityMaker () | |
Constructor. More... | |
virtual | ~EntityMaker () |
Destructor. More... | |
virtual void | OnMouseDrag (const common::MouseEvent &_event) |
Callback for dragging with mouse. More... | |
virtual void | OnMouseMove (const common::MouseEvent &_event) |
Callback when moving mouse. More... | |
virtual void | OnMousePush (const common::MouseEvent &_event) |
Callback for pushing entity with mouse. More... | |
virtual void | OnMouseRelease (const common::MouseEvent &_event) |
Callback for releasing mouse button. More... | |
Static Public Member Functions | |
static double | Convert (double _value) |
static double | ConvertAngle (double _angle) |
Convert an angle from editor unit to Gazebo unit. More... | |
static math::Pose | ConvertPose (const QVector3D &_pos, const QVector3D &_rot) |
Helper method to convert pose from editor coordinate system to Gazebo coordinate system. More... | |
static math::Pose | ConvertPose (double _x, double _y, double _z, double _roll, double _pitch, double _yaw) |
Helper method to convert pose from editor coordinate system to Gazebo coordinate system. More... | |
static math::Vector3 | ConvertSize (const QVector3D &_size) |
Helper method to convert size from editor coordinate system to Gazebo coordinate system. More... | |
static math::Vector3 | ConvertSize (double _width, double _depth, double _height) |
Helper method to convert size from editor coordinate system to Gazebo coordinate system. More... | |
Static Public Member Functions inherited from gazebo::gui::EntityMaker | |
static void | SetSnapToGrid (bool _snap) |
Set whether to snap to grid. More... | |
Static Public Attributes | |
static double | conversionScale |
Conversion scale used by the Convert helper functions. More... | |
Additional Inherited Members | |
Public Types inherited from gazebo::gui::EntityMaker | |
typedef boost::function< void(const math::Vector3 &pos, const math::Vector3 &scale)> | CreateCallback |
Protected Member Functions inherited from gazebo::gui::EntityMaker | |
math::Vector3 | GetSnappedPoint (math::Vector3 _p) |
Get a point snapped to a grid. More... | |
Protected Attributes inherited from gazebo::gui::EntityMaker | |
rendering::UserCameraPtr | camera |
CreateCallback | createCB |
transport::PublisherPtr | makerPub |
transport::NodePtr | node |
transport::PublisherPtr | requestPub |
transport::PublisherPtr | visPub |
Create and manage 3D visuals of a building.
gazebo::gui::BuildingMaker::BuildingMaker | ( | ) |
Constructor.
|
virtual |
Destructor.
std::string gazebo::gui::BuildingMaker::AddDoor | ( | const QVector3D & | _size, |
const QVector3D & | _pos, | ||
double | _angle | ||
) |
Add a door to the model.
[in] | _size | Size of the door. |
[in] | _pos | Position of the door in pixel coordinates. |
[in] | _angle | Yaw rotation of the door in degrees. |
std::string gazebo::gui::BuildingMaker::AddFloor | ( | const QVector3D & | _size, |
const QVector3D & | _pos, | ||
double | _angle | ||
) |
Add a floor to the model.
[in] | _size | Size of the floor. |
[in] | _pos | Position of the floor in pixel coordinates. |
[in] | _angle | Yaw rotation of the floor in radians. |
std::string gazebo::gui::BuildingMaker::AddPart | ( | const std::string & | _type, |
const QVector3D & | _size, | ||
const QVector3D & | _pos, | ||
double | _angle | ||
) |
Add a building part to the model.
[in] | _type | Type of the building part. |
[in] | _size | Size of the building part. |
[in] | _pos | Position of the building part in pixel coordinates. |
[in] | _angle | Yaw rotation of the building part in degrees. |
std::string gazebo::gui::BuildingMaker::AddStairs | ( | const QVector3D & | _size, |
const QVector3D & | _pos, | ||
double | _angle, | ||
int | _steps | ||
) |
Add a staircase to the model.
[in] | _size | Size of the staircase. |
[in] | _pos | Position of the staircase in pixel coordinates. |
[in] | _angle | Yaw rotation of the staircase in degrees. |
[in] | _steps | Number of steps in the staircase. |
std::string gazebo::gui::BuildingMaker::AddWall | ( | const QVector3D & | _size, |
const QVector3D & | _pos, | ||
double | _angle | ||
) |
Add a wall to the model.
[in] | _size | Size of the wall. |
[in] | _pos | Position of the wall in pixel coordinates. |
[in] | _angle | Yaw rotation of the wall in degrees. |
std::string gazebo::gui::BuildingMaker::AddWindow | ( | const QVector3D & | _size, |
const QVector3D & | _pos, | ||
double | _angle | ||
) |
Add a window to the model.
[in] | _size | Size of the window. |
[in] | _pos | Position of the window in pixel coordinates. |
[in] | _angle | Yaw rotation of the window in degrees. |
void gazebo::gui::BuildingMaker::AttachManip | ( | const std::string & | _child, |
const std::string & | _parent | ||
) |
Attach a building part to another, this is currently used for making holes in walls and floors.
[in] | _child | Name of the child building part |
[in] | _parent | Name of the parent building part. |
void gazebo::gui::BuildingMaker::BuildingChanged | ( | ) |
Set save state upon a change to the building.
void gazebo::gui::BuildingMaker::ConnectItem | ( | const std::string & | _partName, |
const EditorItem * | _item | ||
) |
Connect the 2D editor item Qt signals to the 3D building part.
[in] | _partName | Name of the 3D building part |
[in] | _item | 2D editor item. |
|
static |
[in] | _value | Convert a value from pixels to metric units |
[in] | _value | Value in pixels. |
|
static |
Convert an angle from editor unit to Gazebo unit.
[in] | _angle | Angle in degrees. |
|
static |
Helper method to convert pose from editor coordinate system to Gazebo coordinate system.
[in] | _pos | Position in pixels. |
[in] | _rot | Rotation in degrees. |
|
static |
Helper method to convert pose from editor coordinate system to Gazebo coordinate system.
[in] | _x | X position in pixels. |
[in] | _y | Y position in pixels. |
[in] | _y | Z position in pixels. |
[in] | _roll | Roll rotation in degrees. |
[in] | _pitch | Pitch rotation in degrees. |
[in] | _yaw | Yaw rotation in degrees. |
|
static |
Helper method to convert size from editor coordinate system to Gazebo coordinate system.
[in] | _size | Size vector in pixels. |
|
static |
Helper method to convert size from editor coordinate system to Gazebo coordinate system.
[in] | _width | Width in pixels. |
[in] | _depth | Depth in pixels. |
[in] | _height | Height in pixels. |
void gazebo::gui::BuildingMaker::DetachAllChildren | ( | const std::string & | _manip | ) |
Detach all child building parts from the given manip.
[in] | _manip | Name of the building part. |
void gazebo::gui::BuildingMaker::DetachManip | ( | const std::string & | _child, |
const std::string & | _parent | ||
) |
Detach a child building part from its parent.
[in] | _child | Name of the child building part. |
[in] | _parent | Name of the parent building part. |
void gazebo::gui::BuildingMaker::FinishModel | ( | ) |
Finish the model and create the entity on the gzserver.
void gazebo::gui::BuildingMaker::GenerateConfig | ( | ) |
Generate the config file.
void gazebo::gui::BuildingMaker::GenerateSDF | ( | ) |
Generate the SDF from building part visuals.
|
virtual |
Checks if entity is active.
Implements gazebo::gui::EntityMaker.
void gazebo::gui::BuildingMaker::OnEdit | ( | bool | _checked | ) |
QT callback when entering or leaving building edit mode.
[in] | _checked | True if the menu item is checked |
void gazebo::gui::BuildingMaker::RemovePart | ( | const std::string & | _partName | ) |
Remove a building part from the model.
[in] | _partName | Name of the building part to remove |
void gazebo::gui::BuildingMaker::RemoveWall | ( | const std::string & | _wallName | ) |
Remove a wall from the model.
[in] | _partName | Name of the wall to remove |
void gazebo::gui::BuildingMaker::Reset | ( | ) |
Reset the building maker and the SDF.
void gazebo::gui::BuildingMaker::SaveToConfig | ( | const std::string & | _savePath | ) |
Save config file.
[in] | _savePath | Path to save the file to. |
void gazebo::gui::BuildingMaker::SaveToSDF | ( | const std::string & | _savePath | ) |
Save model to SDF format.
[in] | _savePath | Path to save the SDF to. |
void gazebo::gui::BuildingMaker::SetModelName | ( | const std::string & | _modelName | ) |
Set the name of this building model.
[in] | _modelName | Name of the model to set to. |
|
virtual |
[in] | _camera | Pointer to the user camera |
Implements gazebo::gui::EntityMaker.
|
virtual |
Implements gazebo::gui::EntityMaker.
|
static |
Conversion scale used by the Convert helper functions.