LinePointRep.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _LinePointRep_H_
15 #define _LinePointRep_H_
16 
17 #include "PointRepBase.h"
18 
19 namespace hippodraw {
20 
21 class Rect;
22 class Point;
23 
35 {
36 
37 private:
38 
39  // The drawing rectangle boundaries.
40  double m_xmin, m_xmax, m_ymin, m_ymax;
41 
42  const Rect * m_user_rect;
43 
46  void transformValues ( const DataSource * source,
47  TransformBase * transform );
48 
49  bool outside_box(std::vector<double>::const_iterator ix,
50  std::vector<double>::const_iterator iy) const;
51 
52  bool straddles_x_boundary(std::vector<double>::const_iterator ix,
53  std::vector<double>::const_iterator iy,
54  Point & pt1, Point & pt2,
55  double & distance) const;
56 
57  bool straddles_y_boundary(std::vector<double>::const_iterator ix,
58  std::vector<double>::const_iterator iy,
59  Point & pt1, Point & pt2,
60  double & distance) const;
61 
62  bool cornerCase(std::vector<double>::const_iterator ix,
63  std::vector<double>::const_iterator iy,
64  std::vector<double> & x, std::vector<double> & y) const;
65 
66  double interpolate(double x, std::vector<double>::const_iterator ix,
67  std::vector<double>::const_iterator iy) const;
68 
69  double separation(const Point & pt1, const Point & pt2) const;
70 
71  void findEndPoints(std::vector<double>::const_iterator ix,
72  std::vector<double>::const_iterator iy,
73  Point & pt1, Point & pt2) const;
74 
75  void addEndPoints(std::vector<double>::const_iterator ix,
76  std::vector<double>::const_iterator iy,
77  std::vector<double> & x, std::vector<double> & y) const;
78 
79 protected:
80 
87  std::vector< double > m_x;
88 
95  std::vector< double > m_y;
96 
100 
103  LinePointRep ( const char * name, float size );
104 
108  void drawValues ( ViewBase * view );
109 
110 public:
112  LinePointRep();
113 
115  LinePointRep ( float size );
116 
118  LinePointRep( const LinePointRep & point_rep );
119 
121  virtual ~LinePointRep();
122 
125  virtual RepBase * clone();
126 
129  virtual void setStyle ( unsigned int style );
130 
133  virtual unsigned int getStyle ( ) const;
134 
135  virtual void drawProjectedValues ( const DataSource * ntuple,
136  TransformBase * transform,
137  ViewBase * previews );
138 
141  virtual bool uses ( hippodraw::Line::Style ) const;
142 
143 };
144 
145 } // namespace hippodraw
146 
147 #endif // _LinePointRep_H_

Generated for HippoDraw Class Library by doxygen