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

Class that represents a "Model" part of Scale MVC component. Its coordinate system is the same of scene (millimeters). This is also son of ItemModelObservable, so it can become observable, and son of AbstractVisitor, so it can become visitor. It is must visit the map, via te::layout::Visitable*, to get the scale value. More...

#include <ScaleModel.h>

Inheritance diagram for te::layout::ScaleModel:
te::layout::ItemModelObservable te::layout::AbstractVisitor te::layout::Observable

Public Member Functions

virtual bool addChildren (ItemObserver *item)
 Reimplemented from Observable. More...
 
virtual bool addObserver (Observer *o)
 Reimplemented from Observable. More...
 
virtual bool contains (const te::gm::Coord2D &coord) const
 Checks if the coordinate is contained within the bounding rectangle. More...
 
virtual void disassociate ()
 Separate this object from visitable. More...
 
virtual void draw (ContextItem context)
 Drawing method of the MVC component. More...
 
virtual double getAngle ()
 Returns the value of rotation. More...
 
virtual te::color::RGBAColor getBackgroundColor ()
 Returns the background color of the MVC component. More...
 
virtual te::color::RGBAColor getBorderColor ()
 Returns the border color of the MVC component. More...
 
virtual te::gm::Envelope getBox ()
 Reimplemented from Observable. More...
 
virtual std::set< ItemObserver * > getChildren () const
 Reimplemented from Observable. More...
 
virtual EnumTypegetCurrentScaleType ()
 
virtual EnumScaleTypegetEnumScaleType ()
 
virtual int getHashCode ()
 Reimplemented from Observable. More...
 
virtual int getId ()
 Reimplemented from Observable. More...
 
virtual double getMapScale ()
 
virtual std::string getName ()
 Reimplemented from Observable. More...
 
virtual double getOldAngle ()
 Returns the value of old rotation. More...
 
virtual te::gm::Coord2D getOldPos ()
 Returns the value of old position. More...
 
virtual PropertiesgetProperties () const
 Reimplemented from Observable. More...
 
virtual te::layout::PropertiesgetPublicProperties () const
 Reimplemented from Observable. More...
 
virtual double getScaleGapX ()
 
virtual double getScaleGapY ()
 
virtual EnumTypegetType ()
 Reimplemented from Observable. More...
 
virtual VisitablegetVisitable ()
 Return the object to be visited. More...
 
virtual int getZValue ()
 Reimplemented from Observable. More...
 
virtual bool isBorder ()
 Returns whether the border should be drawn or not. More...
 
virtual bool isEnableChildren ()
 Returns true if MVC component can have children, false otherwise. More...
 
virtual bool isResizable ()
 Reimplemented from Observable. More...
 
virtual bool removeChildren (int hashCode)
 Reimplemented from Observable. More...
 
virtual bool removeObserver (Observer *o)
 Reimplemented from Observable. More...
 
virtual void resize (double w, double h)
 Resize the bounding rectangle of the MVC component. More...
 
 ScaleModel ()
 Constructor. More...
 
virtual void setAngle (double angle)
 Change the value of rotation of the MVC component. More...
 
virtual void setBackgroundColor (te::color::RGBAColor color)
 Change the background color of the MVC component. More...
 
virtual void setBorder (bool value)
 Change whether the border should be drawn or not. More...
 
virtual void setBorderColor (te::color::RGBAColor color)
 Change the background color of the MVC component. More...
 
virtual void setBox (te::gm::Envelope box)
 Change the bounding rectangle. More...
 
virtual void setEnableChildren (bool value)
 Sets true if MVC component can have children, false otherwise. More...
 
virtual void setId (int id)
 Reimplemented from Observable. More...
 
virtual void setName (std::string name)
 Change the name of the MVC component. More...
 
virtual void setPosition (const double &x, const double &y)
 Change coordinate llx,lly of the MVC component. More...
 
virtual void setResizable (bool resize)
 Reimplemented from Observable. More...
 
virtual void setScaleGapX (double x)
 
virtual void setScaleGapY (double y)
 
virtual void setType (EnumType *type)
 Reimplemented from Observable. More...
 
virtual void setZValue (int zValue)
 Reimplemented from Observable. More...
 
virtual void updateProperties (te::layout::Properties *properties)
 Reimplemented from Observable. More...
 
virtual void visit (Visitable *visitable)
 Constructor. More...
 
virtual ~ScaleModel ()
 Destructor. More...
 

Protected Member Functions

virtual void addChildrenProperties (Properties *properties)
 
virtual int calculateHashCode ()
 Returns a new hashcode. More...
 
virtual void drawBackground (ContextItem context)
 Draws the background of the MVC component. More...
 
virtual ContextItem getContextItem ()
 Returns context maintaining the drawing context of a MVC component. More...
 
