00001
00002
00014 #ifndef _LinePointRep_H_
00015 #define _LinePointRep_H_
00016
00017 #include "PointRepBase.h"
00018
00019 namespace hippodraw {
00020
00021 class Rect;
00022 class Point;
00023
00034 class MDL_HIPPOPLOT_API LinePointRep : public PointRepBase
00035 {
00036
00037 private:
00038
00039
00040 double m_xmin, m_xmax, m_ymin, m_ymax;
00041
00042 const Rect * m_user_rect;
00043
00046 void transformValues ( const DataSource * source,
00047 TransformBase * transform );
00048
00049 bool outside_box(std::vector<double>::const_iterator ix,
00050 std::vector<double>::const_iterator iy) const;
00051
00052 bool straddles_x_boundary(std::vector<double>::const_iterator ix,
00053 std::vector<double>::const_iterator iy,
00054 Point & pt1, Point & pt2,
00055 double & distance) const;
00056
00057 bool straddles_y_boundary(std::vector<double>::const_iterator ix,
00058 std::vector<double>::const_iterator iy,
00059 Point & pt1, Point & pt2,
00060 double & distance) const;
00061
00062 bool cornerCase(std::vector<double>::const_iterator ix,
00063 std::vector<double>::const_iterator iy,
00064 std::vector<double> & x, std::vector<double> & y) const;
00065
00066 double interpolate(double x, std::vector<double>::const_iterator ix,
00067 std::vector<double>::const_iterator iy) const;
00068
00069 double separation(const Point & pt1, const Point & pt2) const;
00070
00071 void findEndPoints(std::vector<double>::const_iterator ix,
00072 std::vector<double>::const_iterator iy,
00073 Point & pt1, Point & pt2) const;
00074
00075 void addEndPoints(std::vector<double>::const_iterator ix,
00076 std::vector<double>::const_iterator iy,
00077 std::vector<double> & x, std::vector<double> & y) const;
00078
00079 protected:
00080
00087 std::vector< double > m_x;
00088
00095 std::vector< double > m_y;
00096
00099 hippodraw::Line::Style m_line_style;
00100
00103 LinePointRep ( const char * name, float size );
00104
00108 void drawValues ( ViewBase * view );
00109
00110 public:
00112 LinePointRep();
00113
00115 LinePointRep ( float size );
00116
00118 LinePointRep( const LinePointRep & point_rep );
00119
00121 virtual ~LinePointRep();
00122
00125 virtual RepBase * clone();
00126
00129 virtual void setStyle ( unsigned int style );
00130
00133 virtual unsigned int getStyle ( ) const;
00134
00135 virtual void drawProjectedValues ( const DataSource * ntuple,
00136 TransformBase * transform,
00137 ViewBase * previews );
00138
00141 virtual bool uses ( hippodraw::Line::Style ) const;
00142
00143 };
00144
00145 }
00146
00147 #endif // _LinePointRep_H_