Loris 1.5

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 LinearEnvelope * clone (void) const
virtual double valueAt (double t) const
void insert (double time, double value)
void insertBreakpoint (double time, double value)
LinearEnvelope & operator+= (double offset)
LinearEnvelope & operator-= (double offset)
LinearEnvelope & operator*= (double scale)
LinearEnvelope & operator/= (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

  • size_type
  • value_type
  • iterator
  • const_iterator

and the member functions

  • size_type size( void ) const
  • bool empty( void ) const
  • iterator begin( void )
  • const_iterator begin( void ) const
  • iterator end( void )
  • const_iterator end( void ) const

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:
initialValueis 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:
timeis the time at which to insert a new breakpoint
valueis 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:
timeis the time at which to insert a new breakpoint
valueis 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:
scaleis 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:
offsetis 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:
offsetis 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:
divis 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:
tis the time at which to evaluate this LinearEnvelope.

Implements Loris::Envelope.


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