line.h

Go to the documentation of this file.
00001 #ifndef IIS_LINE_H
00002 #define IIS_LINE_H
00003 #include "value.h"
00004 #include "point.h"
00005 #include "image-dialog.h"
00006 
00007 class LineValue: public Value
00008 {
00009  public:
00010   PointValue a;
00011   PointValue b;
00012   virtual QString toString();
00013   double dx() {return b.x-a.x;};
00014   double dy() {return b.y-a.y;};
00015   LineValue()
00016     {
00017     };
00018   LineValue(Token data) : 
00019     a((Token)data["a"]),
00020     b((Token)data["b"])
00021      {
00022      }
00023   virtual Data getSaveDescription(QString prefix) 
00024     {
00025       Token r;
00026       r["type"]=Symbol("line");
00027       r["a"]=a.getSaveDescription(prefix);
00028       r["b"]=b.getSaveDescription(prefix);
00029       return r;
00030     };
00031  protected:
00032   virtual bool equals_same_type(Value * other);
00033 };
00034 
00035 class LinePicker: public ImagePicker
00036 {
00037     LineValue line;
00038     bool first;
00039  public:
00040     LinePicker(ImageValue * I): ImagePicker(I), first(true) {};
00041     virtual Value * value() {return new LineValue(line);};
00042     virtual void nextPoint(PointValue point, bool right);
00043 };
00044 
00045 #endif

Generated on Mon Jun 5 22:08:42 2006 for iis by  doxygen 1.4.6