PSQt/src/WdgGeoTree.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------------
00002 // File and Version Information:
00003 //   $Id: WdgGeoTree.cpp 11039 2015-12-01 01:18:58Z dubrovin@SLAC.STANFORD.EDU $
00004 //
00005 // Author: Mikhail S. Dubrovin
00006 //---------------------------------------------------------------------
00007 
00008 //--------------------------
00009 
00010 #include "PSQt/WdgGeoTree.h"
00011 #include "PSQt/QGUtils.h"
00012 #include "PSQt/Logger.h"
00013 
00014 //#include <string>
00015 //#include <fstream>   // ofstream
00016 //#include <iomanip>   // for setw, setfill
00017 //#include <math.h>
00018 //#include <stdio.h>
00019 
00020 #include <sstream>   // for stringstream
00021 #include <iostream>    // cout
00022 #include <fstream>    // ifstream(fname), ofstream
00023 
00024 //#include <dirent.h> // for DIR, dirent
00025 
00026 //using namespace std; // for cout without std::
00027 
00028 namespace PSQt {
00029 
00030 //--------------------------
00031 
00032 WdgGeoTree::WdgGeoTree(QWidget *parent, const std::string& gfname, const unsigned& pbits) //, const std::string& gfname, const unsigned& pbits)
00033     : Frame(parent)
00034     , m_pbits(pbits)
00035 {
00036   m_geotree = new GeoTree(parent,gfname,m_pbits); 
00037   m_view = (QTreeView*) m_geotree;
00038 
00039   QVBoxLayout *vbox = new QVBoxLayout();
00040   vbox -> addWidget(m_view);
00041   setLayout(vbox);
00042   //move(100,50);  
00043   this -> setContentsMargins(-9,-9,-9,-9);
00044   showTips();
00045 }
00046 //--------------------------
00047 
00048 PSCalib::GeometryAccess* 
00049 WdgGeoTree::geoacc()
00050 {
00051   return m_geotree->geoacc();
00052 }
00053 
00054 //--------------------------
00055 
00056 void
00057 WdgGeoTree::showTips() 
00058 {
00059   //m_file_geo  -> setToolTip("Select \"geometry\" file");
00060   //m_file_geo  -> setToolTip("Select ndarray with image file");
00061   //m_but_exit  -> setToolTip("Exit application");
00062 }
00063 
00064 //--------------------------
00065 
00066 void 
00067 WdgGeoTree::resizeEvent(QResizeEvent *event)
00068 {
00069   stringstream ss; ss << "w:" << event->size().width() << " h:" <<  event->size().height();
00070   setWindowTitle(ss.str().c_str());
00071 }
00072 
00073 //--------------------------
00074 void
00075 WdgGeoTree::moveEvent(QMoveEvent *event)
00076 {
00077   stringstream ss; ss << "x:" << event->pos().x() << " y:" << event->pos().y();
00078   setWindowTitle(ss.str().c_str());
00079 }
00080 
00081 //--------------------------
00082 
00083 void 
00084 WdgGeoTree::closeEvent(QCloseEvent *event)
00085 {
00086   QWidget::closeEvent(event);
00087   std::stringstream ss; ss << "closeEvent(...): type = " << event -> type();
00088   MsgInLog(_name_(), INFO, ss.str());
00089 }
00090 
00091 //--------------------------
00092 
00093 void 
00094 WdgGeoTree::mousePressEvent(QMouseEvent *event)
00095 {
00096   //int x = event->pos().x();
00097   //int y = event->pos().y();
00098   //QString text = "mousePressEvent: " + QString::number(x) + "," + QString::number(y);
00099   //std::cout << text.toStdString()  << std::endl;
00100 }
00101 
00102 //--------------------------
00103 //--------------------------
00104 //--------------------------
00105 //--------------------------
00106 //--------------------------
00107 
00108 } // namespace PSQt
00109 
00110 //--------------------------

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7