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

HammerAito Class Reference

#include <HammerAito.h>

Inheritance diagram for HammerAito:

Inheritance graph
[legend]
Collaboration diagram for HammerAito:

Collaboration graph
[legend]
List of all members.

Detailed Description

A transform that performs the Hammer-Aitoff projection.

A transform that performs the Hammer-Aitoff map projection. This map projection is an equal-area projection which displays the world on an ellipse. "Equal-area" means equal-areas on the globe are equal areas on the two dimension projection. If this transforms were used with an XY Plot containing the boundaries of the continents, it might look like image below.

hammer.gif

Requests:
Cross hairs could follow the transform.

Author:
Kaustuv <kaustuv@stanford.edu>

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

Definition at line 36 of file HammerAito.h.

Public Member Functions

virtual void adjustValues (AxisModelBase &model, hippodraw::Axes::Type axes, const Range &limit)
 Sets the range of given axis to be a new "nice" within the limits given.
virtual double aspectRatio () const
 Returns the aspect ratio.
virtual HippoRectangle calcRectangle (const Range &x, const Range &y)
 Returns a HippoRectangle enclosing the transformed data space.
virtual HammerAitoclone () const
 Creates a new Transform object by copying an existing one.
 HammerAito (const HammerAito &)
 The copy constructor.
 HammerAito (UnaryTransform *z)
 The constructor.
virtual void inverseTransform (double &lon, double &lat) const
 Transform the transformed coordinates on X and Y axis back to the original true data space.
void inverseTransformZ (double &z) const
 Inverse transforms the z coordinate.
virtual bool isLinearInXY () const
 Returns true if the transform would be one to one on both the X and Y axes.
bool isPeriodic () const
 Sets wether this transform is periodic.
virtual const RangelimitX () const
 Returns the Range limits of the first corrdinate.
virtual const RangelimitY () const
 Returns the Range limits of the second corrdinate.
const RangelimitZ () const
 Returns the Range limits on the third corrdinate.
double moduloAdd (double a1, double a2, hippodraw::Axes::Type axis) const
 Modulo Addition along either X or Y axis.
double moduloAddX (double x1, double x2) const
 Modulo Addition along X axis.
double moduloAddY (double y1, double y2) const
 Modulo Addition along Y axis.
double moduloSub (double s1, double s2, hippodraw::Axes::Type axis) const
 Modulo Substraction along either X or Y axis.
double moduloSubX (double x1, double x2) const
 Modulo Substraction along X axis.
double moduloSubY (double y1, double y2) const
 Modulo Substraction along Y axis.
const std::stringname () const
 Returns the name of the Transform.
bool needsGrid () const
 Returns wether this transform needs grid.
bool needsXTicks () const
 Returns wether this transform needs x ticks.
bool needsYTicks () const
 Returns wether this transform needs y ticks.
void setNeedsGrid (bool needs_grid)
 Sets wether this transform needs grid.
void setNeedsXTicks (bool needs_x_ticks)
 Sets wether this transform needs x ticks.
void setNeedsYTicks (bool needs_y_ticks)
 Sets wether this transform needs y yicks.
virtual const std::vector<
AxisTick > & 
setTicks (AxisModelBase &axis_model, hippodraw::Axes::Type axis)
void setXOffset (double x_offset)
 Sets the xOffset of the (periodic) transform.
void setYOffset (double y_offset)
 Sets the yOffset of the (periodic) transform.
void setZTransform (TransformBase *transform)
 Sets the transform function on the Z axis.
virtual void transform (std::vector< double > &lon, std::vector< double > &lat) const
 A transform on two axes.
virtual void transform (double &lon, double &lat) const
 Transform the coordinates on the X and Y axes.
void transformZ (double &z) const
 Transforms the z coordinate.
virtual void validate (Range &lat, Range &lon) const
 Validates the Ranges.
double xOffset () const
 Returns the xOffset of the (periodic) transform.
double yOffset () const
 Returns the yOffset of the (periodic) transform.
TransformBasezTransform () const
 Returns the transform function on the Z axis.
virtual ~HammerAito ()
 The virtual destructor.

Protected Attributes

bool m_is_periodic
 Is this transform periodic.
std::string m_name
 Name of the Transform.
bool m_needs_grid
 Does this binary tranform needs grid?
bool m_needs_x_ticks
 Does this binary tranform x ticks?
bool m_needs_y_ticks
 Does this binary tranform y ticks?
Range m_x_limits
 The limits on X axis of the transform.
double m_x_offset
 The xoffset of this periodic transform.
Range m_y_limits
 The limits on Y axis of the transform.
double m_y_offset
 The yoffset of this periodic transform.
UnaryTransformm_z
 The transform on the Z axis.

Private Member Functions

const std::vector< AxisTick > & genTicks (AxisModelBase &axis, hippodraw::Axes::Type axistype)
 Generates the ticks in the axis.
void setFirstTick (AxisModelBase &axis)
 Sets the first tick on the axis.
void setTickStep (AxisModelBase &axis)
 Helps to decide the tick size for the corresponding axis.

Private Attributes

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


Constructor & Destructor Documentation

HammerAito::HammerAito UnaryTransform z  ) 
 

The constructor.

The constructor taking a UnaryTransform for its Z axis.

Definition at line 31 of file HammerAito.cxx.

References TransformBase::m_name.

HammerAito::HammerAito const HammerAito  ) 
 

The copy constructor.

Definition at line 39 of file HammerAito.cxx.

HammerAito::~HammerAito  )  [virtual]
 

The virtual destructor.

Definition at line 44 of file HammerAito.cxx.


Member Function Documentation

void HammerAito::adjustValues AxisModelBase model,
hippodraw::Axes::Type  axes,
const Range limit
[virtual]
 

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

Implements BinaryTransform.

Definition at line 230 of file HammerAito.cxx.

double HammerAito::aspectRatio  )  const [virtual]
 

Returns the aspect ratio.

Some transforms require a specific ration of the width to the height of the display. Returning a value of 2.0, for example, means that the width should be twice the height. Returning a value of 0.0 means any aspect ratio may be used.

Reimplemented from BinaryTransform.

Definition at line 123 of file HammerAito.cxx.

HippoRectangle HammerAito::calcRectangle const Range x,
const Range y
[virtual]
 

Returns a HippoRectangle enclosing the transformed data space.

Implements BinaryTransform.

Definition at line 128 of file HammerAito.cxx.

References Range::high(), Range::low(), and transform().

HammerAito * HammerAito::clone  )  const [virtual]
 

Creates a new Transform object by copying an existing one.

Implements BinaryTransform.

Definition at line 51 of file HammerAito.cxx.

const vector< AxisTick > & HammerAito::genTicks AxisModelBase axis,
hippodraw::Axes::Type  axistype
[private]
 

Generates the ticks in the axis.

Todo:
Handle too many ticks better, rather than doing nothing.
See more detailed comment in code.

Definition at line 279 of file HammerAito.cxx.

References std::abs(), FLT_EQUAL(), AxisModelBase::getFirstTick(), AxisModelBase::getPMag(), AxisModelBase::getRange(), AxisModelBase::getRMag(), AxisModelBase::getScaleFactor(), AxisModelBase::getTickStep(), Range::high(), m_ticks, PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloAddY(), std::pow(), AxisModelBase::setUsePMag(), hippodraw::Axes::X, PeriodicBinaryTransform::xOffset(), hippodraw::Axes::Y, and PeriodicBinaryTransform::yOffset().

Referenced by setTicks().

void HammerAito::inverseTransform double &  lon,
double &  lat
const [virtual]
 

Transform the transformed coordinates on X and Y axis back to the original true data space.

Implements BinaryTransform.

Definition at line 86 of file HammerAito.cxx.

References M_PI, and std::sqrt().

void BinaryTransform::inverseTransformZ double &  z  )  const [inherited]
 

Inverse transforms the z coordinate.

Definition at line 104 of file BinaryTransform.cxx.

References UnaryTransform::inverseTransform(), and BinaryTransform::m_z.

bool HammerAito::isLinearInXY  )  const [virtual]
 

Returns true if the transform would be one to one on both the X and Y axes.

Clients can use this function to avoid calling the transform in for loops.

Implements BinaryTransform.

Definition at line 59 of file HammerAito.cxx.

bool BinaryTransform::isPeriodic  )  const [inherited]
 

Sets wether this transform is periodic.

Definition at line 146 of file BinaryTransform.cxx.

References BinaryTransform::m_is_periodic.

Referenced by BinaryTransform::BinaryTransform(), AxisRepBase::drawCrossHairs(), CompositePlotter::fillPickedPoint(), and Inspector::setHighRange().

const Range & PeriodicBinaryTransform::limitX  )  const [virtual, inherited]
 

Returns the Range limits of the first corrdinate.

Implements BinaryTransform.

Definition at line 60 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_x_limits.

const Range & PeriodicBinaryTransform::limitY  )  const [virtual, inherited]
 

Returns the Range limits of the second corrdinate.

Implements BinaryTransform.

Definition at line 66 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_y_limits.

const Range & BinaryTransform::limitZ  )  const [inherited]
 

Returns the Range limits on the third corrdinate.

Definition at line 110 of file BinaryTransform.cxx.

References UnaryTransform::limits(), and BinaryTransform::m_z.

Referenced by CompositePlotter::autoScaleZ(), and CompositePlotter::setRangePrivate().

double PeriodicBinaryTransform::moduloAdd double  a1,
double  a2,
hippodraw::Axes::Type  axis
const [inherited]
 

Modulo Addition along either X or Y axis.

Definition at line 96 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloAddY(), hippodraw::Axes::X, and hippodraw::Axes::Y.

double PeriodicBinaryTransform::moduloAddX double  x1,
double  x2
const [inherited]
 

Modulo Addition along X axis.

Definition at line 120 of file PeriodicBinaryTransform.cxx.

References Range::high(), Range::low(), PeriodicBinaryTransform::m_x_limits, and PeriodicBinaryTransform::moduloSubX().

Referenced by CompositePlotter::fillPickedPoint(), Lambert::genTicks(), genTicks(), PeriodicBinaryTransform::moduloAdd(), PeriodicBinaryTransform::moduloSubX(), and Inspector::setHighRange().

double PeriodicBinaryTransform::moduloAddY double  y1,
double  y2
const [inherited]
 

Modulo Addition along Y axis.

Definition at line 149 of file PeriodicBinaryTransform.cxx.

References Range::high(), Range::low(), PeriodicBinaryTransform::m_y_limits, and PeriodicBinaryTransform::moduloSubY().

Referenced by CompositePlotter::fillPickedPoint(), Lambert::genTicks(), genTicks(), PeriodicBinaryTransform::moduloAdd(), PeriodicBinaryTransform::moduloSubY(), and Inspector::setHighRange().

double PeriodicBinaryTransform::moduloSub double  s1,
double  s2,
hippodraw::Axes::Type  axis
const [inherited]
 

Modulo Substraction along either X or Y axis.

Definition at line 109 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::moduloSubX(), PeriodicBinaryTransform::moduloSubY(), hippodraw::Axes::X, and hippodraw::Axes::Y.

double PeriodicBinaryTransform::moduloSubX double  x1,
double  x2
const [inherited]
 

Modulo Substraction along X axis.

Definition at line 135 of file PeriodicBinaryTransform.cxx.

References Range::high(), Range::low(), PeriodicBinaryTransform::m_x_limits, and PeriodicBinaryTransform::moduloAddX().

Referenced by AxisRepBase::drawCrossHairs(), PeriodicBinaryTransform::moduloAddX(), and PeriodicBinaryTransform::moduloSub().

double PeriodicBinaryTransform::moduloSubY double  y1,
double  y2
const [inherited]
 

Modulo Substraction along Y axis.

Definition at line 164 of file PeriodicBinaryTransform.cxx.

References Range::high(), Range::low(), PeriodicBinaryTransform::m_y_limits, and PeriodicBinaryTransform::moduloAddY().

Referenced by AxisRepBase::drawCrossHairs(), PeriodicBinaryTransform::moduloAddY(), and PeriodicBinaryTransform::moduloSub().

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().

bool BinaryTransform::needsGrid  )  const [inherited]
 

Returns wether this transform needs grid.

Definition at line 116 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_grid.

Referenced by BinaryTransform::BinaryTransform(), and CompositePlotter::drawAxisRep().

bool BinaryTransform::needsXTicks  )  const [inherited]
 

