Empirical
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
D3::Scale Class Reference

#include <scales.h>

Inheritance diagram for D3::Scale:
D3::D3_Base D3::IdentityScale D3::QuantizeScale D3::LinearScale D3::OrdinalScale D3::QuantileScale D3::ThresholdScale D3::LogScale D3::PowScale D3::TimeScale

Public Member Functions

 Scale ()
 
 Scale (bool derived)
 Decoy constructor so we don't construct extra base scales. More...
 
template<typename T , size_t SIZE>
ScaleSetRange (emp::array< T, SIZE > values)
 
ScaleSetRange (double min, double max)
 
template<typename T , size_t SIZE>
ScaleSetDomain (emp::array< T, SIZE > values)
 
ScaleSetDomain (double min, double max)
 
Scale Copy ()
 Make a copy of this scale. More...
 
double ApplyScale (double input)
 Calculate the ouput for [input], based on the scale's scaling function. More...
 
int ApplyScale (int input)
 
int GetID () const
 
void Log () const
 

Protected Member Functions

 Scale (int id)
 

Protected Attributes

int id
 

Detailed Description

Scales in D3 are functions that take input values and map them to output based on a scaling function. They are often used to map data calues to x, y coordinates in pixels describing where on the screen elements should be placed. This is a base class to inherit from - should never be made stand-alone

Constructor & Destructor Documentation

D3::Scale::Scale ( int  id)
inlineprotected
D3::Scale::Scale ( )
inline
D3::Scale::Scale ( bool  derived)
inline

Decoy constructor so we don't construct extra base scales.

Member Function Documentation

double D3::Scale::ApplyScale ( double  input)
inline

Calculate the ouput for [input], based on the scale's scaling function.

int D3::Scale::ApplyScale ( int  input)
inline
Scale D3::Scale::Copy ( )
inline

Make a copy of this scale.

int D3::D3_Base::GetID ( ) const
inlineinherited
void D3::D3_Base::Log ( ) const
inlineinherited
template<typename T , size_t SIZE>
Scale& D3::Scale::SetDomain ( emp::array< T, SIZE >  values)
inline

Set the input values corresponding to values in the range. Array should contain same number of elements as the one used to set the range.

Scale& D3::Scale::SetDomain ( double  min,
double  max 
)
inline
template<typename T , size_t SIZE>
Scale& D3::Scale::SetRange ( emp::array< T, SIZE >  values)
inline

Set the output values corresponding to values in the domain. Output for values in between will be interpolated with a function determined by the type of the scale. Array should contain same number of elements as the one used to set the domain.

Scale& D3::Scale::SetRange ( double  min,
double  max 
)
inline

Member Data Documentation

int D3::D3_Base::id
protectedinherited

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