ICF 3.0.5.47
Technical documentation of ICF Libraries
iview::CCalibratedViewBase Class Reference

Abstract base class for all calibrated view. More...

#include <CCalibratedViewBase.h>

Inheritance diagram for iview::CCalibratedViewBase:
Collaboration diagram for iview::CCalibratedViewBase:

Public Types

typedef CViewBase BaseClass
 
- Public Types inherited from iview::CViewBase
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 ,
  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_LAST = MPM_SCREEN_MOVE
}
 Defines possible states of mouse pointer. More...
 
enum  EditMode { EM_NONE = 0 , EM_MOVE = 1 , EM_ADD = 2 , EM_REMOVE = 3 }
 Describes standard edit modes. More...
 
typedef QSet< IInteractiveShape * > SelectedShapes
 
- Public Types inherited from iview::ITouchable
enum  TouchState {
  TS_NONE , TS_TRANSPARENT , TS_INACTIVE , TS_TICKER ,
  TS_DRAGGABLE , TS_OTHER , TS_LAST = TS_OTHER
}
 Enumeration for possible shape touch states. More...
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ICF_INTERNAL = 0 , CF_ALL_DATA , CF_ANY , CF_DESTROYING ,
  CF_DELEGATED , CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0 , SO_OBSERVE = 1 << 0 , SO_COPY = 1 << 1 , SO_CLONE = 1 << 2 ,
  SO_COMPARE = 1 << 3 , SO_RESET = 1 << 4 , SO_CHANGE_LOCK = 1 << 5
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT , CM_WITHOUT_REFS , CM_WITH_REFS , CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 

Public Member Functions

 CCalibratedViewBase ()
 
void SetDisplayCalibration (const i2d::ICalibration2d *calibrationPtr)
 Set calibration using to display logical coordinates.
 
virtual void SetGridVisible (bool state=true)
 Set grid visibility state.
 
virtual void ConnectCalibrationShape (iview::IShape *shapePtr)
 Connect visualisation shape for calibration object.
 
virtual void SetDistanceMeasureToolActive (bool state=true)
 Set distance measure tool active.
 
virtual void SetPointMeasureToolActive (bool state=true)
 Set point measure tool active.
 
virtual void ConnectToolShape (iview::IShape *shapePtr)
 Connect visualisation shape for ruler object.
 
void SetMinGridDistance (double gridDistance)
 Set minimal grid size.
 
void SetGridInMm (bool state=true)
 Set if grid should be shown in milimeter.
 
const iview::IViewLayerGetCalibrationLayer () const
 Get default calibration layer.
 
const iview::IViewLayerGetToolsLayer () const
 Get default tools layer.
 
void SetDefaultColorSchema (istd::TOptDelPtr< const IColorSchema > &&colorSchemaPtr)
 Set default color schema object.
 
bool IsBackgroundBufferActive () const
 
void SetBackgroundBufferActive (bool state=true)
 
bool IsDoubleBufferActive () const
 
void SetDoubleBufferActive (bool state=true)
 
const iview::CDrawBufferGetBackgroundBuffer () const
 
iview::CDrawBufferGetBackgroundBuffer ()
 
const iview::CDrawBufferGetDoubleBuffer () const
 
iview::CDrawBufferGetDoubleBuffer ()
 
virtual void OnResize ()
 Called if found that display area was resized.
 
void CheckResize ()
 Check if size size was changed and invalidation and OnResize() should be done.
 
const iview::IColorSchemaGetDefaultColorSchema () const override
 
void UpdateAllShapes (const istd::IChangeable::ChangeSet &changeSet) override
 Inform all shapes about changes.
 
void InsertDefaultLayers () override
 Insert default layers, when there is no one user layer.
 
int InsertLayer (iview::IViewLayer *layerPtr, int index=-1, int layerType=IViewLayer::LT_NONE) override
 Insert layer to view.
 
