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

#include <CInteractiveViewLayer.h>

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

Public Types

typedef CViewLayer BaseClass
 
- Public Types inherited from iview::CViewLayer
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 Types inherited from iview::ISelectable
enum  MousePointerMode {
  MPM_NONE, MPM_DEFAULT, MPM_DESELECT, MPM_POINTER,
  MPM_WAIT, MPM_CROSS, MPM_HAND, MPM_DRAG,
  MPM_SCREEN_MOVE, MPM_LAST = MPM_SCREEN_MOVE
}
 Defines possible states of mouse pointer. More...
 
enum  EditMode { EM_NONE = 0, EM_MOVE = 1, EM_ADD = 2, EM_REMOVE = 3 }
 Describes standard edit modes. More...
 
typedef QSet< IInteractiveShape * > SelectedShapes
 

Public Member Functions

 CInteractiveViewLayer ()
 
virtual ~CInteractiveViewLayer ()
 
IInteractiveShapeGetFirstActiveShape () const
 
virtual i2d::CRect RecalcAllShapes (const istd::IChangeable::ChangeSet &changeSet)
 Recalculate all shapes after view changes. More...
 
i2d::CRect CalcBoundingBox () const
 Calculate bounding box for all shapes. More...
 
virtual bool ConnectInteractiveShape (IInteractiveShape *shapePtr)
 Connect active shape object. More...
 
virtual int GetUnselectedShapesCount () const
 Get number of unselected shapes. More...
 
virtual void DrawFocusedShape (QPainter &drawContext)
 Draw only focused shape. More...
 
virtual bool OnMouseButton (istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag)
 Called, when mouse button was pushed down or up. More...
 
virtual bool OnFocusedMouseButton (istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag)
 Called, when this layer has focus, and mouse button was pushed down or up on this object. More...
 
virtual bool OnFocusedMouseMove (istd::CIndex2d position)
 Called, when this layer has focus, and mouse was moved. More...
 
virtual TouchState IsTouched (istd::CIndex2d position, IInteractiveShape **shapePtrPtr=NULL) const
 Check, if any shape is touched. More...
 
virtual int GetSelectedShapesCount () const
 Get count of selected shapes. More...
 
virtual void InsertSelectedShapes (SelectedShapes &result) const
 Get set of selected shapes. More...
 
virtual void DeselectAllShapes ()
 Set all shapes to be deselected. More...
 
virtual int GetKeysState () const
 Get state of system keys. More...
 
virtual int GetEditMode () const
 Get actual edit mode. More...
 
virtual void OnShapeFocused (IInteractiveShape *shapePtr)
 Called when shape get focus. More...
 
virtual void OnShapeDefocused (IInteractiveShape *shapePtr)
 Called when shape loose focus. More...
 
virtual void OnShapeSelected (IInteractiveShape &shape, bool state=true)
 It is called after change shape selection state. 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 DisconnectAllShapes ()
 Disconnect all shapes from this layer. More...
 
virtual void DrawShapes (QPainter &drawContext)
 Draw all shapes using specified draw context. 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...
 
virtual void BeginDrag (const istd::CIndex2d &reference)
 Called before dragging is begin. More...
 
virtual void SetDragPosition (const istd::CIndex2d &position)
 Set new drag position. More...
 
virtual void EndDrag ()
 Called after dragging. More...
 
virtual bool IsDraggable () const
 Check if drag is enabled. More...
 
- Public Member Functions inherited from iview::CViewLayer
 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 void UpdateAllShapes (const istd::IChangeable::ChangeSet &changeSet)
 Send update to all shapes after view changes. 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...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Attributes

ShapeMap m_activeShapes
 
- Protected Attributes inherited from iview::CViewLayer
ShapeMap m_shapes
 

Additional Inherited Members

- Protected Types inherited from iview::CViewLayer
typedef QMap< IShape
*, i2d::CRect
ShapeMap
 
- Protected Member Functions inherited from iview::CViewLayer
bool OnChangeShapeElement (ShapeMap::Iterator elementIter)
 
void DisconnectShapeElement (ShapeMap &map, ShapeMap::iterator iter)
 
void InvalidateBoundingBox ()
 
i2d::CRectGetBoundingBoxRef () const
 
void SetBoundingBoxValid () const
 

Detailed Description

Definition at line 14 of file CInteractiveViewLayer.h.

Member Typedef Documentation

Definition at line 19 of file CInteractiveViewLayer.h.

Constructor & Destructor Documentation

iview::CInteractiveViewLayer::CInteractiveViewLayer ( )
virtual iview::CInteractiveViewLayer::~CInteractiveViewLayer ( )
virtual

Member Function Documentation

virtual void iview::CInteractiveViewLayer::BeginDrag ( const istd::CIndex2d reference)
virtual

Called before dragging is begin.

It set also reference value for dragging position.

Implements iview::IDraggable.

i2d::CRect iview::CInteractiveViewLayer::CalcBoundingBox ( ) const
virtual

Calculate bounding box for all shapes.

Reimplemented from iview::CViewLayer.

virtual bool iview::CInteractiveViewLayer::ConnectInteractiveShape ( IInteractiveShape shapePtr)
virtual

Connect active shape object.

Implements iview::ISelectableLayer.

virtual bool iview::CInteractiveViewLayer::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.

Reimplemented from iview::CViewLayer.

