SCV  4.2.1
Simple Components for Visual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Canvas.h
Go to the documentation of this file.
1 
7 #ifndef __SCV_CANVAS_H__
8 #define __SCV_CANVAS_H__
9 
10 #include <SCV/SCV.h>
11 
12 namespace scv {
13 
14 class Canvas : public Component {
15 public:
16  Canvas(const scv::Point &p1, const scv::Point &p2);
17 
18  virtual void display();
19 
20  virtual void render(void) {}
21  virtual void update(void) {}
22 
23  //Adicional Rendering functions
24  void point(int x, int y); //point coordinates
25  void line( int x1, int y1, int x2, int y2 );
26 
27  //rectangles
28  void rect( int x1, int y1, int x2, int y2 );
29  void rectFill( int x1, int y1, int x2, int y2 );
30 
31  //Convex polygon. Four vertices specify a rectangle
32  void polygon(float vx[], float vy[], int n_elems);
33  void polygonFill(float vx[], float vy[], int n_elems);
34 
35  void circle( int x, int y, int raio, int div );
36  void circleFill( int x, int y, int raio, int div );
37 
38  //Colors for drawing and cleanning
39  void color(float r, float g, float b);
40  void clear(float r, float g, float b);
41 
42  //draw a text
43  void text(int x, int y, const char *t);
44 
45 };
46 
47 } // namespace scv
48 
49 
50 #endif // __SCV_CANVAS_H__