00001 // $Id: TGo4ExportManager.h 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4EXPORTMANAGER_H 00015 #define TGO4EXPORTMANAGER_H 00016 00017 #include "TNamed.h" 00018 #include "TString.h" 00019 00020 class TH1; 00021 class TH2; 00022 class TCollection; 00023 class TFolder; 00024 class TDirectory; 00025 class TGraph; 00026 00027 00028 enum Go4Export_t 00029 { 00030 GO4EX_ASCII, 00031 GO4EX_ASCII_CHANNELS, 00032 GO4EX_RADWARE, 00033 GO4EX_ROOT, 00034 GO4EX_XML 00035 }; 00036 00044 class TGo4ExportManager : public TNamed { 00045 public: 00046 00047 TGo4ExportManager(); 00048 00049 TGo4ExportManager(const char* name); 00050 00051 virtual ~TGo4ExportManager(); 00052 00057 void Export(TObject* ob, Go4Export_t format); 00058 00061 void Export(TObject* ob); 00062 00064 void Export(TH1* histo); 00065 00067 void Export(TGraph* graph); 00068 00071 void Export(TFolder* fold); 00072 00075 void Export(TDirectory* dir); 00076 00079 void Export(TCollection* dir); 00080 00081 void SetFilter(Go4Export_t format); 00082 00083 void SetCurrentDir(const char* dir=0); 00084 00085 void SetStartDir(const char* dir=0); 00086 00087 void SetOutFile(const char* filename=0) 00088 { fxOutFile = (filename!=0) ? filename : "Go4Export"; } 00089 00090 void SetOutFileComment(const char* comment=0) 00091 { fxOutFileComment=(comment!=0) ? comment : "Saved from Go4"; } 00092 00093 private: 00094 00099 void ExportASCII(TH1* histo, Bool_t channels=kTRUE); 00100 00102 void ExportASCII(TGraph* graph); 00103 00105 void ExportRadware(TH1* histo); 00106 00108 void ExportRadware(TH2* histo); 00109 00111 void ExportRadware(TGraph* graph); 00112 00114 void ExportRoot(TObject* ob); 00115 00117 void ExportXML(TObject* ob); 00118 00121 TString fxStartDir; 00122 00124 TString fxCurrentDir; 00125 00128 TString fxOutFile; 00129 00132 TString fxOutFileComment; 00133 00135 Go4Export_t fiFilter; 00136 }; 00137 00138 #endif //TGO4EXPORTMANAGER_H