00001 // -*- C++ -*- 00002 #ifndef Fireworks_Core_CmsShowMain_h 00003 #define Fireworks_Core_CmsShowMain_h 00004 // 00005 // Package: Core 00006 // Class : CmsShowMain 00007 // 00016 // 00017 // Original Author: 00018 // Created: Mon Dec 3 08:34:30 PST 2007 00019 // $Id: CmsShowMain.h,v 1.56 2011/02/23 14:07:03 amraktad Exp $ 00020 // 00021 00022 #include "Fireworks/Core/interface/CmsShowMainBase.h" 00023 // user include files 00024 #include "Fireworks/Core/interface/FWGeometry.h" 00025 00026 // system include files 00027 #include <vector> 00028 #include <string> 00029 #include <memory> 00030 #include <boost/shared_ptr.hpp> 00031 #include "Rtypes.h" 00032 00033 00034 // forward declarations 00035 class TGPictureButton; 00036 class TGComboBox; 00037 class TGTextButton; 00038 class TGTextEntry; 00039 class FWEventItemsManager; 00040 class FWViewManagerManager; 00041 class FWModelChangeManager; 00042 class FWColorManager; 00043 class FWSelectionManager; 00044 class FWGUIManager; 00045 class FWEventItem; 00046 class FWPhysicsObjectDesc; 00047 class FWConfigurationManager; 00048 class FWLiteJobMetadataManager; 00049 class TTimer; 00050 class TMonitor; 00051 class TSocket; 00052 class CmsShowNavigator; 00053 class CmsShowTaskExecutor; 00054 class CSGAction; 00055 class CmsShowSearchFiles; 00056 00057 namespace fwlite { 00058 class Event; 00059 } 00060 00061 class CmsShowMain : public CmsShowMainBase 00062 { 00063 public: 00064 CmsShowMain(int argc, char *argv[]); 00065 virtual ~CmsShowMain(); 00066 void resetInitialization(); 00067 void openData(); 00068 void appendData(); 00069 void openDataViaURL(); 00070 virtual void quit(); 00071 void doExit(); 00072 00073 // void writeConfigurationFile(const std::string& iFileName) const; 00074 // ---------- static member functions -------------------- 00075 00076 // ---------- member functions --------------------------- 00077 // int draw(const fwlite::Event& ); 00078 00079 void notified(TSocket*); 00080 const fwlite::Event* getCurrentEvent() const; 00081 const fireworks::Context* context() const { return m_context.get(); }; 00082 00083 void fileChangedSlot(const TFile *file); 00084 00085 protected: 00086 virtual void eventChangedImp(); 00087 00088 private: 00089 CmsShowMain(const CmsShowMain&); // stop default 00090 const CmsShowMain& operator=(const CmsShowMain&); // stop default 00091 00092 void loadGeometry(); 00093 void setupDataHandling(); 00094 void setupSocket(unsigned int); 00095 void connectSocket(); 00096 00097 virtual void autoLoadNewEvent(); 00098 virtual void checkPosition(); 00099 virtual void stopPlaying(); 00100 00101 void reachedEnd(); 00102 void reachedBeginning(); 00103 00104 // Filtering bits. 00105 void navigatorChangedFilterState(int); 00106 void filterButtonClicked(); 00107 void preFiltering(); 00108 void postFiltering(); 00109 00110 void setLiveMode(); 00111 void checkLiveMode(); 00112 00113 // ---------- member data -------------------------------- 00114 std::auto_ptr<CmsShowNavigator> m_navigator; 00115 std::auto_ptr<FWLiteJobMetadataManager> m_metadataManager; 00116 std::auto_ptr<fireworks::Context> m_context; 00117 00118 std::vector<std::string> m_inputFiles; 00119 bool m_loadedAnyInputFile; 00120 const TFile *m_openFile; 00121 00122 std::auto_ptr<CmsShowSearchFiles> m_searchFiles; 00123 00124 // live options 00125 bool m_live; 00126 std::auto_ptr<SignalTimer> m_liveTimer; 00127 int m_liveTimeout; 00128 Int_t m_lastPointerPositionX; 00129 Int_t m_lastPointerPositionY; 00130 00131 std::auto_ptr<TMonitor> m_monitor; 00132 }; 00133 00134 #endif