|
ACF $AcfVersion:0$
|
#include <CViewBase.h>
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::CRectangle & | GetFitArea () 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 IViewLayer & | GetLayer (int index) const override |
| Get layer with the given index. | |
| virtual bool | ConnectShape (IShape *shapePtr) override |
| Connect shape object to view. | |
| virtual ISelectableLayer * | GetFocusedLayerPtr () 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 IDisplay * | GetParentDisplayPtr () const override |
| Get parent object of this display. | |
| virtual const iview::CScreenTransform & | GetTransform () const override |
| Return a screen transformation. | |
| virtual i2d::CRect | GetBoundingBox () const override |
| Get bounding box of all object in this display. | |
| virtual const IColorSchema & | GetColorSchema () 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 IColorSchema & | GetDefaultColorSchema () 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::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. | |
Definition at line 28 of file CViewBase.h.
|
protected |
Definition at line 145 of file CViewBase.h.
|
protected |
| Enumerator | |
|---|---|
| VM_NONE | |
| VM_DRAG | |
| VM_MOVE | |
Definition at line 254 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 34 of file CViewBase.h.
| iview::CViewBase::CViewBase | ( | ) |
|
virtual |
|
overridevirtual |
Add/remove external event observers.
Implements iview::IShapeView.
|
overridevirtual |
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 |
Calc mouse pointer for the given position.
|
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.
| void iview::CViewBase::CenterTo | ( | const iview::IShape & | shape | ) |
Zooms the view to the given shape.
|
overridevirtual |
Connect shape object to view.
| shape | a shape object. |
Implements iview::IShapeView.
|
overridevirtual |
Set all shapes to be deselected.
Implements iview::ISelectable.
|
protected |
Disconnect all shapes from this view.
|
overridevirtual |
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.
|
overridevirtual |
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 458 of file CViewBase.h.
References m_activeLayerIndex.
|
inline |
Get index of default background layer.
Definition at line 446 of file CViewBase.h.
References m_backgroundLayerIndex.
|
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.
|
inlineoverridevirtual |
Get color schema.
Implements iview::IDisplay.
Definition at line 410 of file CViewBase.h.
References GetDefaultColorSchema().
|
pure virtual |
Implemented in iview::CCalibratedViewBase.
Referenced by GetColorSchema().
|
overridevirtual |
Get actual display mode.
Implements iview::ISelectable.
|
overridevirtual |
Get actual edit mode.
Implements iview::ISelectable.
|
inlinevirtual |
Definition at line 324 of file CViewBase.h.
References m_fitArea.
|
inlineoverridevirtual |
Get focused layer.
Implements iview::IShapeView.
Definition at line 310 of file CViewBase.h.
References m_focusedLayerPtr.
|
inline |
Get index of default inactive layer.
Definition at line 452 of file CViewBase.h.
References m_inactiveLayerIndex.
|
inlineprotected |
Get bounding box of all invalidated rectangles.
Definition at line 481 of file CViewBase.h.
References m_invalidatedBox.
|
inlineoverridevirtual |
Get state of system keys.
Implements iview::ISelectable.
Definition at line 418 of file CViewBase.h.
References m_keysState.
|
inlineprotected |
Get last background layer index.
Definition at line 434 of file CViewBase.h.
References m_lastBackgroundLayerIndex.
|
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.
|
overridevirtual |
|
overridevirtual |
|
inlineprotected |
Definition at line 511 of file CViewBase.h.
References m_layers.
|
inlineprotected |
Definition at line 505 of file CViewBase.h.
References m_layers.
|
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().
|
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.
|
overridevirtual |
Get count of selected shapes.
Implements iview::ISelectable.
|
overridevirtual |
Get description to shape at specified position.
Implements iview::ITouchable.
|
overridevirtual |
Get tooltip at specified position.
Implements iview::ITouchable.
|
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.
|
virtual |
Reimplemented in iview::CCalibratedViewBase.
Referenced by GetLayer().
|
overridevirtual |
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.
|
overridevirtual |
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 487 of file CViewBase.h.
References m_invalidatedBox, and i2d::CRect::Union().
|
inlineprotectedvirtual |
Check if background buffer is valid.
Definition at line 464 of file CViewBase.h.
References m_isBackgroundBufferValid.
|
inlineoverridevirtual |
Check if drag is enabled.
Implements iview::IDraggable.
Definition at line 426 of file CViewBase.h.
References m_isDraggable.
|
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.
|
overridevirtual |
Check, if any shape is touched.
When shape is touched, it return also pointer to this shape.
Implements iview::ITouchable.
|
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.
|
overridevirtual |
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.
|
overridevirtual |
Invalidate a shape.
When you call Update, all invalidated shapes will be repainted.
Implements iview::IShapeObserver.
|
overridevirtual |
Inform that layer was invalidated.
Implements iview::IShapeView.
|
overridevirtual |
Called when shape in layer loose focus.
Implements iview::IShapeView.
|
overridevirtual |
Called when shape in layer get focus.
Implements iview::IShapeView.
|
overridevirtual |
It is called, when mouse button is pushed down or up on this object.
| position | - position of mouse pointer on client area (picture coords). |
| downFlag | - true, if mouse button is pushed down, false if pushed up. |
Implements iview::IMouseActionObserver.
|
overridevirtual |
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.
|
inlineoverridevirtual |
Called when shape loose focus.
Implements iview::ISelectable.
Definition at line 108 of file CViewBase.h.
|
inlineoverridevirtual |
Called when shape get focus.
Implements iview::ISelectable.
Definition at line 107 of file CViewBase.h.
|
overridevirtual |
It is called after change shape selection state.
Implements iview::ISelectable.
|
overridevirtual |
|
overridevirtual |
Implements iview::IShapeView.
|
inlineprotected |
Reset invalidated box.
Definition at line 493 of file CViewBase.h.
References m_invalidatedBox, and i2d::CRect::Reset().
|
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().
|
overridevirtual |
Changes the display mode.
Implements iview::IShapeView.
|
inlinevirtual |
Definition at line 348 of file CViewBase.h.
References m_isDraggable.
|
overridevirtual |
Set new drag position.
It must be enclosed using BeginDrag() and EndDrag() methods.
Implements iview::IDraggable.
|
overridevirtual |
|
inline |
Definition at line 316 of file CViewBase.h.
References m_transformPtr.
|
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.
|
inlineprotected |
|
inlineprotected |
Definition at line 440 of file CViewBase.h.
References m_lastBackgroundLayerIndex.
|
protectedpure virtual |
Set mouse pointer.
You have to implement it in your iview::CViewBase implementations.
Implemented in iview::CViewport.
|
inlinevirtual |
Definition at line 342 of file CViewBase.h.
References m_isMultiselectable.
|
virtual |
|
overridevirtual |
|
inlinevirtual |
Definition at line 336 of file CViewBase.h.
References m_isViewDraggable.
|
virtual |
|
overridevirtual |
|
virtual |
Reimplemented in iview::CCalibratedViewBase.
|
overridevirtual |
Update mouse pointer.
Implements iview::IShapeView.
|
protectedpure virtual |
Start updating specified rectangle area.
Implemented in iview::CViewport.
|
protected |
Definition at line 291 of file CViewBase.h.
|
protected |
Definition at line 278 of file CViewBase.h.
Referenced by GetActiveLayerIndex().
|
protected |
Definition at line 289 of file CViewBase.h.
|
protected |
Definition at line 277 of file CViewBase.h.
Referenced by GetBackgroundLayerIndex().
|
mutableprotected |
Definition at line 304 of file CViewBase.h.
|
protected |
Definition at line 301 of file CViewBase.h.
Referenced by GetBoundingBox().
|
protected |
Definition at line 267 of file CViewBase.h.
|
protected |
Definition at line 266 of file CViewBase.h.
|
protected |
Definition at line 282 of file CViewBase.h.
Referenced by GetFitArea(), and SetFitArea().
|
protected |
Definition at line 276 of file CViewBase.h.
Referenced by GetFocusedLayerPtr().
|
protected |
Definition at line 290 of file CViewBase.h.
|
protected |
Definition at line 279 of file CViewBase.h.
Referenced by GetInactiveLayerIndex().
|
protected |
Definition at line 281 of file CViewBase.h.
Referenced by GetInvalidatedBox(), InvalidateBox(), ResetInvalidatedBox(), and SetBackgroundBufferValid().
|
protected |
Definition at line 261 of file CViewBase.h.
Referenced by IsBackgroundBufferValid(), and SetBackgroundBufferValid().
|
protected |
Definition at line 302 of file CViewBase.h.
|
protected |
Definition at line 272 of file CViewBase.h.
Referenced by IsDraggable(), and SetDraggable().
|
protected |
Definition at line 296 of file CViewBase.h.
|
protected |
Definition at line 270 of file CViewBase.h.
Referenced by IsMultiselectable(), and SetMultiselectable().
|
mutableprotected |
Definition at line 299 of file CViewBase.h.
|
protected |
Definition at line 271 of file CViewBase.h.
Referenced by IsViewDraggable(), and SetViewDraggable().
|
mutableprotected |
Definition at line 297 of file CViewBase.h.
Referenced by GetKeysState(), and SetKeysState().
|
protected |
Definition at line 284 of file CViewBase.h.
Referenced by GetLastBackgroundLayerIndex(), and SetLastBackgroundLayerIndex().
|
mutableprotected |
Definition at line 298 of file CViewBase.h.
|
protected |
Definition at line 293 of file CViewBase.h.
Referenced by GetLayer(), GetLayers(), GetLayers(), and GetLayersCount().
|
protected |
Definition at line 286 of file CViewBase.h.
|
protected |
Definition at line 268 of file CViewBase.h.
|
protected |
Definition at line 263 of file CViewBase.h.
Referenced by GetTransform(), and SetExternalScreenTransform().
|
protected |
Definition at line 274 of file CViewBase.h.
|
protected |
Definition at line 265 of file CViewBase.h.