void RemoveLayer (int index) override
 Remove layer from view.
 
bool IsGridVisible () const override
 Check if grid is visible.
 
double GetMinGridDistance () const override
 Get minimal distance between grid lines.
 
bool IsGridInMm () const override
 Check if grid should be shown in milimeter.
 
bool IsDistanceMeasureToolActive () const override
 Check if the distance measuring is active.
 
bool IsPointMeasureToolActive () const override
 Check if the point measuring is active.
 
const i2d::ICalibration2dGetCalibration () const override
 Get access to transformation object, which transforms a local logical coordinate system to global one.
 
virtual void InvalidateBackground ()
 Invalidate whole background buffer.
 
- Public Member Functions inherited from iview::CViewBase
 CViewBase ()
 
virtual ~CViewBase ()
 
virtual void SetZoom (ZoomMode zoom)
 Set zoom.
 
virtual void SetEditMode (int mode)
 Set edit mode.
 
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::CRectangleGetFitArea () 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.
 
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.
 
IInteractiveShapeGetMouseShapePtr () const
 Get shape under mouse pointer.
 
IInteractiveShapeGetFirstActiveShape () 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 GetLayerIndex (const IViewLayer &layer) const
 Get index of layer.
 
virtual int GetLayerIndex (int layerType) const
 Get index of layer by type.
 
virtual int GetLayersCount () const
 Get count of layer in this view.
 
virtual IViewLayerGetLayer (int index) const
 Get layer with the given index.
 
virtual bool ConnectShape (IShape *shapePtr)
 Connect shape object to view.
 
virtual ISelectableLayerGetFocusedLayerPtr () 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 IDisplayGetParentDisplayPtr () const
 Get parent object of this display.
 
virtual const iview::CScreenTransformGetTransform () const
 Return a screen transformation.
 
virtual i2d::CRect GetBoundingBox () const
 Get bounding box of all object in this display.
 
virtual const IColorSchemaGetColorSchema () 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.
 
- 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
- Public Member Functions inherited from i2d::ICalibration2dProvider
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations.
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one.
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object.
 
virtual std::unique_ptr< IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object.
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state.
 
virtual QMutex * GetChangesLock () const
 Get mutex beeing locked during changes, if available.
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction.
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction.
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes.
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes.
 
- Public Member Functions inherited from iview::IVisualCalibrationInfo
- Public Member Functions inherited from iview::IToolsLayerInfo

Protected Member Functions

virtual void DrawBuffers (QPaintDevice &nativeContext, const i2d::CRect &clipRect)
 
virtual void DrawToContext (QPaintDevice &nativeContext, QPainter &context, const i2d::CRect &invalidatedBox)
 
int CalcShapeLayerIndex (const IShape &shape) const override
 Calculate optimal layer index for some shape.
 
- Protected Member Functions inherited from iview::CViewBase
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 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.
 
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 Member Functions inherited from iview::IMouseActionObserver
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event.
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event.
 

Additional Inherited Members

- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes.
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set.
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set.
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set.
 
- Protected Types inherited from iview::CViewBase
typedef QVector< IViewLayer * > Layers
 

Detailed Description

Abstract base class for all calibrated view.

Calibrated view implements i2d::ICalibration2dProvider interface, and can automatically show calibration grid if supported.

Definition at line 34 of file CCalibratedViewBase.h.

Member Typedef Documentation

◆ BaseClass

Constructor & Destructor Documentation

◆ CCalibratedViewBase()

iview::CCalibratedViewBase::CCalibratedViewBase ( )

Member Function Documentation

◆ CalcShapeLayerIndex()

int iview::CCalibratedViewBase::CalcShapeLayerIndex ( const IShape & shape) const
overrideprotectedvirtual

Calculate optimal layer index for some shape.

Returns
layer index or negative value, if is not calculable.

Reimplemented from iview::CViewBase.

◆ CheckResize()

