ACF $AcfVersion:0$
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
iview::CViewBase Class Referenceabstract

#include <CViewBase.h>

Inheritance diagram for iview::CViewBase:
iview::IShapeView iview::IDraggable iview::IMouseActionObserver iview::IDisplay iview::ISelectable istd::IPolymorphic istd::IPolymorphic iview::IShapeObserver iview::ITouchable istd::IPolymorphic istd::IPolymorphic iview::CCalibratedViewBase iview::CViewport

Public Types

enum  ZoomMode {
  ZM_RESET , ZM_ZOOM_IN , ZM_ZOOM_OUT , ZM_FIT ,
  ZM_FIT_COVER , ZM_FIT_UNPROP , ZM_FIT_H , ZM_FIT_V
}
 
- Public Types inherited from iview::IShapeView
typedef IShapeObserver BaseClass
 
- 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::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 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 Member Functions

 CViewBase ()
 
virtual ~CViewBase ()
 
void SetExternalScreenTransform (const istd::TSmartPtr< iview::CScreenTransform > &screenTransformPtr)
 
void CenterTo (const iview::IShape &shape)
 Zooms the view to the given shape.
 
int GetBackgroundLayerIndex () const
 Get index of default background layer.
 
int GetInactiveLayerIndex () const
 Get index of default inactive layer.
 
int GetActiveLayerIndex () const
 Get index of default active layer.
 
virtual void AddViewEventObserver (iview::IViewEventObserver *listenerPtr) override
 Add/remove external event observers.
 
virtual void RemoveViewEventObserver (iview::IViewEventObserver *listenerPtr) override
 
virtual void SetZoom (ZoomMode zoom)
 
virtual void SetEditMode (int mode) override
 Changes the edit mode.
 
virtual void SetDisplayMode (int mode) override
 Changes the display mode.
 
virtual void Update () override
 Updates all invalidates shapes.
 
virtual void UpdateAllShapes (const istd::IChangeable::ChangeSet &changeSet)
 
virtual void SetScreenPosition (const i2d::CVector2d &client, istd::CIndex2d screen)
 
virtual const i2d::CRectangleGetFitArea () const
 
virtual void SetFitArea (const i2d::CRectangle &area) override
 Set area used for fitting of the view contents.
 
virtual void SetViewDraggable (bool state=true)
 
virtual void SetMultiselectable (bool state=true)
 
virtual void SetDraggable (bool state=true)
 
virtual void InsertDefaultLayers ()
 
virtual bool IsViewDraggable () const override
 Check if is draggable mode.
 
virtual bool IsMultiselectable () const override
 Check, if it is possible to select more than one shape.
 
virtual int InsertLayer (IViewLayer *layerPtr, int index=-1, int layerType=IViewLayer::LT_NONE) override
 Insert layer to view.
 
virtual int GetLayerIndex (const IViewLayer &layer) const override
 Get index of layer.
 
virtual int GetLayerIndex (int layerType) const override
 Get index of layer by type.
 
virtual void RemoveLayer (int index) override
 Remove layer from view.
 
virtual int GetLayersCount () const override
 Get count of layer in this view.
 
virtual IViewLayerGetLayer (int index) const override
 Get layer with the given index.
 
virtual bool ConnectShape (IShape *shapePtr) override
 Connect shape object to view.
 
virtual ISelectableLayerGetFocusedLayerPtr () const override
 Get focused layer.
 
virtual void OnLayerShapeFocused (IInteractiveShape *shapePtr, ISelectableLayer *layerPtr) override
 Called when shape in layer get focus.
 
virtual void OnLayerShapeDefocused (IInteractiveShape *shapePtr, ISelectableLayer *layerPtr) override
 Called when shape in layer loose focus.
 
virtual void OnLayerInvalidated (const IViewLayer &layer, const i2d::CRect &prevArea, const i2d::CRect &newArea) override
 Inform that layer was invalidated.
 
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 *) override
 Called when shape get focus.
 
virtual void OnShapeDefocused (IInteractiveShape *) override
 Called when shape loose focus.
 
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) const override
 Get tooltip at specified position.
 
