Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

LogTransform Class Reference

#include <LogTransform.h>

Inheritance diagram for LogTransform:

Inheritance graph
[legend]
Collaboration diagram for LogTransform:

Collaboration graph
[legend]
List of all members.

Detailed Description

A UnaryTransform which takes the log of the coordinate.

Bug:
For egret.py, the low end of the range appears to be too low.

Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 28 of file LogTransform.h.

Public Member Functions

const RangeadjustValues (AxisModelBase &axis, const Range &limit)
 Sets the range of given axis to be a new "nice" within the limits given.
virtual double aspectRatio () const
 Get the aspect ratio.
virtual LogTransformclone () const
 Creates a new Transform object by copying an existing one.
virtual void inverseTransform (double &x) const
 Inverse transforms the coordinate x.
virtual bool isLinear () const
virtual const Rangelimits () const
 Returns a Range whose values are the limits on the coordinate.
 LogTransform (const LogTransform &)
 The copy constructor.
 LogTransform ()
 The default constructor.
const std::stringname () const
 Returns the name of the Transform.
virtual const std::vector<
AxisTick > & 
setTicks (AxisModelBase &axis)
 Sets the vector of ticks along the axis to which this Log transform is applied.
virtual void transform (std::vector< double > &x) const
 Transforms each element of the vector x.
virtual void transform (double &x) const
 Transforms the coordinate @ x.
virtual void validate (Range &) const
 Validates the Range, and adjusts the argument Range so that the values are positive.
virtual ~LogTransform ()
 The virtual destructor.

Protected Attributes

const Range m_limits
 The valid Range of the transform.
std::string m_name
 Name of the Transform.

Private Member Functions

const RangeadjustLogValues (AxisModelBase &axis)
const std::vector< AxisTick > & genTicks (AxisModelBase &)
double nextStep (double current, AxisModelBase &axis)
double prevStep (double current, AxisModelBase &axis)
void setFirstTick (AxisModelBase &)
void setTickStep (AxisModelBase &)

Private Attributes

std::vector< AxisTickm_ticks
 The ticks generated by this transform.


Constructor & Destructor Documentation

LogTransform::LogTransform  ) 
 

The default constructor.

Definition at line 39 of file LogTransform.cxx.

References TransformBase::m_name.

LogTransform::LogTransform const LogTransform  ) 
 

The copy constructor.

Definition at line 49 of file LogTransform.cxx.

LogTransform::~LogTransform  )  [virtual]
 

The virtual destructor.

Definition at line 45 of file LogTransform.cxx.


Member Function Documentation

const Range & LogTransform::adjustLogValues AxisModelBase axis  )  [private]
 

Definition at line 457 of file LogTransform.cxx.

References AxisModelBase::getRange(), Range::high(), Range::low(), Range::pos(), and AxisModelBase::setRange().

Referenced by adjustValues().

const Range & LogTransform::adjustValues AxisModelBase axis,
const Range limit
[virtual]
 

Sets the range of given axis to be a new "nice" within the limits given.

Implements UnaryTransform.

Definition at line 370 of file LogTransform.cxx.

References adjustLogValues(), AxisModelBase::getPMag(), AxisModelBase::getRange(), AxisModelBase::getScaleFactor(), Range::high(), Range::length(), Range::low(), nextStep(), Range::pos(), std::pow(), prevStep(), AxisModelBase::setIntersectRange(), and setTickStep().

double TransformBase::aspectRatio  )  const [virtual, inherited]
 

Get the aspect ratio.

Reimplemented in BinaryTransform, HammerAito, Lambert, and XYTransform.

Definition at line 48 of file TransformBase.cxx.

Referenced by CompositePlotter::getAspectRatio().

LogTransform * LogTransform::clone  )  const [virtual]
 

Creates a new Transform object by copying an existing one.

Implements UnaryTransform.

Definition at line 57 of file LogTransform.cxx.

const vector< AxisTick > & LogTransform::genTicks AxisModelBase axis  )  [private]
 

Todo:
This is an ugly way to display scientific notation.
Can we improve it?
Todo:
Use C++ stringstream insted of sprintf().

Definition at line 181 of file LogTransform.cxx.

References FLT_EQUAL(), AxisModelBase::getFirstTick(), AxisModelBase::getMaxTicks(), AxisModelBase::getRange(), AxisModelBase::getScaleFactor(), AxisModelBase::getTickStep(), Range::high(), std::log10(), Range::low(), m_ticks, nextStep(), and std::pow().

Referenced by setTicks().

