17 #ifndef _BUILDING_MAKER_HH_
18 #define _BUILDING_MAKER_HH_
43 class BuildingModelManip;
44 class FinishBuildingDialog;
61 public:
void SetModelName(
const std::string &_modelName);
64 public:
void FinishModel();
72 public: std::string AddPart(
const std::string &_type,
73 const QVector3D &_size,
const QVector3D &_pos,
double _angle);
80 public: std::string AddWall(
const QVector3D &_size,
const QVector3D &_pos,
88 public: std::string AddWindow(
const QVector3D &_size,
89 const QVector3D &_pos,
double _angle);
96 public: std::string AddDoor(
const QVector3D &_size,
const QVector3D &_pos,
105 public: std::string AddStairs(
const QVector3D &_size,
106 const QVector3D &_pos,
double _angle,
int _steps);
113 public: std::string AddFloor(
const QVector3D &_size,
114 const QVector3D &_pos,
double _angle);
118 public:
void RemovePart(
const std::string &_partName);
122 public:
void RemoveWall(
const std::string &_wallName);
127 public:
void ConnectItem(
const std::string &_partName,
134 public:
void AttachManip(
const std::string &_child,
135 const std::string &_parent);
140 public:
void DetachManip(
const std::string &_child,
141 const std::string &_parent);
147 public:
static math::Vector3 ConvertSize(
const QVector3D &_size);
155 public:
static math::Vector3 ConvertSize(
double _width,
double _depth,
163 public:
static math::Pose ConvertPose(
const QVector3D &_pos,
164 const QVector3D &_rot);
175 public:
static math::Pose ConvertPose(
double _x,
double _y,
double _z,
176 double _roll,
double _pitch,
double _yaw);
181 public:
static double Convert(
double _value);
186 public:
static double ConvertAngle(
double _angle);
190 public:
void SaveToSDF(
const std::string &_savePath);
193 public:
void Reset();
199 public:
virtual void Stop();
202 public:
void GenerateSDF();
205 public:
virtual bool IsActive()
const;
208 private:
virtual void CreateTheEntity();
211 private:
bool Init();
215 private: std::string CreateModel();
218 private:
void GenerateSDFWithCSG();
221 private: std::string GetTemplateSDFString();
225 private:
static bool PointCompareY(
const QPointF &_a,
const QPointF &_b);
229 private:
static bool RectCompareX(
const QRectF &_a,
const QRectF &_b);
233 private:
static bool RectCompareY(
const QRectF &_a,
const QRectF &_b);
241 private:
void SubdivideRectSurface(
const QRectF &_surface,
242 const std::vector<QRectF> &_holes, std::vector<QRectF> &_subdivisions);
245 private:
void OnSave();
248 private:
void OnDiscard();
252 private:
void OnDone();
255 private:
void OnExit();
262 private: std::map<std::string, BuildingModelManip *> allItems;
265 private: sdf::SDFPtr modelSDF;
268 private: sdf::SDFPtr modelTemplateSDF;
271 private: std::string modelName;
280 private:
int wallCounter;
283 private:
int windowCounter;
286 private:
int doorCounter;
289 private:
int stairsCounter;
292 private:
int floorCounter;
298 private: std::string saveLocation;
301 private: std::vector<event::ConnectionPtr> connections;
304 private: std::string buildingDefaultName;
Base class of an item in the editor.
Definition: EditorItem.hh:34
Encapsulates a position and rotation in three space.
Definition: Pose.hh:40
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
GAZEBO_VISIBLE msgs::Vector3d Convert(const math::Vector3 &_v)
Convert a math::Vector3 to a msgs::Vector3d.
static double conversionScale
Conversion scale used by the Convert helper functions.
Definition: BuildingMaker.hh:258
to make an entity base class
Definition: EntityMaker.hh:41
Create and manage 3D visuals of a building.
Definition: BuildingMaker.hh:51
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Dialog for saving the building model.
Definition: FinishBuildingDialog.hh:34
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:100
boost::shared_ptr< UserCamera > UserCameraPtr
Definition: RenderTypes.hh:84
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48