Main Page | Modules | Class Hierarchy | Class List | File List | Class Members

SoQtFullViewer.h

00001 /**************************************************************************\ 00002 * 00003 * This file is part of the Coin 3D visualization library. 00004 * Copyright (C) 1998-2003 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, Teknobyen, Abels Gate 5, 7030 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 // FIXME: get rid of non-templatized code. 20020108 mortene. 00030 #ifdef __COIN_SOWIN__ 00031 typedef void AppPushButtonCB(HWND hwnd, int id, void * buttonData, void * userData); 00032 typedef void RedrawAppPushButtonCB(LPDRAWITEMSTRUCT lpdis, void * userData); 00033 typedef void CreateAppPushButtonCB(LPMEASUREITEMSTRUCT lpmis, void * userData); 00034 #endif // ! __COIN_SOWIN__ 00035 00036 00037 class SoQtPopupMenu; 00038 00039 // ************************************************************************* 00040 00041 class SOQT_DLL_API SoQtFullViewer : public SoQtViewer { 00042 SOQT_OBJECT_ABSTRACT_HEADER(SoQtFullViewer, SoQtViewer); 00043 00044 public: 00045 enum BuildFlag { 00046 BUILD_NONE = 0x00, 00047 BUILD_DECORATION = 0x01, 00048 BUILD_POPUP = 0x02, 00049 BUILD_ALL = (BUILD_DECORATION | BUILD_POPUP) 00050 }; 00051 00052 void setDecoration(const SbBool on); 00053 SbBool isDecoration(void) const; 00054 00055 void setPopupMenuEnabled(const SbBool on); 00056 SbBool isPopupMenuEnabled(void) const; 00057 00058 QWidget * getAppPushButtonParent(void) const; 00059 void addAppPushButton(QWidget * newButton); 00060 void insertAppPushButton(QWidget * newButton, int index); 00061 void removeAppPushButton(QWidget * oldButton); 00062 int findAppPushButton(QWidget * oldButton) const; 00063 int lengthAppPushButton(void) const; 00064 00065 QWidget * getRenderAreaWidget(void) const; 00066 00067 virtual void setViewing(SbBool on); 00068 00069 virtual void setComponentCursor(const SoQtCursor & cursor); 00070 00071 protected: 00072 SoQtFullViewer(QWidget * parent, 00073 const char * name, 00074 SbBool embed, 00075 BuildFlag flag, 00076 Type type, 00077 SbBool build); 00078 ~SoQtFullViewer(); 00079 00080 virtual void sizeChanged(const SbVec2s & size); 00081 00082 QWidget * buildWidget(QWidget * parent); 00083 00084 virtual void buildDecoration(QWidget * parent); 00085 virtual QWidget * buildLeftTrim(QWidget * parent); 00086 virtual QWidget * buildBottomTrim(QWidget * parent); 00087 virtual QWidget * buildRightTrim(QWidget * parent); 00088 QWidget * buildAppButtons(QWidget * parent); 00089 QWidget * buildViewerButtons(QWidget * parent); 00090 virtual void createViewerButtons(QWidget * parent, SbPList * buttonlist); 00091 00092 virtual void buildPopupMenu(void); 00093 virtual void setPopupMenuString(const char * title); 00094 virtual void openPopupMenu(const SbVec2s position); 00095 00096 virtual void leftWheelStart(void); 00097 virtual void leftWheelMotion(float); 00098 virtual void leftWheelFinish(void); 00099 float getLeftWheelValue(void) const; 00100 void setLeftWheelValue(const float value); 00101 00102 virtual void bottomWheelStart(void); 00103 virtual void bottomWheelMotion(float); 00104 virtual void bottomWheelFinish(void); 00105 float getBottomWheelValue(void) const; 00106 void setBottomWheelValue(const float value); 00107 00108 virtual void rightWheelStart(void); 00109 virtual void rightWheelMotion(float); 00110 virtual void rightWheelFinish(void); 00111 float getRightWheelValue(void) const; 00112 void setRightWheelValue(const float value); 00113 00114 void setLeftWheelString(const char * const name); 00115 QWidget * getLeftWheelLabelWidget(void) const; 00116 void setBottomWheelString(const char * const name); 00117 QWidget * getBottomWheelLabelWidget(void) const; 00118 void setRightWheelString(const char * const name); 00119 QWidget * getRightWheelLabelWidget(void) const; 00120 00121 virtual SbBool processSoEvent(const SoEvent * const event); 00122 00123 protected: 00124 QWidget * leftDecoration; 00125 QWidget * rightDecoration; 00126 QWidget * bottomDecoration; 00127 00128 #ifndef __COIN_SOWIN__ // FIXME: get rid of non-templatized code. 20020108 mortene. 00129 QWidget * leftWheel; 00130 QWidget * rightWheel; 00131 QWidget * bottomWheel; 00132 #endif // !__COIN_SOWIN__ 00133 00134 QWidget * leftWheelLabel; 00135 char * leftWheelStr; 00136 float leftWheelVal; 00137 00138 QWidget * rightWheelLabel; 00139 char * rightWheelStr; 00140 float rightWheelVal; 00141 00142 QWidget * bottomWheelLabel; 00143 char * bottomWheelStr; 00144 float bottomWheelVal; 00145 00146 SoQtPopupMenu * prefmenu; 00147 00148 private: 00149 // Private class for implementation hiding. The idiom we're using is 00150 // a variant of what is known as the "Cheshire Cat", and is also 00151 // described as the "Bridge" pattern in «Design Patterns» by Gamma 00152 // et al (aka The Gang Of Four). 00153 class SoQtFullViewerP * pimpl; 00154 #ifndef DOXYGEN_SKIP_THIS 00155 friend class SoGuiFullViewerP; 00156 friend class SoQtFullViewerP; 00157 #endif // DOXYGEN_SKIP_THIS 00158 00159 00160 // FIXME: get rid of non-templatized code. 20020108 mortene. 00161 00162 #ifdef __COIN_SOXT__ // FIXME: get rid of non-templatized code. 20020108 mortene. 00163 protected: 00164 Widget buildAppButtonsForm(Widget parent); 00165 00166 Widget buildFunctionsSubmenu(Widget popup); 00167 Widget buildDrawStyleSubmenu(Widget popup); 00168 00169 char * popupTitle; 00170 SbBool popupEnabled; 00171 SbPList * viewerButtonWidgets; 00172 #endif // __COIN_SOXT__ 00173 00174 #ifdef __COIN_SOWIN__ // FIXME: get rid of non-templatized code. 20020108 mortene. 00175 public: 00176 static void setDoButtonBar(SbBool enable); 00177 static SbBool isDoButtonBar(void); 00178 00179 void addAppPushButtonCallback(AppPushButtonCB * callback, 00180 void * data = NULL); 00181 void addRedrawAppPushButtonCallback(RedrawAppPushButtonCB * callback, 00182 void * data = NULL); 00183 void addCreateAppPushButtonCallback(CreateAppPushButtonCB * callback, 00184 void * data = NULL); 00185 00186 virtual void buildViewerButtonsEx(HWND parent, int x, int y, int size); 00187 00188 virtual LRESULT onCommand(HWND window, UINT message, WPARAM wparam, LPARAM lparam); 00189 virtual LRESULT onDrawItem(HWND window, UINT message, WPARAM wparam, LPARAM lparam); 00190 virtual LRESULT onMeasureItem(HWND window, UINT message, WPARAM wparam, LPARAM lparam); 00191 00192 class SoWinThumbWheel * rightWheel; 00193 class SoWinThumbWheel * bottomWheel; 00194 class SoWinThumbWheel * leftWheel; 00195 00196 HWND viewerWidget; 00197 HWND renderAreaWidget; 00198 00199 protected: 00200 SbPList * viewerButtonList; 00201 SbPList * appButtonList; 00202 #endif // __COIN_SOWIN__ 00203 }; 00204 00205 // ************************************************************************* 00206 00207 #endif // ! SOQT_FULLVIEWER_H

Generated on Wed Aug 18 12:57:38 2004 for SoQt by doxygen 1.3.7