Main Page | File List

TQtCoinViewerImp.h

00001 // @(#)root/g3d:$Name: $:$Id: TQtCoinViewerImp.h,v 1.24 2006/07/07 16:48:22 fine Exp $ 00002 // Author: Valery Fine 23/05/97 00003 00004 /**************************************************************************** 00005 ** $Id: TQtCoinViewerImp.h,v 1.24 2006/07/07 16:48:22 fine Exp $ 00006 ** 00007 ** Copyright (C) 2002 by Valeri Fine. Brookhaven National Laboratory. 00008 ** All rights reserved. 00009 ** 00010 ** This file may be distributed under the terms of the Q Public License 00011 ** as defined by Trolltech AS of Norway and appearing in the file 00012 ** LICENSE.QPL included in the packaging of this file. 00013 ** 00014 *****************************************************************************/ 00015 00016 #ifndef ROOT_TQtCoinViewerImp 00017 #define ROOT_TQtCoinViewerImp 00018 00020 // // 00021 // TQtCoinViewerImp // 00022 // // 00023 // Second ABC TQtCoinViewerImp specifies Window system independent openGL // 00024 // interface. This class uses the GL includes and isn't passed to CINT // 00025 // // 00027 00028 #include "RVersion.h" 00029 #if ROOT_VERSION_CODE >= 262400 00030 // ROOT_VERSION(4,01,00) 00031 # include "TQGLViewerImp.h" 00032 #else 00033 # include "TGLViewerImp.h" 00034 #endif 00035 00036 #include "TString.h" 00037 00038 #ifndef __CINT__ 00039 # include <qglobal.h> 00040 # if QT_VERSION < 0x40000 00041 # include <qmainwindow.h> 00042 # include <qptrvector.h> 00043 # else /* QT_VERSION */ 00044 # include <q3mainwindow.h> 00045 # include <q3ptrvector.h> 00046 # endif /* QT_VERSION */ 00047 # include <qlabel.h> 00048 #else 00049 # if QT_VERSION < 0x40000 00050 class QMainWindow; 00051 # else /* QT_VERSION */ 00052 class Q3MainWindow; 00053 # endif /* QT_VERSION */ 00054 class QString; 00055 #endif 00056 00057 //==================== 00058 class SoSeparator; 00059 class SoNode; 00060 class SoMaterial; 00061 class SoCallback; 00062 class SoQtRenderArea; 00063 class SoPerspectiveCamera; 00064 class SoSelection; 00065 00066 //#include <qintdict.h> 00067 //class TQtRootAction; 00068 //==================== 00069 00070 #include <vector> 00071 00072 class QAction; 00073 class TVirtualPad; 00074 class SoQtExaminerViewer; 00075 class TObject3DView; 00076 00077 #if QT_VERSION < 0x40000 00078 class TQtCoinViewerImp :public QMainWindow, public TGLViewerImp { 00079 #else /* QT_VERSION */ 00080 //MOC_SKIP_BEGIN 00081 class TQtCoinViewerImp :public Q3MainWindow, public TGLViewerImp { 00082 //MOC_SKIP_END 00083 #endif /* QT_VERSION */ 00084 Q_OBJECT 00085 private: 00086 00087 SoQtRenderArea *fInventorViewer; 00088 SoQtExaminerViewer *qt_viewer; 00089 SoSeparator *fRootNode; 00090 SoSeparator *fShapeNode; 00091 SoSelection *fSelNode; 00092 SoPerspectiveCamera *myCamera; 00093 SoPerspectiveCamera *fCamera; 00094 00095 std::vector<int> flist[3]; 00096 00097 TQtCoinViewerImp(const TQtCoinViewerImp&); 00098 void operator=(const TQtCoinViewerImp&) {} 00099 protected: 00100 00101 TString fSaveFile; // the file name to save the pixmap to 00102 TString fSaveType; // the image format type name 00103 Int_t fMaxSnapFileCounter; // The max number of the difffrent "snapshot files" (The length of the cyclic buffer) 00104 //static Int_t gfDefaultMaxSnapFileCounter; // the default max number of the different "snapshot files" (The length of the cyclic bugger) 00105 //QGLWidget *fGLWidget; // QT GL widget to render the view 00106 TVirtualPad *fPad; // For forward compatibility with the new viewer 00107 //TContextMenu *fContextMenu; // ROOT Context menu for the 3D widget 00108 00109 00110 #ifndef __CINT__ 00111 #if QT_VERSION < 0x40000 00112 QPtrVector<QLabel> fStatusBar; 00113 #else 00114 //MOC_SKIP_BEGIN 00115 Q3PtrVector<QLabel> fStatusBar; 00116 //MOC_SKIP_END 00117 #endif 00118 #endif 00119 00120 //TQtCoinViewerImp *fSelectedView; // extra viewer to show the selected object only 00121 //Bool_t fSelectedViewActive; // the flag to activate the "Selected view" 00122 //Bool_t fSelectionViewer; // Flag to create the slave viewer with no own layout 00123 //Bool_t fSelectionHighlight; // Flag to highlight the selection object in place 00124 //Bool_t fShowSelectionGlobal; // Show the selected object in the global coordinate 00125 //Bool_t fWantRootContextMenu; // Create "ROOT Context menu" for the seelcted ROOT objects 00126 QAction *fSnapShotAction; // QAction to toglle the snap shot file saving 00127 00128 00129 00130 00131 protected: 00132 void CopyFile(const QString &fileName2Copy,Int_t counter); 00133 void CreateViewer(const char *name="qcoinviewer"); 00134 //void CreateViewer(QGLWidget *share, const char *name="qglviewershared"); 00135 void MakeMenu(); 00136 //void SaveHtml(Int_t counter); 00137 //void SaveHtml(QString &fileName, Int_t counter); 00138 //void CreateSelectionViewer(); 00139 //static int CreateSnapShotCounter(); 00140 00141 //TQtCoinViewerImp(TQtCoinViewerImp &); 00142 00143 public: 00144 enum {kStatusPopIn, kStatusNoBorders, kStatusOwn, kStatusPopOut}; 00145 //TQtCoinViewerImp(); 00146 //TQtCoinViewerImp(TPadOpenGLView *padview, const char *title="OpenGL Viewer", UInt_t width=400, UInt_t height=300); 00147 00148 //TQtCoinViewerImp(TPadOpenGLView *padview, const char *title, Int_t x, Int_t y,UInt_t width, UInt_t height); 00149 TQtCoinViewerImp(TVirtualPad *pad, const char *title="Coin Viewer", UInt_t width=400, UInt_t height=300); 00150 //TQtCoinViewerImp(TVirtualPad *pad, const char *title, Int_t x, Int_t y,UInt_t width, UInt_t height); 00151 00152 virtual ~TQtCoinViewerImp(); 00153 void AddRootChild(ULong_t id); 00154 virtual void Clear(); 00155 //virtual void CreateStatusBar(Int_t nparts=1); 00156 virtual void CreateStatusBar(Int_t *parts, Int_t nparts=1); 00157 //virtual void DeleteContext() { } 00158 //virtual void MakeCurrent(); 00159 //virtual void Paint(Option_t *opt=""); 00160 00161 //virtual void SetStatusText(const char *text, Int_t partidx=0,Int_t stype=-1); 00162 //virtual void ShowStatusBar(Bool_t show = kTRUE); 00163 00164 //virtual void SwapBuffers() { }; 00165 00166 std::vector<int> GetMyGLList1() { return flist[0]; } 00167 std::vector<int> GetMyGLList2() { return flist[1]; } 00168 std::vector<int> GetMyGLList3() { return flist[2]; } 00169 //virtual void SetDrawList(UInt_t list) { fDrawList = list; } 00170 00171 //virtual void Iconify() { hide(); }; 00172 //virtual void Show() { show(); }; 00173 virtual void Update(); 00174 00175 virtual ULong_t GetViewerID() const; 00176 //virtual void SetPadSynchronize(Bool_t on=kTRUE); 00177 // static void SetDefaultFileCounter(int counter); 00178 virtual void DisconnectPad(); 00179 //QGLWidget *GLWidget() const { return fGLWidget;} 00180 virtual TVirtualPad *GetPad(); 00181 void CreateViewer(const int id); 00182 void EmitSelectSignal(TObject3DView * view); 00183 void SetBoxSelection(); 00184 void SetLineSelection(); 00185 00186 #ifndef __CINT__ 00187 public slots: 00188 //virtual void ActivateSelectorWidgetCB(bool); 00189 //virtual void ActivateSelectionHighlighCB(bool); 00190 //virtual void ActivateSelectionGlobalCB(bool); 00191 //virtual void DisconnectSelectorWidgetCB(); 00192 virtual void AddGLList(unsigned int list, int type=1); 00193 virtual void RemoveGLList(unsigned int list); 00194 //virtual void NewViewer(); 00195 virtual void PrintCB(); 00196 virtual void CopyCB(); 00197 virtual void CopyFrameCB(); 00198 virtual void SaveCB(); 00199 virtual void OpenCB(); 00200 virtual void ClearCB(); 00201 virtual void SaveAsCB(); 00202 //virtual void SelectEventCB(bool on); 00203 //virtual void SelectDetectorCB(bool on); 00204 virtual void SetBackgroundColor(Color_t color); 00205 //virtual void SetBackgroundColor(const TColor *color); 00206 virtual void ShowObjectInfo(TObject *, const QPoint&); 00207 virtual void SnapShotSaveCB(bool); 00208 virtual void SaveSnapShot(bool); 00209 virtual void ShowFrameAxisCB(bool); 00210 virtual void ShowLightsCB(bool); 00211 virtual void SynchTPadCB(bool); 00212 virtual void SetRotationAxisAngle(const float x, const float y, const float z, const float a); 00213 virtual void SetSnapFileCounter(int counter); 00214 //virtual void SetFooter(QString &text); 00215 //virtual void WantRootContextMenuCB(bool on); 00216 virtual void AboutCB(); 00217 virtual void HelpCB(); 00218 signals: 00219 void CoinObjectSelected(TObject *, const QPoint&); 00220 #endif 00221 00222 // ClassDef(TQtCoinViewerImp,0) //ROOT OpenGL viewer implementation 00223 }; 00224 00225 // $log$ 00226 #endif

Generated on Wed Sep 27 15:15:34 2006 for QtCoinViewer by doxygen 1.3.7