Loris::LinearEnvelope Class Reference

#include <LinearEnvelope.h>

Inheritance diagram for Loris::LinearEnvelope:
Loris::Envelope

List of all members.

Public Member Functions

 LinearEnvelope (void)
 LinearEnvelope (double initialValue)
virtual LinearEnvelopeclone (void) const
virtual double valueAt (double t) const
void insert (double time, double value)
void insertBreakpoint (double time, double value)
LinearEnvelopeoperator+= (double offset)
LinearEnvelopeoperator-= (double offset)
LinearEnvelopeoperator*= (double scale)
LinearEnvelopeoperator/= (double div)

Detailed Description

A LinearEnvelope represents a linear segment breakpoint function with infinite extension at each end (that is, evalutaing the envelope past either end of the breakpoint function yields the value at the nearest end point).

LinearEnvelope implements the Envelope interface, described by the abstract class Envelope.

LinearEnvelope inherits the types

and the member functions

from std::map< double, double >.


Constructor & Destructor Documentation

Loris::LinearEnvelope::LinearEnvelope ( void   ) 

Construct a new LinearEnvelope having no breakpoints (and an implicit value of 0 everywhere).

Loris::LinearEnvelope::LinearEnvelope ( double  initialValue  )  [explicit]

Construct and return a new LinearEnvelope having a single breakpoint at 0 (and an implicit value everywhere) of initialValue.

Parameters:
initialValue is the value of this LinearEnvelope at time 0.

Member Function Documentation

virtual LinearEnvelope* Loris::LinearEnvelope::clone ( void   )  const [virtual]

Return an exact copy of this LinearEnvelope (polymorphic copy, following the Prototype pattern).

Implements Loris::Envelope.

void Loris::LinearEnvelope::insert ( double  time,
double  value 
)

Insert a breakpoint representing the specified (time, value) pair into this LinearEnvelope. If there is already a breakpoint at the specified time, it will be replaced with the new breakpoint.

Parameters:
time is the time at which to insert a new breakpoint
value is the value of the new breakpoint
void Loris::LinearEnvelope::insertBreakpoint ( double  time,
double  value 
) [inline]

Insert a breakpoint representing the specified (time, value) pair into this LinearEnvelope. Same as insert, retained for backwards-compatibility.

Parameters:
time is the time at which to insert a new breakpoint
value is the value of the new breakpoint
LinearEnvelope& Loris::LinearEnvelope::operator*= ( double  scale  ) 

Scale this LinearEnvelope by a constant value and return a reference to self.

Parameters:
scale is the value by which to multiply to all points in the envelope
LinearEnvelope& Loris::LinearEnvelope::operator+= ( double  offset  ) 

Add a constant value to this LinearEnvelope and return a reference to self.

Parameters:
offset is the value to add to all points in the envelope
LinearEnvelope& Loris::LinearEnvelope::operator-= ( double  offset  )  [inline]

Subtract a constant value from this LinearEnvelope and return a reference to self.

Parameters:
offset is the value to subtract from all points in the envelope
LinearEnvelope& Loris::LinearEnvelope::operator/= ( double  div  )  [inline]

Divide this LinearEnvelope by a constant value and return a reference to self.

Parameters:
div is the value by which to divide to all points in the envelope
virtual double Loris::LinearEnvelope::valueAt ( double  t  )  const [virtual]

Return the linearly-interpolated value of this LinearEnvelope at the specified time.

Parameters:
t is the time at which to evaluate this LinearEnvelope.

Implements Loris::Envelope.


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

Generated by  doxygen 1.6.2