#ifndef __BLOP_GRAPH_DRAWER_H__
#define __BLOP_GRAPH_DRAWER_H__
#include "length.h"
#include "function.h"
#include "axis.h"
#include "constants.h"
#include "arrowhead.h"
#include "sym.h"
namespace blop
{
class point_drawer;
class terminal;
class graph;
class frame;
class axis;
class plottable;
class color_mapping
{
private:
void *p2f_cint_;
color (*p2f_)(double,double,double);
string fname_;
color start_color_, end_color_;
public:
static color the_color_;
static color def(double value, double mini, double maxi);
color_mapping();
color map_interpreted(double,double,double) const;
color map(double val, double mini, double maxi) const;
void set(color (*p)(double,double,double))
{
p2f_ = p;
p2f_cint_ = 0;
fname_ = "this_should_not_happen";
}
void set(void *p);
void set(const color &start_color, const color &end_color);
};
class color_legend;
class graph_drawer
{
public:
virtual function get_x(const plottable *) const;
virtual function get_y(const plottable *) const;
virtual void set_ranges(plottable *g,axis *x,axis *y) = 0;
virtual void draw(plottable *g,frame *f,terminal *t) = 0;
virtual void draw_sample(const length &x,
const length &y,
const length &size,
const plottable *style,
terminal *) {}
virtual bool draws_sample() const {return true;}
virtual graph_drawer *clone() const = 0;
virtual void prepare_for_draw(plottable *,frame *, int count) = 0;
virtual ~graph_drawer() {}
virtual int req_components() const = 0;
virtual void setup_when_added(plottable *p, frame *f) {}
virtual bool uses_linecolor() const { return true; }
virtual bool draws_points() const { return true; }
};
class graphd_colorscale : public graph_drawer
{
protected:
friend class color_legend;
color_legend *colorlegend_;
double color_min_, color_max_;
bool color_logscale_;
bool color_min_fixed_, color_max_fixed_;
int color_samples_;
color_mapping cmapping_;
color underflow_color_, overflow_color_;
var color_title_;
int draw_colorlegend_;
std::string legendname_;
public:
graphd_colorscale();
graphd_colorscale(const graphd_colorscale &o);
void copy(const graphd_colorscale &rhs);
virtual ~graphd_colorscale();
virtual graphd_colorscale &color_min(double v);
virtual double color_min() const { return color_min_; }
virtual graphd_colorscale &color_max(double v);
virtual double color_max() const { return color_max_; }
virtual graphd_colorscale &color_range(double min, double max);
virtual graphd_colorscale &color_range(const color &startcolor, const color &endcolor);
virtual int color_samples() const { return color_samples_; }
virtual graphd_colorscale &color_samples(int n) { color_samples_ = n; return *this; }
virtual bool color_logscale() const { return color_logscale_; }
virtual graphd_colorscale &color_logscale(bool f) { color_logscale_ = f; return *this; }
virtual var color_title() const { return color_title_; }
virtual graphd_colorscale &color_title(const var &t) { color_title_ = t; return *this; }
virtual bool color_min_fixed() const { return color_min_fixed_; }
virtual bool color_max_fixed() const { return color_max_fixed_; }
virtual graphd_colorscale &underflow_color(const color &c) { underflow_color_ = c; return *this; }
virtual graphd_colorscale &overflow_color(const color &c) { overflow_color_ = c; return *this; }
virtual graphd_colorscale &draw_colorlegend(bool f);
virtual color map_color(double val, double mini, double maxi) const;
void map_function(void *p) { cmapping_.set(p); }
void map_function(color (*p)(double,double,double)) { cmapping_.set(p); }
virtual void setup_when_added(plottable *p, frame *f);
virtual void set_colorlegend(color_legend *);
};
class dots : public graph_drawer
{
public:
void set_ranges(plottable *g,axis *x,axis *y);
void draw(plottable *g,frame *f,terminal *t);
virtual void draw_sample(const length &x,
const length &y,
const length &size,
const plottable *style,
terminal *);
bool draws_sample() const {return true;}
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int) {};
virtual int req_components() const {return 2;}
bool draws_points() const { return false; }
};
class lines : public graph_drawer
{
private:
bool break_line_;
public:
lines() : break_line_(true) {}
virtual lines &break_line(bool f) { break_line_ = f; return *this; }
virtual void set_ranges(plottable *g,axis *x,axis *y);
void draw(plottable *g,frame *f,terminal *t);
void draw_sample(const length &x,
const length &y,
const length &size,
const plottable *style,
terminal *);
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const {return 2;}
bool draws_points() const { return false; }
};
class splines : public lines
{
public:
graph_drawer *clone() const;
void draw(plottable *g,frame *f,terminal *t);
void draw_sample(const length &x, const length &y,
const length &samplen, const plottable *s, terminal *t);
};
class histo : public lines
{
private:
bool fill_;
public:
void set_ranges(plottable *g,axis *x,axis *y);
void draw(plottable *g,frame *f,terminal *t);
graph_drawer *clone() const;
int req_components() const {return 2;}
bool draws_points() const { return false; }
};
class points : public graph_drawer
{
protected:
point_drawer *point_drawer_;
public:
virtual void set_ranges(plottable *g,axis *x,axis *y);
void draw(plottable *g,frame *f,terminal *t);
void draw_sample(const length &x,const length &y,
const length &size,
const plottable *s,
terminal *t);
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const {return 2;}
};
class linespoints : public graph_drawer
{
protected:
point_drawer *point_drawer_;
public:
virtual void set_ranges(plottable *g,axis *x,axis *y);
void draw(plottable *g,frame *f,terminal *t);
void draw_sample(const length &x,const length &y,
const length &size,
const plottable *s,
terminal *t);
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const {return 2;}
};
class spoints : public points
{
public:
int req_components() const {return 3;}
graph_drawer *clone() const;
void draw(plottable *g,frame *f,terminal *t);
};
class cpoints : public points
{
public:
int req_components() const {return 5;}
graph_drawer *clone() const;
void draw(plottable *g,frame *f,terminal *t);
};
class bars : public graph_drawer
{
private:
length l1_,l2_;
sym::horizontal_vertical dir_;
function from_value_;
sym::position from_side_;
public:
bars(const length &width=4*blop::MM, const length &offset=0.0);
bars &operator() (const length &width,const length &offset);
void set_ranges(plottable *g,axis *x,axis *y);
void draw(plottable *g,frame *f,terminal *t);
void draw_sample(const length &x,
const length &y,
const length &size,
const plottable *style,
terminal *);
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const {return 2;}
bool draws_points() const { return false; }
};
class labels : public graph_drawer
{
private:
length x_offset_,y_offset_;
sym::position xalign_,yalign_;
double angle_;
public:
labels &operator() (sym::position xal = sym::left,
sym::position yal = sym::bottom,
double angle = 0,
const length &xoff = length(),
const length &yoff = length());
labels &xalign(sym::position a);
labels &yalign(sym::position a);
labels &align(sym::position xa, sym::position ya);
labels &angle(double a);
labels &xoffset(const length &xoff);
labels &yoffset(const length &yoff);
labels &offset(const length &xoff, const length &yoff);
bool draws_sample() const {return false;}
virtual void set_ranges(plottable *g,axis *x,axis *y);
void draw(plottable *g,frame *f,terminal *t);
void draw_sample(const length &x,
const length &y,
const length &size,
const plottable *style,
terminal *);
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
labels(sym::position xal=sym::center, sym::position yal = sym::center, double ang=0,
const length &xoff = length(), const length &yoff = length());
int req_components() const {return 3;}
bool draws_points() const { return false; }
};
class errorbars : public graph_drawer
{
private:
bool x_,y_,symmetric_x_,symmetric_y_;
static bool default_clip_errorbars_, default_clip_points_;
bool clip_errorbars_, clip_points_;
void get_functions(const plottable *g,
function &x, function &x1, function &x2,
function &y, function &y1, function &y2);
length endmarker_size_;
static length &default_endmarker_size_();
public:
static void default_clip_errorbars(bool f) { default_clip_errorbars_ = f; }
static void default_clip_points (bool f) { default_clip_points_ = f; }
static void default_endmarker_size(const length &l) { default_endmarker_size_() = l; }
errorbars &clip_errorbars(bool);
errorbars &clip_points (bool);
errorbars &endmarker_size(const length &l);
errorbars(bool x=false,bool sx=false,bool y=true,bool sy=true);
errorbars(const errorbars &);
void set_ranges(plottable *g,axis *x,axis *y);
void draw(plottable *g,frame *f,terminal *t);
void draw_sample(const length &x,
const length &y,
const length &size,
const plottable *style,
terminal *);
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const;
};
class yerrorbars : public errorbars
{public: yerrorbars() : errorbars(false,false,true,false) {}};
class syerrorbars : public errorbars
{public: syerrorbars() : errorbars(false,false,true,true) {}};
class xerrorbars : public errorbars
{public: xerrorbars() : errorbars(true,false,false,false) {}};
class sxerrorbars : public errorbars
{public: sxerrorbars() : errorbars(true,true,false,false) {}};
class xyerrorbars : public errorbars
{public: xyerrorbars() : errorbars(true,false,true,false) {}};
class sxyerrorbars : public errorbars
{public: sxyerrorbars() : errorbars(true,true,true,true) {}};
class ticlabels : public graph_drawer
{
private:
bool x_,y_;
graph_drawer *drawer_;
public:
function get_x(const plottable *g) const { return drawer_->get_x(g); }
function get_y(const plottable *g) const { return drawer_->get_y(g); }
ticlabels(bool x,bool y,const graph_drawer & = blop::points());
ticlabels(const ticlabels &);
ticlabels operator() (const graph_drawer &);
void set_ranges(plottable *g,axis *x,axis *y);
void draw(plottable *g,frame *f,terminal *t);
void draw_sample(const length &x,
const length &y,
const length &size,
const plottable *style,
terminal *);
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const;
bool draws_points() const { return (drawer_?drawer_->draws_points():false); }
};
class xticlabels : public ticlabels
{
public:
xticlabels() : ticlabels(true,false) {}
xticlabels(const graph_drawer &d) : ticlabels(true,false,d) {}
};
class yticlabels : public ticlabels
{
public:
yticlabels() : ticlabels(false,true) {}
yticlabels(const graph_drawer &d) : ticlabels(false,true,d) {}
};
class xyticlabels : public ticlabels
{
public:
xyticlabels() : ticlabels(true,true) {}
xyticlabels(const graph_drawer &d) : ticlabels(true,true,d) {}
};
class cbox_base : public virtual graphd_colorscale
{
private:
friend class color_legend;
void init_lengths();
protected:
std::vector<double> labelpositions_;
public:
cbox_base(const cbox_base &);
cbox_base(void *cmapfunc);
cbox_base(color (*p)(double,double,double));
cbox_base(double mini, double maxi);
cbox_base(const color &start, const color &end);
cbox_base();
~cbox_base();
void draw_sample(const length &x,
const length &y,
const length &size,
const plottable *style,
terminal *);
double min() const { return color_min_; }
double max() const { return color_max_; }
bool draws_points() const { return false; }
};
class csboxes : public cbox_base
{
private:
void init_csboxes_();
void calc_box_x_(double x, double dx, double *x1, double *x2);
void calc_box_y_(double y, double dy, double *y1, double *y2);
protected:
function boxsize_x_func_, boxsize_y_func_, color_func_;
double cell_dx_, cell_dy_;
bool cell_dx_fixed_, cell_dy_fixed_;
bool normalize_xsize_, normalize_ysize_;
double xsize_min_, xsize_max_, ysize_min_, ysize_max_;
bool xsize_min_fixed_;
bool xsize_max_fixed_;
bool ysize_min_fixed_;
bool ysize_max_fixed_;
double xsize_goal_min_, xsize_goal_max_, ysize_goal_min_, ysize_goal_max_;
bool skip_outrange_x_, skip_outrange_y_, skip_outrange_color_;
bool fill_;
friend class hist;
void calc(plottable *g, axis *xaxis, axis *yaxis);
static bool default_frame_foreground_;
static bool default_grid_foreground_;
bool frame_foreground_, grid_foreground_;
void get_functions(plottable *g,
function &getx,
function &gety,
function &boxsizex,
function &boxsizey,
function &getz);
public:
csboxes();
csboxes(const csboxes &);
csboxes(const color &startcolor, const color &endcolor);
csboxes(double min, double max);
csboxes &xsize_range(double min, double max);
csboxes &xsize_min (double min);
csboxes &xsize_max (double max);
csboxes &ysize_range(double min, double max);
csboxes &ysize_min (double min);
csboxes &ysize_max (double max);
csboxes &color_range(double min, double max) { graphd_colorscale::color_range(min,max); return *this; }
csboxes &color_range(const color &startcolor, const color &endcolor) { graphd_colorscale::color_range(startcolor,endcolor); return *this; }
csboxes &xsize_goal_range(double min, double max);
csboxes &xsize_goal_min (double min);
csboxes &xsize_goal_max (double max);
csboxes &ysize_goal_range(double min, double max);
csboxes &ysize_goal_min (double min);
csboxes &ysize_goal_max (double max);
csboxes &skip_outrange_x (bool f) { skip_outrange_x_ = f; return *this; }
csboxes &skip_outrange_y (bool f) { skip_outrange_y_ = f; return *this; }
csboxes &skip_outrange_color(bool f) { skip_outrange_y_ = f; return *this; }
csboxes &underflow(const color &c) { graphd_colorscale::underflow_color(c); skip_outrange_color_ = false; return *this; }
csboxes &underflow_color(const color &c) { graphd_colorscale::underflow_color(c); skip_outrange_color_ = false; return *this; }
csboxes &overflow(const color &c) { graphd_colorscale::overflow_color(c); skip_outrange_color_ = false; return *this; }
csboxes &overflow_color(const color &c) { graphd_colorscale::overflow_color(c); skip_outrange_color_ = false; return *this; }
csboxes &normalize_xsize(bool f) { normalize_xsize_ = f; return *this; }
csboxes &normalize_ysize(bool f) { normalize_ysize_ = f; return *this; }
csboxes &normalize_size (bool f) { normalize_xsize_ = normalize_ysize_ = f; return *this; }
csboxes &independent_xy(bool f);
csboxes &dx(double v);
csboxes &dy(double v);
virtual csboxes &fill(bool f) { fill_ = f; return *this; }
csboxes &color_samples(int n) { graphd_colorscale::color_samples(n); return *this; }
csboxes &color_logscale(bool f) { graphd_colorscale::color_logscale(f); return *this; }
csboxes &color_title(const var &t) { graphd_colorscale::color_title(t); return *this; }
csboxes &title(const var &t) { color_title(t); return *this; }
csboxes &colormapping(color (*p)(double,double,double));
static void default_frame_foreground(bool f) { default_frame_foreground_ = f; }
static void default_grid_foreground(bool f) { default_grid_foreground_ = f; }
csboxes &frame_foreground(bool f) { frame_foreground_ = f; return *this; }
csboxes &grid_foreground (bool f) { grid_foreground_ = f; return *this; }
csboxes &operator() (double mini=unset, double maxi=unset) { color_range(mini,maxi); return *this; }
csboxes &operator() (const color &start, const color &end) { color_range(start,end); return *this; }
csboxes &operator() (void *p) { map_function(p); return *this; }
csboxes &operator() (color (*p)(double,double,double)) { map_function(p); return *this; }
csboxes &legend(color_legend *l) { set_colorlegend(l); return *this; }
csboxes &legend(bool f) { draw_colorlegend(f); return *this; }
csboxes &legend(const var &legendname) {legendname_ = legendname.str();return *this;}
void draw(plottable *g,frame *f,terminal *t);
void set_ranges(plottable *g,axis *x,axis *y);
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const {return 3;}
bool draws_points() const { return false; }
};
class cboxes : public csboxes
{
private:
void init_();
public:
cboxes *clone() const { return new cboxes(*this); }
cboxes();
cboxes(const cboxes &rhs);
cboxes(const csboxes &rhs);
cboxes(double min, double max);
cboxes(const color &start, const color &stop);
cboxes(void *p);
cboxes(color (*p)(double,double,double));
cboxes &operator()(double min,double max);
cboxes &operator()(const color &start, const color &end);
cboxes &operator()(void *p);
cboxes &operator()(color (*p)(double,double,double));
cboxes &title(const var &t) { color_title(t); return *this; }
cboxes &logscale(bool f) { color_logscale(f); return *this; }
cboxes &legend(color_legend *l) { csboxes::legend(l); return *this; }
cboxes &legend(bool f) { csboxes::legend(f); return *this; }
cboxes &legend(const var &legendname) { csboxes::legend(legendname); return *this;}
};
class sboxes : public csboxes
{
private:
void init_();
public:
sboxes *clone() const { return new sboxes(*this); }
sboxes();
sboxes(const sboxes &rhs);
sboxes(const csboxes &rhs);
sboxes(double min, double max);
sboxes &operator()(double min, double max);
void draw_sample(const length &x,
const length &y,
const length &size,
const plottable *s,
terminal *t);
};
class bands : public graph_drawer
{
private:
bool x_,y_;
function get_x1_(plottable *) const;
function get_x2_(plottable *) const;
function get_y1_(plottable *) const;
function get_y2_(plottable *) const;
public:
bands(bool x=true, bool y=true) : x_(x), y_(y) {}
void draw(plottable *g, frame *f, terminal *t);
void draw_sample(const length &x, const length &y,
const length &samplen, const plottable *s, terminal *t);
void set_ranges(plottable *g, axis *x, axis *y);
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int) {}
int req_components() const {if(x_ && y_) return 4; return 3;}
bool draws_points() const { return false; }
};
class xbands : public bands
{public: xbands() : bands(true,false) {}};
class ybands : public bands
{public: ybands() : bands(false,true) {}};
class mosaic : public cbox_base
{
private:
function params_to_xy_;
bool fixdp_;
static bool default_frame_foreground_;
static bool default_grid_foreground_;
bool frame_foreground_, grid_foreground_;
public:
mosaic(const function &f1);
mosaic(const function &f1, const function &f2);
mosaic(const mosaic &rhs);
void set_ranges(plottable *g, axis *x, axis *y);
void draw(plottable *g, frame *f, terminal *t);
bool draws_sample() const { return false; }
graph_drawer *clone() const {return new mosaic(*this);}
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const { return 3; }
mosaic &operator()(double mini, double maxi) { color_range(mini,maxi);return *this; }
mosaic &operator()(double mini, int maxi ) { color_range(mini,(double)maxi); return *this; }
mosaic &operator()(int mini, double maxi) { color_range((double)mini,maxi); return *this; }
mosaic &operator()(int mini, int maxi) { color_range((double)mini,(double)maxi); return *this; }
mosaic &operator() (const color &s, const color &e) { color_range(s,e); return *this; }
mosaic &operator()(void *p) { map_function(p); return *this; }
mosaic &operator()(color (*p)(double,double,double)) { map_function(p); return *this; }
mosaic &color_title(const var &t) { graphd_colorscale::color_title(t); return *this; }
mosaic &color_logscale(bool v) { graphd_colorscale::color_logscale(v); return *this; }
mosaic &legend(bool f) { draw_colorlegend(f); return *this; }
mosaic &legend(const var &legendname) {legendname_=legendname.str();return *this;}
mosaic &fixdp(bool f) { fixdp_ = f; return *this; }
static void default_frame_foreground(bool f) { default_frame_foreground_ = f; }
static void default_grid_foreground(bool f) { default_grid_foreground_ = f; }
mosaic &frame_foreground(bool f) { frame_foreground_ = f; return *this; }
mosaic &grid_foreground(bool f) { grid_foreground_ = f; return *this; }
mosaic &underflow (const color &c) { graphd_colorscale::underflow_color(c); return *this; }
mosaic &underflow_color(const color &c) { graphd_colorscale::underflow_color(c); return *this; }
mosaic &overflow (const color &c) { graphd_colorscale::overflow_color (c); return *this; }
mosaic &overflow_color (const color &c) { graphd_colorscale::overflow_color (c); return *this; }
bool draws_points() const { return false; }
};
class mosaic_polar : public mosaic
{
public:
mosaic_polar() : mosaic(ARG(1)*cos(ARG(2)), ARG(1)*sin(ARG(2))) {}
mosaic_polar(double mini, double maxi) : mosaic(ARG(1)*cos(ARG(2)), ARG(1)*sin(ARG(2)))
{
operator()(mini,maxi);
}
};
class isolines : public graph_drawer
{
private:
bool skip_(const var &, const var &, const var &, axis *xaxis, axis *yaxis,
double xmin, double xmax, double ymin, double ymax);
vector<double> isovalues_;
bool isovalues_specified_;
double min_, max_, step_, spec_val_;
bool minfixed_, maxfixed_, stepfixed_;
bool logscale_;
std::vector<color> colors_;
std::vector<var> labels_;
bool draw_labels_, turn_labels_;
std::string labelformat_;
bool center_labels_;
static bool default_center_labels_;
double x1repulsion_, x2repulsion_, y1repulsion_, y2repulsion_;
double labelrepulsion_[3];
sym::position label_xalign_, label_yalign_;
public:
isolines();
isolines &logscale(bool f) { logscale_ = f; return *this; }
isolines &min(double v) { min_ = v; minfixed_ = true; return *this; }
isolines &max(double v) { max_ = v; maxfixed_ = true; return *this; }
isolines &step(double stepsize, double specval=unset)
{ step_ = stepsize; spec_val_ = specval; stepfixed_ = (stepsize!=unset); return *this; }
isolines &labelformat(const var &format)
{ labelformat_ = format.str(); return *this; }
isolines &at(double val1,
double val2=unset,
double val3=unset,
double val4=unset,
double val5=unset,
double val6=unset,
double val7=unset,
double val8=unset,
double val9=unset,
double val10=unset,
double val11=unset,
double val12=unset,
double val13=unset,
double val14=unset,
double val15=unset,
double val16=unset,
double val17=unset,
double val18=unset,
double val19=unset,
double val20=unset);
isolines &labels(bool f) { draw_labels_ = f; return *this; }
isolines &turn_labels(bool f) { turn_labels_ = f; return *this; }
isolines &colors(const color &c1,
const color &c2 = color(-1,-1,-1),
const color &c3 = color(-1,-1,-1),
const color &c4 = color(-1,-1,-1),
const color &c5 = color(-1,-1,-1),
const color &c6 = color(-1,-1,-1),
const color &c7 = color(-1,-1,-1),
const color &c8 = color(-1,-1,-1),
const color &c9 = color(-1,-1,-1),
const color &c10 = color(-1,-1,-1));
isolines &labels(const var &l1,
const var &l2 = blop::unset,
const var &l3 = blop::unset,
const var &l4 = blop::unset,
const var &l5 = blop::unset,
const var &l6 = blop::unset,
const var &l7 = blop::unset,
const var &l8 = blop::unset,
const var &l9 = blop::unset,
const var &l10 = blop::unset);
isolines ¢er_labels(bool f) { center_labels_ = f; return *this; }
isolines &label_align(sym::position xalign, sym::position yalign);
isolines &label_repulsion_frame(double w);
isolines &label_repulsion_label(double w1, double w2, double w3);
void set_ranges(plottable *g, axis *x, axis *y);
void draw(plottable *g, frame *f, terminal *t);
void draw_sample(const length &, const length &, const length &,
const plottable *, terminal*);
bool draws_sample() const { return true; }
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const { return 3; }
bool draws_points() const { return false; }
};
class vectors : public virtual graphd_colorscale
{
private:
friend class color_legend;
length xunit_, yunit_;
arrowhead *arrow_;
double dx_, dy_, norm_, min_length_cut_;
bool norm_fixed_, min_length_cut_fixed_;
sym::position pos_;
double min_length_, max_length_;
bool scale_arrow_;
bool use_color_;
function colorfunc_;
bool clip_;
public:
vectors(const vectors &);
vectors();
~vectors();
vectors &norm(double val);
vectors &pos(sym::position p);
vectors &arrow(const arrowhead &);
vectors &arrowlength(const length &l) { arrow_->size(l); return *this; }
vectors &arrowangle(double a) { arrow_->angle(a); return *this; }
vectors &min(double v);
vectors &clip(bool f) { clip_ = f; return *this; }
vectors &scale_arrow(bool f) { scale_arrow_ = f; return *this; }
vectors &use_color(bool f) { use_color_ = f; return *this; }
vectors &use_color(const function &f)
{ use_color_ = true; colorfunc_ = f; return *this; }
void setup_when_added(plottable *, frame *);
void set_ranges(plottable *g, axis *x, axis *y);
void draw(plottable *g, frame *f, terminal *t);
void draw_sample(const length &, const length &, const length &,
const plottable *, terminal*);
bool draws_sample() const { return true; }
graph_drawer *clone() const;
void prepare_for_draw(plottable *, frame *, int count);
int req_components() const;
bool draws_points() const { return false; }
};
}
#ifdef __MAKECINT__
#pragma link off function operator<=(vector<blop::color>&,vector<blop::color>&);
#pragma link off function operator<(vector<blop::color>&,vector<blop::color>&);
#pragma link off function operator>=(vector<blop::color>&,vector<blop::color>&);
#pragma link off function operator>(vector<blop::color>&,vector<blop::color>&);
#endif
#endif