17 #ifndef _BUILDING_MAKER_HH_
18 #define _BUILDING_MAKER_HH_
44 class BuildingModelManip;
56 private:
enum SaveState
76 public:
void OnEdit(
bool _checked);
80 public:
void SetModelName(
const std::string &_modelName);
83 public:
void FinishModel();
91 public: std::string AddPart(
const std::string &_type,
92 const QVector3D &_size,
const QVector3D &_pos,
double _angle);
99 public: std::string AddWall(
const QVector3D &_size,
const QVector3D &_pos,
107 public: std::string AddWindow(
const QVector3D &_size,
108 const QVector3D &_pos,
double _angle);
115 public: std::string AddDoor(
const QVector3D &_size,
const QVector3D &_pos,
124 public: std::string AddStairs(
const QVector3D &_size,
125 const QVector3D &_pos,
double _angle,
int _steps);
132 public: std::string AddFloor(
const QVector3D &_size,
133 const QVector3D &_pos,
double _angle);
137 public:
void RemovePart(
const std::string &_partName);
141 public:
void RemoveWall(
const std::string &_wallName);
146 public:
void ConnectItem(
const std::string &_partName,
153 public:
void AttachManip(
const std::string &_child,
154 const std::string &_parent);
159 public:
void DetachManip(
const std::string &_child,
160 const std::string &_parent);
164 public:
void DetachAllChildren(
const std::string &_manip);
170 public:
static math::Vector3 ConvertSize(
const QVector3D &_size);
178 public:
static math::Vector3 ConvertSize(
double _width,
double _depth,
186 public:
static math::Pose ConvertPose(
const QVector3D &_pos,
187 const QVector3D &_rot);
198 public:
static math::Pose ConvertPose(
double _x,
double _y,
double _z,
199 double _roll,
double _pitch,
double _yaw);
204 public:
static double Convert(
double _value);
209 public:
static double ConvertAngle(
double _angle);
212 public:
void Reset();
218 public:
virtual void Stop();
221 public:
void GenerateSDF();
224 public:
virtual bool IsActive()
const;
227 public:
void BuildingChanged();
230 private:
virtual void CreateTheEntity();
233 private:
bool Init();
237 private: std::string CreateModel();
240 private:
void GenerateSDFWithCSG();
243 private: std::string GetTemplateSDFString();
247 private:
static bool PointCompareY(
const QPointF &_a,
const QPointF &_b);
251 private:
static bool RectCompareX(
const QRectF &_a,
const QRectF &_b);
255 private:
static bool RectCompareY(
const QRectF &_a,
const QRectF &_b);
263 private:
void SubdivideRectSurface(
const QRectF &_surface,
264 const std::vector<QRectF> &_holes, std::vector<QRectF> &_subdivisions);
267 private:
void SaveModelFiles();
271 private:
bool OnSave();
275 private:
bool OnSaveAs();
279 private:
void OnNameChanged(
const std::string &_modelName);
282 private:
void OnNew();
285 private:
void OnExit();
290 private:
void OnChangeLevel(
int _level);
293 private:
void StopMaterialModes();
297 private:
void ResetHoverVis();
302 private:
void OnColorSelected(QColor _color);
307 private:
void OnTextureSelected(QString _texture);
334 private: std::map<std::string, BuildingModelManip *> allItems;
337 private: sdf::SDFPtr modelSDF;
340 private: sdf::SDFPtr modelTemplateSDF;
343 private: std::string modelName;
346 private: std::string folderName;
349 private:
static const std::string previewName;
355 private:
int wallCounter;
358 private:
int windowCounter;
361 private:
int doorCounter;
364 private:
int stairsCounter;
367 private:
int floorCounter;
370 private:
enum SaveState currentSaveState;
373 private: std::vector<event::ConnectionPtr> connections;
376 private:
static const std::string buildingDefaultName;
386 private: QColor selectedColor;
390 private: QString selectedTexture;
393 private:
int currentLevel;
Generic description of a mouse event.
Definition: MouseEvent.hh:35
Base class of an item in the editor.
Definition: EditorItem.hh:34
Dialog for saving to file.
Definition: SaveDialog.hh:37
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
Generic description of a keyboard event.
Definition: KeyEvent.hh:32
GAZEBO_VISIBLE msgs::Vector3d Convert(const math::Vector3 &_v) GAZEBO_DEPRECATED(6.0)
Convert a math::Vector3 to a msgs::Vector3d.
static double conversionScale
Conversion scale used by the Convert helper functions.
Definition: BuildingMaker.hh:330
to make an entity base class
Definition: EntityMaker.hh:41
Create and manage 3D visuals of a building.
Definition: BuildingMaker.hh:52
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
#define GZ_GUI_BUILDING_VISIBLE
Definition: system.hh:393
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:107
boost::shared_ptr< UserCamera > UserCameraPtr
Definition: RenderTypes.hh:91