Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SIN Class Reference

A transform that performs the SIN projection. More...

#include <SIN.h>

Inheritance diagram for SIN:
Inheritance graph
[legend]
Collaboration diagram for SIN:
Collaboration graph
[legend]

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. More...
 
virtual double aspectRatio () const
 Returns the aspect ratio. More...
 
virtual Rect calcRectangle (const Range &x, const Range &y)
 Returns a rectangle enclosing the transformed data space. More...
 
virtual SIN * clone () const
 Creates a new Transform object by copying an existing one. More...
 
virtual bool inverseTransform (double &lon, double &lat) const
 Transform the transformed coordinates on X and Y axis back to the original true data space. More...
 
void inverseTransformZ (double &z) const
 Inverse transforms the z coordinate. More...
 
virtual bool isLinearInXY () const
 Returns true if the transform would be one to one on both the X and Y axes. More...
 
virtual bool isLinearInZ () const
 Returns true if the transform would be one to one on Z axes. More...
 
bool isPeriodic () const
 Sets whether this transform is periodic. More...
 
virtual const Range & limitX () const
 Returns the Range limits of the first coordinate. More...
 
virtual const Range & limitY () const
 Returns the Range limits of the second coordinate. More...
 
const Range & limitZ () const
 Returns the Range limits on the third coordinate. More...
 
double moduloAdd (double a1, double a2, hippodraw::Axes::Type axis) const
 Modulo Addition along either X or Y axis. More...
 
double moduloAddX (double x1, double x2) const
 Modulo Addition along X axis. More...
 
double moduloAddY (double y1, double y2) const
 Modulo Addition along Y axis. More...
 
double moduloSub (double s1, double s2, hippodraw::Axes::Type axis) const
 Modulo Subtraction along either X or Y axis. More...
 
double moduloSubX (double x1, double x2) const
 Modulo Subtraction along X axis. More...
 
double moduloSubY (double y1, double y2) const
 Modulo Subtraction along Y axis. More...
 
const std::string & name () const
 Returns the name of the Transform. More...
 
bool needsGrid () const
 Returns whether this transform needs grid. More...
 
bool needsXTicks () const
 Returns whether this transform needs x ticks. More...
 
bool needsYTicks () const
 Returns whether this transform needs y ticks. More...
 
void setNeedsGrid (bool needs_grid)
 Sets whether this transform needs grid. More...
 
void setNeedsXTicks (bool needs_x_ticks)
 Sets whether this transform needs x ticks. More...
 
void setNeedsYTicks (bool needs_y_ticks)
 Sets whether this transform needs y yicks. More...
 
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. More...
 
void setYOffset (double y_offset)
 Sets the yOffset of the (periodic) transform. More...
 
void setZTransform (TransformBase *transform)
 Sets the transform function on the Z axis. More...
 
 SIN (UnaryTransform *z)
 The constructor. More...
 
 SIN (const SIN &)
 The copy constructor. More...
 
virtual void transform (double &lon, double &lat) const
 Transform the coordinates on the X and Y axes. More...
 
virtual void transform (std::vector< double > &lon, std::vector< double > &lat) const
 A transform on two axes. More...
 
void transformZ (double &z) const
 Transforms the z coordinate. More...
 
virtual void validate (Range &lat, Range &lon) const
 Validates the Ranges. More...
 
double xOffset () const
 Returns the xOffset of the (periodic) transform. More...
 
double yOffset () const
 Returns the yOffset of the (periodic) transform. More...
 
TransformBase * zTransform () const
 Returns the transform function on the Z axis. More...
 
virtual ~SIN ()
 The virtual destructor. More...
 

Protected Member Functions

const std::vector< AxisTick > & genTicks (AxisModelBase &axis, hippodraw::Axes::Type axistype)
 Generates the ticks in the axis. More...
 
void initwcs (const std::string &transformName, double *crpix, double *crval, double *cdelt, double crota2, bool galactic)
 Initialize the WCS transform type. More...
 
void setFirstTick (AxisModelBase &axis)
 Sets the first tick on the axis. More...
 
void setTickStep (AxisModelBase &axis)
 Helps to decide the tick size for the corresponding axis. More...
 
void throwWCSMissing () const
 Throws an exception if WCSLIB support is missing. More...
 

Protected Attributes

bool m_is_periodic
 Is this transform periodic. More...
 
