ReSCue - Retrieval System for Curves
Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CurveCanvas.h

00001 
00002 /****************************************************************
00003 **
00004 ** Definition of CurveCanvas class, Qt tutorial 8
00005 **
00006 ****************************************************************/
00007 
00008 #ifndef RESCUE__CURVECANVAS_H
00009 #define RESCUE__CURVECANVAS_H
00010 
00011 #include <qwidget.h>
00012 #include <ReSCue/polygonal_curve.h>
00013 #include <ReSCue/Point2.h>
00014 
00015 using namespace rescue;
00016 
00017 typedef polygonal_curve<Point2<double> > Curve;
00018 typedef Curve::motion Motion;
00019 
00025 class CurveCanvas : public QWidget
00026 {
00027     Q_OBJECT
00028  
00029 public:
00030     
00031     CurveCanvas( QWidget *parent=0, const char *name=0 );
00032 
00033     QSizePolicy sizePolicy() const;
00034 
00035 public slots:
00036     
00037     void setColor(int);
00038     void del();
00039     void clear_curve();
00040     void next_reparametrization();
00041     void prev_reparametrization();
00042     void motion(const Motion&);
00043     void match_now(double,double);
00044     void open(const QString&);
00045     void save(const QString&);
00046     void setEps(double);
00047     void setEps_prime(double);
00048     void change_method(const QString&);
00049 
00050 protected:
00051     
00052     void paintEvent( QPaintEvent * );
00053     void mouseReleaseEvent( QMouseEvent * );
00054 
00055 private:
00056     
00057     int color_id;
00058     QColor color;
00059 
00060     QString matching_method;
00061 
00062     Curve red_curve;
00063     Curve blue_curve;
00064 
00068     Curve result_curve;
00069 
00075     Curve red_kappa;
00076     
00082     Curve blue_lambda;
00083 
00084     double eps;
00085     double eps_prime;
00086 
00091     bool match_found;
00092 
00097     bool reparametrizations_available;
00098 
00101         Curve::vertex_iterator red_kappa_pos;
00102 
00105         Curve::vertex_iterator blue_lambda_pos;
00106 
00107 };
00108 
00109 #endif // CURVECANVAS_H
ReSCue - Retrieval System for Curves
Universität Bonn, Institut für Informatik III, 2001