All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::layout::ItemGroup Class Reference

Class that represents the grouping of objects of type QGraphicsItem, MVC components. Its coordinate system is the same of scene (millimeters). He is also the son of ItemObserver and ObjectItem, so it can become observer of a model (Observable). More...

#include <ItemGroup.h>

Inheritance diagram for te::layout::ItemGroup:
te::layout::ItemObserver te::layout::Observer te::layout::MovingItemGroup

Public Member Functions

virtual void addToGroup (QGraphicsItem *item)
 
virtual void changeZoomFactor (double currentZoomFactor)
 It is called immediately by the Scene when the zoom factor is changed in the Context. More...
 
virtual bool contains (const QPointF &point) const
 
virtual ItemControllergetController ()
 Returns the "Controller" part of the MVC. More...
 
virtual ObservablegetModel ()
 Returns the "Model" part of the MVC. More...
 
virtual std::string getNameClass ()
 Method that returns the class name. More...
 
virtual te::gm::Coord2D getPosition ()
 Method that returns the position llx, lly Reimplement this function in a ItemObserver subclass to provide the item's getPosition implementation. More...
 
virtual te::color::RGBAColor ** getRGBAColorImage (int &w, int &h)
 Returns a image of the graphic component. Reimplement this function in a ItemObserver subclass to provide the item's getImage implementation. More...
 
virtual bool isCanChangeGraphicOrder ()
 Returns whether the graphic component to be or not send to back or bring to front. More...
 
virtual bool isInvertedMatrix ()
 Returns whether the graph component has the inverted matrix, otherwise the matrix scene. More...
 
virtual bool isPrintable ()
 Returns whether the graphic component is printable. More...
 
 ItemGroup (ItemController *controller, Observable *o)
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 
virtual void recalculateBoundingRect ()
 The default implementation does nothing. More...
 
virtual void redraw (bool bRefresh=true)
 Redraws the graphic component. More...
 
virtual void refresh (bool pos=true)
 Updated model state. More...
 
virtual void setCanChangeGraphicOrder (bool canChange)
 Change the state of the graphic component to be or not send to back or bring to front. More...
 
void setPixmap (const QPixmap &pixmap)
 
virtual void setPrintable (bool print)
 Modifies the state of the graphic component to be or not printable. More...
 
void setZValue (qreal z)
 
virtual void updateObserver (ContextItem context)
 Reimplemented from Observer. More...
 
virtual ~ItemGroup ()
 

Protected Member Functions

virtual void applyRotation ()
 Rotates the graphic component. Reimplement this function in a ItemObserver subclass to provide the item's applyImage implementation. More...
 
void drawBackground (QPainter *painter)
 
void drawSelection (QPainter *painter)
 
virtual int getZValueItem ()
 Return the Z value. Reimplement this function in a ItemObserver subclass to provide the item's getZValueItem implementation. More...
 
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 
virtual void setPosition (const double &x, const double &y)
 
virtual void setZValueItem (int z)
 The Z value decides the stacking order of drawing. More...
 

Protected Attributes

bool m_canChangeGraphicOrder
 Define if item can send to back or bring to front. More...
 
te::layout::ItemControllerm_controller
 "Controller" part of MVC component. More...
 
bool m_invertedMatrix
 true if inverted, false otherwise the matrix scene More...
 
te::layout::Observablem_model
 "Model" part of MVC component. More...
 
std::string m_nameClass
 Class name. More...
 
QPixmap m_pixmap
 
bool m_printable
 State of the graphic component to be or not printable. More...
 

Detailed Description

Class that represents the grouping of objects of type QGraphicsItem, MVC components. Its coordinate system is the same of scene (millimeters). He is also the son of ItemObserver and ObjectItem, so it can become observer of a model (Observable).

See also
te::layout::ItemObserver

Definition at line 63 of file ItemGroup.h.

Constructor & Destructor Documentation

te::layout::ItemGroup::ItemGroup ( ItemController controller,
Observable o 
)
te::layout::ItemGroup::~ItemGroup ( )
virtual

Definition at line 61 of file ItemGroup.cpp.

Member Function Documentation

void te::layout::ItemGroup::addToGroup ( QGraphicsItem *  item)
virtual
void te::layout::ItemGroup::applyRotation ( )
protectedvirtual

Rotates the graphic component. Reimplement this function in a ItemObserver subclass to provide the item's applyImage implementation.

Implements te::layout::ItemObserver.

