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_

Generated for HippoDraw Class Library by doxygen