Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
gazebo::gui::BuildingMaker Class Reference

Create and manage 3D visuals of a building. More...

#include <BuildingMaker.hh>

Inheritance diagram for gazebo::gui::BuildingMaker:
Inheritance graph
[legend]

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 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 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
 

Detailed Description

Create and manage 3D visuals of a building.

Constructor & Destructor Documentation

gazebo::gui::BuildingMaker::BuildingMaker ( )

Constructor.

virtual gazebo::gui::BuildingMaker::~BuildingMaker ( )
virtual

Destructor.

Member Function Documentation

std::string gazebo::gui::BuildingMaker::AddDoor ( const QVector3D &  _size,
const QVector3D &  _pos,
double  _angle 
)

Add a door to the model.

Parameters
[in]_sizeSize of the door.
[in]_posPosition of the door in pixel coordinates.
[in]_angleYaw rotation of the door in degrees.
Returns
Name of the 3D door that has been added.
std::string gazebo::gui::BuildingMaker::AddFloor ( const QVector3D &  _size,
const QVector3D &  _pos,
double  _angle 
)

Add a floor to the model.

Parameters
[in]_sizeSize of the floor.
[in]_posPosition of the floor in pixel coordinates.
[in]_angleYaw rotation of the floor in radians.
Returns
Name of the 3D floor that has been added.
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.

Parameters
[in]_typeType of the building part.
[in]_sizeSize of the building part.
[in]_posPosition of the building part in pixel coordinates.
[in]_angleYaw rotation of the building part in degrees.
Returns
Name of the 3D building part that has been added.
std::string gazebo::gui::BuildingMaker::AddStairs ( const QVector3D &  _size,
const QVector3D &  _pos,
double  _angle,
int  _steps 
)

Add a staircase to the model.

Parameters
[in]_sizeSize of the staircase.
[in]_posPosition of the staircase in pixel coordinates.
[in]_angleYaw rotation of the staircase in degrees.
[in]_stepsNumber of steps in the staircase.
Returns
Name of the 3D staircase that has been added.
std::string gazebo::gui::BuildingMaker::AddWall ( const QVector3D &  _size,
const QVector3D &  _pos,
double  _angle 
)

Add a wall to the model.

Parameters
[in]_sizeSize of the wall.
[in]_posPosition of the wall in pixel coordinates.
[in]_angleYaw rotation of the wall in degrees.
Returns
Name of the 3D wall that has been added.
std::string gazebo::gui::BuildingMaker::AddWindow ( const QVector3D &  _size,
const QVector3D &  _pos,
double  _angle 
)

Add a window to the model.

Parameters
[in]_sizeSize of the window.
[in]_posPosition of the window in pixel coordinates.
[in]_angleYaw rotation of the window in degrees.
Returns
Name of the 3D window that has been added.
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.

Parameters
[in]_childName of the child building part
[in]_parentName 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.

Parameters
[in]_partNameName of the 3D building part
[in]_item2D editor item.
static double gazebo::gui::BuildingMaker::Convert ( double  _value)
static
Parameters
[in]_valueConvert a value from pixels to metric units
[in]_valueValue in pixels.
Returns
Value in metric units.
static double gazebo::gui::BuildingMaker::ConvertAngle ( double  _angle)
static

Convert an angle from editor unit to Gazebo unit.

Parameters
[in]_angleAngle in degrees.
Returns
Angle in radians.
static math::Pose gazebo::gui::BuildingMaker::ConvertPose ( const QVector3D &  _pos,
const QVector3D &  _rot 
)
static

Helper method to convert pose from editor coordinate system to Gazebo coordinate system.

Parameters
[in]_posPosition in pixels.
[in]_rotRotation in degrees.
Returns
Pose with position in metric units and rotation in radians.
static math::Pose gazebo::gui::BuildingMaker::ConvertPose ( double  _x,
double  _y,
double  _z,
double  _roll,
double  _pitch,
double  _yaw 
)
static

Helper method to convert pose from editor coordinate system to Gazebo coordinate system.

Parameters
[in]_xX position in pixels.
[in]_yY position in pixels.
[in]_yZ position in pixels.
[in]_rollRoll rotation in degrees.
[in]_pitchPitch rotation in degrees.
[in]_yawYaw rotation in degrees.
Returns
Pose with position in metric units and rotation in radians.
static math::Vector3 gazebo::gui::BuildingMaker::ConvertSize ( const QVector3D &  _size)
static

Helper method to convert size from editor coordinate system to Gazebo coordinate system.

Parameters
[in]_sizeSize vector in pixels.
Returns
Size in metric units.
static math::Vector3 gazebo::gui::BuildingMaker::ConvertSize ( double  _width,
double  _depth,
double  _height 
)
static

Helper method to convert size from editor coordinate system to Gazebo coordinate system.

Parameters
[in]_widthWidth in pixels.
[in]_depthDepth in pixels.
[in]_heightHeight in pixels.
Returns
Size in metric units.
void gazebo::gui::BuildingMaker::DetachAllChildren ( const std::string &  _manip)

Detach all child building parts from the given manip.

Parameters
[in]_manipName 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.

Parameters
[in]_childName of the child building part.
[in]_parentName of the parent building part.
void gazebo::gui::BuildingMaker::FinishModel ( )

Finish the model and create the entity on the gzserver.

void gazebo::gui::BuildingMaker::GenerateSDF ( )

Generate the SDF from building part visuals.

virtual bool gazebo::gui::BuildingMaker::IsActive ( ) const
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.

Parameters
[in]_checkedTrue if the menu item is checked
void gazebo::gui::BuildingMaker::RemovePart ( const std::string &  _partName)

Remove a building part from the model.

Parameters
[in]_partNameName of the building part to remove
void gazebo::gui::BuildingMaker::RemoveWall ( const std::string &  _wallName)

Remove a wall from the model.

Parameters
[in]_partNameName of the wall to remove
void gazebo::gui::BuildingMaker::Reset ( )

Reset the building maker and the SDF.

void gazebo::gui::BuildingMaker::SetModelName ( const std::string &  _modelName)

Set the name of this building model.

Parameters
[in]_modelNameName of the model to set to.
virtual void gazebo::gui::BuildingMaker::Start ( const rendering::UserCameraPtr  _camera)
virtual
Parameters
[in]_cameraPointer to the user camera

Implements gazebo::gui::EntityMaker.

virtual void gazebo::gui::BuildingMaker::Stop ( )
virtual

Member Data Documentation

double gazebo::gui::BuildingMaker::conversionScale
static

Conversion scale used by the Convert helper functions.


The documentation for this class was generated from the following file: