ACF $AcfVersion:0$
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::IViewLayer
enum  LayerType {
  LT_NONE , LT_BACKGROUND , LT_INACTIVE , LT_ACTIVE ,
  LT_CALIBRATION , LT_TOOLS
}
 
typedef QList< IShape * > Shapes
 
- Public Types inherited from iview::IDisplay
enum  ChangeFlags {
  CF_TRANSFORM = 0x3f67360 , CF_COLORS , CF_SIZE , CF_EDIT_MODE ,
  CF_DISPLAY_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_AREA , 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_ADD , MPM_LAST
}
 Defines possible states of mouse pointer. More...
 
enum  EditMode {
  EM_NONE = 0 , EM_MOVE = 1 , EM_ADD = 2 , EM_REMOVE = 3 ,
  EM_LAST = 100
}
 Describes standard edit modes. More...
 
enum  DisplayMode { DM_DEFAULT = 0 }
 Describes standard display modes. More...
 
typedef QSet< IInteractiveShape * > SelectedShapes
 

Public Member Functions

 CInteractiveViewLayer ()
 
virtual ~CInteractiveViewLayer ()
 
virtual i2d::CRect RecalcAllShapes (const istd::IChangeable::ChangeSet &changeSet) override
 Recalculate all shapes after view changes.
 
virtual i2d::CRect CalcBoundingBox () const override
 Calculate bounding box for all shapes.
 
virtual bool ConnectInteractiveShape (IInteractiveShape *shapePtr) override
 Connect active shape object.
 
virtual int GetUnselectedShapesCount () const override
 Get number of unselected shapes.
 
virtual void DrawFocusedShape (QPainter &drawContext) override
 Draw only focused shape.
 
virtual bool OnKeyPress (int key, Qt::KeyboardModifiers modifiers) override
 Called, when key has been pressed.
 
virtual bool OnMouseButton (istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag) override
 Called, when mouse button was pushed down or up.
 
virtual bool OnFocusedMouseButton (istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag) override
 Called, when this layer has focus, and mouse button was pushed down or up on this object.
 
virtual bool OnFocusedMouseMove (istd::CIndex2d position) override
 Called, when this layer has focus, and mouse was moved.
 
virtual TouchState IsTouched (istd::CIndex2d position, IInteractiveShape **shapePtrPtr=NULL) const override
 Check, if any shape is touched.
 
virtual int GetSelectedShapesCount () const override
 Get count of selected shapes.
 
virtual void InsertSelectedShapes (SelectedShapes &result) const override
 Get set of selected shapes.
 
virtual void DeselectAllShapes () override
 Set all shapes to be deselected.
 
virtual int GetKeysState () const override
 Get state of system keys.
 
virtual int GetEditMode () const override
 Get actual edit mode.
 
virtual int GetDisplayMode () const override
 Get actual display mode.
 
virtual void OnShapeFocused (IInteractiveShape *shapePtr) override
 Called when shape get focus.
 
virtual void OnShapeDefocused (IInteractiveShape *shapePtr) override
 Called when shape loose focus.
 
virtual void OnShapeSelected (IInteractiveShape &shape, bool state=true) override
 It is called after change shape selection state.
 
virtual bool IsShapeConnected (IShape *shapePtr) override
 Check, if the shape is connected to the layer.
 
virtual bool ConnectShape (IShape *shapePtr) override
 Connect shape object to view.
 
virtual int GetShapesCount () const override
 Get count of all shapes on this layer.
 
virtual void DisconnectAllShapes () override
 Disconnect all shapes from this layer.
 
virtual void DrawShapes (QPainter &drawContext) override
 Draw all shapes using specified draw context.
 
virtual void OnChangeShape (IShape *shapePtr) override
 Invalidate a shape.
 
virtual bool DisconnectShape (IShape *shapePtr) override
 Disconnect shape object from view.
 
virtual TouchState IsTouched (istd::CIndex2d position) const override
 Check, if any shape is touched.
 
virtual QString GetShapeDescriptionAt (istd::CIndex2d position) const override
 Get description to shape at specified position.
 
virtual QString GetToolTipAt (istd::CIndex2d position) const override
 Get tooltip at specified position.
 
virtual void BeginDrag (const istd::CIndex2d &reference) override
 Called before dragging is begin.
 
virtual void SetDragPosition (const istd::CIndex2d &position) override
 Set new drag position.
 
virtual void EndDrag () override
 Called after dragging.
 
virtual bool IsDraggable () const override
 Check if drag is enabled.
 
- Public Member Functions inherited from iview::CViewLayer
 CViewLayer ()
 
virtual ~CViewLayer ()
 
virtual void OnConnectView (IShapeView *viewPtr) override
 Called after layer is connected to view.
 
virtual void OnDisconnectView (IShapeView *viewPtr) override
 Called before layer is disconnected from view.
 
virtual IShapeViewGetViewPtr () const override
 Get parent view of this layer.
 
virtual Shapes GetShapes () const override
 Get all shapes on this layer.
 
virtual void UpdateAllShapes (const istd::IChangeable::ChangeSet &changeSet) override
 Send update to all shapes after view changes.
 
virtual bool IsVisible () const override
 Check, if this layer is visible.
 
virtual void SetVisible (bool state=true) override
 Make this layer visible.
 
virtual IDisplayGetParentDisplayPtr () const override
 Get parent object of this display.
 
virtual const CScreenTransformGetTransform () const override
 Return a screen transformation.
 
virtual i2d::CRect GetBoundingBox () const override
 Get bounding box of all object in this display.
 
virtual i2d::CRect GetClientRect () const override
 Get bounding box of client area.
 