Definition at line 249 of file ItemGroup.cpp.

References te::layout::ItemModelObservable::getAngle(), and te::layout::ItemModelObservable::getOldAngle().

void te::layout::ItemObserver::changeZoomFactor ( double  currentZoomFactor)
virtualinherited

It is called immediately by the Scene when the zoom factor is changed in the Context.

Parameters
currentZoomFactorcurrent zoom factor of the layout module

Reimplemented in te::layout::MapItem.

Definition at line 134 of file ItemObserver.cpp.

Referenced by te::layout::Scene::onChangeZoomFactor().

bool te::layout::ItemGroup::contains ( const QPointF &  point) const
virtual

Definition at line 232 of file ItemGroup.cpp.

void te::layout::ItemGroup::drawBackground ( QPainter *  painter)
protected
void te::layout::ItemGroup::drawSelection ( QPainter *  painter)
protected

Definition at line 210 of file ItemGroup.cpp.

References te::map::DashLine, and te::map::SolidLine.

te::layout::ItemController * te::layout::ItemObserver::getController ( )
virtualinherited

Returns the "Controller" part of the MVC.

Returns
controller

Definition at line 99 of file ItemObserver.cpp.

te::layout::Observable * te::layout::ItemObserver::getModel ( )
virtualinherited

Returns the "Model" part of the MVC.

Returns
model

Definition at line 104 of file ItemObserver.cpp.

Referenced by te::layout::BuildGraphicsItem::addChild(), te::layout::ItemModelObservable::addChildren(), te::layout::VisitorUtils::changeMapVisitable(), te::layout::PropertiesOutside::changeMapVisitable(), te::layout::MenuBuilder::changePropertyValue(), te::layout::ChangePropertyCommand::checkItem(), te::layout::ItemUtils::countType(), te::layout::AddCommand::createCommandString(), te::layout::MoveCommand::createCommandString(), te::layout::ChangePropertyCommand::createCommandString(), te::layout::ItemUtils::createLegendChildAsObject(), te::layout::ObjectInspectorOutside::createProperty(), te::layout::ItemUtils::createTextItemFromObject(), te::layout::ItemUtils::createTextMapAsObject(), te::layout::Scene::deleteItems(), te::layout::PropertiesUtils::equalsHashCode(), te::layout::Scene::exportItemsToImage(), te::layout::PropertiesUtils::getAllProperties(), te::layout::Scene::getItemsProperties(), te::layout::ItemUtils::getMapItem(), te::layout::PropertiesOutside::getMapModel(), te::layout::ObjectInspectorOutside::hasMoveItemGroup(), te::layout::PropertiesUtils::intersection(), te::layout::GridMapItem::itemChange(), te::layout::ParentItem< T >::itemChange(), te::layout::ObjectInspectorOutside::itemsInspector(), te::layout::ItemUtils::mapNameList(), te::layout::ItemUtils::maxTypeId(), te::layout::View::mousePressEvent(), te::layout::Scene::removeSelectedItems(), te::layout::PropertiesUtils::sameProperties(), te::layout::Scene::selectItem(), te::layout::ObjectInspectorOutside::selectItems(), te::layout::PropertiesOutside::sendPropertyToSelectedItem(), and te::layout::PropertiesOutside::sendPropertyToSelectedItems().

std::string te::layout::ItemObserver::getNameClass ( )
virtualinherited

Method that returns the class name.

Returns
class name

Definition at line 124 of file ItemObserver.cpp.

Referenced by te::layout::ObjectInspectorOutside::createProperty().

te::gm::Coord2D te::layout::ItemGroup::getPosition ( )
virtual

Method that returns the position llx, lly Reimplement this function in a ItemObserver subclass to provide the item's getPosition implementation.

Returns
coordinate

Implements te::layout::ItemObserver.

Definition at line 112 of file ItemGroup.cpp.

References te::gm::Coord2D::x, and te::gm::Coord2D::y.

te::color::RGBAColor ** te::layout::ItemGroup::getRGBAColorImage ( int &  w,
int &  h 
)
virtual

Returns a image of the graphic component. Reimplement this function in a ItemObserver subclass to provide the item's getImage implementation.

Parameters
imagewidth
imageheight
Returns
image

Implements te::layout::ItemObserver.

Definition at line 271 of file ItemGroup.cpp.

References te::qt::widgets::GetImage().

int te::layout::ItemGroup::getZValueItem ( )
protectedvirtual