virtual void SetTransform (const i2d::CAffine2d &transform) override
 Set a screen transformation.
 
virtual void UpdateMousePointer () override
 Update mouse pointer.
 
virtual bool OnMouseButton (istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag) override
 It is called, when mouse button is pushed down or up on this object.
 
virtual bool OnMouseMove (istd::CIndex2d position) override
 It is called, when mouse is moved.
 
virtual IDisplayGetParentDisplayPtr () const override
 Get parent object of this display.
 
virtual const iview::CScreenTransformGetTransform () const override
 Return a screen transformation.
 
virtual i2d::CRect GetBoundingBox () const override
 Get bounding box of all object in this display.
 
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 void OnShapeSelected (IInteractiveShape &shape, bool state=true) override
 It is called after change shape selection state.
 
virtual bool IsDraggable () const override
 Check if drag is enabled.
 
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 const IColorSchemaGetDefaultColorSchema () const =0
 
- Public Member Functions inherited from iview::IDisplay
virtual i2d::CRect GetClientRect () const =0
 Get bounding box of client area.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Types

enum  ViewMode { VM_NONE , VM_DRAG , VM_MOVE }
 
typedef QVector< IViewLayer * > Layers
 

Protected Member Functions

virtual void DrawLayers (QPainter &drawContext, int firstLayer, int lastLayer)
 Draw Background layer.
 
int GetLastBackgroundLayerIndex () const
 Get last background layer index.
 
void SetLastBackgroundLayerIndex (int index)
 
virtual bool CanBeMoved () const
 This method is internal used to check, if drag mode is allowed.
 
void DisconnectAllShapes ()
 Disconnect all shapes from this view.
 
virtual void InvalidateBackground ()
 Invalidate whole background buffer.
 
virtual void InvalidateBoundingBox ()
 Invalidate bounding box.
 
bool EnsureBoundingBoxValid ()
 Calculate bounding box if it was invalid.
 
virtual i2d::CRect CalcBoundingBox () const
 Calculate bounding box of all shapes.
 
virtual void OnBoundingBoxChanged ()
 Called when bounding box has been changed.
 
virtual MousePointerMode CalcMousePointer (istd::CIndex2d position) const
 Calc mouse pointer for the given position.
 
virtual bool IsBackgroundBufferValid () const
 Check if background buffer is valid.
 
virtual void SetBackgroundBufferValid (bool state=true)
 Set validate flag of background buffer.
 
const i2d::CRectGetInvalidatedBox () const
 Get bounding box of all invalidated rectangles.
 
void InvalidateBox (const i2d::CRect &rect)
 Invalidate rectangle screen area.
 
void ResetInvalidatedBox ()
 Reset invalidated box.
 
void SetKeysState (int state)
 Set state of keys.
 
const LayersGetLayers () const
 
LayersGetLayers ()
 
virtual void SetMousePointer (MousePointerMode mode)=0
 Set mouse pointer.
 
virtual void UpdateRectArea (const i2d::CRect &rect)=0
 Start updating specified rectangle area.
 

Protected Attributes

bool m_isBackgroundBufferValid
 
istd::TSmartPtr< iview::CScreenTransformm_transformPtr
 
ViewMode m_viewMode
 
int m_editMode
 
int m_displayMode
 
i2d::CVector2d m_moveReference
 
bool m_isMultiselectable
 
bool m_isViewDraggable
 
bool m_isDraggable
 
QVector< iview::IViewEventObserver * > m_viewListeners
 
ISelectableLayerm_focusedLayerPtr
 
int m_backgroundLayerIndex
 
int m_activeLayerIndex
 
int m_inactiveLayerIndex
 
i2d::CRect m_invalidatedBox
 
i2d::CRectangle m_fitArea
 
int m_lastBackgroundLayerIndex
 
iview::IMouseActionObserverm_mouseActionObserverPtr = nullptr
 
iview::CViewLayer m_backgroundLayer
 
iview::CViewLayer m_inactiveLayer
 
