Simbody  3.6
SimTK::Visualizer::Reporter Class Reference

This is an EventReporter that makes it easy to generate on-screen movies of any simulation. More...

+ Inheritance diagram for SimTK::Visualizer::Reporter:

Public Member Functions

 Reporter (const Visualizer &viz, Real reportInterval=Infinity)
 Create a Reporter for the given Visualizer viz, and call its report() method every reportInterval time units of simulation time (not necessarily measured in seconds). More...
 
 Reporter (const MultibodySystem &sys, Real reportInterval=Infinity)
 This constructor will create a Visualizer with all the default settings for the supplied system sys. More...
 
 ~Reporter ()
 Destructor will also destroy the contained Visualizer object if there are no other references to it. More...
 
const VisualizergetVisualizer () const
 Get the Visualizer which this Reporter is using to generate images. More...
 
virtual void handleEvent (const State &state) const override
 This satisfies the pure virtual method in EventReporter. More...
 
- Public Member Functions inherited from SimTK::PeriodicEventReporter
 ~PeriodicEventReporter ()
 
Real getNextEventTime (const State &state, bool includeCurrentTime) const override
 Get the next time at which an event will occur. More...
 
 PeriodicEventReporter (Real eventInterval)
 Create a PeriodicEventReporter. More...
 
Real getEventInterval () const
 Get the time interval at which events occur. More...
 
void setEventInterval (Real eventInterval)
 Set the time interval at which events occur. More...
 
- Public Member Functions inherited from SimTK::ScheduledEventReporter
virtual ~ScheduledEventReporter ()
 
- Public Member Functions inherited from SimTK::EventReporter
virtual ~EventReporter ()
 

Protected Member Functions

const ImplgetImpl () const
 
ImplupdImpl ()
 

Protected Attributes

Implimpl
 

Detailed Description

This is an EventReporter that makes it easy to generate on-screen movies of any simulation.

Use it like this:

MultibodySystem system;
// ... build your system
// Create a Visualizer object for communication with the visualizer.
Visualizer viz(system);
// ... set visualization options by calling methods on viz
// Create a Reporter that will make periodic calls to the Visualizer's
// report() method to render frames. Note that ownership of the Reporter
// is taken by the System; don't delete it yourself.
system.addEventReporter(new Visualizer::Reporter(viz, interval));

Constructor & Destructor Documentation

◆ Reporter() [1/2]

SimTK::Visualizer::Reporter::Reporter ( const Visualizer viz,
Real  reportInterval = Infinity 
)
explicit

Create a Reporter for the given Visualizer viz, and call its report() method every reportInterval time units of simulation time (not necessarily measured in seconds).

Note that if you want to run your simulation in real time and you aren't using seconds as time units, you should set the time scale via the Visualizer's setRealTimeScale() method and set the report interval here to TimeScale/FrameRate.

◆ Reporter() [2/2]

SimTK::Visualizer::Reporter::Reporter ( const MultibodySystem sys,
Real  reportInterval = Infinity 
)
explicit

This constructor will create a Visualizer with all the default settings for the supplied system sys.

This is an abbreviation for

Reporter(Visualizer(system), reportInterval);

.

◆ ~Reporter()

SimTK::Visualizer::Reporter::~Reporter ( )

Destructor will also destroy the contained Visualizer object if there are no other references to it.

Member Function Documentation

◆ getVisualizer()

const Visualizer& SimTK::Visualizer::Reporter::getVisualizer ( ) const

Get the Visualizer which this Reporter is using to generate images.

◆ handleEvent()

virtual void SimTK::Visualizer::Reporter::handleEvent ( const State state) const
overridevirtual

This satisfies the pure virtual method in EventReporter.

Implements SimTK::EventReporter.

◆ getImpl()

const Impl& SimTK::Visualizer::Reporter::getImpl ( ) const
inlineprotected

◆ updImpl()

Impl& SimTK::Visualizer::Reporter::updImpl ( )
inlineprotected

Member Data Documentation

◆ impl

Impl* SimTK::Visualizer::Reporter::impl
protected

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