Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
iview::CViewLayer Class Reference

Standard implementation of view layer. More...

#include <CViewLayer.h>

Inheritance diagram for iview::CViewLayer:
iview::IViewLayer iview::IDisplay iview::ITouchable iview::IShapeObserver istd::IPolymorphic istd::IPolymorphic iview::CInteractiveViewLayer

Public Types

typedef QList< IShape * > Shapes
 
- Public Types inherited from iview::IViewLayer
enum  LayerType {
  LT_NONE, LT_BACKGROUND, LT_INACTIVE, LT_ACTIVE,
  LT_CALIBRATION
}
 
- Public Types inherited from iview::IDisplay
enum  ChangeFlags {
  CF_TRANSFORM = 0x3f67360, CF_COLORS, CF_SIZE, CF_EDIT_MODE,
  CS_CONSOLE
}
 Define possible display change flags. More...
 
- Public Types inherited from iview::ITouchable
enum  TouchState {
  TS_NONE, TS_INACTIVE, TS_TICKER, TS_DRAGGABLE,
  TS_OTHER, TS_LAST = TS_OTHER
}
 Enumeration for possible shape touch states. More...
 

Public Member Functions

 CViewLayer ()
 
virtual ~CViewLayer ()
 
Shapes GetAllShapes () const
 
virtual void OnConnectView (IShapeView *viewPtr)
 Called after layer is connected to view. More...
 
virtual void OnDisconnectView (IShapeView *viewPtr)
 Called before layer is disconnected from view. More...
 
virtual IShapeViewGetViewPtr () const
 Get parent view of this layer. More...
 
virtual bool IsShapeConnected (IShape *shapePtr)
 Check, if the shape is connected to the layer. More...
 
virtual bool ConnectShape (IShape *shapePtr)
 Connect shape object to view. More...
 
virtual int GetShapesCount () const
 Get count of all shapes on this layer. More...
 
virtual void UpdateAllShapes (const istd::IChangeable::ChangeSet &changeSet)
 Send update to all shapes after view changes. More...
 
virtual void DisconnectAllShapes ()
 Disconnect all shapes from this layer. More...
 
virtual void DrawShapes (QPainter &drawContext)
 Draw all shapes using specified draw context. More...
 
virtual bool IsVisible () const
 Check, if this layer is visible. More...
 
virtual void SetVisible (bool state=true)
 Make this layer visible. More...
 
virtual IDisplayGetParentDisplayPtr () const
 Get parent object of this display. More...
 
virtual const CScreenTransformGetTransform () const
 Return a screen transformation. More...
 
virtual i2d::CRect GetBoundingBox () const
 Get bounding box of all object in this display. More...
 
virtual i2d::CRect GetClientRect () const
 Get bounding box of client area. More...
 
virtual const IColorSchemaGetColorSchema () const
 Get color schema. More...
 
virtual void OnAreaInvalidated (const i2d::CRect &prevArea, const i2d::CRect &newArea)
 Invalidate display area. More...
 
virtual void OnChangeShape (IShape *shapePtr)
 Invalidate a shape. More...
 
virtual bool DisconnectShape (IShape *shapePtr)
 Disconnect shape object from view. More...
 
virtual TouchState IsTouched (istd::CIndex2d position) const
 Check, if any shape is touched. More...
 
virtual QString GetShapeDescriptionAt (istd::CIndex2d position) const
 Get description to shape at specified position. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Types

typedef QMap< IShape
*, i2d::CRect
ShapeMap
 

Protected Member Functions

bool OnChangeShapeElement (ShapeMap::Iterator elementIter)
 
void DisconnectShapeElement (ShapeMap &map, ShapeMap::iterator iter)
 
void InvalidateBoundingBox ()
 
i2d::CRectGetBoundingBoxRef () const
 
void SetBoundingBoxValid () const
 
virtual i2d::CRect RecalcAllShapes (const istd::IChangeable::ChangeSet &changeSet)
 Recalculate all shapes after view changes. More...
 
virtual i2d::CRect CalcBoundingBox () const
 Calculate bounding box for all shapes. More...
 

Protected Attributes

ShapeMap m_shapes
 

Detailed Description

Standard implementation of view layer.

It contains non interactive shapes only.

Definition at line 21 of file CViewLayer.h.

Member Typedef Documentation

typedef QMap<IShape*, i2d::CRect> iview::CViewLayer::ShapeMap
protected

Definition at line 61 of file CViewLayer.h.

Definition at line 24 of file CViewLayer.h.

Constructor & Destructor Documentation

iview::CViewLayer::CViewLayer ( )
virtual iview::CViewLayer::~CViewLayer ( )
virtual

Member Function Documentation

virtual i2d::CRect iview::CViewLayer::CalcBoundingBox ( ) const
protectedvirtual

Calculate bounding box for all shapes.

Reimplemented in iview::CInteractiveViewLayer.

virtual bool iview::CViewLayer::ConnectShape ( IShape shapePtr)
virtual

Connect shape object to view.

Parameters
shapea shape object.
activeif true, shape will be active, if false it will be only visible.
Returns
true, if it was possible to connect this shape.

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