iview::CInteractiveViewLayer m_activeLayer
 
Layers m_layers
 
bool m_isLastMouseButtonDown
 
int m_keysState
 
istd::CIndex2d m_lastMousePosition
 
bool m_isSelectEventActive
 
i2d::CRect m_boundingBox
 
bool m_isBoundingBoxValid
 
bool m_blockBBoxEvent
 

Detailed Description

Definition at line 28 of file CViewBase.h.

Member Typedef Documentation

◆ Layers

typedef QVector<IViewLayer*> iview::CViewBase::Layers
protected

Definition at line 145 of file CViewBase.h.

Member Enumeration Documentation

◆ ViewMode

Enumerator
VM_NONE 
VM_DRAG 
VM_MOVE 

Definition at line 254 of file CViewBase.h.

◆ ZoomMode

Enumerator
ZM_RESET 
ZM_ZOOM_IN 
ZM_ZOOM_OUT 
ZM_FIT 
ZM_FIT_COVER 
ZM_FIT_UNPROP 
ZM_FIT_H 
ZM_FIT_V 

Definition at line 34 of file CViewBase.h.

Constructor & Destructor Documentation

◆ CViewBase()

iview::CViewBase::CViewBase ( )

◆ ~CViewBase()

virtual iview::CViewBase::~CViewBase ( )
virtual

Member Function Documentation

◆ AddViewEventObserver()

virtual void iview::CViewBase::AddViewEventObserver ( iview::IViewEventObserver listenerPtr)
overridevirtual

Add/remove external event observers.

Implements iview::IShapeView.

◆ BeginDrag()

virtual void iview::CViewBase::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::CViewBase::CalcBoundingBox ( ) const
protectedvirtual

Calculate bounding box of all shapes.

It doesn't update current bounding box.

◆ CalcMousePointer()

virtual MousePointerMode iview::CViewBase::CalcMousePointer ( istd::CIndex2d  position) const
protectedvirtual

Calc mouse pointer for the given position.

◆ CanBeMoved()

virtual bool iview::CViewBase::CanBeMoved ( ) const
protectedvirtual

This method is internal used to check, if drag mode is allowed.

Normally it return IsViewDraggable(), but in derived class you can change its implementation to avoid dragging.

Reimplemented in iview::CViewport.

◆ CenterTo()

void iview::CViewBase::CenterTo ( const iview::IShape shape)

Zooms the view to the given shape.

◆ ConnectShape()

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

Connect shape object to view.

Parameters
shapea shape object.
Returns
true, if it was possible to connect this shape.

Implements iview::IShapeView.

◆ DeselectAllShapes()

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

Set all shapes to be deselected.

Implements iview::ISelectable.

◆ DisconnectAllShapes()

void iview::CViewBase::DisconnectAllShapes ( )
protected

Disconnect all shapes from this view.

◆ DisconnectShape()

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

◆ DrawLayers()

virtual void iview::CViewBase::DrawLayers ( QPainter &  drawContext,
int  firstLayer,
int  lastLayer 
)
protectedvirtual

Draw Background layer.

Standard implementation draws background shape, but it is also possible to use this method to display additional visual elements like a grid or rulers.

◆ EndDrag()

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

Called after dragging.

Implements iview::IDraggable.

◆ EnsureBoundingBoxValid()

bool iview::CViewBase::EnsureBoundingBoxValid ( )
protected

Calculate bounding box if it was invalid.

Returns
true, if the new bounding box was calculated.

Referenced by GetBoundingBox().

◆ GetActiveLayerIndex()

int iview::CViewBase::GetActiveLayerIndex ( ) const
inline

Get index of default active layer.

Definition at line 458 of file CViewBase.h.

References m_activeLayerIndex.

◆ GetBackgroundLayerIndex()

int iview::CViewBase::GetBackgroundLayerIndex ( ) const
inline

Get index of default background layer.

Definition at line 446 of file CViewBase.h.

References m_backgroundLayerIndex.

◆ GetBoundingBox()

