ACF $AcfVersion:0$
Classes | 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 iview::CToolsViewLayer

Classes

struct  ShapeWithBoundingBox
 

Public Member Functions

 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 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 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 void DisconnectAllShapes () override
 Disconnect all shapes from this layer.
 
virtual void DrawShapes (QPainter &drawContext) override
 Draw all shapes using specified draw context.
 
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.
 
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.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Types

typedef QVector< ShapeWithBoundingBoxShapeList
 

Protected Member Functions

bool OnChangeShapeElement (ShapeList::Iterator elementIter)
 
void DisconnectShapeElement (ShapeList &map, ShapeList::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.
 
virtual i2d::CRect CalcBoundingBox () const
 Calculate bounding box for all shapes.
 

Protected Attributes

ShapeList m_shapes
 

Additional Inherited Members

- 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...
 

Detailed Description

Standard implementation of view layer.

It contains non interactive shapes only.

Definition at line 21 of file CViewLayer.h.

Member Typedef Documentation

◆ ShapeList

Definition at line 67 of file CViewLayer.h.

Constructor & Destructor Documentation

◆ CViewLayer()

iview::CViewLayer::CViewLayer ( )

◆ ~CViewLayer()

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

Member Function Documentation

◆ CalcBoundingBox()

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

Calculate bounding box for all shapes.

Reimplemented in iview::CInteractiveViewLayer.

◆ ConnectShape()

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

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

◆ DisconnectAllShapes()

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

Disconnect all shapes from this layer.

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

◆ DisconnectShape()

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

Implements iview::IShapeObserver.

Reimplemented in iview::CInteractiveViewLayer.

◆ DisconnectShapeElement()

void iview::CViewLayer::DisconnectShapeElement ( ShapeList map,
ShapeList::iterator  iter 
)
protected

◆ DrawShapes()

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

Draw all shapes using specified draw context.

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

◆ GetBoundingBox()

virtual i2d::CRect iview::CViewLayer::GetBoundingBox ( ) const
overridevirtual

Get bounding box of all object in this display.

Implements iview::IDisplay.

◆ GetBoundingBoxRef()

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

◆ GetClientRect()

virtual i2d::CRect iview::CViewLayer::GetClientRect ( ) const
overridevirtual

Get bounding box of client area.

Implements iview::IDisplay.

◆ GetColorSchema()

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

Get color schema.

Implements iview::IDisplay.

◆ GetParentDisplayPtr()

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

Get parent object of this display.

If this display is root, it returns NULL.

Implements iview::IDisplay.

◆ GetShapeDescriptionAt()

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

Get description to shape at specified position.

Implements iview::ITouchable.

Reimplemented in iview::CInteractiveViewLayer.

◆ GetShapes()

virtual Shapes iview::CViewLayer::GetShapes ( ) const
overridevirtual

Get all shapes on this layer.

Implements iview::IViewLayer.

◆ GetShapesCount()

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

Get count of all shapes on this layer.

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

◆ GetToolTipAt()

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

Get tooltip at specified position.

Implements iview::ITouchable.

Reimplemented in iview::CInteractiveViewLayer.

◆ GetTransform()

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

Return a screen transformation.

This transformation converts view units to screen units.

Implements iview::IDisplay.

◆ GetViewPtr()

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

Get parent view of this layer.

It can be used only when view is connected.

Implements iview::IViewLayer.

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

◆ InvalidateBoundingBox()

void iview::CViewLayer::InvalidateBoundingBox ( )
protected

◆ IsShapeConnected()

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

Check, if the shape is connected to the layer.

Implements iview::IViewLayer.

Reimplemented in iview::CInteractiveViewLayer.

◆ IsTouched()

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

Implements iview::ITouchable.

Reimplemented in iview::CInteractiveViewLayer, and iview::CToolsViewLayer.

◆ IsVisible()

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

Check, if this layer is visible.

Implements iview::IViewLayer.

Definition at line 107 of file CViewLayer.h.

◆ OnAreaInvalidated()

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

Invalidate display area.

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

Implements iview::IDisplay.

◆ OnChangeShape()

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

Implements iview::IShapeObserver.

Reimplemented in iview::CInteractiveViewLayer.

◆ OnChangeShapeElement()

bool iview::CViewLayer::OnChangeShapeElement ( ShapeList::Iterator  elementIter)
protected

◆ OnConnectView()

virtual void iview::CViewLayer::OnConnectView ( IShapeView viewPtr)
overridevirtual

Called after layer is connected to view.

Implements iview::IViewLayer.

◆ OnDisconnectView()

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

Called before layer is disconnected from view.

Implements iview::IViewLayer.

◆ RecalcAllShapes()

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

Recalculate all shapes after view changes.

Reimplemented in iview::CInteractiveViewLayer.

◆ SetBoundingBoxValid()

void iview::CViewLayer::SetBoundingBoxValid ( ) const
protected

◆ SetVisible()

virtual void iview::CViewLayer::SetVisible ( bool  state = true)
overridevirtual

Make this layer visible.

Implements iview::IViewLayer.

◆ UpdateAllShapes()

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

Send update to all shapes after view changes.

Implements iview::IViewLayer.

Member Data Documentation

◆ m_shapes

ShapeList iview::CViewLayer::m_shapes
protected

Definition at line 94 of file CViewLayer.h.


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