std::string m_name
 Name of the Transform. More...
 
bool m_needs_grid
 Does this binary transform needs grid? More...
 
bool m_needs_x_ticks
 Does this binary transform x ticks? More...
 
bool m_needs_y_ticks
 Does this binary transform y ticks? More...
 
std::vector< AxisTick > m_ticks
 The ticks last generated by this transform. More...
 
wcsprm * m_wcs
 
char m_wcs_struct [2000]
 
Range m_x_limits
 The limits on X axis of the transform. More...
 
double m_x_offset
 The xoffset of this periodic transform. More...
 
Range m_y_limits
 The limits on Y axis of the transform. More...
 
double m_y_offset
 The yoffset of this periodic transform. More...
 
UnaryTransform * m_z
 The transform on the Z axis. More...
 

Detailed Description

A transform that performs the SIN projection.

Definition at line 24 of file SIN.h.

Constructor & Destructor Documentation

SIN ( UnaryTransform *  z)

The constructor.

The constructor taking a UnaryTransform for its Z axis.

Definition at line 18 of file SIN.cxx.

References PeriodicBinaryTransform::initwcs(), and TransformBase::m_name.

SIN ( const SIN &  t)

The copy constructor.

Definition at line 29 of file SIN.cxx.

References PeriodicBinaryTransform::initwcs().

~SIN ( )
virtual

The virtual destructor.

Definition at line 37 of file SIN.cxx.

Member Function Documentation

void adjustValues ( AxisModelBase &  model,
hippodraw::Axes::Type  axes,
const Range &  limit 
)
virtualinherited

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

Todo:
This code is duplicated and should move up the hierarchy.

Implements BinaryTransform.

Definition at line 303 of file PeriodicBinaryTransform.cxx.

double 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 53 of file SIN.cxx.

Rect calcRectangle ( const Range &  x,
const Range &  y 
)
virtualinherited

Returns a rectangle enclosing the transformed data space.

Implements BinaryTransform.

Definition at line 202 of file PeriodicBinaryTransform.cxx.

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

SIN * clone ( ) const
virtual

Creates a new Transform object by copying an existing one.

Implements BinaryTransform.

Definition at line 44 of file SIN.cxx.

const vector< AxisTick > & genTicks ( AxisModelBase &  axis,
hippodraw::Axes::Type  axistype 
)
protectedinherited
void initwcs ( const std::string &  transformName,
double *  crpix,
double *  crval,
double *  cdelt,
double  crota2,
bool  galactic 
)
protectedinherited
bool inverseTransform ( double &  x,
double &  y 
) const
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 545 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_wcs, and PeriodicBinaryTransform::throwWCSMissing().

void inverseTransformZ ( double &  z) const
inherited

Inverse transforms the z coordinate.

Definition at line 106 of file BinaryTransform.cxx.

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

bool isLinearInXY ( ) const
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 460 of file PeriodicBinaryTransform.cxx.

bool isLinearInZ ( ) const
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().

bool isPeriodic ( ) const
inherited
const Range & limitX ( ) const
virtualinherited

Returns the Range limits of the first coordinate.

Implements BinaryTransform.

Definition at line 87 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_x_limits.

const Range & limitY ( ) const
virtualinherited

Returns the Range limits of the second coordinate.

Implements BinaryTransform.

Definition at line 93 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_y_limits.

const Range & limitZ ( ) const
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().

double moduloAdd ( double  a1,
double  a2,
hippodraw::Axes::Type  axis 
) const
inherited
double moduloAddX ( double  x1,
double  x2 
) const
inherited
double moduloAddY ( double  y1,
double  y2 
) const
inherited
double moduloSub ( double  s1,
double  s2,
hippodraw::Axes::Type  axis 
) const
inherited

Modulo Subtraction along either X or Y axis.

Definition at line 136 of file PeriodicBinaryTransform.cxx.

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

double moduloSubX ( double  x1,
double  x2 
) const
inherited
double moduloSubY ( double  y1,
double  y2 
) const
inherited
const string & name ( ) const
inherited
bool needsGrid ( ) const
inherited

Returns whether this transform needs grid.

Definition at line 118 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_grid.

Referenced by BinaryTransform::BinaryTransform().

bool needsXTicks ( ) const
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().

bool needsYTicks ( ) const
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().

void setFirstTick ( AxisModelBase &  axis)
protectedinherited