void iview::CCalibratedViewBase::CheckResize ( )

Check if size size was changed and invalidation and OnResize() should be done.

◆ ConnectCalibrationShape()

virtual void iview::CCalibratedViewBase::ConnectCalibrationShape ( iview::IShape * shapePtr)
virtual

Connect visualisation shape for calibration object.

Reimplemented in iview::CViewport.

◆ ConnectToolShape()

virtual void iview::CCalibratedViewBase::ConnectToolShape ( iview::IShape * shapePtr)
virtual

Connect visualisation shape for ruler object.

◆ DrawBuffers()

virtual void iview::CCalibratedViewBase::DrawBuffers ( QPaintDevice & nativeContext,
const i2d::CRect & clipRect )
protectedvirtual

◆ DrawToContext()

virtual void iview::CCalibratedViewBase::DrawToContext ( QPaintDevice & nativeContext,
QPainter & context,
const i2d::CRect & invalidatedBox )
protectedvirtual

◆ GetBackgroundBuffer() [1/2]

iview::CDrawBuffer & iview::CCalibratedViewBase::GetBackgroundBuffer ( )

◆ GetBackgroundBuffer() [2/2]

const iview::CDrawBuffer & iview::CCalibratedViewBase::GetBackgroundBuffer ( ) const

◆ GetCalibration()

const i2d::ICalibration2d * iview::CCalibratedViewBase::GetCalibration ( ) const
inlineoverridevirtual

Get access to transformation object, which transforms a local logical coordinate system to global one.

Returns
Pointer to transformation if it is accessible, or nullptr.

Implements i2d::ICalibration2dProvider.

Definition at line 283 of file CCalibratedViewBase.h.

Referenced by iinspgui::TSupplierGuiCompBase< UI >::RemoveItemsFromScene().

◆ GetCalibrationLayer()

const iview::IViewLayer & iview::CCalibratedViewBase::GetCalibrationLayer ( ) const
inline

Get default calibration layer.

Definition at line 211 of file CCalibratedViewBase.h.

◆ GetDefaultColorSchema()

const iview::IColorSchema & iview::CCalibratedViewBase::GetDefaultColorSchema ( ) const
overridevirtual

Implements iview::CViewBase.

◆ GetDoubleBuffer() [1/2]

iview::CDrawBuffer & iview::CCalibratedViewBase::GetDoubleBuffer ( )

◆ GetDoubleBuffer() [2/2]

const iview::CDrawBuffer & iview::CCalibratedViewBase::GetDoubleBuffer ( ) const

◆ GetMinGridDistance()

double iview::CCalibratedViewBase::GetMinGridDistance ( ) const
inlineoverridevirtual

Get minimal distance between grid lines.

Implements iview::IVisualCalibrationInfo.

Definition at line 229 of file CCalibratedViewBase.h.

◆ GetToolsLayer()

const iview::IViewLayer & iview::CCalibratedViewBase::GetToolsLayer ( ) const
inline

Get default tools layer.

Definition at line 217 of file CCalibratedViewBase.h.

◆ InsertDefaultLayers()

void iview::CCalibratedViewBase::InsertDefaultLayers ( )
overridevirtual

Insert default layers, when there is no one user layer.

Reimplemented from iview::CViewBase.

◆ InsertLayer()

