PSQt/include/WdgGeo.h

Go to the documentation of this file.
00001 #ifndef WDGGEO_H
00002 #define WDGGEO_H
00003 
00004 #include "PSCalib/GeometryObject.h"
00005 #include <boost/shared_ptr.hpp>
00006 
00007 #include <Qt>
00008 #include <QtGui>
00009 #include <QtCore>
00010 
00011 #include "PSQt/Frame.h"
00012 
00013 namespace PSQt {
00014 
00015 /**
00016  *  @ingroup PSQt
00017  *
00018  *  @brief Widget for GeometryObject parameters editor.
00019  * 
00020  *  WdgGeo is a sub-class of Frame (QWidget).
00021  *
00022  *  WdgGeo is an interactive editor of the GeometryObject parameters.
00023  *  Slot setNewGO(shpGO&) - resets the GeometryObject.
00024  *  Sends signal geoIsChanged() when geo is changed.
00025  *
00026  *  This software was developed for the LCLS project.  If you use all or 
00027  *  part of it, please give an appropriate acknowledgment.
00028  *
00029  *  @see GUIMain
00030  *
00031  *  @version $Id: WdgGeo.h 9841 2015-03-26 18:35:44Z dubrovin@SLAC.STANFORD.EDU $
00032  *
00033  *  @author Mikhail Dubrovin
00034  */
00035 
00036 
00037 //class WdgGeo : public QWidget
00038 class WdgGeo : public Frame
00039 {
00040  Q_OBJECT // macro is needed for connection of signals and slots
00041 
00042  typedef boost::shared_ptr<PSCalib::GeometryObject> shpGO;
00043 
00044  public:
00045     WdgGeo(QWidget *parent=0, shpGO=shpGO(new PSCalib::GeometryObject()), const unsigned& pbits=0x177777);
00046     //    ~WdgGeo(){}
00047     void resizeEvent(QResizeEvent *event = 0) ;
00048     void moveEvent  (QMoveEvent   *event = 0) ;
00049     void closeEvent (QCloseEvent  *event = 0) ;
00050 
00051  public slots:
00052     void setNewGO(shpGO&);
00053     void onRadioGroup();
00054     void onButAddSub(QAbstractButton* but);
00055     void testSignalGeoIsChanged(shpGO&);
00056     void onEdiStep();
00057 
00058  signals :
00059     void geoIsChanged(shpGO&);
00060 
00061  private :
00062     std::string   m_path;
00063     shpGO         m_geo; 
00064     unsigned      m_pbits;
00065 
00066     QLabel*       m_lab_geo;
00067     QLabel*       m_lab_par;
00068     QLineEdit*    m_edi_step;
00069     QPushButton*  m_but_add;
00070     QPushButton*  m_but_sub;
00071 
00072     QLineEdit*    m_edi_x0;
00073     QLineEdit*    m_edi_y0;
00074     QLineEdit*    m_edi_z0;
00075     QLineEdit*    m_edi_rot_x;
00076     QLineEdit*    m_edi_rot_y;
00077     QLineEdit*    m_edi_rot_z;
00078     QLineEdit*    m_edi_tilt_x;
00079     QLineEdit*    m_edi_tilt_y;
00080     QLineEdit*    m_edi_tilt_z;
00081 
00082     QRadioButton* m_rad_x0;    
00083     QRadioButton* m_rad_y0;   
00084     QRadioButton* m_rad_z0;                                  
00085     QRadioButton* m_rad_rot_x; 
00086     QRadioButton* m_rad_rot_y; 
00087     QRadioButton* m_rad_rot_z;                               
00088     QRadioButton* m_rad_tilt_x;
00089     QRadioButton* m_rad_tilt_y;
00090     QRadioButton* m_rad_tilt_z;
00091 
00092     QButtonGroup* m_but_gr;
00093     QButtonGroup* m_rad_gr;
00094 
00095     QGridLayout*  m_grid;
00096     QVBoxLayout*  m_box;
00097     QHBoxLayout*  m_cbox;
00098 
00099     std::map<QRadioButton*,QLineEdit*> map_radio_to_edit;
00100 
00101     inline const char* _name_(){return "WdgGeo";}
00102     void setStyle() ;
00103     void showTips() ;
00104     void setGeoPars();
00105     void updateGeoPars();
00106 };
00107 
00108 } // namespace PSQt
00109 
00110 #endif // WDGGEO_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7