A transform that performs the Lambert projection. More...
#include <Lambert.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 Rect | calcRectangle (const Range &x, const Range &y) |
Returns a rectangle enclosing the transformed data space. | |
virtual Lambert * | clone () const |
Creates a new Transform object by copying an existing one. | |
virtual bool | 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. | |
virtual bool | isLinearInZ () const |
Returns true if the transform would be one to one on Z axes. | |
bool | isPeriodic () const |
Sets whether this transform is periodic. | |
Lambert (UnaryTransform *z) | |
The constructor. | |
Lambert (const Lambert &) | |
The copy constructor. | |
virtual const Range & | limitX () const |
Returns the Range limits of the first coordinate. | |
virtual const Range & | limitY () const |
Returns the Range limits of the second coordinate. | |
const Range & | limitZ () const |
Returns the Range limits on the third coordinate. | |
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 Subtraction along either X or Y axis. | |
double | moduloSubX (double x1, double x2) const |
Modulo Subtraction along X axis. | |
double | moduloSubY (double y1, double y2) const |
Modulo Subtraction along Y axis. | |
const std::string & | name () const |
Returns the name of the Transform. | |
bool | needsGrid () const |
Returns whether this transform needs grid. | |
bool | needsXTicks () const |
Returns whether this transform needs x ticks. | |
bool | needsYTicks () const |
Returns whether this transform needs y ticks. | |
void | setNeedsGrid (bool needs_grid) |
Sets whether this transform needs grid. | |
void | setNeedsXTicks (bool needs_x_ticks) |
Sets whether this transform needs x ticks. | |
void | setNeedsYTicks (bool needs_y_ticks) |
Sets whether 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 (double &lon, double &lat) const |
Transform the coordinates on the X and Y axes. | |
virtual void | transform (std::vector< double > &lon, std::vector< double > &lat) const |
A transform on two 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. | |
TransformBase * | zTransform () const |
Returns the transform function on the Z axis. | |
virtual | ~Lambert () |
The virtual destructor. |
Protected Member Functions | |
const std::vector< AxisTick > & | genTicks (AxisModelBase &axis, hippodraw::Axes::Type axistype) |
Generates the ticks in the axis. | |
void | initwcs (const std::string &transformName, double *crpix, double *crval, double *cdelt, double crota2, bool galactic) |
Initialize the WCS transform type. | |
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. | |
void | throwWCSMissing () const |
Throws an exception if WCSLIB support is missing. |
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 transform needs grid? | |
bool | m_needs_x_ticks |
Does this binary transform x ticks? | |
bool | m_needs_y_ticks |
Does this binary transform y ticks? | |
std::vector< AxisTick > | m_ticks |
The ticks last generated by this transform. | |
wcsprm * | m_wcs |
char | m_wcs_struct [2000] |
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. | |
UnaryTransform * | m_z |
The transform on the Z axis. |
Lambert | ( | UnaryTransform * | z | ) |
The constructor.
The constructor taking a UnaryTransform for its Z axis.
Definition at line 18 of file Lambert.cxx.
References PeriodicBinaryTransform::initwcs(), and TransformBase::m_name.
The copy constructor.
Definition at line 29 of file Lambert.cxx.
References PeriodicBinaryTransform::initwcs().
|
virtual |
The virtual destructor.
Definition at line 37 of file Lambert.cxx.
|
virtualinherited |
Sets the range of given axis to be a new "nice" within the limits given.
Implements BinaryTransform.
Definition at line 302 of file PeriodicBinaryTransform.cxx.
|
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 53 of file Lambert.cxx.
Returns a rectangle enclosing the transformed data space.
Implements BinaryTransform.
Definition at line 201 of file PeriodicBinaryTransform.cxx.
References Range::high(), Range::low(), and PeriodicBinaryTransform::transform().
|
virtual |
Creates a new Transform object by copying an existing one.
Implements BinaryTransform.
Definition at line 44 of file Lambert.cxx.
|
protectedinherited |
Generates the ticks in the axis.
Handle too many ticks better, rather than doing nothing. See more detailed comment in code.
Do not use sprintf, it cause warnings from VS 8.
Definition at line 353 of file PeriodicBinaryTransform.cxx.
References hippodraw::FLT_EQUAL(), AxisModelBase::getFirstTick(), AxisModelBase::getPMag(), AxisModelBase::getRange(), AxisModelBase::getRMag(), AxisModelBase::getScaleFactor(), AxisModelBase::getTickStep(), Range::high(), PeriodicBinaryTransform::m_ticks, PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloAddY(), AxisModelBase::setUsePMag(), hippodraw::Axes::X, PeriodicBinaryTransform::xOffset(), hippodraw::Axes::Y, and PeriodicBinaryTransform::yOffset().
Referenced by PeriodicBinaryTransform::setTicks().
|
protectedinherited |
Initialize the WCS transform type.
Definition at line 472 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_wcs, PeriodicBinaryTransform::m_wcs_struct, and PeriodicBinaryTransform::throwWCSMissing().
Referenced by AIR::AIR(), AIR2::AIR2(), ARC::ARC(), ARC2::ARC2(), Cartesian::Cartesian(), Cartesian2::Cartesian2(), GlobalSinusoidal::GlobalSinusoidal(), GlobalSinusoidal2::GlobalSinusoidal2(), HammerAito::HammerAito(), HammerAito2::HammerAito2(), Lambert::Lambert(), Lambert2::Lambert2(), Mercator::Mercator(), Mercator2::Mercator2(), SIN::SIN(), SIN2::SIN2(), STG::STG(), STG2::STG2(), TAN::TAN(), and TAN2::TAN2().
|
virtualinherited |
Transform the transformed coordinates on X and Y axis back to the original true data space.
Return true if success, else return false.
Implements BinaryTransform.
Definition at line 544 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_wcs, and PeriodicBinaryTransform::throwWCSMissing().
|
inherited |
Inverse transforms the z coordinate.
Definition at line 106 of file BinaryTransform.cxx.
References UnaryTransform::inverseTransform(), and BinaryTransform::m_z.
|
virtualinherited |
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 459 of file PeriodicBinaryTransform.cxx.
|
virtualinherited |
Returns true
if the transform would be one to one on Z axes.
Clients can use this function to avoid calling the transform in for loops.
Definition at line 153 of file BinaryTransform.cxx.
References UnaryTransform::isLinear(), and BinaryTransform::m_z.
Referenced by ContourPointRep::getContour().
|
inherited |
Sets whether this transform is periodic.
Definition at line 148 of file BinaryTransform.cxx.
References BinaryTransform::m_is_periodic.
Referenced by BinaryTransform::BinaryTransform(), AxisRepBase::drawCrossHairs(), ContourPointRep::drawProjectedValues(), CompositePlotter::fillPickedPoint(), XyPlotter::getZValues(), Inspector::setHighRange(), and Inspector::updateTransformTab().
|
virtualinherited |
Returns the Range limits of the first coordinate.
Implements BinaryTransform.
Definition at line 86 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_x_limits.
|
virtualinherited |
Returns the Range limits of the second coordinate.
Implements BinaryTransform.
Definition at line 92 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_y_limits.
|
inherited |
Returns the Range limits on the third coordinate.
Definition at line 112 of file BinaryTransform.cxx.
References UnaryTransform::limits(), and BinaryTransform::m_z.
Referenced by CompositePlotter::autoScaleZ(), and CompositePlotter::setRangePrivate().
|
inherited |
Modulo Addition along either X or Y axis.
Definition at line 122 of file PeriodicBinaryTransform.cxx.
References hippodraw::a2, PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloAddY(), hippodraw::Axes::X, and hippodraw::Axes::Y.
|
inherited |
Modulo Addition along X axis.
Definition at line 146 of file PeriodicBinaryTransform.cxx.
References Range::high(), Range::low(), PeriodicBinaryTransform::m_x_limits, and PeriodicBinaryTransform::moduloSubX().
Referenced by CompositePlotter::fillPickedPoint(), PeriodicBinaryTransform::genTicks(), PeriodicBinaryTransform::moduloAdd(), PeriodicBinaryTransform::moduloSubX(), and Inspector::setHighRange().
|
inherited |
Modulo Addition along Y axis.
Definition at line 175 of file PeriodicBinaryTransform.cxx.
References Range::high(), Range::low(), PeriodicBinaryTransform::m_y_limits, and PeriodicBinaryTransform::moduloSubY().
Referenced by CompositePlotter::fillPickedPoint(), PeriodicBinaryTransform::genTicks(), PeriodicBinaryTransform::moduloAdd(), PeriodicBinaryTransform::moduloSubY(), and Inspector::setHighRange().
|
inherited |
Modulo Subtraction along either X or Y axis.
Definition at line 135 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::moduloSubX(), PeriodicBinaryTransform::moduloSubY(), hippodraw::Axes::X, and hippodraw::Axes::Y.
|
inherited |
Modulo Subtraction along X axis.
Definition at line 161 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().
|
inherited |
Modulo Subtraction along Y axis.
Definition at line 190 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().
|
inherited |
Returns the name of the Transform.
Definition at line 45 of file TransformBase.cxx.
References TransformBase::m_name.
Referenced by BinaryTransform::BinaryTransform(), TransformXML::createElement(), DisplayController::getLog(), DisplayController::setLog(), Inspector::updateTransformTab(), and XYTransform::XYTransform().
|
inherited |
Returns whether this transform needs grid.
Definition at line 118 of file BinaryTransform.cxx.
References BinaryTransform::m_needs_grid.
Referenced by BinaryTransform::BinaryTransform().
|
inherited |
Returns whether this transform needs x ticks.
Definition at line 128 of file BinaryTransform.cxx.
References BinaryTransform::m_needs_x_ticks.
Referenced by BinaryTransform::BinaryTransform(), and CompositePlotter::drawAxisRep().
|
inherited |
Returns whether this transform needs y ticks.
Definition at line 138 of file BinaryTransform.cxx.
References BinaryTransform::m_needs_y_ticks.
Referenced by BinaryTransform::BinaryTransform(), and CompositePlotter::drawAxisRep().
|
protectedinherited |
Sets the first tick on the axis.
Definition at line 339 of file PeriodicBinaryTransform.cxx.
References AxisModelBase::getRange(), Range::low(), and AxisModelBase::setFirstTick().
Referenced by PeriodicBinaryTransform::setTicks().
|
inherited |
Sets whether this transform needs grid.
Definition at line 123 of file BinaryTransform.cxx.
References BinaryTransform::m_needs_grid.
|
inherited |
Sets whether this transform needs x ticks.
Definition at line 133 of file BinaryTransform.cxx.
References BinaryTransform::m_needs_x_ticks.
|
inherited |
Sets whether this transform needs y yicks.
Definition at line 143 of file BinaryTransform.cxx.
References BinaryTransform::m_needs_y_ticks.
|
virtualinherited |
Implements BinaryTransform.
Definition at line 288 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::genTicks(), BinaryTransform::m_z, PeriodicBinaryTransform::setFirstTick(), PeriodicBinaryTransform::setTickStep(), and hippodraw::Axes::Z.
|
protectedinherited |
Helps to decide the tick size for the corresponding axis.
Definition at line 316 of file PeriodicBinaryTransform.cxx.
References AxisModelBase::getRange(), AxisModelBase::getScaleFactor(), Range::high(), Range::length(), Range::low(), AxisModelBase::setPMag(), AxisModelBase::setRMag(), and AxisModelBase::setTickStep().
Referenced by PeriodicBinaryTransform::setTicks().
|
inherited |
Sets the xOffset of the (periodic) transform.
Definition at line 103 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_x_offset.
Referenced by Inspector::autoScale_clicked(), Inspector::rotateY(), Inspector::setHighRange(), and Inspector::setYRotateText().
|
inherited |
Sets the yOffset of the (periodic) transform.
Definition at line 113 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_y_offset.
Referenced by Inspector::autoScale_clicked(), Inspector::rotateX(), Inspector::setHighRange(), and Inspector::setXRotateText().
|
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 93 of file BinaryTransform.cxx.
References BinaryTransform::m_z, and BinaryTransform::transform().
|
protectedinherited |
Throws an exception if WCSLIB support is missing.
Definition at line 505 of file PeriodicBinaryTransform.cxx.
Referenced by PeriodicBinaryTransform::initwcs(), PeriodicBinaryTransform::inverseTransform(), and PeriodicBinaryTransform::transform().
|
virtualinherited |
Transform the coordinates on the X and Y axes.
Implements BinaryTransform.
Definition at line 517 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_wcs, and PeriodicBinaryTransform::throwWCSMissing().
Referenced by PeriodicBinaryTransform::calcRectangle().
|
virtualinherited |
A transform on two axes.
Implements BinaryTransform.
Definition at line 578 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_wcs, num_util::size(), and PeriodicBinaryTransform::throwWCSMissing().
|
inherited |
Transforms the z coordinate.
Definition at line 100 of file BinaryTransform.cxx.
References BinaryTransform::m_z, and UnaryTransform::transform().
Referenced by ContourPointRep::drawContourTicks(), AxisRepColor::drawZTickLabels(), AxisRepColor::drawZTickLines(), and CompositePlotter::prepareToDraw().
Validates the Ranges.
Adjusts Ranges to be restricted to that which is valid for the transform.
Implements BinaryTransform.
Definition at line 274 of file PeriodicBinaryTransform.cxx.
References Range::high(), Range::low(), PeriodicBinaryTransform::m_x_limits, PeriodicBinaryTransform::m_y_limits, Range::setHigh(), and Range::setLow().
|
inherited |
Returns the xOffset of the (periodic) transform.
Definition at line 98 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_x_offset.
Referenced by AxisRepBase::drawCrossHairs(), CompositePlotter::fillPickedPoint(), PeriodicBinaryTransform::genTicks(), Inspector::setHighRange(), and Inspector::updateTransformTab().
|
inherited |
Returns the yOffset of the (periodic) transform.
Definition at line 108 of file PeriodicBinaryTransform.cxx.
References PeriodicBinaryTransform::m_y_offset.
Referenced by AxisRepBase::drawCrossHairs(), CompositePlotter::fillPickedPoint(), PeriodicBinaryTransform::genTicks(), Inspector::setHighRange(), and Inspector::updateTransformTab().
|
inherited |
Returns the transform function on the Z axis.
Definition at line 86 of file BinaryTransform.cxx.
References BinaryTransform::m_z.
Referenced by DisplayController::getLog(), and DisplayController::setLog().
|
protectedinherited |
Is this transform periodic.
Definition at line 57 of file BinaryTransform.h.
Referenced by BinaryTransform::BinaryTransform(), and BinaryTransform::isPeriodic().
|
protectedinherited |
Name of the Transform.
Definition at line 42 of file TransformBase.h.
Referenced by AIR::AIR(), AIR2::AIR2(), ARC::ARC(), ARC2::ARC2(), BinaryTransform::BinaryTransform(), Cartesian::Cartesian(), Cartesian2::Cartesian2(), GlobalSinusoidal::GlobalSinusoidal(), GlobalSinusoidal2::GlobalSinusoidal2(), HammerAito::HammerAito(), HammerAito2::HammerAito2(), Lambert::Lambert(), Lambert2::Lambert2(), LinearTransform::LinearTransform(), LogTransform::LogTransform(), Mercator::Mercator(), Mercator2::Mercator2(), TransformBase::name(), SIN::SIN(), SIN2::SIN2(), STG::STG(), STG2::STG2(), TAN::TAN(), TAN2::TAN2(), TransformBase::TransformBase(), XYTransform::XYTransform(), XYZTransform::XYZTransform(), and XYZTransformBase::XYZTransformBase().
|
protectedinherited |
Does this binary transform needs grid?
Definition at line 48 of file BinaryTransform.h.
Referenced by BinaryTransform::BinaryTransform(), BinaryTransform::needsGrid(), and BinaryTransform::setNeedsGrid().
|
protectedinherited |
Does this binary transform x ticks?
Definition at line 51 of file BinaryTransform.h.
Referenced by BinaryTransform::BinaryTransform(), BinaryTransform::needsXTicks(), and BinaryTransform::setNeedsXTicks().
|
protectedinherited |
Does this binary transform y ticks?
Definition at line 54 of file BinaryTransform.h.
Referenced by BinaryTransform::BinaryTransform(), BinaryTransform::needsYTicks(), and BinaryTransform::setNeedsYTicks().
|
protectedinherited |
The ticks last generated by this transform.
Definition at line 94 of file PeriodicBinaryTransform.h.
Referenced by PeriodicBinaryTransform::genTicks().
|
protectedinherited |
Definition at line 55 of file PeriodicBinaryTransform.h.
Referenced by PeriodicBinaryTransform::initwcs(), PeriodicBinaryTransform::inverseTransform(), and PeriodicBinaryTransform::transform().
|
protectedinherited |
Definition at line 56 of file PeriodicBinaryTransform.h.
Referenced by PeriodicBinaryTransform::initwcs().
|
protectedinherited |
The limits on X axis of the transform.
Definition at line 60 of file PeriodicBinaryTransform.h.
Referenced by PeriodicBinaryTransform::limitX(), PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloSubX(), and PeriodicBinaryTransform::validate().
|
protectedinherited |
The xoffset of this periodic transform.
Definition at line 66 of file PeriodicBinaryTransform.h.
Referenced by PeriodicBinaryTransform::setXOffset(), and PeriodicBinaryTransform::xOffset().
|
protectedinherited |
The limits on Y axis of the transform.
Definition at line 63 of file PeriodicBinaryTransform.h.
Referenced by PeriodicBinaryTransform::limitY(), PeriodicBinaryTransform::moduloAddY(), PeriodicBinaryTransform::moduloSubY(), and PeriodicBinaryTransform::validate().
|
protectedinherited |
The yoffset of this periodic transform.
Definition at line 69 of file PeriodicBinaryTransform.h.
Referenced by PeriodicBinaryTransform::setYOffset(), and PeriodicBinaryTransform::yOffset().
|
protectedinherited |
The transform on the Z axis.
Definition at line 45 of file BinaryTransform.h.
Referenced by XYTransform::adjustValues(), BinaryTransform::BinaryTransform(), BinaryTransform::inverseTransformZ(), BinaryTransform::isLinearInZ(), BinaryTransform::limitZ(), XYTransform::setTicks(), PeriodicBinaryTransform::setTicks(), BinaryTransform::setZTransform(), BinaryTransform::transformZ(), BinaryTransform::zTransform(), and BinaryTransform::~BinaryTransform().