Simbody
Public Member Functions | Protected Member Functions | Protected Attributes

SimTK::Visualizer::Reporter Class Reference

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

#include <Visualizer_Reporter.h>

Inheritance diagram for SimTK::Visualizer::Reporter:

List of all members.

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).
 Reporter (const MultibodySystem &sys, Real reportInterval=Infinity)
 This constructor will create a Visualizer with all the default settings for the supplied system sys.
 ~Reporter ()
 Destructor will also destroy the contained Visualizer object if there are no other references to it.
const VisualizergetVisualizer () const
 Get the Visualizer which this Reporter is using to generate images.
virtual void handleEvent (const State &state) const
 This satisfies the pure virtual method in EventReporter.

Protected Member Functions

const Impl & getImpl () const
Impl & updImpl ()

Protected Attributes

Impl * impl

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 VisualizerGUI.
    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

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.

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); 

.

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

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


Member Function Documentation

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

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

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

This satisfies the pure virtual method in EventReporter.

Implements SimTK::EventReporter.

const Impl& SimTK::Visualizer::Reporter::getImpl ( ) const [inline, protected]
Impl& SimTK::Visualizer::Reporter::updImpl ( ) [inline, protected]

Member Data Documentation

Reimplemented from SimTK::PeriodicEventReporter.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines