![]() |
http://www.sim.no http://www.coin3d.org |
00001 /**************************************************************************\ 00002 * 00003 * This file is part of the Coin 3D visualization library. 00004 * Copyright (C) 1998-2004 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 // src/Inventor/Qt/viewers/SoQtViewer.h. Generated from SoGuiViewer.h.in by configure. 00025 00026 #ifndef SOQT_VIEWER_H 00027 #define SOQT_VIEWER_H 00028 00029 /**************************************************************************\ 00030 * 00031 * A WORD OF ADVICE 00032 * 00033 * It is fruitless to modify the contents of the SoQtViewer.h file 00034 * because it is autogenerated by configure from the SoAnyViewer.h.in 00035 * file which you will find in the src/Inventor/Qt/common/ directory. 00036 * Do your modifications to that file instead. 00037 * 00038 \**************************************************************************/ 00039 00040 // Include this first, as a workaround for building on top of SGI and 00041 // TGS Inventor on some Linux distributions. (The bug is in SGI/TGS 00042 // Inventor.) 00043 #include <math.h> 00044 00045 #include <Inventor/SbTime.h> 00046 #include <Inventor/SoType.h> 00047 #include <Inventor/SbLinear.h> 00048 00049 #include <Inventor/Qt/SoQtRenderArea.h> 00050 00051 class SoCallbackList; 00052 class SoBaseColor; 00053 class SoCamera; 00054 class SoComplexity; 00055 class SoDirectionalLight; 00056 class SoDrawStyle; 00057 class SoGetBoundingBoxAction; 00058 class SoGroup; 00059 class SoLightModel; 00060 class SoMaterialBinding; 00061 class SoNode; 00062 class SoPolygonOffset; 00063 class SoSensor; 00064 class SoSeparator; 00065 class SoSwitch; 00066 class SoTimerSensor; 00067 00068 class SoQtViewer; 00069 00070 typedef void SoQtViewerCB(void * data, SoQtViewer * viewer); 00071 typedef void SoQtViewerFPSCB(float fps, void * data, SoQtViewer * viewer); 00072 00073 typedef SbVec2f SoQtAutoClippingCB(void * data, const SbVec2f & nearfar); 00074 00075 // ************************************************************************* 00076 00077 class SOQT_DLL_API SoQtViewer : public SoQtRenderArea { 00078 SOQT_OBJECT_ABSTRACT_HEADER(SoQtViewer, SoQtRenderArea); 00079 00080 public: 00081 enum Type { 00082 BROWSER, 00083 EDITOR 00084 }; 00085 00086 enum DrawStyle { 00087 VIEW_AS_IS, 00088 VIEW_HIDDEN_LINE, 00089 VIEW_NO_TEXTURE, 00090 VIEW_LOW_COMPLEXITY, 00091 VIEW_LINE, 00092 VIEW_POINT, 00093 VIEW_BBOX, 00094 VIEW_LOW_RES_LINE, 00095 VIEW_LOW_RES_POINT, 00096 VIEW_SAME_AS_STILL, 00097 VIEW_WIREFRAME_OVERLAY 00098 }; 00099 00100 enum DrawType { 00101 STILL = 0, 00102 INTERACTIVE 00103 }; 00104 00105 enum BufferType { 00106 BUFFER_SINGLE, 00107 BUFFER_DOUBLE, 00108 BUFFER_INTERACTIVE 00109 }; 00110 00111 enum AutoClippingStrategy { 00112 VARIABLE_NEAR_PLANE, 00113 CONSTANT_NEAR_PLANE 00114 }; 00115 00116 virtual void setCamera(SoCamera * camera); 00117 SoCamera * getCamera(void) const; 00118 00119 virtual void setCameraType(SoType type); 00120 SoType getCameraType(void) const; 00121 00122 virtual void toggleCameraType(void); 00123 00124 virtual void viewAll(void); 00125 00126 virtual void saveHomePosition(void); 00127 virtual void resetToHomePosition(void); 00128 00129 virtual void setHeadlight(SbBool enable); 00130 SbBool isHeadlight(void) const; 00131 SoDirectionalLight * getHeadlight(void) const; 00132 00133 virtual void setDrawStyle(SoQtViewer::DrawType type, SoQtViewer::DrawStyle style); 00134 SoQtViewer::DrawStyle getDrawStyle(const SoQtViewer::DrawType type) const; 00135 00136 virtual void setBufferingType(SoQtViewer::BufferType type); 00137 SoQtViewer::BufferType getBufferingType(void) const; 00138 00139 virtual void setViewing(SbBool enable); 00140 SbBool isViewing(void) const; 00141 00142 virtual void setCursorEnabled(SbBool enable); 00143 SbBool isCursorEnabled(void) const; 00144 00145 void setAutoClipping(SbBool enable); 00146 SbBool isAutoClipping(void) const; 00147 00148 void setAutoClippingStrategy(const AutoClippingStrategy strategy, 00149 const float value = 0.6f, 00150 SoQtAutoClippingCB * cb = NULL, 00151 void * cbuserdata = NULL); 00152 00153 virtual void setStereoViewing(SbBool enable); 00154 SbBool isStereoViewing(void) const; 00155 00156 virtual void setStereoOffset(const float dist); 00157 float getStereoOffset(void) const; 00158 00159 enum StereoType { 00160 STEREO_NONE, STEREO_ANAGLYPH, STEREO_QUADBUFFER, 00161 STEREO_INTERLEAVED_ROWS, STEREO_INTERLEAVED_COLUMNS 00162 }; 00163 00164 SbBool setStereoType(SoQtViewer::StereoType s); 00165 SoQtViewer::StereoType getStereoType(void) const; 00166 00167 void setAnaglyphStereoColorMasks(const SbBool left[3], const SbBool right[3]); 00168 void getAnaglyphStereoColorMasks(SbBool left[3], SbBool right[3]); 00169 00170 void setDetailSeek(const SbBool enable); 00171 SbBool isDetailSeek(void) const; 00172 00173 void setSeekTime(const float seconds); 00174 float getSeekTime(void) const; 00175 00176 void addStartCallback(SoQtViewerCB * func, void * data = NULL); 00177 void addFinishCallback(SoQtViewerCB * func, void * data = NULL); 00178 void removeStartCallback(SoQtViewerCB * func, void * data = NULL); 00179 void removeFinishCallback(SoQtViewerCB * func, void * data = NULL); 00180 00181 void setWireframeOverlayColor(const SbColor & color); 00182 const SbColor & getWireframeOverlayColor(void) const; 00183 00184 virtual void setDoubleBuffer(const SbBool enable); 00185 00186 virtual void setSceneGraph(SoNode * root); 00187 virtual SoNode * getSceneGraph(void); 00188 00189 protected: 00190 SoQtViewer(QWidget * parent, 00191 const char * name, 00192 SbBool embed, 00193 Type type, 00194 SbBool build); 00195 ~SoQtViewer(); 00196 00197 virtual void sizeChanged(const SbVec2s & size); 00198 virtual void setSeekMode(SbBool enable); 00199 SbBool isSeekMode(void) const; 00200 SbBool seekToPoint(const SbVec2s screenpos); 00201 virtual void computeSeekFinalOrientation(void); 00202 00203 virtual void actualRedraw(void); 00204 virtual SbBool processSoEvent(const SoEvent * const event); 00205 00206 void interactiveCountInc(void); 00207 void interactiveCountDec(void); 00208 int getInteractiveCount(void) const; 00209 00210 void setSeekDistance(const float distance); 00211 float getSeekDistance(void) const; 00212 void setSeekValueAsPercentage(const SbBool on); 00213 SbBool isSeekValuePercentage(void) const; 00214 00215 virtual void changeCameraValues(SoCamera * camera); 00216 00217 void addSuperimposition(SoNode * scene); 00218 void removeSuperimposition(SoNode * scene); 00219 void setSuperimpositionEnabled(SoNode * scene, const SbBool enable); 00220 SbBool getSuperimpositionEnabled(SoNode * scene) const; 00221 00222 private: 00223 class SoQtViewerP * pimpl; 00224 friend class SoQtViewerP; 00225 }; 00226 00227 // ************************************************************************* 00228 00229 #endif // ! SOQT_VIEWER_H
Copyright © 1998-2004 by Systems in Motion AS. All rights reserved.
Generated on Tue Oct 26 18:47:30 2004 for SoQt by Doxygen. 1.3.9.1