i2d::CRect iview::CViewBase::GetBoundingBox ( ) const
inlineoverridevirtual

Get bounding box of all object in this display.

Implements iview::IDisplay.

Definition at line 402 of file CViewBase.h.

References EnsureBoundingBoxValid(), and m_boundingBox.

◆ GetColorSchema()

const IColorSchema & iview::CViewBase::GetColorSchema ( ) const
inlineoverridevirtual

Get color schema.

Implements iview::IDisplay.

Definition at line 410 of file CViewBase.h.

References GetDefaultColorSchema().

◆ GetDefaultColorSchema()

virtual const IColorSchema & iview::CViewBase::GetDefaultColorSchema ( ) const
pure virtual

Implemented in iview::CCalibratedViewBase.

Referenced by GetColorSchema().

◆ GetDisplayMode()

virtual int iview::CViewBase::GetDisplayMode ( ) const
overridevirtual

Get actual display mode.

Implements iview::ISelectable.

◆ GetEditMode()

virtual int iview::CViewBase::GetEditMode ( ) const
overridevirtual

Get actual edit mode.

Implements iview::ISelectable.

◆ GetFitArea()

const i2d::CRectangle & iview::CViewBase::GetFitArea ( ) const
inlinevirtual

Definition at line 324 of file CViewBase.h.

References m_fitArea.

◆ GetFocusedLayerPtr()

iview::ISelectableLayer * iview::CViewBase::GetFocusedLayerPtr ( ) const
inlineoverridevirtual

Get focused layer.

Implements iview::IShapeView.

Definition at line 310 of file CViewBase.h.

References m_focusedLayerPtr.

◆ GetInactiveLayerIndex()

int iview::CViewBase::GetInactiveLayerIndex ( ) const
inline

Get index of default inactive layer.

Definition at line 452 of file CViewBase.h.

References m_inactiveLayerIndex.

◆ GetInvalidatedBox()

const i2d::CRect & iview::CViewBase::GetInvalidatedBox ( ) const
inlineprotected

Get bounding box of all invalidated rectangles.

Definition at line 481 of file CViewBase.h.

References m_invalidatedBox.

◆ GetKeysState()

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

Get state of system keys.

Implements iview::ISelectable.

Definition at line 418 of file CViewBase.h.

References m_keysState.

◆ GetLastBackgroundLayerIndex()

int iview::CViewBase::GetLastBackgroundLayerIndex ( ) const
inlineprotected

Get last background layer index.

Definition at line 434 of file CViewBase.h.

References m_lastBackgroundLayerIndex.

◆ GetLayer()

IViewLayer & iview::CViewBase::GetLayer ( int  index) const
inlineoverridevirtual

Get layer with the given index.

Implements iview::IShapeView.

Definition at line 372 of file CViewBase.h.

References GetLayersCount(), InsertDefaultLayers(), m_layers, and NULL.

◆ GetLayerIndex() [1/2]

virtual int iview::CViewBase::GetLayerIndex ( const IViewLayer layer) const
overridevirtual

Get index of layer.

Returns
layer index, or -1 if not found.

Implements iview::IShapeView.

◆ GetLayerIndex() [2/2]

virtual int iview::CViewBase::GetLayerIndex ( int  layerType) const
overridevirtual

Get index of layer by type.

Returns
layer index, or -1 if not found.

Implements iview::IShapeView.

◆ GetLayers() [1/2]

CViewBase::Layers & iview::CViewBase::GetLayers ( )
inlineprotected

Definition at line 511 of file CViewBase.h.

References m_layers.

◆ GetLayers() [2/2]

const CViewBase::Layers & iview::CViewBase::GetLayers ( ) const
inlineprotected

Definition at line 505 of file CViewBase.h.

References m_layers.

◆ GetLayersCount()

int iview::CViewBase::GetLayersCount ( ) const
inlineoverridevirtual

Get count of layer in this view.

Implements iview::IShapeView.

Definition at line 366 of file CViewBase.h.

References m_layers.

Referenced by GetLayer().

◆ GetParentDisplayPtr()

