![]() |
http://www.coin3d.org/ http://www.kongsberg.com/kogt/ |
00001 #ifndef SOQT_RENDERAREA_H 00002 #define SOQT_RENDERAREA_H 00003 00004 // src/Inventor/Qt/SoQtRenderArea.h. Generated from SoGuiRenderArea.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 #include <Inventor/SbColor.h> 00039 #include <Inventor/SbViewportRegion.h> 00040 #include <Inventor/actions/SoGLRenderAction.h> 00041 #include <Inventor/SoSceneManager.h> 00042 00043 #include <Inventor/Qt/SoQtGLWidget.h> 00044 00045 class SbColor; 00046 class SoNode; 00047 class SoSelection; 00048 00049 class SoQtDevice; 00050 // SoQtRenderAreaP is only used in the "friend class" statement in 00051 // the class definition, so this shouldn't really be necessary. But 00052 // the OSF1/cxx compiler complains if it's left out. 00053 class SoQtRenderAreaP; 00054 00055 typedef SbBool SoQtRenderAreaEventCB(void * closure, QEvent * event); 00056 00057 // ************************************************************************* 00058 00059 class SOQT_DLL_API SoQtRenderArea : public SoQtGLWidget { 00060 SOQT_OBJECT_HEADER(SoQtRenderArea, SoQtGLWidget); 00061 00062 public: 00063 SoQtRenderArea(QWidget * parent = NULL, 00064 const char * name = NULL, 00065 SbBool embed = TRUE, 00066 SbBool mouseInput = TRUE, 00067 SbBool keyboardInput = TRUE); 00068 ~SoQtRenderArea(); 00069 00070 virtual void setSceneGraph(SoNode * scene); 00071 virtual SoNode * getSceneGraph(void); 00072 void setOverlaySceneGraph(SoNode * scene); 00073 SoNode * getOverlaySceneGraph(void); 00074 00075 void setBackgroundColor(const SbColor & color); 00076 const SbColor & getBackgroundColor(void) const; 00077 void setBackgroundIndex(int idx); 00078 int getBackgroundIndex(void) const; 00079 void setOverlayBackgroundIndex(int idx); 00080 int getOverlayBackgroundIndex(void) const; 00081 void setColorMap(int start, int num, const SbColor * colors); 00082 void setOverlayColorMap(int start, int num, const SbColor * colors); 00083 void setViewportRegion(const SbViewportRegion & newRegion); 00084 const SbViewportRegion & getViewportRegion(void) const; 00085 void setTransparencyType(SoGLRenderAction::TransparencyType type); 00086 SoGLRenderAction::TransparencyType getTransparencyType(void) const; 00087 void setAntialiasing(SbBool smoothing, int numPasses); 00088 void getAntialiasing(SbBool & smoothing, int & numPasses) const; 00089 void setClearBeforeRender(SbBool enable, SbBool zbEnable = TRUE); 00090 SbBool isClearBeforeRender(void) const; 00091 SbBool isClearZBufferBeforeRender(void) const; 00092 void setClearBeforeOverlayRender(SbBool enable); 00093 SbBool isClearBeforeOverlayRender(void) const; 00094 void setAutoRedraw(SbBool enable); 00095 SbBool isAutoRedraw(void) const; 00096 void setRedrawPriority(uint32_t priority); 00097 uint32_t getRedrawPriority(void) const; 00098 static uint32_t getDefaultRedrawPriority(void); 00099 void render(void); 00100 void renderOverlay(void); 00101 void scheduleRedraw(void); 00102 void scheduleOverlayRedraw(void); 00103 void redrawOnSelectionChange(SoSelection * selection); 00104 void redrawOverlayOnSelectionChange(SoSelection * selection); 00105 void setEventCallback(SoQtRenderAreaEventCB * func, void * user = NULL); 00106 void setSceneManager(SoSceneManager * manager); 00107 SoSceneManager * getSceneManager(void) const; 00108 void setOverlaySceneManager(SoSceneManager * manager); 00109 SoSceneManager * getOverlaySceneManager(void) const; 00110 void setGLRenderAction(SoGLRenderAction * action); 00111 SoGLRenderAction * getGLRenderAction(void) const; 00112 void setOverlayGLRenderAction(SoGLRenderAction * action); 00113 SoGLRenderAction * getOverlayGLRenderAction(void) const; 00114 00115 SbBool sendSoEvent(const SoEvent * event); 00116 00117 void registerDevice(SoQtDevice * device); 00118 void unregisterDevice(SoQtDevice * device); 00119 00120 00121 protected: 00122 SoQtRenderArea(QWidget * parent, 00123 const char * name, 00124 SbBool embed, 00125 SbBool mouseInput, 00126 SbBool keyboardInput, 00127 SbBool build); 00128 00129 virtual void redraw(void); 00130 virtual void actualRedraw(void); 00131 virtual void redrawOverlay(void); 00132 virtual void actualOverlayRedraw(void); 00133 00134 virtual SbBool processSoEvent(const SoEvent * const event); 00135 virtual void processEvent(QEvent * event); 00136 virtual void initGraphic(void); 00137 virtual void initOverlayGraphic(void); 00138 virtual void sizeChanged(const SbVec2s & size); 00139 virtual void widgetChanged(QWidget * widget); 00140 virtual void afterRealizeHook(void); 00141 00142 QWidget * buildWidget(QWidget * parent); 00143 00144 virtual const char * getDefaultWidgetName(void) const; 00145 virtual const char * getDefaultTitle(void) const; 00146 virtual const char * getDefaultIconTitle(void) const; 00147 00148 virtual SbBool glScheduleRedraw(void); 00149 00150 private: 00151 class SoQtRenderAreaP * pimpl; 00152 friend class SoQtRenderAreaP; 00153 }; 00154 00155 // ************************************************************************* 00156 00157 #endif // ! SOQT_RENDERAREA_H
Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Mon Sep 7 2015 11:30:44 for SoQt by Doxygen 1.7.3.