OpenGLView.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*-
2  *
3  * Hippo OpenGLView class interface
4  *
5  */
6 
7 #ifndef Hippo_OpenGLView_h
8 #define Hippo_OpenGLView_h
9 
10 // Inheritance :
11 #include "graphics/DataView.h"
12 
13 namespace hippodraw {
14  class TextTTF;
15 }
16 
25 // class OpenGLView : public hippodraw::ViewBase {
27 public: // ViewerBase :
28  virtual void update ( const hippodraw::Observable * );
29  virtual void drawLines ( const std::vector< double > & x,
30  const std::vector< double > & y,
32  const hippodraw::Color & color,float );
33  virtual void drawColorLines ( const std::vector< double > & x,
34  const std::vector< double > & y,
36  const std::vector <hippodraw::Color> & colors,
37  float size );
38 
39  virtual void drawViewLines ( const std::vector< double > & x,
40  const std::vector< double > & y,
42  bool color, float);
43  virtual void drawViewLines ( const std::vector< double > & x,
44  const std::vector< double > & y,
46  const hippodraw::Color & color, float);
47  virtual void drawPolyLine ( const std::vector< double > & xpoints,
48  const std::vector< double > & ypoints,
50  const hippodraw::Color & color , float);
51  virtual void drawSquare ( double x1, double y1, double x2, double y2,
52  int red, int green, int blue );
53  virtual void drawViewSquare ( float x1, float y1, float x2, float y2,
54  int red, int green, int blue );
55  virtual void drawPoints ( const std::vector<double> & x,
56  const std::vector<double> & y,
58  float sym_size,
59  const hippodraw::Color & color );
60  virtual void drawPoints ( const std::vector< double > & x,
61  const std::vector< double > & y,
62  const std::vector< hippodraw::Color > & colors,
64  float sym_size );
65  virtual void drawMag ( float x, float y, int mag, float fontsize );
66 // virtual void drawUserText ( const std::string &s, float x, float y,
67 // float fontsize, float angle,
68 // char xp, char yp );
69  virtual void drawText ( const std::string &s, float x, float y,
70  float fontsize, float angle,
71  char xp, char yp , bool resize = false );
72  virtual void drawText ( const std::string &s, float x, float y,
73  float fontsize, float angle,
74  char xp, char yp , bool resize = false,
75  const hippodraw::FontBase * font = 0,
76  const hippodraw::Color * color = 0 );
77 
78  virtual hippodraw::Rect getDrawRect () const;
79  virtual void setDrawRect ( float x, float y, float w, float h );
80  float userToDrawX ( double x ) const;
81  float userToDrawXAutoInv ( double x ) const;
82  float userToDrawY ( double x ) const;
83  float userToDrawColor ( double c ) const;
84 public:
85  OpenGLView ();
86  virtual ~OpenGLView ();
87  void setRect( double x, double y, double w, double h);
90 private:
91  float toViewX ( double datX ) const;
92  float toViewY ( double datY ) const;
93  float toCanvasX ( double datX ) const;
94  float toCanvasY ( double datY ) const;
95  float toX ( double x ) const;
96  float toY ( double y ) const;
97  void draw_Text ( const std::string &s, float x, float y,
98  float fontsize, float angle,
99  char xp, char yp,const hippodraw::FontBase* font = 0 );
100 private:
103 };
104 
105 
106 #endif // Hippo_OpenGLView_h
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
Definition: Observable.h:39
void draw_Text(const std::string &s, float x, float y, float fontsize, float angle, char xp, char yp, const hippodraw::FontBase *font=0)
Definition: OpenGLView.cxx:610
TextTTF permits to render text in the pixmap buffer by using the freetype fonts.
Definition: TextTTF.h:24
virtual void drawPolyLine(const std::vector< double > &xpoints, const std::vector< double > &ypoints, hippodraw::Line::Style style, const hippodraw::Color &color, float)
Draws a polyline.
Definition: OpenGLView.cxx:232
float toCanvasY(double datY) const
Definition: OpenGLView.cxx:726
void setRect(double x, double y, double w, double h)
Definition: OpenGLView.cxx:49
virtual ~OpenGLView()
Definition: OpenGLView.cxx:44
float userToDrawXAutoInv(double x) const
Type
Enumeration of the type of symbols supported by this class.
Definition: SymbolType.h:28
float userToDrawColor(double c) const
Converts a coordinate in user space to drawing space along the color (X) axis.
Definition: OpenGLView.cxx:587
float userToDrawX(double x) const
Converts a coordinate in user space to drawing space along the X axis.
Definition: OpenGLView.cxx:575
virtual void drawViewSquare(float x1, float y1, float x2, float y2, int red, int green, int blue)
Draws a colored square in view space.
Definition: OpenGLView.cxx:291
virtual void drawPoints(const std::vector< double > &x, const std::vector< double > &y, hippodraw::Symbol::Type type, float sym_size, const hippodraw::Color &color)
Draws symbol points.
Definition: OpenGLView.cxx:312
hippodraw::Rect m_draw_rect
Definition: OpenGLView.h:101
float userToDrawY(double x) const
Converts a coordinate in user space to drawing space along the Y axis.
Definition: OpenGLView.cxx:581
virtual void setDrawRect(float x, float y, float w, float h)
Sets the drawing Rectangle in the devices coordinate system.
Definition: OpenGLView.cxx:598
virtual void drawViewLines(const std::vector< double > &x, const std::vector< double > &y, hippodraw::Line::Style style, bool color, float)
Draws multiple line segments.
Definition: OpenGLView.cxx:160
A abstract base class for font handling.
Definition: FontBase.h:32
The abstract base class for views that have a region for drawing data points with area around it for ...
Definition: DataView.h:30
A Color class for creating the color object following the standard RGB color space.
Definition: Color.h:37
float toViewY(double datY) const
Definition: OpenGLView.cxx:695
The base class for the PlotterBase hierarchy.
Definition: PlotterBase.h:55
PyArray_TYPES type(numeric::array arr)
Definition: num_util.cpp:249
hippodraw::DataView class interface
virtual hippodraw::Rect getDrawRect() const
Returns the drawing Rectangle in the devices coordinate system.
Definition: OpenGLView.cxx:594
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
virtual void drawLines(const std::vector< double > &x, const std::vector< double > &y, hippodraw::Line::Style style, const hippodraw::Color &color, float)
Draws multiple line segments - that is, a line between x0,y0 and x1,y2, another between x2...
Definition: OpenGLView.cxx:67
hippodraw::TextTTF * m_TTF
Definition: OpenGLView.h:102
virtual void drawMag(float x, float y, int mag, float fontsize)
Definition: OpenGLView.cxx:501
virtual void drawSquare(double x1, double y1, double x2, double y2, int red, int green, int blue)
Draws a colored square.
Definition: OpenGLView.cxx:270
hippodraw::PlotterBase * getPlotter() const
Definition: OpenGLView.cxx:61
float toX(double x) const
Definition: OpenGLView.cxx:732
The ViewBase class using OpenGL for drawing.
Definition: OpenGLView.h:26
virtual void update(const hippodraw::Observable *)
Implements the update method of the Observer pattern.
Definition: OpenGLView.cxx:568
float toViewX(double datX) const
Definition: OpenGLView.cxx:688
virtual void drawText(const std::string &s, float x, float y, float fontsize, float angle, char xp, char yp, bool resize=false)
Definition: OpenGLView.cxx:546
virtual void drawColorLines(const std::vector< double > &x, const std::vector< double > &y, hippodraw::Line::Style style, const std::vector< hippodraw::Color > &colors, float size)
Draws multiple line segments, each with a different color - that is, a line between x0...
Definition: OpenGLView.cxx:118
float toCanvasX(double datX) const
Definition: OpenGLView.cxx:721
void setPlotter(hippodraw::PlotterBase *)
Sets the PlotterBase object to plotter.
Definition: OpenGLView.cxx:55
float toY(double y) const
Definition: OpenGLView.cxx:736

Generated for HippoDraw Class Library by doxygen