virtual void iview::CInteractiveViewLayer::DeselectAllShapes ( )
virtual

Set all shapes to be deselected.

Implements iview::ISelectable.

virtual void iview::CInteractiveViewLayer::DisconnectAllShapes ( )
virtual

Disconnect all shapes from this layer.

Reimplemented from iview::CViewLayer.

virtual bool iview::CInteractiveViewLayer::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.

Reimplemented from iview::CViewLayer.

virtual void iview::CInteractiveViewLayer::DrawFocusedShape ( QPainter &  drawContext)
virtual

Draw only focused shape.

Implements iview::ISelectableLayer.

virtual void iview::CInteractiveViewLayer::DrawShapes ( QPainter &  drawContext)
virtual

Draw all shapes using specified draw context.

Reimplemented from iview::CViewLayer.

virtual void iview::CInteractiveViewLayer::EndDrag ( )
virtual

Called after dragging.

Implements iview::IDraggable.

int iview::CInteractiveViewLayer::GetEditMode ( ) const
inlinevirtual

Get actual edit mode.

Implements iview::ISelectable.

Definition at line 91 of file CInteractiveViewLayer.h.

References iview::ISelectable::GetEditMode(), iview::CViewLayer::GetViewPtr(), and NULL.

IInteractiveShape* iview::CInteractiveViewLayer::GetFirstActiveShape ( ) const
int iview::CInteractiveViewLayer::GetKeysState ( ) const
inlinevirtual

Get state of system keys.

Implements iview::ISelectable.

Definition at line 82 of file CInteractiveViewLayer.h.

References iview::ISelectable::GetKeysState(), iview::CViewLayer::GetViewPtr(), and NULL.

virtual int iview::CInteractiveViewLayer::GetSelectedShapesCount ( ) const
virtual

Get count of selected shapes.

Implements iview::ISelectable.

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

Get description to shape at specified position.

Reimplemented from iview::CViewLayer.

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

Get count of all shapes on this layer.

Reimplemented from iview::CViewLayer.

virtual int iview::CInteractiveViewLayer::GetUnselectedShapesCount ( ) const
virtual

Get number of unselected shapes.

Implements iview::ISelectableLayer.

virtual void iview::CInteractiveViewLayer::InsertSelectedShapes ( SelectedShapes result) const
virtual

Get set of selected shapes.

Implements iview::ISelectable.

virtual bool iview::CInteractiveViewLayer::IsDraggable ( ) const
virtual

Check if drag is enabled.

Implements iview::IDraggable.

virtual bool iview::CInteractiveViewLayer::IsShapeConnected ( IShape shapePtr)
virtual

Check, if the shape is connected to the layer.

Reimplemented from iview::CViewLayer.

virtual TouchState iview::CInteractiveViewLayer::IsTouched ( istd::CIndex2d  position,
IInteractiveShape **  shapePtrPtr = NULL 
) const
virtual

Check, if any shape is touched.

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

Parameters
shapePtrPtrpointer to shape pointer will be filled if shape is found. It can be equal NULL.
Returns
touch state for the shape, or iview::IInteractiveShape::TS_NONE, when nothing found.

Implements iview::ISelectableLayer.

virtual TouchState iview::CInteractiveViewLayer::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.

Reimplemented from iview::CViewLayer.

virtual void iview::CInteractiveViewLayer::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.

Reimplemented from iview::CViewLayer.

virtual bool iview::CInteractiveViewLayer::OnFocusedMouseButton ( istd::CIndex2d  position,
Qt::MouseButton  buttonType,
bool  downFlag 
)
virtual

Called, when this layer has focus, and mouse button was pushed down or up on this object.

Returns
true, if this event was consumed.

Implements iview::ISelectableLayer.

virtual bool iview::CInteractiveViewLayer::OnFocusedMouseMove ( istd::CIndex2d  position)
virtual

Called, when this layer has focus, and mouse was moved.

Returns
true, if this event was consumed.

Implements iview::ISelectableLayer.

virtual bool iview::CInteractiveViewLayer::OnMouseButton ( istd::CIndex2d  position,
Qt::MouseButton  buttonType,
bool  downFlag 
)
virtual

Called, when mouse button was pushed down or up.

Returns
true, if this event was consumed.

Implements iview::ISelectableLayer.

virtual void iview::CInteractiveViewLayer::OnShapeDefocused ( IInteractiveShape shapePtr)
virtual

Called when shape loose focus.

Implements iview::ISelectable.

virtual void iview::CInteractiveViewLayer::OnShapeFocused ( IInteractiveShape shapePtr)
virtual

Called when shape get focus.

Implements iview::ISelectable.

virtual void iview::CInteractiveViewLayer::OnShapeSelected ( IInteractiveShape shape,
bool  state = true 
)
virtual

It is called after change shape selection state.

Implements iview::ISelectable.

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

Recalculate all shapes after view changes.

Reimplemented from iview::CViewLayer.

virtual void iview::CInteractiveViewLayer::SetDragPosition ( const istd::CIndex2d position)
virtual

Set new drag position.

It must be enclosed using BeginDrag() and EndDrag() methods.

Implements iview::IDraggable.

Member Data Documentation

ShapeMap iview::CInteractiveViewLayer::m_activeShapes
protected

Definition at line 71 of file CInteractiveViewLayer.h.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy