Coin Logo http://www.sim.no
http://www.coin3d.org

SoQtFullViewer.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2005 by Systems in Motion.  All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  ("GPL") version 2 as published by the Free Software Foundation.
00009  *  See the file LICENSE.GPL at the root directory of this source
00010  *  distribution for additional information about the GNU GPL.
00011  *
00012  *  For using Coin with software that can not be combined with the GNU
00013  *  GPL, and for taking advantage of the additional benefits of our
00014  *  support services, please contact Systems in Motion about acquiring
00015  *  a Coin Professional Edition License.
00016  *
00017  *  See <URL:http://www.coin3d.org/> for more information.
00018  *
00019  *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
00020  *  <URL:http://www.sim.no/>.
00021  *
00022 \**************************************************************************/
00023 
00024 #ifndef SOQT_FULLVIEWER_H
00025 #define SOQT_FULLVIEWER_H
00026 
00027 #include <Inventor/Qt/viewers/SoQtViewer.h>
00028 
00029 class SoQtPopupMenu;
00030 
00031 // *************************************************************************
00032 
00033 class SOQT_DLL_API SoQtFullViewer : public SoQtViewer {
00034   SOQT_OBJECT_ABSTRACT_HEADER(SoQtFullViewer, SoQtViewer);
00035 
00036 public:
00037   enum BuildFlag {
00038     BUILD_NONE       = 0x00,
00039     BUILD_DECORATION = 0x01,
00040     BUILD_POPUP      = 0x02,
00041     BUILD_ALL        = (BUILD_DECORATION | BUILD_POPUP)
00042   };
00043 
00044   void setDecoration(const SbBool on);
00045   SbBool isDecoration(void) const;
00046 
00047   void setPopupMenuEnabled(const SbBool on);
00048   SbBool isPopupMenuEnabled(void) const;
00049 
00050   QWidget * getAppPushButtonParent(void) const;
00051   void addAppPushButton(QWidget * newButton);
00052   void insertAppPushButton(QWidget * newButton, int index);
00053   void removeAppPushButton(QWidget * oldButton);
00054   int findAppPushButton(QWidget * oldButton) const;
00055   int lengthAppPushButton(void) const;
00056 
00057   QWidget * getRenderAreaWidget(void) const;
00058 
00059   virtual void setViewing(SbBool on);
00060 
00061   virtual void setComponentCursor(const SoQtCursor & cursor);
00062 
00063 protected:
00064   SoQtFullViewer(QWidget * parent,
00065                     const char * name,
00066                     SbBool embed,
00067                     BuildFlag flag,
00068                     Type type,
00069                     SbBool build);
00070   ~SoQtFullViewer();
00071 
00072   virtual void sizeChanged(const SbVec2s & size);
00073 
00074   QWidget * buildWidget(QWidget * parent);
00075 
00076   virtual void buildDecoration(QWidget * parent);
00077   virtual QWidget * buildLeftTrim(QWidget * parent);
00078   virtual QWidget * buildBottomTrim(QWidget * parent);
00079   virtual QWidget * buildRightTrim(QWidget * parent);
00080   QWidget * buildAppButtons(QWidget * parent);
00081   QWidget * buildViewerButtons(QWidget * parent);
00082   virtual void createViewerButtons(QWidget * parent, SbPList * buttonlist);
00083 
00084   virtual void buildPopupMenu(void);
00085   virtual void setPopupMenuString(const char * title);
00086   virtual void openPopupMenu(const SbVec2s position);
00087 
00088   virtual void leftWheelStart(void);
00089   virtual void leftWheelMotion(float);
00090   virtual void leftWheelFinish(void);
00091   float getLeftWheelValue(void) const;
00092   void setLeftWheelValue(const float value);
00093 
00094   virtual void bottomWheelStart(void);
00095   virtual void bottomWheelMotion(float);
00096   virtual void bottomWheelFinish(void);
00097   float getBottomWheelValue(void) const;
00098   void setBottomWheelValue(const float value);
00099 
00100   virtual void rightWheelStart(void);
00101   virtual void rightWheelMotion(float);
00102   virtual void rightWheelFinish(void);
00103   float getRightWheelValue(void) const;
00104   void setRightWheelValue(const float value);
00105 
00106   void setLeftWheelString(const char * const name);
00107   QWidget * getLeftWheelLabelWidget(void) const;
00108   void setBottomWheelString(const char * const name);
00109   QWidget * getBottomWheelLabelWidget(void) const;
00110   void setRightWheelString(const char * const name);
00111   QWidget * getRightWheelLabelWidget(void) const;
00112 
00113   virtual SbBool processSoEvent(const SoEvent * const event);
00114 
00115 protected:
00116   QWidget * leftWheel;
00117   QWidget * rightWheel;
00118   QWidget * bottomWheel;
00119 
00120   QWidget * leftDecoration;
00121   QWidget * rightDecoration;
00122   QWidget * bottomDecoration;
00123 
00124   QWidget * leftWheelLabel;
00125   char * leftWheelStr;
00126   float leftWheelVal;
00127 
00128   QWidget * rightWheelLabel;
00129   char * rightWheelStr;
00130   float rightWheelVal;
00131 
00132   QWidget * bottomWheelLabel;
00133   char * bottomWheelStr;
00134   float bottomWheelVal;
00135 
00136   SoQtPopupMenu * prefmenu;
00137 
00138 private:
00139   // Private class for implementation hiding. The idiom we're using is
00140   // a variant of what is known as the "Cheshire Cat", and is also
00141   // described as the "Bridge" pattern in «Design Patterns» by Gamma
00142   // et al (aka The Gang Of Four).
00143   class SoQtFullViewerP * pimpl;
00144 
00145   friend class SoGuiFullViewerP;
00146   friend class SoQtFullViewerP;
00147 
00148 
00149 
00150 // FIXME: get rid of non-templatized code. 20020108 mortene.
00151 
00152 #ifdef __COIN_SOXT__ // FIXME: get rid of non-templatized code. 20020108 mortene.
00153 protected:
00154   Widget buildFunctionsSubmenu(Widget popup);
00155   Widget buildDrawStyleSubmenu(Widget popup);
00156 
00157   char * popupTitle;
00158   SbBool popupEnabled;
00159   SbPList * viewerButtonWidgets;
00160 #endif // __COIN_SOXT__
00161 };
00162 
00163 // *************************************************************************
00164 
00165 #endif // ! SOQT_FULLVIEWER_H

Copyright © 1998-2005 by Systems in Motion AS. All rights reserved.

Generated on Mon Mar 27 00:38:51 2006 for SoQt by Doxygen. 1.4.6