The Vish Visualization Shell 0.3
Vish
Public Types | Public Member Functions | Public Attributes | List of all members
Wizt::VTime Class Reference

An input type for steering time-dependent objects. More...

#include <ocean/shrimp/VTime.hpp>

Public Types

typedef double timestep_t
 A type definition for clarification which values are time steps.
 

Public Member Functions

double maxTsteps () const
 The number of all time steps for the given increment in the current range.
 
double & operator() ()
 The time value.
 
double operator() () const
 Return the time value.
 
VTime operator() (double TimeValue) const
 Get time for new time in given time interval, TimeValue will need to be between zero and one.
 
VTime operator[] (timestep_t TimeStep) const
 Get time for a (fractional) time step.
 
double Tdiscrete (timestep_t Tstep) const
 The time value for the given time step number (can be fractional, if need to be, but should be an integer).
 
double Tdiscretized (double Tvalue) const
 The discretized version of a given time value, i.e.
 
timestep_t Tstep () const
 Return the (possibly fractional) time step of the current time.
 
timestep_t Tstep (double TimeValue) const
 The time step number of the given time.
 
 VTime (double v, const VTime &Source, bool WrapIt=true)
 Construct time from new value and existing time, wrapping it around the boundaries if required.
 
 VTime (double v=0.0)
 Construct time from double value.
 
 ~VTime ()
 Destruct time.
 

Public Attributes

double increment
 Size of a time step.
 
Range TimeRange
 The range of the allowed time here.
 

Detailed Description

An input type for steering time-dependent objects.

The time consists out of a value, an interval, an increment, and some textual meta-information describing e.g. the units of the given time.

The time class provides three kinds of timings:

  1. Physical (absolute) time
  2. Time steps (number of time increments, relative to given time interval)
  3. Interval time (location within the given time interval) Special attention must be taken to not confuse these time values, since all of them are specified via floating point numbers (including the time step, which can be fractional).
Examples
DynamicBackground.cpp.

Member Typedef Documentation

◆ timestep_t

typedef double Wizt::VTime::timestep_t

A type definition for clarification which values are time steps.

Time step values are integers, but they are stored in double precision floating point values.

Member Function Documentation

◆ operator()()

VTime Wizt::VTime::operator() ( double  TimeValue) const
inline

Get time for new time in given time interval, TimeValue will need to be between zero and one.

The resulting time will be wrapped to reside within the given time range.

◆ operator[]()

VTime Wizt::VTime::operator[] ( timestep_t  TimeStep) const
inline

Get time for a (fractional) time step.

The resulting time will be wrapped to reside within the given time range.

◆ Tdiscretized()

double Wizt::VTime::Tdiscretized ( double  Tvalue) const

The discretized version of a given time value, i.e.

rounded to fit the given time range and increment.

References increment, Tdiscrete(), and Tstep().

◆ Tstep()

double Wizt::VTime::Tstep ( double  TimeValue) const

The time step number of the given time.

This will always be an integer value.

References increment.