IDisplay * iview::CViewBase::GetParentDisplayPtr ( ) const
inlineoverridevirtual

Get parent object of this display.

If this display is root, it returns NULL.

Implements iview::IDisplay.

Definition at line 390 of file CViewBase.h.

References NULL.

◆ GetSelectedShapesCount()

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

Get count of selected shapes.

Implements iview::ISelectable.

◆ GetShapeDescriptionAt()

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

Get description to shape at specified position.

Implements iview::ITouchable.

◆ GetToolTipAt()

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

Get tooltip at specified position.

Implements iview::ITouchable.

◆ GetTransform()

const iview::CScreenTransform & iview::CViewBase::GetTransform ( ) const
inlineoverridevirtual

Return a screen transformation.

This transformation converts view units to screen units.

Implements iview::IDisplay.

Definition at line 396 of file CViewBase.h.

References istd::TTransPtr< Type >::GetPtr(), and m_transformPtr.

◆ InsertDefaultLayers()

virtual void iview::CViewBase::InsertDefaultLayers ( )
virtual

Reimplemented in iview::CCalibratedViewBase.

Referenced by GetLayer().

◆ InsertLayer()

virtual int iview::CViewBase::InsertLayer ( IViewLayer layerPtr,
int  index = -1,
int  layerType = IViewLayer::LT_NONE 
)
overridevirtual

Insert layer to view.

Parameters
layerPtrpointer to inserted layer.
indexindex of inserted layer. If equals -1, layer will be inserted after last existing layer.
layerTypeused to set standard layers.
See also
iview::IShapeView::LayerType
Returns
index of this layer.

Implements iview::IShapeView.

Reimplemented in iview::CCalibratedViewBase.

◆ InsertSelectedShapes()

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

Get set of selected shapes.

Implements iview::ISelectable.

◆ InvalidateBackground()

virtual void iview::CViewBase::InvalidateBackground ( )
protectedvirtual

Invalidate whole background buffer.

By next call Update() background buffer will be full repainted.

Reimplemented in iview::CCalibratedViewBase.

◆ InvalidateBoundingBox()

virtual void iview::CViewBase::InvalidateBoundingBox ( )
protectedvirtual

Invalidate bounding box.

◆ InvalidateBox()

void iview::CViewBase::InvalidateBox ( const i2d::CRect rect)
inlineprotected

Invalidate rectangle screen area.

It added this area to other invalidated areas.

Definition at line 487 of file CViewBase.h.

References m_invalidatedBox, and i2d::CRect::Union().

◆ IsBackgroundBufferValid()

bool iview::CViewBase::IsBackgroundBufferValid ( ) const
inlineprotectedvirtual

Check if background buffer is valid.

Definition at line 464 of file CViewBase.h.

References m_isBackgroundBufferValid.

◆ IsDraggable()

bool iview::CViewBase::IsDraggable ( ) const
inlineoverridevirtual

Check if drag is enabled.

Implements iview::IDraggable.

Definition at line 426 of file CViewBase.h.

References m_isDraggable.

◆ IsMultiselectable()

bool iview::CViewBase::IsMultiselectable ( ) const
inlineoverridevirtual

Check, if it is possible to select more than one shape.

Implements iview::IShapeView.

Definition at line 360 of file CViewBase.h.

References m_isMultiselectable.

◆ IsTouched()

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

◆ IsViewDraggable()

bool iview::CViewBase::IsViewDraggable ( ) const
inlineoverridevirtual

Check if is draggable mode.

If this function return true, user can move a view by dragging.

Implements iview::IShapeView.

Definition at line 354 of file CViewBase.h.

References m_isViewDraggable.

◆ OnAreaInvalidated()

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

Reimplemented in iview::CViewport.

◆ OnBoundingBoxChanged()

virtual void iview::CViewBase::OnBoundingBoxChanged ( )
protectedvirtual

Called when bounding box has been changed.

Reimplemented in iview::CViewport.

◆ OnChangeShape()

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

◆ OnLayerInvalidated()

