Computer Assited Medical Intervention Tool Kit  version 4.0
Public Member Functions | Protected Attributes | List of all members
AnimationMotorAddon Class Referenceabstract

The Animation Motor addon class. More...

#include <AnimationMotorAddon.h>

Public Member Functions

 AnimationMotorAddon (LoadsManager *lm)
 the default constructor get the loads manager (and thus the Physical model, ...) More...
 
virtual LoadsdoMove (double dt, double forcedTime=0.0)=0
 This method is called everytime the motor has to do one step of simulation. More...
 
virtual QString getDescription ()=0
 get a simple description (can be rich text) More...
 
virtual QWidget * getMotorWidget ()
 get the optionnal operator widget if there the return value is not null, then the motor widget will be displayed as a new tab More...
 
virtual double getTime () const =0
 get the current motor internal time More...
 
virtual void restart ()=0
 start the simulation from the begining More...
 
virtual void setBoundaryConditions (Loads *)
 set the initial loads (for boundary conditions) More...
 
virtual ~AnimationMotorAddon ()
 default virtual destructor More...
 

Protected Attributes

LoadsboundaryConditions
 
LoadsManagermyLM
 

Detailed Description

The Animation Motor addon class.

All animation motor addon have to inherit from this class (which is an interface).

I highly recommand a look/study/thesis at/on the code of the ShakerAnimationMotorAddon class. It gives an good idea of all the different facets of a animation motor addon.

Constructor & Destructor Documentation

◆ AnimationMotorAddon()

AnimationMotorAddon::AnimationMotorAddon ( LoadsManager lm)

the default constructor get the loads manager (and thus the Physical model, ...)

References myLM.

◆ ~AnimationMotorAddon()

virtual AnimationMotorAddon::~AnimationMotorAddon ( )
inlinevirtual

default virtual destructor

Member Function Documentation

◆ doMove()

virtual Loads* AnimationMotorAddon::doMove ( double  dt,
double  forcedTime = 0.0 
)
pure virtual

This method is called everytime the motor has to do one step of simulation.

I.e. this method is called everytime the application needs to know the positions of the atoms at time t+dt.

Note: There are two possibilities for motors to produce deformations:

  • Either by returning a Loads* filled up with the appropriate translations,
  • or by modifying directly the position of the atoms. In this case doMove(..) must return NULL. It is a kind of "direct rendering".

The latter is around 5% faster when a big percentage of the atoms are moving due to the action of the motor; consequently for a very low 3D refresh rate, the speed difference can become quite important. It is strongly advise to decrease the 3D refresh rate and use direct rendering.

The two methods are provided for convenience (sometimes it is easier to produce loads, and sometimes easier to directly modify the atom positions).

Again, see the artistic effect ShakerAnimationMotorAddon for more infos and examples (you could also use the shaker to check performances for your objects).

The Loads * boundaryConditions object can be used here to set initial boundary conditions.

The second paramater allows you to do more than one motor loop, if non zero it means that the motor can compute all the iterations up to time=forcedTime without producing any loads or updating any positions, making the motor faster.

Parameters
dtthe delta-t to use in the motor
forcedTimethe time at which the user wants a result
Returns
the list of loads produce by the motor

Referenced by LoadsSimulation::doOneStep().

◆ getDescription()

virtual QString AnimationMotorAddon::getDescription ( )
pure virtual

get a simple description (can be rich text)

Referenced by LoadsSimulation::loadAddon().

◆ getMotorWidget()

QWidget * AnimationMotorAddon::getMotorWidget ( )
virtual

get the optionnal operator widget if there the return value is not null, then the motor widget will be displayed as a new tab

Referenced by LoadsSimulation::loadAddon().

◆ getTime()

virtual double AnimationMotorAddon::getTime ( ) const
pure virtual

get the current motor internal time

Referenced by LoadsSimulation::doOneStep(), and LoadsSimulation::updateTime().

◆ restart()

virtual void AnimationMotorAddon::restart ( )
pure virtual

start the simulation from the begining

Referenced by LoadsSimulation::rewind().

◆ setBoundaryConditions()

void AnimationMotorAddon::setBoundaryConditions ( Loads bc)
virtual

set the initial loads (for boundary conditions)

References boundaryConditions.

Member Data Documentation

◆ boundaryConditions

Loads* AnimationMotorAddon::boundaryConditions
protected

Referenced by setBoundaryConditions().

◆ myLM

LoadsManager* AnimationMotorAddon::myLM
protected

Referenced by AnimationMotorAddon().


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