BuildingMaker Class Reference

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

#include <BuildingMaker.hh>

Public Member Functions

 BuildingMaker ()
 Constructor. More...
 
 ~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 &_parent)
 Detach all child building parts from the given manip. More...
 
void DetachFromParent (const std::string &_child)
 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...
 
bool IsAttached (const std::string &_child) const
 Whether the given manip is attached to another manip or not. More...
 
BuildingModelManipManipByName (const std::string &_name)
 Detach all child building parts from the given manip. More...
 
std::string ModelSDF () const
 Get the last generated SDF as string. 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...
 

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 ignition::math::Pose3d ConvertPose (const double _x, const double _y, const double _z, const double _roll, const double _pitch, const double _yaw)
 Helper method to convert pose from editor coordinate system to Gazebo coordinate system. More...
 
static ignition::math::Vector3d ConvertSize (const double _width, const double _depth, const double _height)
 Helper method to convert size from editor coordinate system to Gazebo coordinate system. More...
 

Static Public Attributes

static const double conversionScale
 Conversion scale used by the Convert helper functions. More...
 

Detailed Description

Create and manage 3D visuals of a building.

Constructor & Destructor Documentation

Constructor.

Destructor.

Member Function Documentation

std::string 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 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 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 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 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 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 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.

This function doesn't check if the parts exist.

Parameters
[in]_childName of the child building part
[in]_parentName of the parent building part.
void BuildingChanged ( )

Set save state upon a change to the building.

void 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 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 ConvertAngle ( double  _angle)
static

Convert an angle from editor unit to Gazebo unit.

Parameters
[in]_angleAngle in degrees.
Returns
Angle in radians.
static ignition::math::Pose3d ConvertPose ( const double  _x,
const double  _y,
const double  _z,
const double  _roll,
const double  _pitch,
const 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 ignition::math::Vector3d ConvertSize ( const double  _width,
const double  _depth,
const 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 DetachAllChildren ( const std::string &  _parent)

Detach all child building parts from the given manip.

Parameters
[in]_parentName of the building part.
void DetachFromParent ( const std::string &  _child)

Detach a child building part from its parent.

Parameters
[in]_childName of the child building part.
void FinishModel ( )

Finish the model and create the entity on the gzserver.

void GenerateSDF ( )

Generate the SDF from building part visuals.

bool IsAttached ( const std::string &  _child) const

Whether the given manip is attached to another manip or not.

Parameters
[in]_childName of manip.
Returns
True if manip has a parent.
BuildingModelManip* ManipByName ( const std::string &  _name)

Detach all child building parts from the given manip.

Parameters
[in]_manipName of the building part.
std::string ModelSDF ( ) const

Get the last generated SDF as string.

Returns
String representation of the building's SDF.
void OnEdit ( bool  _checked)

QT callback when entering or leaving building edit mode.

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

Remove a building part from the model.

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

Remove a wall from the model.

Parameters
[in]_partNameName of the wall to remove
void Reset ( )

Reset the building maker and the SDF.

void SetModelName ( const std::string &  _modelName)

Set the name of this building model.

Parameters
[in]_modelNameName of the model to set to.

Member Data Documentation

const double conversionScale
static

Conversion scale used by the Convert helper functions.


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