#ifndef __BLOP_ARROW_H__
#define __BLOP_ARROW_H__
#include "grob.h"
#include "length.h"
#include "color.h"
namespace blop
{
class container;
class arrow : public grob
{
private:
length from_x_, from_y_, to_x_, to_y_;
length head_length_, head_width_,linewidth_;
double head_angle_;
color color_;
public:
arrow();
arrow &from(const length &x, const length &y) {from_x_ = x; from_y_ = y; return *this;}
arrow &to (const length &x, const length &y) {to_x_ = x; to_y_ = y; return *this;}
const length &from_x() const { return from_x_; }
const length &from_y() const { return from_y_; }
const length &to_x() const { return to_x_; }
const length &to_y() const { return to_y_; }
static arrow &fdraw(const length &x1, const length &y1, const length &x2, const length &y2);
static arrow &pdraw(const length &x1, const length &y1, const length &x2, const length &y2);
static arrow &cdraw(const length &x1, const length &y1, const length &x2, const length &y2);
static arrow &draw (container *parent,
const length &x1, const length &y1, const length &x2, const length &y2);
arrow &linewidth(const length &l) { linewidth_ = l; return *this; }
arrow &lw(const length &l) { return linewidth(l); }
const length &linewidth() const { return linewidth_; }
arrow &headangle(double d);
arrow &ha(double d) {return headangle(d); }
double headangle() const {return head_angle_; }
arrow &headlength(const length &l) { head_length_ = l; return *this;}
arrow &hl(const length &l) {return headlength(l);}
const length &headlength() const {return head_length_; }
void prepare_for_draw();
void print(terminal *);
};
}
#endif