00001
00002
00014 #ifndef _BinaryTransform_H_
00015 #define _BinaryTransform_H_
00016
00017 #ifdef _MSC_VER
00018 #include "msdevstudio/MSconfig.h"
00019 #endif
00020
00021 #include "TransformBase.h"
00022
00023 #include "axes/AxesType.h"
00024
00025 #include <vector>
00026
00027 namespace hippodraw {
00028
00029 class AxisModelBase;
00030 class AxisTick;
00031 class Rect;
00032 class UnaryTransform;
00033
00039 class MDL_HIPPOPLOT_API BinaryTransform : public TransformBase
00040 {
00041
00042 protected:
00043
00045 UnaryTransform * m_z;
00046
00048 bool m_needs_grid;
00049
00051 bool m_needs_x_ticks;
00052
00054 bool m_needs_y_ticks;
00055
00057 bool m_is_periodic;
00058
00060 BinaryTransform ();
00061
00067 BinaryTransform ( UnaryTransform *, bool = false, bool = false,
00068 bool = true, bool = true);
00069
00071 BinaryTransform ( const BinaryTransform & );
00072
00073 public:
00074
00076 virtual ~BinaryTransform();
00077
00079 #ifdef CLONE_DEFECT
00080 virtual TransformBase * clone () const = 0;
00081 #else
00082 virtual BinaryTransform * clone () const = 0;
00083 #endif
00084
00088 virtual bool isLinearInXY () const = 0;
00089
00093 virtual bool isLinearInZ () const;
00094
00100 virtual void transform ( double & x, double & y ) const = 0;
00101
00106 virtual bool inverseTransform ( double & x, double & y ) const = 0;
00107
00109 virtual void transform ( std::vector< double > & x,
00110 std::vector< double > & y ) const = 0;
00111
00117 virtual double aspectRatio () const;
00118
00121 virtual Rect calcRectangle ( const Range & x,
00122 const Range & y ) = 0;
00123
00126 virtual void validate ( Range & x, Range & y ) const = 0;
00127
00129 virtual const Range & limitX () const = 0;
00130
00132 virtual const Range & limitY () const = 0;
00133
00136 virtual const std::vector < AxisTick > &
00137 setTicks ( AxisModelBase & axis_model, hippodraw::Axes::Type axis ) = 0;
00138
00141 virtual void adjustValues ( AxisModelBase & model,
00142 hippodraw::Axes::Type axes,
00143 const Range & limit ) = 0;
00144
00146 const Range & limitZ () const;
00147
00149 TransformBase * zTransform () const;
00150
00155 void setZTransform ( TransformBase * transform );
00156
00158 void transformZ ( double & z ) const;
00159
00161 void inverseTransformZ ( double & z ) const;
00162
00164 bool needsGrid() const;
00165
00167 void setNeedsGrid( bool needs_grid );
00168
00170 bool needsXTicks() const;
00171
00173 void setNeedsXTicks( bool needs_x_ticks );
00174
00176 bool needsYTicks() const;
00177
00179 void setNeedsYTicks( bool needs_y_ticks );
00180
00182 bool isPeriodic() const;
00183
00184
00185 };
00186
00187 }
00188
00189 #endif // _BinaryTransform_H_