##

EditorItem.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_GUI_BUILDING_EDITORITEM_HH_
#define GAZEBO_GUI_BUILDING_EDITORITEM_HH_
#include <string>
#include <memory>
#include <ignition/math/Color.hh>
#include <ignition/math/Vector3.hh>
#include "gazebo/gui/qt.h"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace gui
{
// Forward declare private data.
class EditorItemPrivate;
class GZ_GUI_VISIBLE EditorItem : public QObject
{
Q_OBJECT
public: EditorItem();
public: ~EditorItem();
public: virtual ignition::math::Vector3d Size() const;
public: virtual ignition::math::Vector3d ScenePosition() const;
public: virtual double SceneRotation() const;
public: virtual std::string ItemType() const;
public: virtual std::string Name() const;
public: int Level() const;
public: double LevelBaseHeight() const;
public: virtual ignition::math::Color Color3d() const;
public: virtual std::string Texture3d() const;
public: virtual void SetName(const std::string &_name);
public: void SetLevel(const int _level);
public: void SetLevelBaseHeight(const double _height);
public: void SetColor3d(const ignition::math::Color &_color);
public: void SetTexture3d(const std::string &_texture);
public: void Set3dTransparency(const float _transparency);
public: virtual void SetHighlighted(const bool _highlighted);
public: int ZValueIdle() const;
public: int ZValueSelected() const;
Q_SIGNALS: void SizeChanged(const double _width, const double _depth,
const double _height);
Q_SIGNALS: void PoseChanged(const double _x, const double _y,
const double _z, const double _roll, const double _pitch,
const double _yaw);
Q_SIGNALS: void PoseOriginTransformed(const double _x, const double _y,
const double _z, const double _roll, const double _pitch,
const double _yaw);
Q_SIGNALS: void PositionChanged(const double _x, const double _y,
const double _z);
Q_SIGNALS: void RotationChanged(const double _roll, const double _pitch,
const double _yaw);
Q_SIGNALS: void WidthChanged(const double _width);
Q_SIGNALS: void DepthChanged(const double _depth);
Q_SIGNALS: void HeightChanged(const double _height);
Q_SIGNALS: void PosXChanged(const double _posX);
Q_SIGNALS: void PosYChanged(const double _posY);
Q_SIGNALS: void PosZChanged(const double _posZ);
Q_SIGNALS: void YawChanged(const double _yaw);
Q_SIGNALS: void LevelChanged(const int _level);
Q_SIGNALS: void ColorChanged(const ignition::math::Color &_color);
Q_SIGNALS: void TextureChanged(const std::string &_texture);
Q_SIGNALS: void TransparencyChanged(const float _transparency);
Q_SIGNALS: void ItemDeleted();
private slots: void OnColorChanged(const ignition::math::Color &_color);
private slots: void OnTextureChanged(const std::string &_texture);
protected: int zValueIdle;
protected: int zValueSelected;
protected: std::string editorType;
protected: std::string name;
protected: int level;
protected: double levelBaseHeight;
protected: ignition::math::Color visual3dColor;
protected: std::string visual3dTexture;
protected: float visual3dTransparency;
protected: bool highlighted;
protected: double itemScale;
private: std::unique_ptr<EditorItemPrivate> dataPtr;
};
}
}
#endif
gazebo::gui::EditorItem::~EditorItem
~EditorItem()
Destructor.
gazebo::gui::EditorItem::editorType
std::string editorType
Type of editor item.
Definition: EditorItem.hh:236
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::EditorItem::EditorItem
EditorItem()
Constructor.
gazebo::gui::EditorItem
Base class of an item in the editor.
Definition: EditorItem.hh:42
gazebo::gui::EditorItem::Set3dTransparency
void Set3dTransparency(const float _transparency)
Set the transparency of the associated 3D visual.
gazebo::gui::Level
A convenient structure for storing level information.
Definition: EditorView.hh:45
gazebo::gui::EditorItem::Color3d
virtual ignition::math::Color Color3d() const
Get the associated 3D visual's color.
gazebo::gui::EditorItem::SizeChanged
void SizeChanged(const double _width, const double _depth, const double _height)
Qt signal emitted when the editor item size has changed.
system.hh
gazebo::gui::EditorItem::SetLevelBaseHeight
void SetLevelBaseHeight(const double _height)
Set the base height of this level relative to the ground plane.
gazebo::gui::EditorItem::zValueSelected
int zValueSelected
Z ordering of the rect item when selected.
Definition: EditorItem.hh:233
gazebo::gui::EditorItem::SceneRotation
virtual double SceneRotation() const
Get the scene rotation of the editor item.
gazebo::gui::EditorItem::PosXChanged
void PosXChanged(const double _posX)
Qt signal emitted when the editor item's X position has changed.
gazebo::gui::EditorItem::Name
virtual std::string Name() const
Get the name of the editor item.
gazebo::gui::EditorItem::LevelChanged
void LevelChanged(const int _level)
Qt signal emitted when the editor item's level has changed.
gazebo::gui::EditorItem::SetLevel
void SetLevel(const int _level)
Set the level of this building item.
gazebo::gui::EditorItem::SetHighlighted
virtual void SetHighlighted(const bool _highlighted)
Set whether this item should be highlighted or not.
gazebo::gui::EditorItem::ZValueIdle
int ZValueIdle() const
Get the z value of this item when in idle state.
gazebo::gui::EditorItem::level
int level
Level that this item is on.
Definition: EditorItem.hh:242
gazebo::gui::EditorItem::levelBaseHeight
double levelBaseHeight
Vertical distance from the building's base to the base of the level this editor is in.
Definition: EditorItem.hh:246
gazebo::gui::EditorItem::PoseOriginTransformed
void PoseOriginTransformed(const double _x, const double _y, const double _z, const double _roll, const double _pitch, const double _yaw)
Qt signal emitted when the editor item pose origin has changed.
gazebo::gui::EditorItem::SetName
virtual void SetName(const std::string &_name)
Set the name of this editor item.
gazebo::gui::EditorItem::YawChanged
void YawChanged(const double _yaw)
Qt signal emitted when the editor item yaw rotation has changed.
gazebo::gui::EditorItem::Level
int Level() const
Get the level in which this building item is located.
gazebo::gui::EditorItem::itemScale
double itemScale
Scale for converting from pixel to metric units.
Definition: EditorItem.hh:262
gazebo::gui::EditorItem::visual3dTransparency
float visual3dTransparency
Transparency of the associated 3D visual.
Definition: EditorItem.hh:255
gazebo::gui::EditorItem::visual3dTexture
std::string visual3dTexture
Texture of the associated 3D visual.
Definition: EditorItem.hh:252
gazebo::gui::EditorItem::PosYChanged
void PosYChanged(const double _posY)
Qt signal emitted when the editor item's Y position has changed.
gazebo::gui::EditorItem::ItemDeleted
void ItemDeleted()
Qt signal emitted when the editor item is being deleted.
gazebo::gui::EditorItem::Texture3d
virtual std::string Texture3d() const
Get the associated 3D visual's texture.
gazebo::gui::EditorItem::LevelBaseHeight
double LevelBaseHeight() const
Get the base height of this level relative to the ground plane.
gazebo::gui::EditorItem::SetColor3d
void SetColor3d(const ignition::math::Color &_color)
Set the associated 3D visual's color.
gazebo::gui::EditorItem::zValueIdle
int zValueIdle
Z ordering of the rect item when idle (unselected.)
Definition: EditorItem.hh:230
gazebo::gui::EditorItem::DepthChanged
void DepthChanged(const double _depth)
Qt signal emitted when the editor item depth has changed.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::EditorItem::ZValueSelected
int ZValueSelected() const
Get the z value of this item when in selected state.
gazebo::gui::EditorItem::TextureChanged
void TextureChanged(const std::string &_texture)
Qt signal emitted when the editor item's 3D texture has changed.
gazebo::gui::EditorItem::PositionChanged
void PositionChanged(const double _x, const double _y, const double _z)
Qt signal emitted when the editor item position has changed.
gazebo::gui::EditorItem::ColorChanged
void ColorChanged(const ignition::math::Color &_color)
Qt signal emitted when the editor item's 3D color has changed.
gazebo::gui::EditorItem::visual3dColor
ignition::math::Color visual3dColor
Color of the associated 3D visual.
Definition: EditorItem.hh:249
gazebo::gui::EditorItem::RotationChanged
void RotationChanged(const double _roll, const double _pitch, const double _yaw)
Qt signal emitted when the editor item rotation has changed.
gazebo::gui::EditorItem::ItemType
virtual std::string ItemType() const
Get the type of the editor item.
gazebo::gui::EditorItem::highlighted
bool highlighted
Flag to indicate whether this item is currently highlighted or not.
Definition: EditorItem.hh:259
gazebo::gui::EditorItem::name
std::string name
Name of editor item.
Definition: EditorItem.hh:239
gazebo::gui::EditorItem::PoseChanged
void PoseChanged(const double _x, const double _y, const double _z, const double _roll, const double _pitch, const double _yaw)
Qt signal emitted when the editor item pose has changed.
gazebo::gui::EditorItem::Size
virtual ignition::math::Vector3d Size() const
Get the size of the item in pixels.
gazebo::gui::EditorItem::PosZChanged
void PosZChanged(const double _posZ)
Qt signal emitted when the editor item's Z position has changed.
gazebo::gui::EditorItem::TransparencyChanged
void TransparencyChanged(const float _transparency)
Qt signal emitted when the editor item's 3D transparency has changed.
gazebo::gui::EditorItem::ScenePosition
virtual ignition::math::Vector3d ScenePosition() const
Get the scene position of editor item.
gazebo::gui::EditorItem::SetTexture3d
void SetTexture3d(const std::string &_texture)
Set the associated 3D visual's texture.
gazebo::gui::EditorItem::HeightChanged
void HeightChanged(const double _height)
Qt signal emitted when the editor item height has changed.
gazebo::gui::EditorItem::WidthChanged
void WidthChanged(const double _width)
Qt signal emitted when the editor item width has changed.