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... | |
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... | |
Create and manage 3D visuals of a building.
gazebo::gui::BuildingMaker::BuildingMaker | ( | ) |
Constructor.
gazebo::gui::BuildingMaker::~BuildingMaker | ( | ) |
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.
This function doesn't check if the parts exist.
[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] | _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] | _width | Width in pixels. |
[in] | _depth | Depth in pixels. |
[in] | _height | Height in pixels. |
void gazebo::gui::BuildingMaker::DetachAllChildren | ( | const std::string & | _parent | ) |
Detach all child building parts from the given manip.
[in] | _parent | Name of the building part. |
void gazebo::gui::BuildingMaker::DetachFromParent | ( | const std::string & | _child | ) |
Detach a child building part from its parent.
[in] | _child | Name of the child 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.
bool gazebo::gui::BuildingMaker::IsAttached | ( | const std::string & | _child | ) | const |
Whether the given manip is attached to another manip or not.
[in] | _child | Name of manip. |
BuildingModelManip* gazebo::gui::BuildingMaker::ManipByName | ( | const std::string & | _name | ) |
Detach all child building parts from the given manip.
[in] | _manip | Name of the building part. |
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::SetModelName | ( | const std::string & | _modelName | ) |
Set the name of this building model.
[in] | _modelName | Name of the model to set to. |
|
static |
Conversion scale used by the Convert helper functions.