Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gazebo::gui::RectItem Class Reference

2D rectangle. More...

#include <RectItem.hh>

Inheritance diagram for gazebo::gui::RectItem:
Inheritance graph
[legend]

Public Types

enum  ResizeFlags { NONE = 0x00, ITEM_WIDTH = 0x01, ITEM_HEIGHT = 0x02 }
 Resize flags used to indicate which dimension can be resized. More...
 

Public Member Functions

 RectItem ()
 Constructor. More...
 
virtual ~RectItem ()
 Destructor. More...
 
void DetachFromParent ()
 Detach the rect item from its parent. More...
 
double GetAngleOnWall () const
 Get the angle of this item inside its parent wall. More...
 
double GetHeight () const
 Get the height of the rect item. More...
 
double GetPositionOnWall () const
 Get the position of this item inside its parent wall. More...
 
virtual double GetRotation () const
 Get the rotation of the rect item. More...
 
virtual QVector3D GetScenePosition () const
 Get the scene position of editor item. More...
 
virtual double GetSceneRotation () const
 Get the scene rotation of the editor item. More...
 
virtual QVector3D GetSize () const
 Get the size of the item in pixels. More...
 
double GetWidth () const
 Get the width of the rect item. More...
 
void SetAngleOnWall (double _angleOnWall)
 Set the angle of this item inside its parent wall. More...
 
void SetHeight (int _height)
 Set the height of the rect item. More...
 
void SetHighlighted (bool _highlighted)
 Set whether this item should be highlighted or not. More...
 
virtual void SetPosition (const QPointF &_pos)
 Set the position of the rect item. More...
 
virtual void SetPosition (double _x, double _y)
 Set the position of the rect item. More...
 
void SetPositionOnWall (double _positionOnWall)
 Set the position of this item inside its parent wall. More...
 
virtual void SetResizeFlag (unsigned int _flag)
 Set the resize flag of the rect item. More...
 
virtual void SetRotation (double _angle)
 Set the rotation of the rect item. More...
 
void SetSize (QSize _size)
 Set the size of the rect item. More...
 
void SetWidth (int _width)
 Set the width of the rect item. More...
 
void ShowHandles (bool _show)
 Show the grabber and rotate handles of the rect item. More...
 
- Public Member Functions inherited from gazebo::gui::EditorItem
 EditorItem ()
 Constructor. More...
 
 ~EditorItem ()
 Destructor. More...
 
virtual QColor Get3dColor () const
 Get the associated 3D visual's color. More...
 
virtual QString Get3dTexture () const
 Get the associated 3D visual's texture. More...
 
int GetLevel () const
 Get the level in which this building item is located. More...
 
double GetLevelBaseHeight () const
 Get the base height of this level relative to the ground plane. More...
 
virtual std::string GetName () const
 Get the name of the editor item. More...
 
virtual std::string GetType () const
 Get the type of the editor item. More...
 
void Set3dColor (QColor _color)
 Set the associated 3D visual's color. More...
 
void Set3dTexture (QString _texture)
 Set the associated 3D visual's texture. More...
 
void Set3dTransparency (float _transparency)
 Set the transparency of the associated 3D visual. More...
 
void SetLevel (int _level)
 Set the level of this building item. More...
 
void SetLevelBaseHeight (double _height)
 Set the base height of this level relative to the ground plane. More...
 
virtual void SetName (const std::string &_name)
 Set the name of this editor item. More...
 
int ZValueIdle () const
 Get the z value of this item when in idle state. More...
 
int ZValueSelected () const
 Get the z value of this item when in selected state. More...
 

Protected Member Functions

virtual QRectF boundingRect () const
 Get the bounding box of the rect item. More...
 
void DrawBoundingBox (QPainter *_painter)
 Draw bounding box. More...
 
void UpdateCornerPositions ()
 Helper method for Updating the corner positions of the rect item. More...
 
void UpdateMeasures ()
 Update this item's measures. More...
 

Protected Attributes

QColor borderColor
 Border color of the rect item. More...
 
QAction * deleteItemAct
 Qt action for deleting the item. More...
 
double drawingHeight
 Actual height of rect item drawn in pixels. More...
 
double drawingOriginX
 X origin of the rect item in pixels. More...
 
double drawingOriginY
 Y origin of the rect item in pixels. More...
 
double drawingWidth
 Actual width of rect item drawn in pixels. More...
 
double height
 Height of rect item in pixels. More...
 
std::vector< MeasureItem * > measures
 A vector containing this item's measure items. More...
 
QAction * openInspectorAct
 Qt action for opening the inspector. More...
 
