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_
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
std::vector< double > m_y
A cache of the points along the Y axis to be drawn.
Definition: LinePointRep.h:95
A transform that transforms coordinates from one coordinate system to another.
Definition: TransformBase.h:35
Class representing a two or three dimension point.
Definition: Point.h:25
hippodraw::Line::Style m_line_style
The style currently used.
Definition: LinePointRep.h:99
std::vector< double > m_x
A cache of the points along the X axis to be drawn.
Definition: LinePointRep.h:87
const Rect * m_user_rect
Definition: LinePointRep.h:42
numeric::array clone(numeric::array arr)
Definition: num_util.cpp:412
intp size(numeric::array arr)
Definition: num_util.cpp:296
Class representing a rectangle.
Definition: Rectangle.h:34
Style
Line style constants.
Definition: LineStyle.h:25
The abstract base class for views.
Definition: ViewBase.h:62
hippodraw::PointRepBase class interface
A PointRep class that draws a column to represent the value.
Definition: LinePointRep.h:34
The base class for the point representation hierarchy.
Definition: RepBase.h:45
The base class for the point representation hierarchy.
Definition: PointRepBase.h:37
Base class for DataSource.
Definition: DataSource.h:55

Generated for HippoDraw Class Library by doxygen