![]() |
http://www.coin3d.org/ http://www.kongsberg.com/kogt/ |
00001 #ifndef SOQT_VIEWER_H 00002 #define SOQT_VIEWER_H 00003 00004 // src/Inventor/Qt/viewers/SoQtViewer.h. Generated from SoGuiViewer.h.in by configure. 00005 00006 /**************************************************************************\ 00007 * Copyright (c) Kongsberg Oil & Gas Technologies AS 00008 * All rights reserved. 00009 * 00010 * Redistribution and use in source and binary forms, with or without 00011 * modification, are permitted provided that the following conditions are 00012 * met: 00013 * 00014 * Redistributions of source code must retain the above copyright notice, 00015 * this list of conditions and the following disclaimer. 00016 * 00017 * Redistributions in binary form must reproduce the above copyright 00018 * notice, this list of conditions and the following disclaimer in the 00019 * documentation and/or other materials provided with the distribution. 00020 * 00021 * Neither the name of the copyright holder nor the names of its 00022 * contributors may be used to endorse or promote products derived from 00023 * this software without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00026 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00027 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00028 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00029 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00030 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00031 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00032 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00033 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00034 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00035 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 \**************************************************************************/ 00037 00038 /**************************************************************************\ 00039 * 00040 * A WORD OF ADVICE 00041 * 00042 * It is fruitless to modify the contents of the SoQtViewer.h file 00043 * because it is autogenerated by configure from the SoAnyViewer.h.in 00044 * file which you will find in the src/Inventor/Qt/common/ directory. 00045 * Do your modifications to that file instead. 00046 * 00047 \**************************************************************************/ 00048 00049 // Include this first, as a workaround for building on top of SGI and 00050 // TGS Inventor on some Linux distributions. (The bug is in SGI/TGS 00051 // Inventor.) 00052 #include <math.h> 00053 00054 #include <Inventor/SbTime.h> 00055 #include <Inventor/SoType.h> 00056 #include <Inventor/SbLinear.h> 00057 00058 #include <Inventor/Qt/SoQtRenderArea.h> 00059 00060 #ifndef SOQT_INTERNAL 00061 #include <Inventor/events/SoKeyboardEvent.h> 00062 #endif // SOQT_INTERNAL 00063 00064 class SoCallbackList; 00065 class SoBaseColor; 00066 class SoCamera; 00067 class SoComplexity; 00068 class SoDirectionalLight; 00069 class SoDrawStyle; 00070 class SoGetBoundingBoxAction; 00071 class SoGroup; 00072 class SoLightModel; 00073 class SoMaterialBinding; 00074 class SoNode; 00075 class SoPolygonOffset; 00076 class SoSensor; 00077 class SoSeparator; 00078 class SoSwitch; 00079 class SoTimerSensor; 00080 00081 class SoQtViewer; 00082 00083 typedef void SoQtViewerCB(void * data, SoQtViewer * viewer); 00084 typedef void SoQtViewerFPSCB(float fps, void * data, SoQtViewer * viewer); 00085 00086 typedef SbVec2f SoQtAutoClippingCB(void * data, const SbVec2f & nearfar); 00087 00088 // ************************************************************************* 00089 00090 class SOQT_DLL_API SoQtViewer : public SoQtRenderArea { 00091 SOQT_OBJECT_ABSTRACT_HEADER(SoQtViewer, SoQtRenderArea); 00092 00093 public: 00094 enum Type { 00095 BROWSER, 00096 EDITOR 00097 }; 00098 00099 enum DrawStyle { 00100 VIEW_AS_IS, 00101 VIEW_HIDDEN_LINE, 00102 VIEW_NO_TEXTURE, 00103 VIEW_LOW_COMPLEXITY, 00104 VIEW_LINE, 00105 VIEW_POINT, 00106 VIEW_BBOX, 00107 VIEW_LOW_RES_LINE, 00108 VIEW_LOW_RES_POINT, 00109 VIEW_SAME_AS_STILL, 00110 VIEW_WIREFRAME_OVERLAY 00111 }; 00112 00113 enum DrawType { 00114 STILL = 0, 00115 INTERACTIVE 00116 }; 00117 00118 enum BufferType { 00119 BUFFER_SINGLE, 00120 BUFFER_DOUBLE, 00121 BUFFER_INTERACTIVE 00122 }; 00123 00124 enum AutoClippingStrategy { 00125 VARIABLE_NEAR_PLANE, 00126 CONSTANT_NEAR_PLANE 00127 }; 00128 00129 virtual void setCamera(SoCamera * camera); 00130 SoCamera * getCamera(void) const; 00131 00132 virtual void setCameraType(SoType type); 00133 SoType getCameraType(void) const; 00134 00135 virtual void toggleCameraType(void); 00136 00137 virtual void viewAll(void); 00138 00139 virtual void saveHomePosition(void); 00140 virtual void resetToHomePosition(void); 00141 00142 virtual void setHeadlight(SbBool enable); 00143 SbBool isHeadlight(void) const; 00144 SoDirectionalLight * getHeadlight(void) const; 00145 00146 virtual void setDrawStyle(SoQtViewer::DrawType type, SoQtViewer::DrawStyle style); 00147 SoQtViewer::DrawStyle getDrawStyle(const SoQtViewer::DrawType type) const; 00148 00149 virtual void setBufferingType(SoQtViewer::BufferType type); 00150 SoQtViewer::BufferType getBufferingType(void) const; 00151 00152 virtual void setViewing(SbBool enable); 00153 SbBool isViewing(void) const; 00154 00155 virtual void setCursorEnabled(SbBool enable); 00156 SbBool isCursorEnabled(void) const; 00157 00158 void setAutoClipping(SbBool enable); 00159 SbBool isAutoClipping(void) const; 00160 00161 void setAutoClippingStrategy(const AutoClippingStrategy strategy, 00162 const float value = 0.6f, 00163 SoQtAutoClippingCB * cb = NULL, 00164 void * cbuserdata = NULL); 00165 00166 virtual void setStereoViewing(SbBool enable); 00167 SbBool isStereoViewing(void) const; 00168 00169 virtual void setStereoOffset(const float dist); 00170 float getStereoOffset(void) const; 00171 00172 enum StereoType { 00173 STEREO_NONE, STEREO_ANAGLYPH, STEREO_QUADBUFFER, 00174 STEREO_INTERLEAVED_ROWS, STEREO_INTERLEAVED_COLUMNS 00175 }; 00176 00177 SbBool setStereoType(SoQtViewer::StereoType s); 00178 SoQtViewer::StereoType getStereoType(void) const; 00179 00180 void setAnaglyphStereoColorMasks(const SbBool left[3], const SbBool right[3]); 00181 void getAnaglyphStereoColorMasks(SbBool left[3], SbBool right[3]); 00182 00183 void setDetailSeek(const SbBool enable); 00184 SbBool isDetailSeek(void) const; 00185 00186 void setSeekTime(const float seconds); 00187 float getSeekTime(void) const; 00188 00189 void addStartCallback(SoQtViewerCB * func, void * data = NULL); 00190 void addFinishCallback(SoQtViewerCB * func, void * data = NULL); 00191 void removeStartCallback(SoQtViewerCB * func, void * data = NULL); 00192 void removeFinishCallback(SoQtViewerCB * func, void * data = NULL); 00193 00194 void setWireframeOverlayColor(const SbColor & color); 00195 const SbColor & getWireframeOverlayColor(void) const; 00196 00197 virtual void setDoubleBuffer(const SbBool enable); 00198 00199 virtual void setSceneGraph(SoNode * root); 00200 virtual SoNode * getSceneGraph(void); 00201 00202 protected: 00203 SoQtViewer(QWidget * parent, 00204 const char * name, 00205 SbBool embed, 00206 Type type, 00207 SbBool build); 00208 ~SoQtViewer(); 00209 00210 virtual void sizeChanged(const SbVec2s & size); 00211 virtual void setSeekMode(SbBool enable); 00212 SbBool isSeekMode(void) const; 00213 SbBool seekToPoint(const SbVec2s screenpos); 00214 void seekToPoint(const SbVec3f & scenepos); 00215 virtual void computeSeekFinalOrientation(void); 00216 00217 virtual void actualRedraw(void); 00218 virtual SbBool processSoEvent(const SoEvent * const event); 00219 00220 void interactiveCountInc(void); 00221 void interactiveCountDec(void); 00222 int getInteractiveCount(void) const; 00223 00224 void setSeekDistance(const float distance); 00225 float getSeekDistance(void) const; 00226 void setSeekValueAsPercentage(const SbBool on); 00227 SbBool isSeekValuePercentage(void) const; 00228 00229 virtual void changeCameraValues(SoCamera * camera); 00230 00231 void addSuperimposition(SoNode * scene); 00232 void removeSuperimposition(SoNode * scene); 00233 void setSuperimpositionEnabled(SoNode * scene, const SbBool enable); 00234 SbBool getSuperimpositionEnabled(SoNode * scene) const; 00235 00236 private: 00237 class SoQtViewerP * pimpl; 00238 friend class SoQtViewerP; 00239 friend class SoQtPlaneViewer; 00240 }; 00241 00242 // ************************************************************************* 00243 00244 #endif // ! SOQT_VIEWER_H
Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Mon Sep 7 11:22:57 2015 for SoQt by Doxygen 1.5.6.