virtual void notifyAll (ContextItem context)
 Reimplemented from Observable. More...
 
virtual Property scaleProperty () const
 
virtual void updateChildrenProperties (Property prop)
 
virtual void visitDependent (ContextItem context)
 visit and if necessary redraw More...
 

Protected Attributes

double m_angle
 value of rotation More...
 
te::color::RGBAColor m_backgroundColor
 background color More...
 
bool m_border
 true if should be drawn border, false otherwise More...
 
te::color::RGBAColor m_borderColor
 border color More...
 
te::gm::Envelope m_box
 bounding rectangle More...
 
te::gm::Coord2D m_centerCoordinate
 center coordinate of the bounding rectangle More...
 
std::set< ItemObserver * > m_children
 children components More...
 
EnumTypem_currentScaleType
 
bool m_enableChildren
 true if MVC component can have children, false otherwise More...
 
EnumScaleTypem_enumScaleType
 
int m_hashCode
 
int m_id
 hashcode More...
 
std::string m_mapName
 
double m_mapScale
 
std::string m_name
 name of the MVC component More...
 
std::set< Observer * > m_observers
 set of observers of this object More...
 
double m_oldAngle
 value of old rotation More...
 
te::gm::Coord2D m_oldPos
 value of old position More...
 
Propertiesm_properties
 properties More...
 
Propertiesm_publicProperties
 public properties More...
 
bool m_resizable
 true if resizable, false otherwise More...
 
double m_scaleGapX
 
double m_scaleGapY
 
SharedPropertiesm_sharedProps
 Names of common properties among all MVC components. More...
 
EnumTypem_type
 type of the MVC component More...
 
Visitablem_visitable
 object to be visited More...
 
int m_zValue
 The Z value decides the stacking order of drawing. More...
 

Detailed Description

Class that represents a "Model" part of Scale MVC component. Its coordinate system is the same of scene (millimeters). This is also son of ItemModelObservable, so it can become observable, and son of AbstractVisitor, so it can become visitor. It is must visit the map, via te::layout::Visitable*, to get the scale value.

See also
te::layout::ItemModelObservable , te::layout::AbstractVisitor

Definition at line 63 of file ScaleModel.h.

Constructor & Destructor Documentation

te::layout::ScaleModel::~ScaleModel ( )
virtual

Destructor.

Definition at line 61 of file ScaleModel.cpp.

Member Function Documentation

bool te::layout::ItemModelObservable::addChildren ( ItemObserver item)
virtualinherited
void te::layout::ItemModelObservable::addChildrenProperties ( Properties properties)
protectedvirtualinherited
bool te::layout::ItemModelObservable::addObserver ( Observer o)
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 103 of file ItemModelObservable.cpp.

int te::layout::ItemModelObservable::calculateHashCode ( )
protectedvirtualinherited

Returns a new hashcode.

Returns
hashCode

Implements te::layout::Observable.

Definition at line 476 of file ItemModelObservable.cpp.

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

bool te::layout::ItemModelObservable::contains ( const te::gm::Coord2D coord) const
virtualinherited

Checks if the coordinate is contained within the bounding rectangle.

Parameters
coordcoordinated to be verified
Returns
true if contains, false otherwise

Definition at line 280 of file ItemModelObservable.cpp.

References te::gm::Envelope::isValid(), te::gm::Coord2D::x, and te::gm::Coord2D::y.

Referenced by te::layout::ItemController::contains().

void te::layout::AbstractVisitor::disassociate ( )
virtualinherited

Separate this object from visitable.

Definition at line 72 of file AbstractVisitor.cpp.

Referenced by te::layout::Visitable::unacceptVisitor().

void te::layout::ItemModelObservable::draw ( ContextItem  context)
virtualinherited

Drawing method of the MVC component.

Parameters
contextmaintaining the drawing context of a MVC component

Reimplemented in te::layout::LegendModel, te::layout::MapModel, and te::layout::LegendChildModel.

Definition at line 532 of file ItemModelObservable.cpp.

Referenced by te::layout::ItemController::redraw().

void te::layout::ItemModelObservable::drawBackground ( ContextItem  context)
protectedvirtualinherited
double te::layout::ItemModelObservable::getAngle ( )
virtualinherited

Returns the value of rotation.

Returns
value of rotation

Definition at line 466 of file ItemModelObservable.cpp.

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

te::color::RGBAColor te::layout::ItemModelObservable::getBackgroundColor ( )
virtualinherited
te::color::RGBAColor te::layout::ItemModelObservable::getBorderColor ( )
virtualinherited

Returns the border color of the MVC component.

Returns
border color

Definition at line 244 of file ItemModelObservable.cpp.

Referenced by te::layout::ParentItem< T >::drawBorder(), and te::layout::PaperItem::drawPaper().

