18 #define _ugraph_hpp_ 1 20 #include <ubit/udefs.hpp> 21 #include <ubit/ucolor.hpp> 22 #include <ubit/ugeom.hpp> 27 UGraphAttributes() : color_rgba(0u,0u,0u,255u), bgcolor_rgba(255u,255u,255u,255u) {}
30 unsigned long color, bgcolor;
31 URgba color_rgba, bgcolor_rgba;
32 enum {OPAQUE, UNIFORM_BLEND, PSEUDO_BLEND, TRUE_BLEND} blend_mode;
53 virtual void begin(
UView*,
bool _push_attrib);
108 UBox* getBox()
const;
126 void getClip(
URect&)
const;
129 void setClip(
const URect&);
142 void setXORMode(
const UColor& background_color);
157 void setColor(
const UColor&);
172 void setColor(
const UColor&,
float alpha);
177 void setColor(
const UColor&,
unsigned int alpha);
182 void setBackground(
const UColor&);
186 void setFont(
const UFont&);
198 void setWidth(
float);
203 float getWidth()
const;
213 void draw(
const UShape&)
const;
216 void fill(
const UShape&)
const;
219 void drawArc(
double x,
double y,
double width,
double height,
220 double start_angle,
double ext_angle)
const;
227 void fillArc(
double x,
double y,
double width,
double height,
228 double start_angle,
double ext_angle)
const;
231 void drawEllipse(
double x,
double y,
double width,
double height)
const;
234 void fillEllipse(
double x,
double y,
double width,
double height)
const;
237 void drawIma(
const UIma&,
double x,
double y,
double scale = 1.)
const;
240 void drawLine(
double x1,
double y1,
double x2,
double y2)
const;
243 void drawLine(
const UPoint& p1,
const UPoint& p2)
const;
246 static const int LINE_STRIP, LINE_LOOP, FILLED;
248 void drawPolygon(
const std::vector<UPoint>& points,
int type = LINE_LOOP)
const;
253 void drawPolygon(
const float* points,
int npoints,
int type = LINE_LOOP)
const;
259 void drawPolyline(
const std::vector<UPoint>& points)
const {drawPolygon(points, LINE_STRIP);}
262 void fillPolygon(
const std::vector<UPoint>& points)
const {drawPolygon(points, FILLED);}
265 void drawRect(
double x,
double y,
double width,
double height)
const;
268 void fillRect(
double x,
double y,
double width,
double height)
const;
271 void drawRoundRect(
double x,
double y,
double width,
double height,
272 double arc_w,
double arc_h)
const;
277 void fillRoundRect(
double x,
double y,
double width,
double height,
278 double arc_w,
double arc_h)
const;
281 void drawString(
const UStr&
string,
double x,
double y)
const;
284 void drawString(
const char*
string,
int length,
double x,
double y)
const;
287 void copyArea(
double x,
double y,
double width,
double height,
288 double delta_x,
double delta_y,
289 bool paint_events_when_obscured)
const;
315 void getHardwinClip(
URect&)
const;
318 void setHardwinClip(
const URect&);
321 void set3Dmode(
bool state);
322 bool in3Dmode()
const {
return in_3d_mode;}
324 void getWinOffset(
float& x,
float& y)
const;
325 void setWinOffset(
float x,
float y)
const;
337 friend class UGlcontext;
338 friend class UX11context;
UView * getView() const
returns the view of the widget where this UGraph can draw on.
Definition: ugraph.hpp:114
[Impl] Native Font.
Definition: uhardfont.hpp:35
Image.
Definition: uima.hpp:50
Box container.
Definition: ubox.hpp:64
2D Point.
Definition: ugeom.hpp:25
class for drawing on widgets.
Definition: ugraph.hpp:44
2D Rectangle.
Definition: ugeom.hpp:165
Display Context.
Definition: udisp.hpp:44
URect getClip() const
returns the drawing zone relatively to the origin of getView().
Definition: ugraph.hpp:123
[impl] Internal representation for fonts.
Definition: ufontImpl.hpp:24
Color attribute of an element or a widget.
Definition: ucolor.hpp:73
void fillPolygon(const std::vector< UPoint > &points) const
fills a polygon (that must be convex).
Definition: ugraph.hpp:262
for client GL Graphics.
Definition: ugraph.hpp:48
Paint event.
Definition: uevent.hpp:377
Specifies a RGBA value for defining UColor(s).
Definition: ucolor.hpp:24
UDisp * getDisp() const
returns the display that is related to this UGraph.
Definition: ugraph.hpp:120
Abstract Base class for geometrical shapes.
Definition: ugeom.hpp:85
Box View.
Definition: uview.hpp:65
Font of a UElem or UBox container.
Definition: ufont.hpp:30
Definition: uhardfont.hpp:31
Definition: urendercontext.hpp:22
Definition: uwinImpl.hpp:84
Definition: ufontmetrics.hpp:21
void drawPolyline(const std::vector< UPoint > &points) const
draws a polyline.
Definition: ugraph.hpp:259
bool isXORMode() const
sets the drawing mode in XOR mode.
Definition: ugraph.hpp:152
Definition: ugraph.hpp:26
Ubit String.
Definition: ustr.hpp:72