virtual void iview::CViewBase::OnLayerInvalidated ( const IViewLayer layer,
const i2d::CRect prevArea,
const i2d::CRect newArea 
)
overridevirtual

Inform that layer was invalidated.

Implements iview::IShapeView.

◆ OnLayerShapeDefocused()

virtual void iview::CViewBase::OnLayerShapeDefocused ( IInteractiveShape shapePtr,
ISelectableLayer layerPtr 
)
overridevirtual

Called when shape in layer loose focus.

Implements iview::IShapeView.

◆ OnLayerShapeFocused()

virtual void iview::CViewBase::OnLayerShapeFocused ( IInteractiveShape shapePtr,
ISelectableLayer layerPtr 
)
overridevirtual

Called when shape in layer get focus.

Implements iview::IShapeView.

◆ OnMouseButton()

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

It is called, when mouse button is pushed down or up on this object.

Parameters
position- position of mouse pointer on client area (picture coords).
downFlag- true, if mouse button is pushed down, false if pushed up.
Returns
true if this shape should get focus to catch all mouse movements.

Implements iview::IMouseActionObserver.

◆ OnMouseMove()

virtual bool iview::CViewBase::OnMouseMove ( istd::CIndex2d  position)
overridevirtual

It is called, when mouse is moved.

Only objects with focus receive this event.

Parameters
position- position of mouse pointer on client area (picture coords).
Returns
true if this shape should hold focus to catch longer all mouse movements.

Implements iview::IMouseActionObserver.

Reimplemented in iview::CViewport.

◆ OnShapeDefocused()

virtual void iview::CViewBase::OnShapeDefocused ( IInteractiveShape shapePtr)
inlineoverridevirtual

Called when shape loose focus.

Implements iview::ISelectable.

Definition at line 108 of file CViewBase.h.

◆ OnShapeFocused()

virtual void iview::CViewBase::OnShapeFocused ( IInteractiveShape shapePtr)
inlineoverridevirtual

Called when shape get focus.

Implements iview::ISelectable.

Definition at line 107 of file CViewBase.h.

◆ OnShapeSelected()

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

It is called after change shape selection state.

Implements iview::ISelectable.

◆ RemoveLayer()

virtual void iview::CViewBase::RemoveLayer ( int  index)
overridevirtual

Remove layer from view.

Implements iview::IShapeView.

Reimplemented in iview::CCalibratedViewBase.

◆ RemoveViewEventObserver()

virtual void iview::CViewBase::RemoveViewEventObserver ( iview::IViewEventObserver listenerPtr)
overridevirtual

Implements iview::IShapeView.

◆ ResetInvalidatedBox()

void iview::CViewBase::ResetInvalidatedBox ( )
inlineprotected

Reset invalidated box.

Definition at line 493 of file CViewBase.h.

References m_invalidatedBox, and i2d::CRect::Reset().

◆ SetBackgroundBufferValid()

void iview::CViewBase::SetBackgroundBufferValid ( bool  state = true)
inlineprotectedvirtual

Set validate flag of background buffer.

Reimplemented in iview::CViewport.

Definition at line 470 of file CViewBase.h.

References iview::IDisplay::GetClientRect(), m_invalidatedBox, and m_isBackgroundBufferValid.

Referenced by iview::CCalibratedViewBase::SetGridInMm(), and iview::CCalibratedViewBase::SetMinGridDistance().

◆ SetDisplayMode()

virtual void iview::CViewBase::SetDisplayMode ( int  mode)
overridevirtual

Changes the display mode.

Implements iview::IShapeView.

◆ SetDraggable()

void iview::CViewBase::SetDraggable ( bool  state = true)
inlinevirtual

Definition at line 348 of file CViewBase.h.

References m_isDraggable.

◆ SetDragPosition()

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

Set new drag position.

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

Implements iview::IDraggable.

◆ SetEditMode()

virtual void iview::CViewBase::SetEditMode ( int  mode)
overridevirtual

Changes the edit mode.

Implements iview::IShapeView.

Reimplemented in iview::CViewport.

◆ SetExternalScreenTransform()