Return the Z value. Reimplement this function in a ItemObserver subclass to provide the item's getZValueItem implementation.

Returns
Z value

Implements te::layout::ItemObserver.

Definition at line 244 of file ItemGroup.cpp.

bool te::layout::ItemObserver::isCanChangeGraphicOrder ( )
virtualinherited

Returns whether the graphic component to be or not send to back or bring to front.

Returns
true if send to back or bring to front, false otherwise

Definition at line 119 of file ItemObserver.cpp.

Referenced by te::layout::AlignItems::bringToFront(), te::layout::Scene::createItem(), and te::layout::AlignItems::sendToBack().

bool te::layout::ItemObserver::isInvertedMatrix ( )
virtualinherited

Returns whether the graph component has the inverted matrix, otherwise the matrix scene.

Returns
true if inverted, false otherwise

Definition at line 129 of file ItemObserver.cpp.

Referenced by te::layout::Scene::insertItem(), and te::layout::View::mousePressEvent().

bool te::layout::ItemObserver::isPrintable ( )
virtualinherited

Returns whether the graphic component is printable.

Returns
true if printable, false otherwise

Definition at line 94 of file ItemObserver.cpp.

Referenced by te::layout::Scene::getItemsProperties(), and te::layout::Scene::redrawItems().

void te::layout::ItemGroup::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 136 of file ItemGroup.cpp.

void te::layout::ItemGroup::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 141 of file ItemGroup.cpp.

void te::layout::ItemGroup::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 158 of file ItemGroup.cpp.

void te::layout::ItemGroup::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
virtual
void te::layout::ItemObserver::recalculateBoundingRect ( )
virtualinherited

The default implementation does nothing.

Reimplemented in te::layout::MapItem, and te::layout::GridMapItem.

Definition at line 139 of file ItemObserver.cpp.

void te::layout::ItemObserver::refresh ( bool  pos = true)
virtualinherited

Updated model state.

Parameters
trueif refresh the current position, false otherwise

Definition at line 78 of file ItemObserver.cpp.

References te::gm::Coord2D::x, and te::gm::Coord2D::y.

Referenced by te::layout::ItemController::contains(), te::layout::Scene::insertItem(), and te::layout::Scene::updateSelectedItemsPositions().

void te::layout::ItemObserver::setCanChangeGraphicOrder ( bool  canChange)
virtualinherited

Change the state of the graphic component to be or not send to back or bring to front.

Parameters
canChangetrue if send to back or bring to front, false otherwise

Definition at line 114 of file ItemObserver.cpp.

void te::layout::ItemGroup::setPixmap ( const QPixmap &  pixmap)

Definition at line 163 of file ItemGroup.cpp.

void te::layout::ItemGroup::setPosition ( const double &  x,
const double &  y 
)
protectedvirtual

Definition at line 107 of file ItemGroup.cpp.

void te::layout::ItemObserver::setPrintable ( bool  print)
virtualinherited

Modifies the state of the graphic component to be or not printable.

Parameters
printtrue if printable, false otherwise

Definition at line 89 of file ItemObserver.cpp.

void te::layout::ItemGroup::setZValue ( qreal  z)

Definition at line 238 of file ItemGroup.cpp.

void te::layout::ItemObserver::setZValueItem ( int  z)
protectedvirtualinherited

The Z value decides the stacking order of drawing.

Parameters
drawingorder

Definition at line 109 of file ItemObserver.cpp.

Member Data Documentation

bool te::layout::ItemObserver::m_canChangeGraphicOrder
protectedinherited

Define if item can send to back or bring to front.

Definition at line 200 of file ItemObserver.h.

Referenced by te::layout::PaperItem::PaperItem().

te::layout::ItemController* te::layout::ItemObserver::m_controller
protectedinherited

"Controller" part of MVC component.

Definition at line 197 of file ItemObserver.h.

bool te::layout::ItemObserver::m_invertedMatrix
protectedinherited

true if inverted, false otherwise the matrix scene

Definition at line 202 of file ItemObserver.h.

Referenced by te::layout::BarCodeItem::BarCodeItem(), and te::layout::ParentItem< T >::ParentItem().

te::layout::Observable* te::layout::ItemObserver::m_model
protectedinherited
QPixmap te::layout::ItemGroup::m_pixmap
protected

Definition at line 107 of file ItemGroup.h.

bool te::layout::ItemObserver::m_printable
protectedinherited

State of the graphic component to be or not printable.

Definition at line 199 of file ItemObserver.h.


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