Returns wether this transform needs x ticks.

Definition at line 126 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_x_ticks.

Referenced by BinaryTransform::BinaryTransform(), and CompositePlotter::drawAxisRep().

bool BinaryTransform::needsYTicks  )  const [inherited]
 

Returns wether this transform needs y ticks.

Definition at line 136 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_y_ticks.

Referenced by BinaryTransform::BinaryTransform(), and CompositePlotter::drawAxisRep().

void HammerAito::setFirstTick AxisModelBase axis  )  [private]
 

Sets the first tick on the axis.

Definition at line 267 of file HammerAito.cxx.

References AxisModelBase::getRange(), Range::low(), and AxisModelBase::setFirstTick().

Referenced by setTicks().

void BinaryTransform::setNeedsGrid bool  needs_grid  )  [inherited]
 

Sets wether this transform needs grid.

Definition at line 121 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_grid.

void BinaryTransform::setNeedsXTicks bool  needs_x_ticks  )  [inherited]
 

Sets wether this transform needs x ticks.

Definition at line 131 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_x_ticks.

void BinaryTransform::setNeedsYTicks bool  needs_y_ticks  )  [inherited]
 

Sets wether this transform needs y yicks.

Definition at line 141 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_y_ticks.

const vector< AxisTick > & HammerAito::setTicks AxisModelBase model,
hippodraw::Axes::Type  axis
[virtual]
 

Todo:
Are the implementations of the functions called, duplicates of what is in the derived classes of LinearTransform?

Implements BinaryTransform.

Definition at line 216 of file HammerAito.cxx.

References genTicks(), BinaryTransform::m_z, setFirstTick(), setTickStep(), and hippodraw::Axes::Z.

void HammerAito::setTickStep AxisModelBase axis  )  [private]
 

Helps to decide the tick size for the corresponding axis.

Definition at line 244 of file HammerAito.cxx.

References std::abs(), AxisModelBase::getRange(), AxisModelBase::getScaleFactor(), Range::high(), Range::length(), std::log10(), Range::low(), std::max(), AxisModelBase::setPMag(), AxisModelBase::setRMag(), and AxisModelBase::setTickStep().

Referenced by setTicks().

void PeriodicBinaryTransform::setXOffset double  x_offset  )  [inherited]
 

Sets the xOffset of the (periodic) transform.

Definition at line 77 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_x_offset.

Referenced by Inspector::autoScale_clicked(), and Inspector::setHighRange().

void PeriodicBinaryTransform::setYOffset double  y_offset  )  [inherited]
 

Sets the yOffset of the (periodic) transform.

Definition at line 87 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_y_offset.

Referenced by Inspector::autoScale_clicked(), and Inspector::setHighRange().

void BinaryTransform::setZTransform TransformBase transform  )  [inherited]
 

Sets the transform function on the Z axis.

The transform object must be derived class of UnaryTransform, otherwise the transform object pointer is set to null.

Definition at line 91 of file BinaryTransform.cxx.

References BinaryTransform::m_z.

void HammerAito::transform std::vector< double > &  lon,
std::vector< double > &  lat
const [virtual]
 

A transform on two axes.

Implements BinaryTransform.

Definition at line 109 of file HammerAito.cxx.

References transform().

void HammerAito::transform double &  lon,
double &  lat
const [virtual]
 

Transform the coordinates on the X and Y axes.

Attention:
The arguments are passed by reference so the values may changed.

Implements BinaryTransform.

Definition at line 67 of file HammerAito.cxx.

References std::cos(), M_PI, std::sin(), and std::sqrt().

Referenced by calcRectangle(), and transform().

void BinaryTransform::transformZ double &  z  )  const [inherited]
 

Transforms the z coordinate.

Definition at line 98 of file BinaryTransform.cxx.

References BinaryTransform::m_z, and UnaryTransform::transform().

Referenced by ContourPointRep::drawContourTicks(), AxisRepColor::drawZTickLabels(), AxisRepColor::drawZTickLines(), and CompositePlotter::prepareToDraw().

void HammerAito::validate Range lat,
Range lon
const [virtual]
 

Validates the Ranges.

Adjusts Ranges to be restricted to that which is valid for the transform.

Implements BinaryTransform.