double rotationAngle
 Rotation angle of the rect item in degrees. More...
 
double width
 Width of rect item in pixels. More...
 
- Protected Attributes inherited from gazebo::gui::EditorItem
std::string editorType
 Type of editor item. More...
 
bool highlighted
 Flag to indicate whether this item is currently highlighted or not. More...
 
double itemScale
 Scale for converting from pixel to metric units. More...
 
int level
 Level that this item is on. More...
 
double levelBaseHeight
 Vertical distance from the building's base to the base of the level this editor is in. More...
 
std::string name
 Name of editor item. More...
 
QColor visual3dColor
 Color of the associated 3D visual. More...
 
QString visual3dTexture
 Texture of the associated 3D visual. More...
 
float visual3dTransparency
 Transparency of the associated 3D visual. More...
 
int zValueIdle
 Z ordering of the rect item when idle (unselected.) More...
 
int zValueSelected
 Z ordering of the rect item when selected. More...
 

Additional Inherited Members

- Signals inherited from gazebo::gui::EditorItem
void ColorChanged (QColor _color)
 Qt signal emitted when the editor item's 3D color has changed. More...
 
void DepthChanged (double _depth)
 Qt signal emitted when the editor item depth has changed. More...
 
void HeightChanged (double _height)
 Qt signal emitted when the editor item height has changed. More...
 
void ItemDeleted ()
 Qt signal emitted when the editor item is being deleted. More...
 
void LevelChanged (int _level)
 Qt signal emitted when the editor item's level has changed. More...
 
void PoseChanged (double _x, double _y, double _z, double _roll, double _pitch, double _yaw)
 Qt signal emitted when the editor item pose has changed. More...
 
void PoseOriginTransformed (double _x, double _y, double _z, double _roll, double _pitch, double _yaw)
 Qt signal emitted when the editor item pose origin has changed. More...
 
void PositionChanged (double _x, double _y, double _z)
 Qt signal emitted when the editor item position has changed. More...
 
void PosXChanged (double _posX)
 Qt signal emitted when the editor item's X position has changed. More...
 
void PosYChanged (double _posY)
 Qt signal emitted when the editor item's Y position has changed. More...
 
void PosZChanged (double _posZ)
 Qt signal emitted when the editor item's Z position has changed. More...
 
void RotationChanged (double _roll, double _pitch, double _yaw)
 Qt signal emitted when the editor item rotation has changed. More...
 
void SizeChanged (double _width, double _depth, double _height)
 Qt signal emitted when the editor item size has changed. More...
 
void TextureChanged (QString _texture)
 Qt signal emitted when the editor item's 3D texture has changed. More...
 
void TransparencyChanged (float _transparency)
 Qt signal emitted when the editor item's 3D transparency has changed. More...
 
void WidthChanged (double _width)
 Qt signal emitted when the editor item width has changed. More...
 
void YawChanged (double _yaw)
 Qt signal emitted when the editor item yaw rotation has changed. More...
 

Detailed Description

2D rectangle.

Member Enumeration Documentation

Resize flags used to indicate which dimension can be resized.

Enumerator
NONE 

No dimensions.

ITEM_WIDTH 

Width.

ITEM_HEIGHT 

Height.

Constructor & Destructor Documentation

gazebo::gui::RectItem::RectItem ( )

Constructor.

virtual gazebo::gui::RectItem::~RectItem ( )
virtual

Destructor.

Member Function Documentation

virtual QRectF gazebo::gui::RectItem::boundingRect ( ) const
protectedvirtual

Get the bounding box of the rect item.

Returns
The bounding box of the rect item.
void gazebo::gui::RectItem::DetachFromParent ( )

Detach the rect item from its parent.

void gazebo::gui::RectItem::DrawBoundingBox ( QPainter *  _painter)
protected

Draw bounding box.

Parameters
[in]_painterQt painter object.
double gazebo::gui::RectItem::GetAngleOnWall ( ) const

Get the angle of this item inside its parent wall.

Returns
Angle on parent wall in degrees.
double gazebo::gui::RectItem::GetHeight ( ) const

Get the height of the rect item.

Returns
Height of the rect item in pixels.
double gazebo::gui::RectItem::GetPositionOnWall ( ) const

Get the position of this item inside its parent wall.

Returns
Normalized position on parent wall.
virtual double gazebo::gui::RectItem::GetRotation ( ) const
virtual

Get the rotation of the rect item.

Returns
Rotation in degrees.
virtual QVector3D gazebo::gui::RectItem::GetScenePosition ( ) const
virtual

Get the scene position of editor item.

Returns
Scene position in pixel coordinates.