virtual const IColorSchemaGetColorSchema () const override
 Get color schema.
 
virtual void OnAreaInvalidated (const i2d::CRect &prevArea, const i2d::CRect &newArea) override
 Invalidate display area.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Attributes

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

Additional Inherited Members

- Protected Types inherited from iview::CViewLayer
typedef QVector< ShapeWithBoundingBoxShapeList
 
- Protected Member Functions inherited from iview::CViewLayer
bool OnChangeShapeElement (ShapeList::Iterator elementIter)
 
void DisconnectShapeElement (ShapeList &map, ShapeList::iterator iter)
 
void InvalidateBoundingBox ()
 
i2d::CRectGetBoundingBoxRef () const
 
void SetBoundingBoxValid () const
 

Detailed Description

Definition at line 14 of file CInteractiveViewLayer.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 19 of file CInteractiveViewLayer.h.

Constructor & Destructor Documentation

◆ CInteractiveViewLayer()

iview::CInteractiveViewLayer::CInteractiveViewLayer ( )

◆ ~CInteractiveViewLayer()

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

Member Function Documentation

◆ BeginDrag()

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

Called before dragging is begin.

It set also reference value for dragging position.

Implements iview::IDraggable.

◆ CalcBoundingBox()

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

Calculate bounding box for all shapes.

Reimplemented from iview::CViewLayer.

◆ ConnectInteractiveShape()

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

Connect active shape object.

Implements iview::ISelectableLayer.

◆ ConnectShape()

virtual bool iview::CInteractiveViewLayer::ConnectShape ( IShape shapePtr)
overridevirtual

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.

◆ DeselectAllShapes()

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

Set all shapes to be deselected.

Implements iview::ISelectable.

◆ DisconnectAllShapes()

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

Disconnect all shapes from this layer.

Reimplemented from iview::CViewLayer.

◆ DisconnectShape()

virtual bool iview::CInteractiveViewLayer::DisconnectShape ( IShape shapePtr)
overridevirtual

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.

◆ DrawFocusedShape()

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

Draw only focused shape.

Implements iview::ISelectableLayer.

◆ DrawShapes()

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

Draw all shapes using specified draw context.

Reimplemented from iview::CViewLayer.

◆ EndDrag()

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

Called after dragging.

Implements iview::IDraggable.

◆ GetDisplayMode()

int iview::CInteractiveViewLayer::GetDisplayMode ( ) const
inlineoverridevirtual

Get actual display mode.

Implements iview::ISelectable.

Definition at line 101 of file CInteractiveViewLayer.h.

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

◆ GetEditMode()

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

Get actual edit mode.

Implements iview::ISelectable.

Definition at line 92 of file CInteractiveViewLayer.h.

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

◆ GetKeysState()

int iview::CInteractiveViewLayer::GetKeysState ( ) const
inlineoverridevirtual

Get state of system keys.

Implements iview::ISelectable.

Definition at line 83 of file CInteractiveViewLayer.h.

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

◆ GetSelectedShapesCount()

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

Get count of selected shapes.

Implements iview::ISelectable.

◆ GetShapeDescriptionAt()

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

Get description to shape at specified position.

Reimplemented from iview::CViewLayer.

◆ GetShapesCount()

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

Get count of all shapes on this layer.

Reimplemented from iview::CViewLayer.

◆ GetToolTipAt()

virtual QString iview::CInteractiveViewLayer::GetToolTipAt ( istd::CIndex2d  position) const
overridevirtual

Get tooltip at specified position.

Reimplemented from iview::CViewLayer.

◆ GetUnselectedShapesCount()

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

Get number of unselected shapes.

Implements iview::ISelectableLayer.

◆ InsertSelectedShapes()

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

Get set of selected shapes.

Implements iview::ISelectable.

◆ IsDraggable()

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

Check if drag is enabled.

Implements iview::IDraggable.

◆ IsShapeConnected()

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

Check, if the shape is connected to the layer.

Reimplemented from iview::CViewLayer.

◆ IsTouched() [1/2]

virtual TouchState iview::CInteractiveViewLayer::IsTouched ( istd::CIndex2d  position) const
overridevirtual

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.

◆ IsTouched() [2/2]

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

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.

◆ OnChangeShape()

virtual void iview::CInteractiveViewLayer::OnChangeShape ( IShape shapePtr)
overridevirtual

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.

◆ OnFocusedMouseButton()

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

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.

◆ OnFocusedMouseMove()

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

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

Returns
true, if this event was consumed.

Implements iview::ISelectableLayer.

◆ OnKeyPress()

virtual bool iview::CInteractiveViewLayer::OnKeyPress ( int  key,
Qt::KeyboardModifiers  modifiers 
)
overridevirtual

Called, when key has been pressed.

Returns
true, if this event was consumed.

Implements iview::ISelectableLayer.

◆ OnMouseButton()

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

Called, when mouse button was pushed down or up.

Returns
true, if this event was consumed.

Implements iview::ISelectableLayer.

◆ OnShapeDefocused()

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

Called when shape loose focus.

Implements iview::ISelectable.

◆ OnShapeFocused()

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

Called when shape get focus.

Implements iview::ISelectable.

◆ OnShapeSelected()

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

It is called after change shape selection state.

Implements iview::ISelectable.

◆ RecalcAllShapes()

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

Recalculate all shapes after view changes.

Reimplemented from iview::CViewLayer.

◆ SetDragPosition()

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

Set new drag position.

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

Implements iview::IDraggable.

Member Data Documentation

◆ m_activeShapes

ShapeList iview::CInteractiveViewLayer::m_activeShapes
protected

Definition at line 72 of file CInteractiveViewLayer.h.


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