Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
DisplayMetric Class Referenceabstract

#include "stage/model/canvas-hook.hpp"

Description

Mix-in interface to allow for concrete CanvasHooked widgets to adapt themselves to the metric currently employed on the canvas.

In some cases, most notably when a timeline canvas is calibrated to precisely represent temporal extension, the widgets (clips, effects) within such a display need to adjust and adapt themselves. A relevant case is when such a widget is dragged — receiving mouse move events in screen coordinates — which then should be translated into a resulting temporal offset or change command to reflect this interaction gesture.

Definition at line 73 of file canvas-hook.hpp.

Public Member Functions

virtual ~DisplayMetric ()
 this is an interface
 
virtual TimeSpan coveredTime () const =0
 the overall time Duration covered by this timeline canvas
 
virtual int translateTimeToPixels (TimeValue) const =0
 extension point for time axis zoom management.
 
virtual int translateScreenDelta (Offset) const =0
 translate a temporal offset into a pixel Δ
 
virtual TimeValue applyScreenDelta (Time anchor, double deltaPx) const =0
 translate an offset in pixel coordinates into a temporal position
 

Constructor & Destructor Documentation

◆ ~DisplayMetric()

virtual ~DisplayMetric ( )
inlinevirtual

this is an interface

Definition at line 76 of file canvas-hook.hpp.

Member Function Documentation

◆ coveredTime()

virtual TimeSpan coveredTime ( ) const
pure virtual

the overall time Duration covered by this timeline canvas

Referenced by DisplayManager::getPixSpan().

+ Here is the caller graph for this function:

◆ translateTimeToPixels()

virtual int translateTimeToPixels ( TimeValue  ) const
pure virtual

extension point for time axis zoom management.

Referenced by DisplayManager::getPixSpan().

+ Here is the caller graph for this function:

◆ translateScreenDelta()

virtual int translateScreenDelta ( Offset  ) const
pure virtual

translate a temporal offset into a pixel Δ

◆ applyScreenDelta()

virtual TimeValue applyScreenDelta ( Time  anchor,
double  deltaPx 
) const
pure virtual

translate an offset in pixel coordinates into a temporal position

Parameters
anchorthe start point on the time axis where to apply the delta
deltaPxa delta given as canvas pixel displacement
Returns
resulting TimeValue when applying the offset within current metric

Referenced by ClipPresenter::DragRelocateObserver::updateOffset().

+ Here is the caller graph for this function:
+ Inheritance diagram for DisplayMetric:
+ Collaboration diagram for DisplayMetric:

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