Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Properties | List of all members
pqAnimationModel Class Reference

#include <pqAnimationModel.h>

Inherits QGraphicsScene.

Public Types

enum  ModeType { Real, Sequence, Custom }
 Real, Sequence or Custom mode Real mode shows no tick marks for timesteps Sequence mode shows evenly spaced ticks for teach timestep where the number of ticks can be controlled by the ticks property Custom shows tick marks at the location indicated by the setTickMarks(). More...
 

Public Slots

void setMode (ModeType)
 set the animation mode More...
 
void setTicks (int)
 set the number of ticks More...
 
void setCurrentTime (double)
 set the current time More...
 
void setStartTime (double)
 set the start time More...
 
void setEndTime (double)
 set the end time More...
 
void setInteractive (bool)
 set whether this scene is interactive More...
 
void setTickMarks (int num, double *tick_marks)
 set the locations for tick marks if Mode is Custom. More...
 
void setTimePrecision (int precision)
 Set the precision for time printing. More...
 
void setTimeNotation (const QChar &notation)
 Set the notation to use for time printing. More...
 
void zoomTrack (pqAnimationTrack *track)
 Scales the drawing of the track to the current zoom. More...
 

Signals

void trackSelected (pqAnimationTrack *)
 
void currentTimeSet (double)
 
void keyFrameTimeChanged (pqAnimationTrack *track, pqAnimationKeyFrame *kf, int end, double time)
 
void zoomChanged ()
 

Public Member Functions

 pqAnimationModel (QGraphicsView *p=nullptr)
 
 ~pqAnimationModel () override
 
int count ()
 the number of tracks More...
 
pqAnimationTracktrack (int)
 get a track at an index More...
 
pqAnimationTrackaddTrack (pqAnimationTrack *trackToAdd=nullptr)
 add a track. More...
 
void removeTrack (pqAnimationTrack *track)
 remove a track More...
 
ModeType mode () const
 get the animation mode More...
 
int ticks () const
 get the number of ticks More...
 
double currentTime () const
 get the current time More...
 
double startTime () const
 get the start time More...
 
double endTime () const
 get the end time More...
 
double zoomStartTime () const
 get the zoom start time More...
 
double zoomEndTime () const
 get the zoom end time More...
 
double zoomFactor () const
 get the zoom factor More...
 
bool interactive () const
 get whether this scene is interactive More...
 
QAbstractItemModel * header ()
 
QAbstractItemModel * enabledHeader ()
 
void setRowHeight (int)
 
int rowHeight () const
 
void positionZoom (double zoomStartTime)
 positions the zoom window with its beginning at zoomStartTime More...
 
const QList< double > & customTicks () const
 provides access to the custom ticks set using setTickMarks() method. More...
 
void setEnabledHeaderToolTip (const QString &val)
 set the tooltip to use for the checkbox in the EnabledHeader. More...
 
const QString & enabledHeaderToolTip () const
 

Protected Slots

void resizeTracks ()
 
void trackNameChanged ()
 
void enabledChanged ()
 

Protected Member Functions

QPolygonF timeBarPoly (double time)
 
double positionFromTime (double time)
 
double timeFromPosition (double pos)
 
double timeFromTick (int tick)
 
int tickFromTime (double pos)
 
void drawForeground (QPainter *painter, const QRectF &rect) override
 
QRectF drawTimeLabel (double time, const QRectF &row, QPainter *painter, const QFontMetrics &metrics, QList< const QRectF *> const &priorities)
 Draws a label for the specified time in the specified row of the timeline. More...
 
void updateNewTime (QGraphicsSceneMouseEvent *mouseEvent)
 
bool hitTestCurrentTimePoly (const QPointF &pos)
 
pqAnimationTrackhitTestTracks (const QPointF &pos)
 
pqAnimationKeyFramehitTestKeyFrame (pqAnimationTrack *t, const QPointF &pos)
 
bool eventFilter (QObject *w, QEvent *e) override
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *mouseEvent) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent) override
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent) override
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent) override
 
void wheelEvent (QGraphicsSceneWheelEvent *wheelEvent) override
 
double timeToNormalizedTime (double) const
 
double normalizedTimeToTime (double) const
 
int currentTicks () const
 Based on this->Mode, this will either returns the number of custom ticks or return this->ticks(). More...
 

Properties

ModeType mode
 
int ticks
 
double currentTime
 
double startTime
 
double endTime
 
bool interactive
 

Detailed Description

