// @(#)LineShape.h	3.7	7/28/92

#ifndef LineShape_First

#ifdef __GNUG__
#pragma interface
#endif

#define LineShape_First

#include "Shape.h"

//---- Line Shape and Sketcher -------------------------------------------------

class LineShape : public Shape {
protected:
    Point p1, p2;
    GeoPos gp1, gp2;
    
public:
    MetaDef(LineShape);
    
    LineShape();
    void Init(Point pp1, Point pp2);
    void SetSpan(Rectangle);
    Rectangle GetSpan();
    void Flip(int n);
    void Moveby(Point delta);

    void AreaChanged();

    void Draw(Rectangle);
    void Outline(Point, Point);
    Rectangle InvalRect();

    bool ContainsPoint(Point);

    virtual float GetLength() const;

    Point *MakeHandles(int*);
    int PointOnHandle(Point);
    bool PointAtLine(Point, Point, Point);

    short *GetImage();
    Point GetConnectionPoint(Point);
    Point Chop(Point);

    Rectangle GetTextRect();

#ifdef ET25
    OStream& PrintOn(OStream&);    
    IStream& ReadFrom(IStream&);
#else
    ostream& PrintOn(ostream&);    
    istream& ReadFrom(istream&);
#endif
};

#endif LineShape_First
