##

BuildingMaker Class Reference
GUI

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...
BuildingModelManip * | ManipByName (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

## BuildingMaker()

BuildingMaker | ( |  | ) |

Constructor.

## ~BuildingMaker()

~BuildingMaker | ( |  | ) |

Destructor.

## Member Function Documentation

## AddDoor()

std::string AddDoor | ( | const QVector3D & | _size,
|  | const QVector3D & | _pos,
|  | double | _angle
| ) |  |

Add a door to the model.

Parameters

  [in] | _size | Size of the door.
  [in] | _pos | Position of the door in pixel coordinates.
  [in] | _angle | Yaw rotation of the door in degrees.

Returns
  Name of the 3D door that has been added.

## AddFloor()

std::string AddFloor | ( | const QVector3D & | _size,
|  | const QVector3D & | _pos,
|  | double | _angle
| ) |  |

Add a floor to the model.

Parameters

  [in] | _size | Size of the floor.
  [in] | _pos | Position of the floor in pixel coordinates.
  [in] | _angle | Yaw rotation of the floor in radians.

Returns
  Name of the 3D floor that has been added.

## AddPart()

std::string AddPart | ( | const std::string & | _type,
|  | const QVector3D & | _size,
|  | const QVector3D & | _pos,
|  | double | _angle
| ) |  |

Add a building part to the model.

Parameters

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

Returns
  Name of the 3D building part that has been added.

## AddStairs()

std::string AddStairs | ( | const QVector3D & | _size,
|  | const QVector3D & | _pos,
|  | double | _angle,
|  | int | _steps
| ) |  |

Add a staircase to the model.

Parameters

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

Returns
  Name of the 3D staircase that has been added.

## AddWall()

std::string AddWall | ( | const QVector3D & | _size,
|  | const QVector3D & | _pos,
|  | double | _angle
| ) |  |

Add a wall to the model.

Parameters

  [in] | _size | Size of the wall.
  [in] | _pos | Position of the wall in pixel coordinates.
  [in] | _angle | Yaw rotation of the wall in degrees.

Returns
  Name of the 3D wall that has been added.

## AddWindow()

std::string AddWindow | ( | const QVector3D & | _size,
|  | const QVector3D & | _pos,
|  | double | _angle
| ) |  |

Add a window to the model.

Parameters

  [in] | _size | Size of the window.
  [in] | _pos | Position of the window in pixel coordinates.
  [in] | _angle | Yaw rotation of the window in degrees.

Returns
  Name of the 3D window that has been added.

## AttachManip()

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] | _child | Name of the child building part
  [in] | _parent | Name of the parent building part.

## BuildingChanged()

void BuildingChanged | ( |  | ) |

Set save state upon a change to the building.

## ConnectItem()

void ConnectItem | ( | const std::string & | _partName,
|  | const EditorItem * | _item
| ) |  |

Connect the 2D editor item Qt signals to the 3D building part.

Parameters

  [in] | _partName | Name of the 3D building part
  [in] | _item | 2D editor item.

## Convert()

static double Convert | ( | double | _value | ) |

static

Parameters

  [in] | _value | Convert a value from pixels to metric units
  [in] | _value | Value in pixels.

Returns
  Value in metric units.

## ConvertAngle()

static double ConvertAngle | ( | double | _angle | ) |

static

Convert an angle from editor unit to Gazebo unit.

Parameters

  [in] | _angle | Angle in degrees.

Returns
  Angle in radians.

## ConvertPose()

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] | _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.

Returns
  Pose with position in metric units and rotation in radians.

## ConvertSize()

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] | _width | Width in pixels.
  [in] | _depth | Depth in pixels.
  [in] | _height | Height in pixels.

Returns
  Size in metric units.

## DetachAllChildren()

void DetachAllChildren | ( | const std::string & | _parent | ) |

Detach all child building parts from the given manip.

Parameters

  [in] | _parent | Name of the building part.

## DetachFromParent()

void DetachFromParent | ( | const std::string & | _child | ) |

Detach a child building part from its parent.

Parameters

  [in] | _child | Name of the child building part.

## FinishModel()

void FinishModel | ( |  | ) |

Finish the model and create the entity on the gzserver.

## GenerateSDF()

void GenerateSDF | ( |  | ) |

Generate the SDF from building part visuals.

## IsAttached()

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

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

Parameters

  [in] | _child | Name of manip.

Returns
  True if manip has a parent.

## ManipByName()

BuildingModelManip* ManipByName | ( | const std::string & | _name | ) |

Detach all child building parts from the given manip.

Parameters

  [in] | _manip | Name of the building part.

## ModelSDF()

std::string ModelSDF | ( |  | ) | const

Get the last generated SDF as string.

Returns
  String representation of the building's SDF.

## OnEdit()

void OnEdit | ( | bool | _checked | ) |

QT callback when entering or leaving building edit mode.

Parameters

  [in] | _checked | True if the menu item is checked

## RemovePart()

void RemovePart | ( | const std::string & | _partName | ) |

Remove a building part from the model.

Parameters

  [in] | _partName | Name of the building part to remove

## RemoveWall()

void RemoveWall | ( | const std::string & | _wallName | ) |

Remove a wall from the model.

Parameters

  [in] | _partName | Name of the wall to remove

## Reset()

void Reset | ( |  | ) |

Reset the building maker and the SDF.

## SetModelName()

void SetModelName | ( | const std::string & | _modelName | ) |

Set the name of this building model.

Parameters

  [in] | _modelName | Name of the model to set to.

## Member Data Documentation

## conversionScale

const double conversionScale

static

Conversion scale used by the Convert helper functions.

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

- BuildingMaker.hh