void iview::CViewBase::SetExternalScreenTransform ( const istd::TSmartPtr< iview::CScreenTransform > &  screenTransformPtr)
inline

Definition at line 316 of file CViewBase.h.

References m_transformPtr.

◆ SetFitArea()

void iview::CViewBase::SetFitArea ( const i2d::CRectangle area)
inlineoverridevirtual

Set area used for fitting of the view contents.

Implements iview::IShapeView.

Reimplemented in iview::CViewport.

Definition at line 330 of file CViewBase.h.

References m_fitArea.

◆ SetKeysState()

void iview::CViewBase::SetKeysState ( int  state)
inlineprotected

Set state of keys.

Definition at line 499 of file CViewBase.h.

References m_keysState.

◆ SetLastBackgroundLayerIndex()

void iview::CViewBase::SetLastBackgroundLayerIndex ( int  index)
inlineprotected

Definition at line 440 of file CViewBase.h.

References m_lastBackgroundLayerIndex.

◆ SetMousePointer()

virtual void iview::CViewBase::SetMousePointer ( MousePointerMode  mode)
protectedpure virtual

Set mouse pointer.

You have to implement it in your iview::CViewBase implementations.

Implemented in iview::CViewport.

◆ SetMultiselectable()

void iview::CViewBase::SetMultiselectable ( bool  state = true)
inlinevirtual

Definition at line 342 of file CViewBase.h.

References m_isMultiselectable.

◆ SetScreenPosition()

virtual void iview::CViewBase::SetScreenPosition ( const i2d::CVector2d client,
istd::CIndex2d  screen 
)
virtual

◆ SetTransform()

virtual void iview::CViewBase::SetTransform ( const i2d::CAffine2d transform)
overridevirtual

Set a screen transformation.

See also
GetTransform()

Implements iview::IShapeView.

◆ SetViewDraggable()

void iview::CViewBase::SetViewDraggable ( bool  state = true)
inlinevirtual

Definition at line 336 of file CViewBase.h.

References m_isViewDraggable.

◆ SetZoom()

virtual void iview::CViewBase::SetZoom ( ZoomMode  zoom)
virtual

◆ Update()

virtual void iview::CViewBase::Update ( )
overridevirtual

Updates all invalidates shapes.

Implements iview::IShapeView.

Reimplemented in iview::CViewport.

◆ UpdateAllShapes()

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

Reimplemented in iview::CCalibratedViewBase.

◆ UpdateMousePointer()

virtual void iview::CViewBase::UpdateMousePointer ( )
overridevirtual

Update mouse pointer.

Implements iview::IShapeView.

◆ UpdateRectArea()

virtual void iview::CViewBase::UpdateRectArea ( const i2d::CRect rect)
protectedpure virtual

Start updating specified rectangle area.

Implemented in iview::CViewport.

Member Data Documentation

◆ m_activeLayer

iview::CInteractiveViewLayer iview::CViewBase::m_activeLayer
protected

Definition at line 291 of file CViewBase.h.

◆ m_activeLayerIndex

int iview::CViewBase::m_activeLayerIndex
protected

Definition at line 278 of file CViewBase.h.

Referenced by GetActiveLayerIndex().

◆ m_backgroundLayer

iview::CViewLayer iview::CViewBase::m_backgroundLayer
protected

Definition at line 289 of file CViewBase.h.

◆ m_backgroundLayerIndex

int iview::CViewBase::m_backgroundLayerIndex
protected

Definition at line 277 of file CViewBase.h.

Referenced by GetBackgroundLayerIndex().

◆ m_blockBBoxEvent

bool iview::CViewBase::m_blockBBoxEvent
mutableprotected

Definition at line 304 of file CViewBase.h.

◆ m_boundingBox

i2d::CRect iview::CViewBase::m_boundingBox
protected

Definition at line 301 of file CViewBase.h.

Referenced by GetBoundingBox().

◆ m_displayMode

int iview::CViewBase::m_displayMode
protected

Definition at line 267 of file CViewBase.h.

◆ m_editMode

