![]() |
ICF 3.1.1.10
Technical documentation of ICF Libraries
|
#include <CViewBase.h>
Public Member Functions | |
| CViewBase () | |
| virtual | ~CViewBase () |
| virtual void | SetZoom (ZoomMode zoom) |
| Set zoom. | |
| virtual void | SetEditMode (int mode) |
| Set edit mode. | |
| virtual void | UpdateAllShapes (const istd::IChangeable::ChangeSet &changeSet) |
| Inform all shapes about changes. | |
| virtual void | SetScreenPosition (const i2d::CVector2d &client, istd::CIndex2d screen) |
| It sets position to become transformation of client point to specified screen position. | |
| virtual const i2d::CRectangle & | GetFitArea () const |
| Get area will be used to automatic fit the zoom to view size. | |
| virtual void | SetFitArea (const i2d::CRectangle &area) |
| Set area will be used to fit in some zoom modes. | |
| virtual void | SetViewDraggable (bool state=true) |
| Turn on/off possibility to move whole view transform. | |
| virtual void | SetMultiselectable (bool state=true) |
| Turn on/off possibility to select more shapes using control keys. | |
| virtual void | SetDraggable (bool state=true) |
| Turn on/off possibility to move more selected shapes, when one is moved. | |
| virtual void | AddViewEventObserver (iview::IViewEventObserver *listenerPtr) |
| Adds handler to catch view events. | |
| virtual void | RemoveViewEventObserver (iview::IViewEventObserver *listenerPtr) |
| Removes handler to catch view events. | |
| virtual void | InsertDefaultLayers () |
| Insert default layers, when there is no one user layer. | |
| 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. | |
| IInteractiveShape * | GetMouseShapePtr () const |
| Get shape under mouse pointer. | |
| IInteractiveShape * | GetFirstActiveShape () const |
| virtual void | Update () |
| Updates all invalidates shapes. | |
| virtual bool | IsViewDraggable () const |
| Check if is draggable mode. | |
| virtual bool | IsMultiselectable () const |
| Check, if it is possible to select more than one shape. | |
| virtual int | InsertLayer (IViewLayer *layerPtr, int index=-1, int layerType=IViewLayer::LT_NONE) |
| Insert layer to view. | |
| virtual int | GetLayerIndex (const IViewLayer &layer) const |
| Get index of layer. | |
| virtual int | GetLayerIndex (int layerType) const |
| Get index of layer by type. | |
| virtual void | RemoveLayer (int index) |
| Remove layer from view. | |
| virtual int | GetLayersCount () const |
| Get count of layer in this view. | |
| virtual IViewLayer & | GetLayer (int index) const |
| Get layer with the given index. | |
| virtual bool | ConnectShape (IShape *shapePtr) |
| Connect shape object to view. | |
| virtual ISelectableLayer * | GetFocusedLayerPtr () const |
| Get focused layer. | |
| virtual void | OnLayerShapeFocused (IInteractiveShape *shapePtr, ISelectableLayer *layerPtr) |
| Called when shape in layer get focus. | |
| virtual void | OnLayerShapeDefocused (IInteractiveShape *shapePtr, ISelectableLayer *layerPtr) |
| Called when shape in layer loose focus. | |
| virtual void | OnLayerInvalidated (const IViewLayer &layer, const i2d::CRect &prevArea, const i2d::CRect &newArea) |
| Inform that layer was invalidated. | |
| virtual int | GetSelectedShapesCount () const |
| Get count of selected shapes. | |
| virtual void | InsertSelectedShapes (SelectedShapes &result) const |
| Get set of selected shapes. | |
| virtual void | DeselectAllShapes () |
| Set all shapes to be deselected. | |
| virtual int | GetKeysState () const |
| Get state of system keys. | |
| virtual int | GetEditMode () const |
| Get actual edit mode. | |
| virtual void | OnShapeFocused (IInteractiveShape *) |
| Called when shape get focus. | |
| virtual void | OnShapeDefocused (IInteractiveShape *) |
| Called when shape loose focus. | |
| virtual TouchState | IsTouched (istd::CIndex2d position) const |
| Check, if any shape is touched. | |
| virtual QString | GetShapeDescriptionAt (istd::CIndex2d position) const |
| Get description to shape at specified position. | |
| virtual void | SetTransform (const i2d::CAffine2d &transform) |
| Set a screen transformation. | |
| virtual void | UpdateMousePointer () |
| Update mouse pointer. | |
| virtual bool | OnMouseButton (istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag) |
| It is called, when mouse button is pushed down or up on this object. | |
| virtual bool | OnMouseMove (istd::CIndex2d position) |
| It is called, when mouse is moved. | |
| virtual IDisplay * | GetParentDisplayPtr () const |
| Get parent object of this display. | |
| virtual const iview::CScreenTransform & | GetTransform () const |
| Return a screen transformation. | |
| virtual i2d::CRect | GetBoundingBox () const |
| Get bounding box of all object in this display. | |
| virtual const IColorSchema & | GetColorSchema () const |
| Get color schema. | |
| virtual void | OnAreaInvalidated (const i2d::CRect &prevArea, const i2d::CRect &newArea) |
| Invalidate display area. | |
| virtual void | OnChangeShape (IShape *shapePtr) |
| Invalidate a shape. | |
| virtual bool | DisconnectShape (IShape *shapePtr) |
| Disconnect shape object from view. | |
| virtual void | OnShapeSelected (IInteractiveShape &shape, bool state=true) |
| It is called after change shape selection state. | |
| virtual bool | IsDraggable () const |
| Check if drag is enabled. | |
| virtual void | BeginDrag (const istd::CIndex2d &reference) |
| Called before dragging is begin. | |
| virtual void | SetDragPosition (const istd::CIndex2d &position) |
| Set new drag position. | |
| virtual void | EndDrag () |
| Called after dragging. | |
| virtual const IColorSchema & | GetDefaultColorSchema () const =0 |
Public Member Functions inherited from iview::IShapeView | |
Public Member Functions inherited from iview::IDisplay | |
| virtual i2d::CRect | GetClientRect () const =0 |
| Get bounding box of client area. | |
Public Member Functions inherited from iview::IShapeObserver | |
Public Member Functions inherited from iview::ISelectable | |
Public Member Functions inherited from iview::ITouchable | |
Public Member Functions inherited from iview::IDraggable | |
Protected Types | |
| typedef QVector< IViewLayer * > | Layers |
Protected Member Functions | |
| virtual void | DrawLayers (QPainter &drawContext, int firstLayer, int lastLayer) |
| Draw Background layer. | |
| int | GetLastBackgroundLayerIndex () |
| 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 |
| virtual void | InvalidateMouseShape () |
| Invalidate stored shape under mouse pointer. | |
| virtual void | CalcMouseShape () const |
| Calc shape under mouse pointer. | |
| virtual bool | IsBackgroundBufferValid () const |
| Check if background buffer is valid. | |
| virtual void | SetBackgroundBufferValid (bool state=true) |
| Set validate flag of background buffer. | |
| virtual int | CalcShapeLayerIndex (const IShape &shape) const |
| Calculate optimal layer index for some shape. | |
| const i2d::CRect & | GetInvalidatedBox () 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 Layers & | GetLayers () const |
| Layers & | GetLayers () |
| virtual void | SetMousePointer (MousePointerMode mode)=0 |
| Set mouse pointer. | |
| virtual void | UpdateRectArea (const i2d::CRect &rect)=0 |
| Start updating specified rectangle area. | |
Protected Member Functions inherited from iview::IMouseActionObserver | |
Definition at line 32 of file CViewBase.h.
|
protected |
Definition at line 196 of file CViewBase.h.
| 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 38 of file CViewBase.h.
| iview::CViewBase::CViewBase | ( | ) |
|
virtual |
|
virtual |
Adds handler to catch view events.
|
virtual |
Called before dragging is begin.
It set also reference value for dragging position.
Implements iview::IDraggable.
|
protectedvirtual |
Calculate bounding box of all shapes.
It doesn't update current bounding box.
|
protectedvirtual |
|
protectedvirtual |
Calc shape under mouse pointer.
Referenced by GetMouseShapePtr().
|
protectedvirtual |
Calculate optimal layer index for some shape.
Reimplemented in iview::CCalibratedViewBase.
|
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.
|
virtual |
Connect shape object to view.
| shapePtr | pointer shape object, will be not owned by this view. |
Implements iview::IShapeView.
|
virtual |
Set all shapes to be deselected.
Implements iview::ISelectable.
|
protected |
Disconnect all shapes from this view.
|
virtual |
Disconnect shape object from view.
This shape had to be connected using ConnectShape.
Implements iview::IShapeObserver.
|
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.
|
virtual |
Called after dragging.
Implements iview::IDraggable.
|
protected |
Calculate bounding box if it was invalid.
Referenced by GetBoundingBox().
|
inline |
Get index of default active layer.
Definition at line 517 of file CViewBase.h.
|
inline |
Get index of default background layer.
Definition at line 505 of file CViewBase.h.
|
inlinevirtual |
Get bounding box of all object in this display.
Implements iview::IDisplay.
Definition at line 461 of file CViewBase.h.
References EnsureBoundingBoxValid().
|
inlinevirtual |
Get color schema.
Implements iview::IDisplay.
Definition at line 469 of file CViewBase.h.
References GetDefaultColorSchema().
|
pure virtual |
Implemented in iview::CCalibratedViewBase.
Referenced by GetColorSchema().
|
virtual |
Get actual edit mode.
Implements iview::ISelectable.
| IInteractiveShape * iview::CViewBase::GetFirstActiveShape | ( | ) | const |
|
inlinevirtual |
Get area will be used to automatic fit the zoom to view size.
Definition at line 370 of file CViewBase.h.
|
virtual |
Get focused layer.
Implements iview::IShapeView.
|
inline |
Get index of default inactive layer.
Definition at line 511 of file CViewBase.h.
|
inlineprotected |
Get bounding box of all invalidated rectangles.
Definition at line 540 of file CViewBase.h.
|
inlinevirtual |
Get state of system keys.
Implements iview::ISelectable.
Definition at line 477 of file CViewBase.h.
|
inlineprotected |
Get last background layer index.
Definition at line 493 of file CViewBase.h.
|
inlinevirtual |
Get layer with the given index.
Implements iview::IShapeView.
Definition at line 431 of file CViewBase.h.
References GetLayersCount(), and InsertDefaultLayers().
|
virtual |
|
virtual |
|
inlineprotected |
Definition at line 570 of file CViewBase.h.
|
inlineprotected |
Definition at line 564 of file CViewBase.h.
|
inlinevirtual |
Get count of layer in this view.
Implements iview::IShapeView.
Definition at line 425 of file CViewBase.h.
Referenced by GetLayer().
|
inline |
Get shape under mouse pointer.
Definition at line 400 of file CViewBase.h.
References CalcMouseShape().
|
inlinevirtual |
Get parent object of this display.
If this display is root, it returns nullptr.
Implements iview::IDisplay.
Definition at line 449 of file CViewBase.h.
|
virtual |
Get count of selected shapes.
Implements iview::ISelectable.
|
virtual |
Get description to shape at specified position.
Implements iview::ITouchable.
|
inlinevirtual |
Return a screen transformation.
This transformation converts view units to screen units.
Implements iview::IDisplay.
Definition at line 455 of file CViewBase.h.
|
virtual |
Insert default layers, when there is no one user layer.
Reimplemented in iview::CCalibratedViewBase.
Referenced by GetLayer().
|
virtual |
Insert layer to view.
| layerPtr | pointer to inserted layer. |
| index | index of inserted layer. If equals -1, layer will be inserted after last existing layer. |
| layerType | used to set standard layers. |
Implements iview::IShapeView.
Reimplemented in iview::CCalibratedViewBase.
|
virtual |
Get set of selected shapes.
Implements iview::ISelectable.
|
protectedvirtual |
Invalidate whole background buffer.
By next call Update() background buffer will be full repainted.
Reimplemented in iview::CCalibratedViewBase.
|
protectedvirtual |
Invalidate bounding box.
|
inlineprotected |
Invalidate rectangle screen area.
It added this area to other invalidated areas.
Definition at line 546 of file CViewBase.h.
References i2d::CRect::Union().
|
protectedvirtual |
Invalidate stored shape under mouse pointer.
|
inlineprotectedvirtual |
Check if background buffer is valid.
Definition at line 523 of file CViewBase.h.
|
inlinevirtual |
|
inlinevirtual |
Check, if it is possible to select more than one shape.
Implements iview::IShapeView.
Definition at line 419 of file CViewBase.h.
|
virtual |
Check, if any shape is touched.
When shape is touched, it return also pointer to this shape.
Implements iview::ITouchable.
|
inlinevirtual |
Check if is draggable mode.
If this function return true, user can move a view by dragging.
Implements iview::IShapeView.
Definition at line 413 of file CViewBase.h.
|
virtual |
Invalidate display area.
| prevArea | previous area used to display object. |
| newArea | new area used to display object. |
Implements iview::IDisplay.
Reimplemented in iview::CViewport.
|
protectedvirtual |
Called when bounding box has been changed.
Reimplemented in iview::CViewport.
|
virtual |
Invalidate a shape.
When you call Update, all invalidated shapes will be repainted.
Implements iview::IShapeObserver.
|
virtual |
Inform that layer was invalidated.
Implements iview::IShapeView.
|
virtual |
Called when shape in layer loose focus.
Implements iview::IShapeView.
|
virtual |
Called when shape in layer get focus.
Implements iview::IShapeView.
|
virtual |
It is called, when mouse button is pushed down or up on this object.
| position | position of mouse pointer on client area (picture coords). |
| buttonType | determine the mouse butten type. |
| downFlag | true, if mouse button is pushed down, false if pushed up. |
Implements iview::IMouseActionObserver.
|
virtual |
It is called, when mouse is moved.
Only objects with focus receive this event.
| position | - position of mouse pointer on client area (picture coords). |
Implements iview::IMouseActionObserver.
Reimplemented in iview::CViewport.
|
inlinevirtual |
Called when shape loose focus.
Implements iview::ISelectable.
Definition at line 160 of file CViewBase.h.
|
inlinevirtual |
Called when shape get focus.
Implements iview::ISelectable.
Definition at line 159 of file CViewBase.h.
|
virtual |
It is called after change shape selection state.
Implements iview::ISelectable.
|
virtual |
|
virtual |
Removes handler to catch view events.
|
inlineprotected |
|
inlineprotectedvirtual |
Set validate flag of background buffer.
Reimplemented in iview::CViewport.
Definition at line 529 of file CViewBase.h.
References iview::IDisplay::GetClientRect().
Referenced by iview::CCalibratedViewBase::SetGridInMm(), and iview::CCalibratedViewBase::SetMinGridDistance().
|
inlinevirtual |
Turn on/off possibility to move more selected shapes, when one is moved.
Definition at line 394 of file CViewBase.h.
|
virtual |
Set new drag position.
It must be enclosed using BeginDrag() and EndDrag() methods.
Implements iview::IDraggable.
|
virtual |
|
inlinevirtual |
Set area will be used to fit in some zoom modes.
Implements iview::IShapeView.
Reimplemented in iview::CViewport.
Definition at line 376 of file CViewBase.h.
|
inlineprotected |
Set state of keys.
Definition at line 558 of file CViewBase.h.
|
inlineprotected |
Definition at line 499 of file CViewBase.h.
|
protectedpure virtual |
Set mouse pointer.
You have to implement it in your iview::CViewBase implementations.
Implemented in iview::CViewport.
|
inlinevirtual |
Turn on/off possibility to select more shapes using control keys.
Definition at line 388 of file CViewBase.h.
|
virtual |
It sets position to become transformation of client point to specified screen position.
|
virtual |
|
inlinevirtual |
Turn on/off possibility to move whole view transform.
Definition at line 382 of file CViewBase.h.
|
virtual |
Set zoom.
|
virtual |
Updates all invalidates shapes.
Implements iview::IShapeView.
|
virtual |
Inform all shapes about changes.
Reimplemented in iview::CCalibratedViewBase.
|
virtual |
Update mouse pointer.
Implements iview::IShapeView.
|
protectedpure virtual |
Start updating specified rectangle area.
Implemented in iview::CViewport.
© Witold Gantzke and Kirill Lepskiy