std::set< te::layout::ItemObserver * > te::layout::ItemModelObservable::getChildren ( ) const
virtualinherited

Reimplemented from Observable.

Definition at line 547 of file ItemModelObservable.cpp.

te::layout::EnumType * te::layout::ScaleModel::getCurrentScaleType ( )
virtual

Definition at line 221 of file ScaleModel.cpp.

Referenced by te::layout::ScaleItem::paint().

te::layout::EnumScaleType * te::layout::ScaleModel::getEnumScaleType ( )
virtual

Definition at line 180 of file ScaleModel.cpp.

Referenced by te::layout::ScaleItem::paint().

int te::layout::ItemModelObservable::getHashCode ( )
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 471 of file ItemModelObservable.cpp.

int te::layout::ItemModelObservable::getId ( )
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 401 of file ItemModelObservable.cpp.

Referenced by te::layout::ItemUtils::maxTypeId().

double te::layout::ScaleModel::getMapScale ( )
virtual
std::string te::layout::ItemModelObservable::getName ( )
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 260 of file ItemModelObservable.cpp.

Referenced by te::layout::GridMapModel::visitDependent().

double te::layout::ItemModelObservable::getOldAngle ( )
virtualinherited

Returns the value of old rotation.

Returns
value of old rotation

Definition at line 522 of file ItemModelObservable.cpp.

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

te::gm::Coord2D te::layout::ItemModelObservable::getOldPos ( )
virtualinherited

Returns the value of old position.

Returns
value of old position

Definition at line 527 of file ItemModelObservable.cpp.

te::layout::Properties * te::layout::ItemModelObservable::getPublicProperties ( ) const
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 601 of file ItemModelObservable.cpp.

References te::layout::Properties::clear().

double te::layout::ScaleModel::getScaleGapX ( )
virtual
double te::layout::ScaleModel::getScaleGapY ( )
virtual
te::layout::EnumType * te::layout::ItemModelObservable::getType ( )
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 371 of file ItemModelObservable.cpp.

te::layout::Visitable * te::layout::AbstractVisitor::getVisitable ( )
virtualinherited

Return the object to be visited.

Parameters

Definition at line 95 of file AbstractVisitor.cpp.

Referenced by te::layout::ItemUtils::createLegendChildAsObject().

int te::layout::ItemModelObservable::getZValue ( )
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 381 of file ItemModelObservable.cpp.

bool te::layout::ItemModelObservable::isBorder ( )
virtualinherited

Returns whether the border should be drawn or not.

Returns
true if should be drawn, false otherwise

Definition at line 391 of file ItemModelObservable.cpp.

Referenced by te::layout::ParentItem< T >::drawBorder().

bool te::layout::ItemModelObservable::isEnableChildren ( )
virtualinherited

Returns true if MVC component can have children, false otherwise.

Returns
true if MVC component can have children, false otherwise

Definition at line 537 of file ItemModelObservable.cpp.

Referenced by te::layout::BuildGraphicsItem::addChild().

bool te::layout::ItemModelObservable::isResizable ( )
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 428 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::notifyAll ( ContextItem  context)
protectedvirtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 123 of file ItemModelObservable.cpp.

bool te::layout::ItemModelObservable::removeChildren ( int  hashCode)
virtualinherited

Reimplemented from Observable.

Definition at line 580 of file ItemModelObservable.cpp.

Referenced by te::layout::ParentItem< T >::itemChange().

bool te::layout::ItemModelObservable::removeObserver ( Observer o)
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 113 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::resize ( double  w,
double  h 
)
virtualinherited

Resize the bounding rectangle of the MVC component.

Parameters
trueif should be drawn, false otherwise

Definition at line 411 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::setAngle ( double  angle)
virtualinherited

Change the value of rotation of the MVC component.

Parameters
valueof rotation

Definition at line 460 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::setBackgroundColor ( te::color::RGBAColor  color)
virtualinherited

Change the background color of the MVC component.

Parameters
colorbackground color

Definition at line 234 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::setBorder ( bool  value)
virtualinherited

Change whether the border should be drawn or not.

Parameters
trueif should be drawn, false otherwise

Definition at line 396 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::setBorderColor ( te::color::RGBAColor  color)
virtualinherited

Change the background color of the MVC component.

Parameters
colorborder color

Definition at line 239 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::setBox ( te::gm::Envelope  box)
virtualinherited
void te::layout::ItemModelObservable::setEnableChildren ( bool  value)
virtualinherited

Sets true if MVC component can have children, false otherwise.

Parameters
trueif MVC component can have children, false otherwise

Definition at line 542 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::setPosition ( const double &  x,
const double &  y 
)
virtualinherited

Change coordinate llx,lly of the MVC component.

Parameters
xllx
ylly

Reimplemented in te::layout::MapModel.