void LogTransform::inverseTransform double &  x  )  const [virtual]
 

Inverse transforms the coordinate x.

Implements UnaryTransform.

Definition at line 75 of file LogTransform.cxx.

References std::pow().

bool LogTransform::isLinear  )  const [virtual]
 

Implements UnaryTransform.

Definition at line 65 of file LogTransform.cxx.

const Range & UnaryTransform::limits  )  const [virtual, inherited]
 

Returns a Range whose values are the limits on the coordinate.

Definition at line 25 of file UnaryTransform.cxx.

References UnaryTransform::m_limits.

Referenced by XYZTransform::limitX(), XYTransform::limitX(), XYZTransform::limitY(), XYTransform::limitY(), XYZTransform::limitZ(), and BinaryTransform::limitZ().

const string & TransformBase::name  )  const [inherited]
 

Returns the name of the Transform.

Definition at line 43 of file TransformBase.cxx.

References TransformBase::m_name.

Referenced by BinaryTransform::BinaryTransform(), TransformXML::createElement(), DisplayController::getLog(), DisplayController::setLog(), and XYTransform::XYTransform().

double LogTransform::nextStep double  current,
AxisModelBase axis
[private]
 

Todo:
: Change this to an array of good ticks rather than hardcoded in here.

Definition at line 291 of file LogTransform.cxx.

References AxisModelBase::getTickStep(), std::log10(), and std::pow().

Referenced by adjustValues(), and genTicks().

double LogTransform::prevStep double  current,
AxisModelBase axis
[private]
 

Todo:
Change this to an array of good ticks rather than hardcoded in here.

Definition at line 333 of file LogTransform.cxx.

References AxisModelBase::getTickStep(), std::log10(), and std::pow().

Referenced by adjustValues(), and setFirstTick().

void LogTransform::setFirstTick AxisModelBase  )  [private]
 

Definition at line 148 of file LogTransform.cxx.

References AxisModelBase::getPMag(), AxisModelBase::getRange(), Range::low(), std::pow(), prevStep(), and AxisModelBase::setFirstTick().

Referenced by setTicks().

const vector< AxisTick > & LogTransform::setTicks AxisModelBase axis  )  [virtual]
 

Sets the vector of ticks along the axis to which this Log transform is applied.

Implements UnaryTransform.

Definition at line 115 of file LogTransform.cxx.

References genTicks(), setFirstTick(), and setTickStep().

void LogTransform::setTickStep AxisModelBase  )  [private]
 

Definition at line 123 of file LogTransform.cxx.

References AxisModelBase::getRange(), Range::high(), std::log10(), Range::low(), std::pow(), AxisModelBase::setPMag(), AxisModelBase::setRMag(), and AxisModelBase::setTickStep().

Referenced by adjustValues(), and setTicks().

void LogTransform::transform std::vector< double > &  x  )  const [virtual]
 

Transforms each element of the vector x.

If any element is non positive, it is transformed to -DBL_MAX.

Implements UnaryTransform.

Definition at line 82 of file LogTransform.cxx.

References std::log10().

void LogTransform::transform double &  x  )  const [virtual]
 

Transforms the coordinate @ x.

If the coordinate is non-positive, it is transformed to -DBL_MAX as defined in float.h.

Implements UnaryTransform.

Definition at line 70 of file LogTransform.cxx.

References std::log10().

void LogTransform::validate Range  )  const [virtual]
 

Validates the Range, and adjusts the argument Range so that the values are positive.

Implements UnaryTransform.

Definition at line 99 of file LogTransform.cxx.

References Range::high(), Range::low(), Range::pos(), Range::setHigh(), and Range::setLow().


Member Data Documentation

const Range UnaryTransform::m_limits [protected, inherited]
 

The valid Range of the transform.

Definition at line 39 of file UnaryTransform.h.

Referenced by UnaryTransform::limits().

std::string TransformBase::m_name [protected, inherited]
 

Name of the Transform.

Definition at line 39 of file TransformBase.h.

Referenced by BinaryTransform::BinaryTransform(), HammerAito::HammerAito(), Lambert::Lambert(), LinearTransform::LinearTransform(), LogTransform(), TransformBase::name(), TransformBase::TransformBase(), XYTransform::XYTransform(), XYZTransform::XYZTransform(), and XYZTransformBase::XYZTransformBase().

std::vector< AxisTick > LogTransform::m_ticks [private]
 

The ticks generated by this transform.

Definition at line 34 of file LogTransform.h.

Referenced by genTicks().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3