Sets the first tick on the axis.

Definition at line 340 of file PeriodicBinaryTransform.cxx.

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

Referenced by PeriodicBinaryTransform::setTicks().

void setNeedsGrid ( bool  needs_grid)
inherited

Sets whether this transform needs grid.

Definition at line 123 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_grid.

void setNeedsXTicks ( bool  needs_x_ticks)
inherited

Sets whether this transform needs x ticks.

Definition at line 133 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_x_ticks.

void setNeedsYTicks ( bool  needs_y_ticks)
inherited

Sets whether this transform needs y yicks.

Definition at line 143 of file BinaryTransform.cxx.

References BinaryTransform::m_needs_y_ticks.

const vector< AxisTick > & setTicks ( AxisModelBase &  model,
hippodraw::Axes::Type  axis 
)
virtualinherited
Todo:
Are the implementations of the functions called, duplicates of what is in the derived classes of LinearTransform?

Implements BinaryTransform.

Definition at line 289 of file PeriodicBinaryTransform.cxx.

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

void setTickStep ( AxisModelBase &  axis)
protectedinherited
void setXOffset ( double  x_offset)
inherited

Sets the xOffset of the (periodic) transform.

Definition at line 104 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_x_offset.

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

void setYOffset ( double  y_offset)
inherited

Sets the yOffset of the (periodic) transform.

Definition at line 114 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_y_offset.

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

void 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 93 of file BinaryTransform.cxx.

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

void throwWCSMissing ( ) const
protectedinherited

Throws an exception if WCSLIB support is missing.

Definition at line 506 of file PeriodicBinaryTransform.cxx.

Referenced by PeriodicBinaryTransform::initwcs(), PeriodicBinaryTransform::inverseTransform(), and PeriodicBinaryTransform::transform().

void transform ( double &  x,
double &  y 
) const
virtualinherited

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 518 of file PeriodicBinaryTransform.cxx.

References PeriodicBinaryTransform::m_wcs, and PeriodicBinaryTransform::throwWCSMissing().

Referenced by PeriodicBinaryTransform::calcRectangle().

void transform ( std::vector< double > &  x,
std::vector< double > &  y 
) const
virtualinherited

A transform on two axes.

Implements BinaryTransform.

Definition at line 579 of file PeriodicBinaryTransform.cxx.

References i, PeriodicBinaryTransform::m_wcs, num_util::size(), and PeriodicBinaryTransform::throwWCSMissing().

void transformZ ( double &  z) const
inherited
void validate ( Range &  x,
Range &  y 
) const
virtualinherited

Validates the Ranges.

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

Implements BinaryTransform.

Definition at line 275 of file PeriodicBinaryTransform.cxx.

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

double xOffset ( ) const
inherited
double yOffset ( ) const
inherited
TransformBase * zTransform ( ) const
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().

Member Data Documentation

bool m_is_periodic
protectedinherited

Is this transform periodic.

Definition at line 57 of file BinaryTransform.h.

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

std::string m_name
protectedinherited
bool m_needs_grid
protectedinherited

Does this binary transform needs grid?

Definition at line 48 of file BinaryTransform.h.

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

bool m_needs_x_ticks
protectedinherited

Does this binary transform x ticks?

Definition at line 51 of file BinaryTransform.h.

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

bool m_needs_y_ticks
protectedinherited

Does this binary transform y ticks?

Definition at line 54 of file BinaryTransform.h.

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

std::vector< AxisTick > m_ticks
protectedinherited

The ticks last generated by this transform.

Definition at line 94 of file PeriodicBinaryTransform.h.

Referenced by PeriodicBinaryTransform::genTicks().

wcsprm* m_wcs
protectedinherited
char m_wcs_struct[2000]
protectedinherited

Definition at line 56 of file PeriodicBinaryTransform.h.

Referenced by PeriodicBinaryTransform::initwcs().

Range m_x_limits
protectedinherited
double m_x_offset
protectedinherited

The xoffset of this periodic transform.

Definition at line 66 of file PeriodicBinaryTransform.h.

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

Range m_y_limits
protectedinherited
double m_y_offset
protectedinherited

The yoffset of this periodic transform.

Definition at line 69 of file PeriodicBinaryTransform.h.

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

UnaryTransform* m_z
protectedinherited

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

Generated for HippoDraw Class Library by doxygen