Definition at line 265 of file ItemModelObservable.cpp.

Referenced by te::layout::ItemController::setPosition(), and te::layout::MapModel::setPosition().

void te::layout::ItemModelObservable::setResizable ( bool  resize)
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 423 of file ItemModelObservable.cpp.

void te::layout::ScaleModel::setScaleGapX ( double  x)
virtual

Definition at line 155 of file ScaleModel.cpp.

void te::layout::ScaleModel::setScaleGapY ( double  y)
virtual

Definition at line 165 of file ScaleModel.cpp.

void te::layout::ItemModelObservable::setType ( EnumType type)
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 376 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::setZValue ( int  zValue)
virtualinherited

Reimplemented from Observable.

Implements te::layout::Observable.

Definition at line 386 of file ItemModelObservable.cpp.

void te::layout::ItemModelObservable::updateChildrenProperties ( Property  prop)
protectedvirtualinherited
void te::layout::AbstractVisitor::visit ( Visitable visitable)
virtualinherited

Constructor.

Definition at line 46 of file AbstractVisitor.cpp.

Referenced by te::layout::Visitable::acceptVisitor().

void te::layout::ScaleModel::visitDependent ( ContextItem  context)
protectedvirtual

visit and if necessary redraw

Implements te::layout::AbstractVisitor.

Definition at line 143 of file ScaleModel.cpp.

References te::layout::MapModel::getScale().

Member Data Documentation

double te::layout::ItemModelObservable::m_angle
protectedinherited

value of rotation

Definition at line 328 of file ItemModelObservable.h.

te::color::RGBAColor te::layout::ItemModelObservable::m_backgroundColor
protectedinherited
te::gm::Coord2D te::layout::ItemModelObservable::m_centerCoordinate
protectedinherited

center coordinate of the bounding rectangle

Definition at line 316 of file ItemModelObservable.h.

std::set<ItemObserver*> te::layout::ItemModelObservable::m_children
protectedinherited

children components

Definition at line 320 of file ItemModelObservable.h.

EnumType* te::layout::ScaleModel::m_currentScaleType
protected

Definition at line 106 of file ScaleModel.h.

Referenced by ScaleModel().

bool te::layout::ItemModelObservable::m_enableChildren
protectedinherited

true if MVC component can have children, false otherwise

Definition at line 332 of file ItemModelObservable.h.

Referenced by te::layout::MapLocationModel::MapLocationModel(), and te::layout::MapModel::MapModel().

EnumScaleType* te::layout::ScaleModel::m_enumScaleType
protected

Definition at line 105 of file ScaleModel.h.

Referenced by ScaleModel().

int te::layout::ItemModelObservable::m_hashCode
protectedinherited
int te::layout::ItemModelObservable::m_id
protectedinherited

hashcode

Definition at line 314 of file ItemModelObservable.h.

std::string te::layout::ScaleModel::m_mapName
protected

Definition at line 101 of file ScaleModel.h.

double te::layout::ScaleModel::m_mapScale
protected

Definition at line 102 of file ScaleModel.h.

std::string te::layout::ItemModelObservable::m_name
protectedinherited

name of the MVC component

Definition at line 326 of file ItemModelObservable.h.

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

std::set<Observer*> te::layout::ItemModelObservable::m_observers
protectedinherited

set of observers of this object

Definition at line 313 of file ItemModelObservable.h.

double te::layout::ItemModelObservable::m_oldAngle
protectedinherited

value of old rotation

Definition at line 330 of file ItemModelObservable.h.

te::gm::Coord2D te::layout::ItemModelObservable::m_oldPos
protectedinherited

value of old position

Definition at line 331 of file ItemModelObservable.h.

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

Properties* te::layout::ItemModelObservable::m_properties
protectedinherited
Properties* te::layout::ItemModelObservable::m_publicProperties
protectedinherited

public properties

Definition at line 321 of file ItemModelObservable.h.

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

bool te::layout::ItemModelObservable::m_resizable
protectedinherited

true if resizable, false otherwise

Definition at line 327 of file ItemModelObservable.h.

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

double te::layout::ScaleModel::m_scaleGapX
protected

Definition at line 103 of file ScaleModel.h.

double te::layout::ScaleModel::m_scaleGapY
protected

Definition at line 104 of file ScaleModel.h.

SharedProperties* te::layout::ItemModelObservable::m_sharedProps
protectedinherited

Names of common properties among all MVC components.

Definition at line 324 of file ItemModelObservable.h.

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

Visitable* te::layout::AbstractVisitor::m_visitable
protectedinherited

object to be visited

Definition at line 90 of file AbstractVisitor.h.

int te::layout::ItemModelObservable::m_zValue
protectedinherited

The Z value decides the stacking order of drawing.

Definition at line 323 of file ItemModelObservable.h.


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