IShapeView.h
Go to the documentation of this file.
1 #ifndef iview_IShapeView_included
2 #define iview_IShapeView_included
3 
4 
5 // Qt includes
6 #include <QtCore/QVector>
7 
8 // ACF includes
9 #include <i2d/CRect.h>
10 #include <i2d/CAffine2d.h>
11 
12 #include <iview/IDisplay.h>
13 #include <iview/ISelectable.h>
14 #include <iview/ISelectableLayer.h>
15 
16 
17 namespace iview
18 {
19 
20 
24 class IShapeView:
25  virtual public IDisplay,
26  virtual public ISelectable
27 {
28 public:
30 
34  virtual void SetFitArea(const i2d::CRectangle& area) = 0;
35 
40  virtual void SetTransform(const i2d::CAffine2d& transform) = 0;
41 
45  virtual void Update() = 0;
46 
50  virtual void SetEditMode(int mode) = 0;
51 
56  virtual bool IsViewDraggable() const = 0;
57 
61  virtual bool IsMultiselectable() const = 0;
62 
66  virtual void UpdateMousePointer() = 0;
67 
76  virtual int InsertLayer(IViewLayer* layerPtr, int index = -1, int layerType = IViewLayer::LT_NONE) = 0;
77 
82  virtual int GetLayerIndex(const IViewLayer& layer) const = 0;
83 
88  virtual int GetLayerIndex(int layerType) const = 0;
89 
93  virtual void RemoveLayer(int index) = 0;
94 
98  virtual int GetLayersCount() const = 0;
99 
103  virtual IViewLayer& GetLayer(int index) const = 0;
104 
110  virtual bool ConnectShape(IShape* shapePtr) = 0;
111 
115  virtual ISelectableLayer* GetFocusedLayerPtr() const = 0;
116 
120  virtual void OnLayerShapeFocused(IInteractiveShape* shapePtr, ISelectableLayer* layerPtr) = 0;
121 
125  virtual void OnLayerShapeDefocused(IInteractiveShape* shapePtr, ISelectableLayer* layerPtr) = 0;
126 
130  virtual void OnLayerInvalidated(const IViewLayer& layer, const i2d::CRect& prevArea, const i2d::CRect& newArea) = 0;
131 };
132 
133 
134 } // namespace iview
135 
136 
137 #endif // !iview_IShapeView_included
138 
139 
virtual ISelectableLayer * GetFocusedLayerPtr() const =0
Get focused layer.
Interface for a logical layer in the console view.
Definition: IViewLayer.h:24
virtual bool IsViewDraggable() const =0
Check if is draggable mode.
virtual IViewLayer & GetLayer(int index) const =0
Get layer with the given index.
virtual void SetEditMode(int mode)=0
Changes the edit mode.
Simple rectangle with integer bounds.
Definition: CRect.h:21
Common interface for a general shape view implementations.
Definition: IShapeView.h:24
virtual void Update()=0
Updates all invalidates shapes.
virtual void SetTransform(const i2d::CAffine2d &transform)=0
Set a screen transformation.
virtual void UpdateMousePointer()=0
Update mouse pointer.
IShapeObserver BaseClass
Definition: IShapeView.h:29
Common interface for all display console shapes which can interacts with user.
Definition of rectangle area orthogonal to axis of coordination system.
Definition: CRectangle.h:26
virtual bool ConnectShape(IShape *shapePtr)=0
Connect shape object to view.
Common interface for all display console shapes.
Definition: IShape.h:27
virtual void RemoveLayer(int index)=0
Remove layer from view.
virtual void OnLayerShapeDefocused(IInteractiveShape *shapePtr, ISelectableLayer *layerPtr)=0
Called when shape in layer loose focus.
Common interface for all objects informed about shapes state changes.
virtual int InsertLayer(IViewLayer *layerPtr, int index=-1, int layerType=IViewLayer::LT_NONE)=0
Insert layer to view.
virtual int GetLayersCount() const =0
Get count of layer in this view.
virtual void SetFitArea(const i2d::CRectangle &area)=0
Set area used for fitting of the view contents.
virtual bool IsMultiselectable() const =0
Check, if it is possible to select more than one shape.
virtual void OnLayerShapeFocused(IInteractiveShape *shapePtr, ISelectableLayer *layerPtr)=0
Called when shape in layer get focus.
This class defines an affine 2D-transformation.
Definition: CAffine2d.h:17
virtual void OnLayerInvalidated(const IViewLayer &layer, const i2d::CRect &prevArea, const i2d::CRect &newArea)=0
Inform that layer was invalidated.
virtual int GetLayerIndex(const IViewLayer &layer) const =0
Get index of layer.
Layer type is not set.
Definition: IViewLayer.h:34

© 2007-2017 Witold Gantzke and Kirill Lepskiy