Definition at line 23 of file pqAnimationModel.h.

Member Enumeration Documentation

◆ ModeType

Real, Sequence or Custom mode Real mode shows no tick marks for timesteps Sequence mode shows evenly spaced ticks for teach timestep where the number of ticks can be controlled by the ticks property Custom shows tick marks at the location indicated by the setTickMarks().

Enumerator
Real 
Sequence 
Custom 

Definition at line 43 of file pqAnimationModel.h.

Constructor & Destructor Documentation

◆ pqAnimationModel()

pqAnimationModel::pqAnimationModel ( QGraphicsView *  p = nullptr)

◆ ~pqAnimationModel()

pqAnimationModel::~pqAnimationModel ( )
override

Member Function Documentation

◆ count()

int pqAnimationModel::count ( )

the number of tracks

◆ track()

pqAnimationTrack* pqAnimationModel::track ( int  )

get a track at an index

◆ addTrack()

pqAnimationTrack* pqAnimationModel::addTrack ( pqAnimationTrack trackToAdd = nullptr)

add a track.

If trackToAdd is nullptr, we create a new pqAnimationTrack instance.

◆ removeTrack()

void pqAnimationModel::removeTrack ( pqAnimationTrack track)

remove a track

◆ mode()

ModeType pqAnimationModel::mode ( ) const

get the animation mode

◆ ticks()

int pqAnimationModel::ticks ( ) const

get the number of ticks

◆ currentTime()

double pqAnimationModel::currentTime ( ) const

get the current time

◆ startTime()

double pqAnimationModel::startTime ( ) const

get the start time

◆ endTime()

double pqAnimationModel::endTime ( ) const

get the end time

◆ zoomStartTime()

double pqAnimationModel::zoomStartTime ( ) const

get the zoom start time

◆ zoomEndTime()

double pqAnimationModel::zoomEndTime ( ) const

get the zoom end time

◆ zoomFactor()

double pqAnimationModel::zoomFactor ( ) const

get the zoom factor

◆ interactive()

bool pqAnimationModel::interactive ( ) const

get whether this scene is interactive

◆ header()

QAbstractItemModel* pqAnimationModel::header ( )

◆ enabledHeader()

QAbstractItemModel* pqAnimationModel::enabledHeader ( )

◆ setRowHeight()

void pqAnimationModel::setRowHeight ( int  )

◆ rowHeight()

int pqAnimationModel::rowHeight ( ) const

◆ positionZoom()

void pqAnimationModel::positionZoom ( double  zoomStartTime)

positions the zoom window with its beginning at zoomStartTime

◆ customTicks()

const QList<double>& pqAnimationModel::customTicks ( ) const
inline

provides access to the custom ticks set using setTickMarks() method.

Definition at line 124 of file pqAnimationModel.h.

◆ setEnabledHeaderToolTip()

void pqAnimationModel::setEnabledHeaderToolTip ( const QString &  val)

set the tooltip to use for the checkbox in the EnabledHeader.

default is "Enable/Disable Track".

◆ enabledHeaderToolTip()

const QString& pqAnimationModel::enabledHeaderToolTip ( ) const
inline

Definition at line 131 of file pqAnimationModel.h.

◆ setMode

void pqAnimationModel::setMode ( ModeType  )
slot

set the animation mode

◆ setTicks

void pqAnimationModel::setTicks ( int  )
slot

set the number of ticks

◆ setCurrentTime

void pqAnimationModel::setCurrentTime ( double  )
slot

set the current time

◆ setStartTime

void pqAnimationModel::setStartTime ( double  )
slot

set the start time

◆ setEndTime

void pqAnimationModel::setEndTime ( double  )
slot

set the end time

◆ setInteractive

void pqAnimationModel::setInteractive ( bool  )
slot

set whether this scene is interactive

◆ setTickMarks

void pqAnimationModel::setTickMarks ( int  num,
double tick_marks 
)
slot

set the locations for tick marks if Mode is Custom.

This also results in a call to setTicks().

◆ setTimePrecision

void pqAnimationModel::setTimePrecision ( int  precision)
slot

Set the precision for time printing.

Default is 6.

◆ setTimeNotation

void pqAnimationModel::setTimeNotation ( const QChar &  notation)
slot

Set the notation to use for time printing.

Should be one of the following: e,E,f,g or G. Default is g.

◆ zoomTrack

void pqAnimationModel::zoomTrack ( pqAnimationTrack track)
slot

