72 Tic(
double x,
const std::string &label ) : _x(x), _label(label) {}
90 std::vector<Tic> _tic;
95 static bool tic_labels_bbox_crash_x(
const double bbox[4],
const double obbox[4] );
96 static bool tic_labels_bbox_crash_y(
const double bbox[4],
const double obbox[4] );
97 bool add_tic(
double x, cairo_t *cairo,
const Coordmapper1D &cm,
98 bool ruler_tic_bbox_test,
double &maxsize,
double obbox[4] );
136 void set_ticlen(
double inlen,
double outlen );
140 void set_autorange(
bool autorange_min,
bool autorange_max );
144 void get_autorange(
bool &autorange_min,
bool &autorange_max )
const;
159 void get_ranges(
double &min,
double &max )
const;
163 void set_endpoints(
double x1,
double y1,
double x2,
double y2 );
Linear 1D coordinate mapper.
Definition: coordmapper.hpp:57
void get_bbox(cairo_t *cairo, double bbox[4], Coordmapper1D &cm, bool recalculate=true)
Get bounding box of ruler.
void calculate(cairo_t *cairo, Coordmapper1D &cm, bool ruler_tic_bbox_test)
Calculate ruler ranges, set tics and coordmapper.
void draw(cairo_t *cairo, Coordmapper1D &cm, bool recalculate=true)
Draw ruler with cairo.
void set_endpoints(double x1, double y1, double x2, double y2)
End points in pixels for ruler.
void set_font_size(double size)
Set font size.
void set_autorange(bool autorange_min, bool autorange_max)
Set ruler autoranging status.
1D and 2D coordinate transformations for plotter.
void copy_tics(const Ruler &ruler)
Copy tics and from other ruler.
void set_ranges(double min, double max)
Set ruler ranges.
void set_ticlen(double inlen, double outlen)
Set tic lengths.
Ruler & operator=(const Ruler &ruler)
Assignment operator.
Class for labels in plots.
Definition: label.hpp:57
void get_ranges(double &min, double &max) const
Get current ruler ranges.
void set_coord_index(int cind)
Set coordinate index.
Class for coordinate axis ruler.
Definition: ruler.hpp:62
void enable_labels(bool enable)
Enable axis title and tic labels.
~Ruler()
Destructor.
Definition: ruler.hpp:120
void set_indir(bool ccw)
Set in direction for frame ruler.
void set_axis_label(const std::string &label)
Set axis label.
Color class for plotting.
Definition: color.hpp:53
void debug_print(std::ostream &os) const
Debug print to stream.
void get_autorange(bool &autorange_min, bool &autorange_max) const
Get ruler autoranging status.
void set_color(const Color &color)
Set ruler color.
Ruler()
Default contructor.