int iview::CCalibratedViewBase::InsertLayer ( iview::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.

Reimplemented from iview::CViewBase.

◆ InvalidateBackground()

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

Invalidate whole background buffer.

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

Reimplemented from iview::CViewBase.

Referenced by SetDistanceMeasureToolActive(), SetGridVisible(), and SetPointMeasureToolActive().

◆ IsBackgroundBufferActive()

bool iview::CCalibratedViewBase::IsBackgroundBufferActive ( ) const

◆ IsDistanceMeasureToolActive()

bool iview::CCalibratedViewBase::IsDistanceMeasureToolActive ( ) const
inlineoverridevirtual

Check if the distance measuring is active.

Implements iview::IToolsLayerInfo.

Definition at line 241 of file CCalibratedViewBase.h.

◆ IsDoubleBufferActive()

bool iview::CCalibratedViewBase::IsDoubleBufferActive ( ) const

◆ IsGridInMm()

bool iview::CCalibratedViewBase::IsGridInMm ( ) const
inlineoverridevirtual

Check if grid should be shown in milimeter.

Implements iview::IVisualCalibrationInfo.

Definition at line 235 of file CCalibratedViewBase.h.

◆ IsGridVisible()

bool iview::CCalibratedViewBase::IsGridVisible ( ) const
inlineoverridevirtual

Check if grid is visible.

Implements iview::IVisualCalibrationInfo.

Definition at line 223 of file CCalibratedViewBase.h.

◆ IsPointMeasureToolActive()

bool iview::CCalibratedViewBase::IsPointMeasureToolActive ( ) const
inlineoverridevirtual

Check if the point measuring is active.

Implements iview::IToolsLayerInfo.

Definition at line 261 of file CCalibratedViewBase.h.

◆ OnResize()

virtual void iview::CCalibratedViewBase::OnResize ( )
virtual

Called if found that display area was resized.

Reimplemented in iview::CViewport.

◆ RemoveLayer()

void iview::CCalibratedViewBase::RemoveLayer ( int index)
overridevirtual

Remove layer from view.

Reimplemented from iview::CViewBase.

◆ SetBackgroundBufferActive()

void iview::CCalibratedViewBase::SetBackgroundBufferActive ( bool state = true)

◆ SetDefaultColorSchema()

void iview::CCalibratedViewBase::SetDefaultColorSchema ( istd::TOptDelPtr< const IColorSchema > && colorSchemaPtr)

Set default color schema object.

Parameters
colorSchemaPtrpointer to color schema object.
releaseFlagif its true, object will be automatically removed.

◆ SetDisplayCalibration()

void iview::CCalibratedViewBase::SetDisplayCalibration ( const i2d::ICalibration2d * calibrationPtr)

◆ SetDistanceMeasureToolActive()

void iview::CCalibratedViewBase::SetDistanceMeasureToolActive ( bool state = true)
inlinevirtual

Set distance measure tool active.

Definition at line 247 of file CCalibratedViewBase.h.

References InvalidateBackground().

◆ SetDoubleBufferActive()

void iview::CCalibratedViewBase::SetDoubleBufferActive ( bool state = true)

◆ SetGridInMm()

void iview::CCalibratedViewBase::SetGridInMm ( bool state = true)
inline

Set if grid should be shown in milimeter.

Definition at line 202 of file CCalibratedViewBase.h.

References iview::CViewBase::SetBackgroundBufferValid().

◆ SetGridVisible()

void iview::CCalibratedViewBase::SetGridVisible ( bool state = true)
inlinevirtual

Set grid visibility state.

Definition at line 182 of file CCalibratedViewBase.h.

References InvalidateBackground().

◆ SetMinGridDistance()

void iview::CCalibratedViewBase::SetMinGridDistance ( double gridDistance)
inline

Set minimal grid size.

It determines minimal distance between grid lines.

Definition at line 191 of file CCalibratedViewBase.h.

References iview::CViewBase::SetBackgroundBufferValid().

◆ SetPointMeasureToolActive()

void iview::CCalibratedViewBase::SetPointMeasureToolActive ( bool state = true)
inlinevirtual

Set point measure tool active.

Definition at line 267 of file CCalibratedViewBase.h.

References InvalidateBackground().

◆ UpdateAllShapes()

void iview::CCalibratedViewBase::UpdateAllShapes ( const istd::IChangeable::ChangeSet & changeSet)
overridevirtual

Inform all shapes about changes.

Reimplemented from iview::CViewBase.


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

© Witold Gantzke and Kirill Lepskiy