int iview::CViewBase::m_editMode
protected

Definition at line 266 of file CViewBase.h.

◆ m_fitArea

i2d::CRectangle iview::CViewBase::m_fitArea
protected

Definition at line 282 of file CViewBase.h.

Referenced by GetFitArea(), and SetFitArea().

◆ m_focusedLayerPtr

ISelectableLayer* iview::CViewBase::m_focusedLayerPtr
protected

Definition at line 276 of file CViewBase.h.

Referenced by GetFocusedLayerPtr().

◆ m_inactiveLayer

iview::CViewLayer iview::CViewBase::m_inactiveLayer
protected

Definition at line 290 of file CViewBase.h.

◆ m_inactiveLayerIndex

int iview::CViewBase::m_inactiveLayerIndex
protected

Definition at line 279 of file CViewBase.h.

Referenced by GetInactiveLayerIndex().

◆ m_invalidatedBox

i2d::CRect iview::CViewBase::m_invalidatedBox
protected

◆ m_isBackgroundBufferValid

bool iview::CViewBase::m_isBackgroundBufferValid
protected

Definition at line 261 of file CViewBase.h.

Referenced by IsBackgroundBufferValid(), and SetBackgroundBufferValid().

◆ m_isBoundingBoxValid

bool iview::CViewBase::m_isBoundingBoxValid
protected

Definition at line 302 of file CViewBase.h.

◆ m_isDraggable

bool iview::CViewBase::m_isDraggable
protected

Definition at line 272 of file CViewBase.h.

Referenced by IsDraggable(), and SetDraggable().

◆ m_isLastMouseButtonDown

bool iview::CViewBase::m_isLastMouseButtonDown
protected

Definition at line 296 of file CViewBase.h.

◆ m_isMultiselectable

bool iview::CViewBase::m_isMultiselectable
protected

Definition at line 270 of file CViewBase.h.

Referenced by IsMultiselectable(), and SetMultiselectable().

◆ m_isSelectEventActive

bool iview::CViewBase::m_isSelectEventActive
mutableprotected

Definition at line 299 of file CViewBase.h.

◆ m_isViewDraggable

bool iview::CViewBase::m_isViewDraggable
protected

Definition at line 271 of file CViewBase.h.

Referenced by IsViewDraggable(), and SetViewDraggable().

◆ m_keysState

int iview::CViewBase::m_keysState
mutableprotected

Definition at line 297 of file CViewBase.h.

Referenced by GetKeysState(), and SetKeysState().

◆ m_lastBackgroundLayerIndex

int iview::CViewBase::m_lastBackgroundLayerIndex
protected

Definition at line 284 of file CViewBase.h.

Referenced by GetLastBackgroundLayerIndex(), and SetLastBackgroundLayerIndex().

◆ m_lastMousePosition

istd::CIndex2d iview::CViewBase::m_lastMousePosition
mutableprotected

Definition at line 298 of file CViewBase.h.

◆ m_layers

Layers iview::CViewBase::m_layers
protected

Definition at line 293 of file CViewBase.h.

Referenced by GetLayer(), GetLayers(), GetLayers(), and GetLayersCount().

◆ m_mouseActionObserverPtr

iview::IMouseActionObserver* iview::CViewBase::m_mouseActionObserverPtr = nullptr
protected

Definition at line 286 of file CViewBase.h.

◆ m_moveReference

i2d::CVector2d iview::CViewBase::m_moveReference
protected

Definition at line 268 of file CViewBase.h.

◆ m_transformPtr

istd::TSmartPtr<iview::CScreenTransform> iview::CViewBase::m_transformPtr
protected

Definition at line 263 of file CViewBase.h.

Referenced by GetTransform(), and SetExternalScreenTransform().

◆ m_viewListeners

QVector<iview::IViewEventObserver*> iview::CViewBase::m_viewListeners
protected

Definition at line 274 of file CViewBase.h.

◆ m_viewMode

ViewMode iview::CViewBase::m_viewMode
protected

Definition at line 265 of file CViewBase.h.


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