Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGQSceneGraphView_qt.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _OSGQSCENEGRAPHVIEW_H_
00040 #define _OSGQSCENEGRAPHVIEW_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include "OSGWindowQTDef.h"
00046 
00047 #include <OSGNode.h>
00048 
00049 #include <qwidget.h>
00050 
00051 class QHBoxLayout;
00052 class QVBoxLayout;
00053 class QSplitter;
00054 class QComboBox;
00055 class QLabel;
00056 class QLineEdit;
00057 class QPushButton;
00058 class QListViewItem;
00059 
00060 OSG_BEGIN_NAMESPACE
00061 
00062 class QNodeTreeView;
00063 class QSceneGraphItem;
00064 class QFieldContainerView;
00065 
00066 class OSG_WINDOWQTLIB_DLLMAPPING QSceneGraphView : public QWidget
00067 {
00068     Q_OBJECT
00069 
00070 public:
00071     QSceneGraphView(      QWidget           *parent, const char *name=NULL);
00072     QSceneGraphView(const FieldContainerPtr &pRoot, 
00073                           QWidget           *parent, const char *name=NULL);
00074 
00075     virtual ~QSceneGraphView(void);
00076 
00077 public slots:
00078     void setRoot   (const FieldContainerPtr &pRoot   );
00079     void showAspect(      UInt32             uiAspect); 
00080 
00081 protected slots:
00082     void onAspectSelected    (int  index);
00083     void onUpdateClicked     (void      );
00084     void onForwardClicked    (void      );
00085     void onBackwardClicked   (void      );
00086     void onRawAddressEntered (void      );
00087 
00088     void onFieldClicked      (FieldContainerPtr pFC,     UInt32    uiFieldId,
00089                               UInt32            uiIndex, ButtonState  button );
00090     void onFieldDoubleClicked(FieldContainerPtr pFC,     UInt32    uiFieldId,
00091                               UInt32            uiIndex, ButtonState  button );
00092     
00093     void onSelectionChanged  (QListViewItem    *pItem                        );
00094 
00095 private:
00096     typedef QWidget Inherited;
00097 
00098     struct HistoryEntry
00099     {
00100         HistoryEntry(const FieldContainerPtr &pRootFC, 
00101                      const FieldContainerPtr &pSelectedFC, UInt32 uiAspect);
00102 
00103         FieldContainerPtr _pRootFC;
00104         FieldContainerPtr _pSelectedFC;
00105         UInt32            _uiAspect;
00106     };
00107 
00108     typedef std::list<HistoryEntry>     HistoryList;
00109     typedef HistoryList::iterator       HistoryListIt;
00110     typedef HistoryList::const_iterator HistoryListConstIt;
00111 
00112     void createChildWidgets (void);
00113     void connectChildWidgets(void);
00114   
00115     void doSetRoot                   (const FieldContainerPtr &pRootFC );
00116     void doShowAspect                (      UInt32             uiAspect);
00117 
00118     void appendHistoryEntry          (void);
00119     void clearHistory                (void);
00120     void selectPrevHistoryEntry      (void);
00121     void selectNextHistoryEntry      (void);
00122     void enableHistoryButtons        (void);
00123 
00124     FieldContainerPtr    _pRootFC;
00125     FieldContainerPtr    _pSelectedFC;
00126     UInt32               _uiAspect;
00127 
00128     HistoryList          _history;
00129     UInt32               _uiMaxHistorySize;
00130     HistoryListIt        _currentHistoryEntry;
00131     bool                 _bRestoringHistory;
00132 
00133     QHBoxLayout         *_pGlobalLayout;
00134 
00135     QSplitter           *_pSplitter;
00136     
00137     QVBoxLayout         *_pVBoxLeft;
00138     QComboBox           *_pCBAspect;
00139     QNodeTreeView      **_pTreeView;
00140     QLabel              *_pLabelRawAddress;
00141     QLineEdit           *_pLERawAddress;
00142     QPushButton         *_pPBUpdate;
00143     QHBoxLayout         *_pHBoxHistoryButtons;
00144     QPushButton         *_pPBBackward;
00145     QPushButton         *_pPBForward;
00146 
00147     QVBoxLayout         *_pVBoxRight;
00148     QFieldContainerView *_pFCView;
00149     QHBoxLayout         *_pHBoxFCHeader;
00150     QLabel              *_pLabelFCName;
00151     QPushButton         *_pPBShowTypeColumn;
00152 };
00153 
00154 OSG_END_NAMESPACE
00155 
00156 #define OSGQSCENEGRAPHVIEW_HEADER_CVSID "@(#)$Id: OSGQSceneGraphView_qt.h,v 1.2 2003/05/16 13:54:29 neumannc Exp $"
00157 
00158 // #include "OSGQSceneGraphView_qt.inl"
00159 
00160 #endif /* _OSGQSCENEGRAPHVIEW_H_ */

Generated on Thu Aug 25 04:08:59 2005 for OpenSG by  doxygen 1.4.3