PSQt/include/WdgImageFigs.h

Go to the documentation of this file.
00001 #ifndef PSQT_WDGIMAGEFIGS_H
00002 #define PSQT_WDGIMAGEFIGS_H
00003 
00004 #include "PSQt/WdgImage.h"
00005 #include "PSQt/DragStore.h"
00006 
00007 /*
00008 #include <QFrame>
00009 #include <QPainter>
00010 #include <QPen>
00011 #include <QPoint>
00012 #include <QRect>
00013 */
00014 
00015 #include <QCloseEvent>
00016 #include <QResizeEvent>
00017 #include <QMoveEvent>
00018 #include <QMouseEvent>
00019 
00020 #include <QtCore>
00021 //#include <QtGui>
00022 //#include <Qt>
00023 
00024 
00025 namespace PSQt {
00026 
00027 // /// @addtogroup PSQt PSQt
00028 
00029 /**
00030  *  @ingroup PSQt
00031  * 
00032  *  @brief Inherits from WdgImage and adds interactive figures on image.
00033  * 
00034  *  This software was developed for the LCLS project.  If you use all or 
00035  *  part of it, please give an appropriate acknowledgment.
00036  *
00037  *  @see WdgImage, DragStore, DragBase, DragCenter, DragCircle.
00038  *
00039  *  @version $Id: WdgImageFigs.h 9841 2015-03-26 18:35:44Z dubrovin@SLAC.STANFORD.EDU $
00040  *
00041  *  @author Mikhail Dubrovin
00042  */
00043 
00044 //class WdgImageFigs : public QWidget
00045 //class WdgImageFigs : public QLabel
00046 class WdgImageFigs : public WdgImage
00047 {
00048  Q_OBJECT // macro is needed for connection of signals and slots
00049 
00050  public:
00051     WdgImageFigs(QWidget *parent = 0, const std::string& fname=std::string()); 
00052     WdgImageFigs(QWidget *parent, const QImage* image);
00053     virtual ~WdgImageFigs();
00054 
00055     inline WdgImage* wdgImage(){ return (WdgImage*) this; }
00056     //inline WdgImage* wdgImage(){ return WdgImage::getThis(); }
00057     const QPointF& getCenter(); //{ return m_dragstore->getCenter(); }
00058 
00059     void addCircle(const float& rad_raw=100);
00060     DragStore* getDragStore(){return m_dragstore;}
00061 
00062  public slots:
00063     void onTest() ;
00064     void forceUpdate() ;
00065 
00066  protected:
00067     void setFrame() ;
00068     void paintEvent(QPaintEvent *event = 0) ;
00069     void closeEvent(QCloseEvent *event = 0) ;
00070     void moveEvent(QMoveEvent *event = 0) ;
00071     void resizeEvent(QResizeEvent *event = 0) ;
00072     void mousePressEvent(QMouseEvent *event = 0) ;
00073     void mouseReleaseEvent(QMouseEvent *event = 0) ;
00074     void mouseMoveEvent(QMouseEvent *event = 0) ;
00075 
00076  private:
00077     QPainter*    m_painter;
00078     DragStore*   m_dragstore;
00079     DRAGMODE     m_dragmode;
00080 
00081 
00082     /*
00083     GeoImage*    m_geo_img; 
00084 
00085     QPixmap*     m_pixmap_raw;
00086     QPixmap*     m_pixmap_scl;
00087     QPoint*      m_point1;
00088     QPoint*      m_point2;
00089     QRect*       m_rect1;
00090     QRect*       m_rect2;
00091     */
00092 
00093     QPen*        m_pen1;
00094     QPen*        m_pen2;
00095 
00096     inline const char* _name_(){return "WdgImageFigs";}
00097     void setParameters();
00098 
00099     void drawDragFigs() ;
00100     void drawDragFigsV0() ;
00101     void drawLine() ;
00102     void drawRect() ;
00103     //void drawCirc() ;
00104     //void drawCenter() ;
00105 };
00106 
00107 } // namespace PSQt
00108 
00109 #endif // PSQT_WDGIMAGEFIGS_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7