Scales the drawing of the track to the current zoom.

◆ trackSelected

void pqAnimationModel::trackSelected ( pqAnimationTrack )
signal

◆ currentTimeSet

void pqAnimationModel::currentTimeSet ( double  )
signal

◆ keyFrameTimeChanged

void pqAnimationModel::keyFrameTimeChanged ( pqAnimationTrack track,
pqAnimationKeyFrame kf,
int  end,
double  time 
)
signal

◆ zoomChanged

void pqAnimationModel::zoomChanged ( )
signal

◆ resizeTracks

void pqAnimationModel::resizeTracks ( )
protectedslot

◆ trackNameChanged

void pqAnimationModel::trackNameChanged ( )
protectedslot

◆ enabledChanged

void pqAnimationModel::enabledChanged ( )
protectedslot

◆ timeBarPoly()

QPolygonF pqAnimationModel::timeBarPoly ( double  time)
protected

◆ positionFromTime()

double pqAnimationModel::positionFromTime ( double  time)
protected

◆ timeFromPosition()

double pqAnimationModel::timeFromPosition ( double  pos)
protected

◆ timeFromTick()

double pqAnimationModel::timeFromTick ( int  tick)
protected

◆ tickFromTime()

int pqAnimationModel::tickFromTime ( double  pos)
protected

◆ drawForeground()

void pqAnimationModel::drawForeground ( QPainter *  painter,
const QRectF &  rect 
)
overrideprotected

◆ drawTimeLabel()

QRectF pqAnimationModel::drawTimeLabel ( double  time,
const QRectF &  row,
QPainter *  painter,
const QFontMetrics &  metrics,
QList< const QRectF *> const priorities 
)
protected

Draws a label for the specified time in the specified row of the timeline.

The user can enter painter or metrics parameters to customize it. A list of priorities must be entered: they define the zones where the label can't be drawn.

◆ updateNewTime()

void pqAnimationModel::updateNewTime ( QGraphicsSceneMouseEvent *  mouseEvent)
protected

◆ hitTestCurrentTimePoly()

bool pqAnimationModel::hitTestCurrentTimePoly ( const QPointF &  pos)
protected

◆ hitTestTracks()

pqAnimationTrack* pqAnimationModel::hitTestTracks ( const QPointF &  pos)
protected

◆ hitTestKeyFrame()

pqAnimationKeyFrame* pqAnimationModel::hitTestKeyFrame ( pqAnimationTrack t,
const QPointF &  pos 
)
protected

◆ eventFilter()

bool pqAnimationModel::eventFilter ( QObject *  w,
QEvent *  e 
)
overrideprotected

◆ mouseDoubleClickEvent()

void pqAnimationModel::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  mouseEvent)
overrideprotected

◆ mousePressEvent()

void pqAnimationModel::mousePressEvent ( QGraphicsSceneMouseEvent *  mouseEvent)
overrideprotected

◆ mouseMoveEvent()

void pqAnimationModel::mouseMoveEvent ( QGraphicsSceneMouseEvent *  mouseEvent)
overrideprotected

◆ mouseReleaseEvent()

void pqAnimationModel::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  mouseEvent)
overrideprotected

◆ wheelEvent()

void pqAnimationModel::wheelEvent ( QGraphicsSceneWheelEvent *  wheelEvent)
overrideprotected

◆ timeToNormalizedTime()

double pqAnimationModel::timeToNormalizedTime ( double  ) const
protected

◆ normalizedTimeToTime()

double pqAnimationModel::normalizedTimeToTime ( double  ) const
protected

◆ currentTicks()

int pqAnimationModel::currentTicks ( ) const
protected

Based on this->Mode, this will either returns the number of custom ticks or return this->ticks().

Property Documentation

◆ mode

ModeType pqAnimationModel::mode
readwrite

Definition at line 29 of file pqAnimationModel.h.

◆ ticks

int pqAnimationModel::ticks
readwrite

Definition at line 30 of file pqAnimationModel.h.

◆ currentTime

double pqAnimationModel::currentTime
readwrite

Definition at line 31 of file pqAnimationModel.h.

◆ startTime

double pqAnimationModel::startTime
readwrite

Definition at line 32 of file pqAnimationModel.h.

◆ endTime

double pqAnimationModel::endTime
readwrite

Definition at line 33 of file pqAnimationModel.h.

◆ interactive

bool pqAnimationModel::interactive
readwrite

Definition at line 34 of file pqAnimationModel.h.


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