Definition at line 202 of file HammerAito.cxx.

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

double PeriodicBinaryTransform::xOffset  )  const [inherited]
 

Returns the xOffset of the (periodic) transform.

Definition at line 72 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_x_offset.

Referenced by AxisRepBase::drawCrossHairs(), CompositePlotter::fillPickedPoint(), Lambert::genTicks(), genTicks(), and Inspector::setHighRange().

double PeriodicBinaryTransform::yOffset  )  const [inherited]
 

Returns the yOffset of the (periodic) transform.

Definition at line 82 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_y_offset.

Referenced by AxisRepBase::drawCrossHairs(), CompositePlotter::fillPickedPoint(), Lambert::genTicks(), genTicks(), and Inspector::setHighRange().

TransformBase * BinaryTransform::zTransform  )  const [inherited]
 

Returns the transform function on the Z axis.

Definition at line 84 of file BinaryTransform.cxx.

References BinaryTransform::m_z.

Referenced by DisplayController::getLog(), and DisplayController::setLog().


Member Data Documentation

bool BinaryTransform::m_is_periodic [protected, inherited]
 

Is this transform periodic.

Definition at line 55 of file BinaryTransform.h.

Referenced by BinaryTransform::BinaryTransform(), and BinaryTransform::isPeriodic().

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

Name of the Transform.

Definition at line 39 of file TransformBase.h.

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

bool BinaryTransform::m_needs_grid [protected, inherited]
 

Does this binary tranform needs grid?

Definition at line 46 of file BinaryTransform.h.

Referenced by BinaryTransform::BinaryTransform(), BinaryTransform::needsGrid(), and BinaryTransform::setNeedsGrid().

bool BinaryTransform::m_needs_x_ticks [protected, inherited]
 

Does this binary tranform x ticks?

Definition at line 49 of file BinaryTransform.h.

Referenced by BinaryTransform::BinaryTransform(), BinaryTransform::needsXTicks(), and BinaryTransform::setNeedsXTicks().

bool BinaryTransform::m_needs_y_ticks [protected, inherited]
 

Does this binary tranform y ticks?

Definition at line 52 of file BinaryTransform.h.

Referenced by BinaryTransform::BinaryTransform(), BinaryTransform::needsYTicks(), and BinaryTransform::setNeedsYTicks().

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

The ticks last generated by this transform.

Definition at line 43 of file HammerAito.h.

Referenced by genTicks().

Range PeriodicBinaryTransform::m_x_limits [protected, inherited]
 

The limits on X axis of the transform.

Definition at line 37 of file PeriodicBinaryTransform.h.

Referenced by PeriodicBinaryTransform::limitX(), PeriodicBinaryTransform::moduloAddX(), and PeriodicBinaryTransform::moduloSubX().

double PeriodicBinaryTransform::m_x_offset [protected, inherited]
 

The xoffset of this periodic transform.

Definition at line 43 of file PeriodicBinaryTransform.h.

Referenced by PeriodicBinaryTransform::setXOffset(), and PeriodicBinaryTransform::xOffset().

Range PeriodicBinaryTransform::m_y_limits [protected, inherited]
 

The limits on Y axis of the transform.

Definition at line 40 of file PeriodicBinaryTransform.h.

Referenced by PeriodicBinaryTransform::limitY(), PeriodicBinaryTransform::moduloAddY(), and PeriodicBinaryTransform::moduloSubY().

double PeriodicBinaryTransform::m_y_offset [protected, inherited]
 

The yoffset of this periodic transform.

Definition at line 46 of file PeriodicBinaryTransform.h.

Referenced by PeriodicBinaryTransform::setYOffset(), and PeriodicBinaryTransform::yOffset().

UnaryTransform* BinaryTransform::m_z [protected, inherited]
 

The transform on the Z axis.

Definition at line 43 of file BinaryTransform.h.

Referenced by XYTransform::adjustValues(), BinaryTransform::BinaryTransform(), BinaryTransform::inverseTransformZ(), BinaryTransform::limitZ(), XYTransform::setTicks(), Lambert::setTicks(), setTicks(), BinaryTransform::setZTransform(), BinaryTransform::transformZ(), BinaryTransform::zTransform(), and BinaryTransform::~BinaryTransform().


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