virtual void iview::CViewLayer::DisconnectAllShapes ( )
virtual

Disconnect all shapes from this layer.

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

virtual bool iview::CViewLayer::DisconnectShape ( IShape shapePtr)
virtual

Disconnect shape object from view.

This shape had to be connected using ConnectShape.

Returns
true, if it was possible to disconnect this shape.

Implements iview::IShapeObserver.

Reimplemented in iview::CInteractiveViewLayer.

void iview::CViewLayer::DisconnectShapeElement ( ShapeMap map,
ShapeMap::iterator  iter 
)
protected
virtual void iview::CViewLayer::DrawShapes ( QPainter &  drawContext)
virtual

Draw all shapes using specified draw context.

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

Shapes iview::CViewLayer::GetAllShapes ( ) const
virtual i2d::CRect iview::CViewLayer::GetBoundingBox ( ) const
virtual

Get bounding box of all object in this display.

Implements iview::IDisplay.

i2d::CRect& iview::CViewLayer::GetBoundingBoxRef ( ) const
protected
virtual i2d::CRect iview::CViewLayer::GetClientRect ( ) const
virtual

Get bounding box of client area.

Implements iview::IDisplay.

virtual const IColorSchema& iview::CViewLayer::GetColorSchema ( ) const
virtual

Get color schema.

Implements iview::IDisplay.

virtual IDisplay* iview::CViewLayer::GetParentDisplayPtr ( ) const
virtual

Get parent object of this display.

If this display is root, it returns NULL.

Implements iview::IDisplay.

virtual QString iview::CViewLayer::GetShapeDescriptionAt ( istd::CIndex2d  position) const
virtual

Get description to shape at specified position.

Implements iview::ITouchable.

Reimplemented in iview::CInteractiveViewLayer.

virtual int iview::CViewLayer::GetShapesCount ( ) const
virtual

Get count of all shapes on this layer.

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

virtual const CScreenTransform& iview::CViewLayer::GetTransform ( ) const
virtual

Return a screen transformation.

This transformation converts view units to screen units.

Implements iview::IDisplay.

virtual IShapeView* iview::CViewLayer::GetViewPtr ( ) const
virtual

Get parent view of this layer.

It can be used only when view is connected.

Implements iview::IViewLayer.

Referenced by iview::CInteractiveViewLayer::GetEditMode(), and iview::CInteractiveViewLayer::GetKeysState().

void iview::CViewLayer::InvalidateBoundingBox ( )
protected
virtual bool iview::CViewLayer::IsShapeConnected ( IShape shapePtr)
virtual

Check, if the shape is connected to the layer.

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

virtual TouchState iview::CViewLayer::IsTouched ( istd::CIndex2d  position) const
virtual

Check, if any shape is touched.

When shape is touched, it return also pointer to this shape.

Returns
touch state for the shape, or iview::IInteractiveShape::TS_NONE, when nothing found.

Implements iview::ITouchable.

Reimplemented in iview::CInteractiveViewLayer.

bool iview::CViewLayer::IsVisible ( ) const
inlinevirtual

Check, if this layer is visible.

Implements iview::IViewLayer.

Definition at line 101 of file CViewLayer.h.

virtual void iview::CViewLayer::OnAreaInvalidated ( const i2d::CRect prevArea,
const i2d::CRect newArea 
)
virtual

Invalidate display area.

Parameters
prevAreaprevious area used to display object.
newAreanew area used to display object.

Implements iview::IDisplay.

virtual void iview::CViewLayer::OnChangeShape ( IShape shapePtr)
virtual

Invalidate a shape.

When you call Update, all invalidated shapes will be repainted.

Returns
true, if it was possible to invalidate this shape.

Implements iview::IShapeObserver.

Reimplemented in iview::CInteractiveViewLayer.

bool iview::CViewLayer::OnChangeShapeElement ( ShapeMap::Iterator  elementIter)
protected
virtual void iview::CViewLayer::OnConnectView ( IShapeView viewPtr)
virtual

Called after layer is connected to view.

Implements iview::IViewLayer.

virtual void iview::CViewLayer::OnDisconnectView ( IShapeView viewPtr)
virtual

Called before layer is disconnected from view.

Implements iview::IViewLayer.

virtual i2d::CRect iview::CViewLayer::RecalcAllShapes ( const istd::IChangeable::ChangeSet changeSet)
protectedvirtual

Recalculate all shapes after view changes.

Reimplemented in iview::CInteractiveViewLayer.

void iview::CViewLayer::SetBoundingBoxValid ( ) const
protected
virtual void iview::CViewLayer::SetVisible ( bool  state = true)
virtual

Make this layer visible.

Implements iview::IViewLayer.

virtual void iview::CViewLayer::UpdateAllShapes ( const istd::IChangeable::ChangeSet changeSet)
virtual

Send update to all shapes after view changes.

Implements iview::IViewLayer.

Member Data Documentation

ShapeMap iview::CViewLayer::m_shapes
protected

Definition at line 88 of file CViewLayer.h.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy