LineClip Class Reference
Line clipper. More...
#include <lineclip.hpp>
Public Member Functions | |
LineClip (cairo_t *cairo) | |
Construct line clipper. More... | |
~LineClip () | |
Destructor. More... | |
void | set (double xmin, double ymin, double xmax, double ymax) |
Set clipping area. More... | |
void | reset () |
Reset clip. More... | |
void | move_to (double x, double y) |
Move to (x,y) More... | |
void | line_to (double x, double y) |
Line to (x,y) More... | |
void | curve_to (double x1, double y1, double x2, double y2, double x3, double y3) |
Curve to (x,y) More... | |
void | close_path () |
Close path. More... | |
void | fill () |
Close path and fill enclosed area. More... | |
Detailed Description
Line clipper.
Cairo graphics coordinates are internally handled using fixed point algebra for speed. This causes problems in clipping algorithm when there are large scale differences in coordinates. This class is provided for the user to overcome this problem by using floating point algebra for line clipping.
Constructor & Destructor Documentation
◆ LineClip()
LineClip::LineClip | ( | cairo_t * | cairo | ) |
Construct line clipper.
◆ ~LineClip()
LineClip::~LineClip | ( | ) |
Destructor.
Member Function Documentation
◆ close_path()
void LineClip::close_path | ( | ) |
Close path.
◆ curve_to()
void LineClip::curve_to | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3 | ||
) |
Curve to (x,y)
Curve is drawn with lines in cairo. Number is subdivisions is made large enough to contain the error at typically less than 1 pixel.
◆ fill()
void LineClip::fill | ( | ) |
Close path and fill enclosed area.
◆ line_to()
void LineClip::line_to | ( | double | x, |
double | y | ||
) |
Line to (x,y)
◆ move_to()
void LineClip::move_to | ( | double | x, |
double | y | ||
) |
Move to (x,y)
◆ reset()
void LineClip::reset | ( | ) |
Reset clip.
Sets clip limits to infinity and forgets last coordinate.
◆ set()
void LineClip::set | ( | double | xmin, |
double | ymin, | ||
double | xmax, | ||
double | ymax | ||
) |
Set clipping area.
The documentation for this class was generated from the following files: