PeriodicBinaryTransform.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _PeriodicBinaryTransform_H_
15 #define _PeriodicBinaryTransform_H_
16 
17 #ifdef _MSC_VER
18 #include "msdevstudio/MSconfig.h" // for CLONE_DEFECT
19 #endif
20 
21 #include "BinaryTransform.h"
22 
23 #include "axes/AxisTick.h"
24 #include "axes/Range.h"
25 
26 
27 // Use C struct in WCSLIB.
28 struct wcsprm;
29 
30 
31 namespace hippodraw {
32 
40 {
41 
42 protected:
43 
45  void initwcs(const std::string &transformName, double* crpix,
46  double* crval, double* cdelt,
47  double crota2, bool galactic);
48 
51  void throwWCSMissing () const;
52 
53  /* Structure defined in WCSLIB wcs.h. This contains all
54  transform information. */
55  wcsprm* m_wcs;
56  char m_wcs_struct[2000];
57 
58 
61 
64 
66  double m_x_offset;
67 
69  double m_y_offset;
70 
73 
80  PeriodicBinaryTransform ( UnaryTransform *, bool = false, bool = false,
81  bool = true, bool = true,
82  double = -180, double = +180,
83  double = -90, double = +90);
84 
87 
88 
89 
90 
91 
94  std::vector < AxisTick > m_ticks;
95 
97  void setTickStep( AxisModelBase & axis );
98 
100  void setFirstTick( AxisModelBase & axis );
101 
103  const std::vector < AxisTick > &
104  genTicks ( AxisModelBase & axis, hippodraw::Axes::Type axistype );
105 
106 
107 public:
108 
110  virtual ~PeriodicBinaryTransform();
111 
113  virtual const Range & limitX() const;
114 
116  virtual const Range & limitY() const;
117 
119  double xOffset() const;
120 
122  void setXOffset ( double x_offset );
123 
125  double yOffset() const;
126 
128  void setYOffset( double y_offset );
129 
131  double moduloAdd ( double a1, double a2, hippodraw::Axes::Type axis ) const;
132 
134  double moduloSub ( double s1, double s2, hippodraw::Axes::Type axis ) const;
135 
137  double moduloAddX ( double x1, double x2 ) const;
138 
140  double moduloAddY ( double y1, double y2 ) const;
141 
143  double moduloSubX ( double x1, double x2 ) const;
144 
146  double moduloSubY ( double y1, double y2 ) const;
147 
148 
149  virtual Rect calcRectangle ( const Range & x,
150  const Range & y );
151 
152  virtual void validate ( Range & lat, Range & lon ) const;
153 
154  virtual const std::vector < AxisTick > &
155  setTicks ( AxisModelBase & axis_model, hippodraw::Axes::Type axis );
156 
161  virtual void adjustValues ( AxisModelBase & model,
163  const Range & limit );
164 
165 
166  virtual bool isLinearInXY () const;
167 
168  // Use wcslib to do transform.
169  virtual void transform (double & lon, double & lat) const;
170  virtual bool inverseTransform (double & lon, double & lat) const;
171  virtual void transform ( std::vector< double > & lon,
172  std::vector< double > & lat) const;
173 
174 };
175 
176 } // namespace hippodraw
177 
178 #endif // _PeriodicBinaryTransform_H_
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
std::vector< AxisTick > m_ticks
The ticks last generated by this transform.
Range m_x_limits
The limits on X axis of the transform.
static double a1[3]
Definition: Landau.cxx:52
static double a2[2]
Definition: Landau.cxx:54
Range m_y_limits
The limits on Y axis of the transform.
A Periodic transform that transforms coordinates from one 2D coordinate system to another...
hippodraw::BinaryTransform class interface
The AxisModelBase class maintains the Range and scaling of an axis.
Definition: AxisModelBase.h:33
Class representing a rectangle.
Definition: Rectangle.h:34
A transform that transforms coordinates from one 2D coordinate system to another. ...
hippodraw::Range class interface
A transform that transforms coordinates in one dimension from one coordinate system to another...
Expresses a range of values.
Definition: Range.h:33
double m_x_offset
The xoffset of this periodic transform.
double m_y_offset
The yoffset of this periodic transform.
Type
Axes constants.
Definition: AxesType.h:31
AxisTick class interface.

Generated for HippoDraw Class Library by doxygen