Reimplemented from gazebo::gui::EditorItem.

Reimplemented in gazebo::gui::FloorItem, gazebo::gui::StairsItem, gazebo::gui::DoorItem, and gazebo::gui::WindowItem.

virtual double gazebo::gui::RectItem::GetSceneRotation ( ) const
virtual

Get the scene rotation of the editor item.

Returns
Scene rotation in degrees.

Reimplemented from gazebo::gui::EditorItem.

Reimplemented in gazebo::gui::FloorItem, gazebo::gui::StairsItem, gazebo::gui::DoorItem, and gazebo::gui::WindowItem.

virtual QVector3D gazebo::gui::RectItem::GetSize ( ) const
virtual

Get the size of the item in pixels.

Returns
Size in pixels.

Reimplemented from gazebo::gui::EditorItem.

Reimplemented in gazebo::gui::FloorItem, gazebo::gui::StairsItem, gazebo::gui::DoorItem, and gazebo::gui::WindowItem.

double gazebo::gui::RectItem::GetWidth ( ) const

Get the width of the rect item.

Returns
Width of the rect item in pixels.
void gazebo::gui::RectItem::SetAngleOnWall ( double  _angleOnWall)

Set the angle of this item inside its parent wall.

Parameters
[in]_angleOnWallNew angle on wall, either 0 or 180 degrees.
void gazebo::gui::RectItem::SetHeight ( int  _height)

Set the height of the rect item.

Parameters
[in]_heightHeight of the rect item in pixels.
void gazebo::gui::RectItem::SetHighlighted ( bool  _highlighted)
virtual

Set whether this item should be highlighted or not.

Parameters
[in]_highlightedTrue for highlighted.

Reimplemented from gazebo::gui::EditorItem.

virtual void gazebo::gui::RectItem::SetPosition ( const QPointF &  _pos)
virtual

Set the position of the rect item.

Parameters
[in]_posPosition in pixel coordinates.
virtual void gazebo::gui::RectItem::SetPosition ( double  _x,
double  _y 
)
virtual

Set the position of the rect item.

Parameters
[in]_xX position in pixel coordinates.
[in]_yY position in pixel coordinates.
void gazebo::gui::RectItem::SetPositionOnWall ( double  _positionOnWall)

Set the position of this item inside its parent wall.

Parameters
[in]_positionOnWallNew normalized position on wall.
virtual void gazebo::gui::RectItem::SetResizeFlag ( unsigned int  _flag)
virtual

Set the resize flag of the rect item.

Parameters
[in]_flagResize flag which controls how the item can be resized.
virtual void gazebo::gui::RectItem::SetRotation ( double  _angle)
virtual

Set the rotation of the rect item.

Parameters
[in]_angleRotation angle in degrees.
void gazebo::gui::RectItem::SetSize ( QSize  _size)

Set the size of the rect item.

Parameters
[in]_sizeSize of the rect item in pixels.
void gazebo::gui::RectItem::SetWidth ( int  _width)

Set the width of the rect item.

Parameters
[in]_widthWidth of the rect item in pixels.
void gazebo::gui::RectItem::ShowHandles ( bool  _show)

Show the grabber and rotate handles of the rect item.

Parameters
[in]_showTrue to draw the handles, and false to hide them.
void gazebo::gui::RectItem::UpdateCornerPositions ( )
protected

Helper method for Updating the corner positions of the rect item.

void gazebo::gui::RectItem::UpdateMeasures ( )
protected

Update this item's measures.

Member Data Documentation

QColor gazebo::gui::RectItem::borderColor
protected

Border color of the rect item.

QAction* gazebo::gui::RectItem::deleteItemAct
protected

Qt action for deleting the item.

double gazebo::gui::RectItem::drawingHeight
protected

Actual height of rect item drawn in pixels.

double gazebo::gui::RectItem::drawingOriginX
protected

X origin of the rect item in pixels.

double gazebo::gui::RectItem::drawingOriginY
protected

Y origin of the rect item in pixels.

double gazebo::gui::RectItem::drawingWidth
protected

Actual width of rect item drawn in pixels.

double gazebo::gui::RectItem::height
protected

Height of rect item in pixels.

std::vector<MeasureItem *> gazebo::gui::RectItem::measures
protected

A vector containing this item's measure items.

Currently only used for windows and doors, containing one measure towards each end of this item's parent wall.

QAction* gazebo::gui::RectItem::openInspectorAct
protected

Qt action for opening the inspector.

double gazebo::gui::RectItem::rotationAngle
protected

Rotation angle of the rect item in degrees.

double gazebo::gui::RectItem::width
protected

Width of rect item in pixels.


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