| 1 | /* |
| 2 | * |
| 3 | * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2.1 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * Further, this software is distributed without any warranty that it is |
| 16 | * free of the rightful claim of any third person regarding infringement |
| 17 | * or the like. Any license provided herein, whether implied or |
| 18 | * otherwise, applies only to this software file. Patent licenses, if |
| 19 | * any, provided herein do not apply to combinations of this program with |
| 20 | * other software, or any other product whatsoever. |
| 21 | * |
| 22 | * You should have received a copy of the GNU Lesser General Public |
| 23 | * License along with this library; if not, write to the Free Software |
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 25 | * |
| 26 | * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, |
| 27 | * Mountain View, CA 94043, or: |
| 28 | * |
| 29 | * http://www.sgi.com |
| 30 | * |
| 31 | * For further information regarding this notice, see: |
| 32 | * |
| 33 | * http://oss.sgi.com/projects/GenInfo/NoticeExplan/ |
| 34 | * |
| 35 | */ |
| 36 | |
| 37 | // -*- C++ -*- |
| 38 | |
| 39 | // |
| 40 | // Copyright (C) 1990-94 Silicon Graphics, Inc. |
| 41 | // |
| 42 | //______________________________________________________________________ |
| 43 | //_____________ S I L I C O N G R A P H I C S I N C . ____________ |
| 44 | // |
| 45 | // $Revision: 1.1.1.1 $ |
| 46 | // |
| 47 | // Description: |
| 48 | // Inventor rendering in a GL/X Motif widget. |
| 49 | // |
| 50 | // Author(s): David Mott, Alain Dumesny |
| 51 | // |
| 52 | //_____________ S I L I C O N G R A P H I C S I N C . ____________ |
| 53 | //______________________________________________________________________ |
| 54 | // |
| 55 | |
| 56 | #ifndef _SO_XT_RENDER_AREA_H_ |
| 57 | #define _SO_XT_RENDER_AREA_H_cxx . . $ `libSoXt/include/Inventor/Xt/SoXtRenderArea.h:57:9`! |
| 58 | |
| 59 | #include <X11/Intrinsic.h> |
| 60 | #include <X11/Xlib.h> |
| 61 | |
| 62 | #include <Inventor/SbColor.h>cxx . . $ `<file>/lib/database/include/Inventor/SbColor.h`/ |
| 63 | #include <Inventor/sensors/SoNodeSensor.h>cxx . . $ `<file>/lib/database/include/Inventor/sensors/SoNodeSensor.h`/ |
| 64 | #include <Inventor/SoSceneManager.h>cxx . . $ `<file>/lib/interaction/include/Inventor/SoSceneManager.h`/ |
| 65 | #include <Inventor/Xt/SoXtGLWidget.h>cxx . . $ `<file>/libSoXt/include/Inventor/Xt/SoXtGLWidget.h`/ |
| 66 | #include <Inventor/actions/SoGLRenderAction.h>cxx . . $ `<file>/lib/database/include/Inventor/actions/SoGLRenderAction.h`/ |
| 67 | |
| 68 | class SoHandleEventActioncxx . . $ SoHandleEventAction#; |
| 69 | class SoXtDevicecxx . . $ SoXtDevice#; |
| 70 | class SoNodecxx . . $ SoNode#; |
| 71 | class SoXtMousecxx . . $ SoXtMouse#; |
| 72 | class SoXtKeyboardcxx . . $ SoXtKeyboard#; |
| 73 | class SoSelectioncxx . . $ SoSelection#; |
| 74 | |
| 75 | |
| 76 | // callback function prototype |
| 77 | typedef SbBoolcxx . . $ SbBool# SoXtRenderAreaEventCBcxx . . $ SoXtRenderAreaEventCB#(void *userData, XAnyEventcxx . . $ XAnyEvent# *anyevent); |
| 78 | |
| 79 | ////////////////////////////////////////////////////////////////////////////// |
| 80 | // |
| 81 | // Class: SoXtRenderArea |
| 82 | // |
| 83 | // Class to do Inventor rendering in a GLX Motif widget. |
| 84 | // |
| 85 | ////////////////////////////////////////////////////////////////////////////// |
| 86 | |
| 87 | // C-api: prefix=SoXtRA |
| 88 | class SoXtRenderAreacxx . . $ SoXtRenderArea# : public SoXtGLWidgetcxx . . $ SoXtGLWidget# { |
| 89 | public: |
| 90 | // Passing FALSE for getMouseInput means the mouse will be ignored. |
| 91 | // Passing FALSE for getKeyboardInput means the keyboard will be ignored. |
| 92 | SoXtRenderAreacxx . . $ SoXtRenderArea#SoXtRenderArea(1eaf1a16d3aa15cc).( |
| 93 | Widgetcxx . . $ Widget# parent = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, |
| 94 | const char *name = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, |
| 95 | SbBoolcxx . . $ SbBool# buildInsideParent = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!, |
| 96 | SbBoolcxx . . $ SbBool# getMouseInput = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!, |
| 97 | SbBoolcxx . . $ SbBool# getKeyboardInput = TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!); |
| 98 | // C-api: interpret #define SoXtRACreateStd(parent,name) SoXtRACreate(parent,name,TRUE,TRUE,TRUE) |
| 99 | ~cxx . . $ SoXtRenderArea#`~SoXtRenderArea`(49f6e7a06ebc5aa8).SoXtRenderAreacxx . . $ SoXtRenderArea#(); |
| 100 | |
| 101 | // |
| 102 | // Sets/gets the scene graph to render. |
| 103 | // |
| 104 | // C-api: expose |
| 105 | // C-api: name=setScene |
| 106 | virtual void setSceneGraphcxx . . $ SoXtRenderArea#setSceneGraph(da6c7544ccee32bd).(SoNodecxx . . $ SoNode# *newScene); |
| 107 | // C-api: expose |
| 108 | // C-api: name=getScene |
| 109 | virtual SoNodecxx . . $ SoNode# * getSceneGraphcxx . . $ SoXtRenderArea#getSceneGraph(37b0c20759e6fed3).(); |
| 110 | |
| 111 | // |
| 112 | // Sets/gets the scene graph to render in the overlay bit planes. |
| 113 | // |
| 114 | // C-api: name=setOverScene |
| 115 | void setOverlaySceneGraphcxx . . $ SoXtRenderArea#setOverlaySceneGraph(da6c7544ccee32bd).(SoNodecxx . . $ SoNode# *newScene); |
| 116 | // C-api: name=getOverScene |
| 117 | SoNodecxx . . $ SoNode# * getOverlaySceneGraphcxx . . $ SoXtRenderArea#getOverlaySceneGraph(37b0c20759e6fed3).() |
| 118 | { return overlaySceneMgrcxx . . $ SoXtRenderArea#overlaySceneMgr.->getSceneGraphcxx . . $ SoSceneManager#getSceneGraph(b794963b450d51b3).();} |
| 119 | |
| 120 | // |
| 121 | // Handle/Unhandle devices. When registerDevice is called, the |
| 122 | // render area will register interest in events which that device |
| 123 | // generates, and pass those events into the scene graph. |
| 124 | // unregisterDevice means the render area will no longer listen |
| 125 | // to events from the passed device. |
| 126 | // |
| 127 | void registerDevicecxx . . $ SoXtRenderArea#registerDevice(887581b3a9692db2).(SoXtDevicecxx . . $ SoXtDevice# *d); |
| 128 | void unregisterDevicecxx . . $ SoXtRenderArea#unregisterDevice(887581b3a9692db2).(SoXtDevicecxx . . $ SoXtDevice# *d); |
| 129 | |
| 130 | // |
| 131 | // Sets/gets the window background color when in RGB mode. |
| 132 | // (default to black (0,0,0)); |
| 133 | // |
| 134 | // C-api: name=setBkgCol |
| 135 | void setBackgroundColorcxx . . $ SoXtRenderArea#setBackgroundColor(fad0b7baf6bfdbd3).(const SbColorcxx . . $ SbColor# &c) |
| 136 | { sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->setBackgroundColorcxx . . $ SoSceneManager#setBackgroundColor(fad0b7baf6bfdbd3).(c); } |
| 137 | // C-api: name=getBkgCol |
| 138 | const SbColorcxx . . $ SbColor# & getBackgroundColorcxx . . $ SoXtRenderArea#getBackgroundColor(d23318ddecff63dd).() const |
| 139 | { return sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->getBackgroundColorcxx . . $ SoSceneManager#getBackgroundColor(d23318ddecff63dd).(); } |
| 140 | |
| 141 | // |
| 142 | // Sets/gets the window background color when in color index mode. |
| 143 | // (default to black (index 0)). |
| 144 | // |
| 145 | // C-api: name=setBkgInd |
| 146 | void setBackgroundIndexcxx . . $ SoXtRenderArea#setBackgroundIndex(d4f767463ce0a6b3).(int index) |
| 147 | { sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->setBackgroundIndexcxx . . $ SoSceneManager#setBackgroundIndex(d4f767463ce0a6b3).(index); } |
| 148 | // C-api: name=getBkgInd |
| 149 | int getBackgroundIndexcxx . . $ SoXtRenderArea#getBackgroundIndex(455f465bc33b4cdf).() const |
| 150 | { return sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->getBackgroundIndexcxx . . $ SoSceneManager#getBackgroundIndex(455f465bc33b4cdf).(); } |
| 151 | |
| 152 | // |
| 153 | // Sets/gets the overlay window background color index. |
| 154 | // (default to 0 (clear color)). |
| 155 | // |
| 156 | // C-api: name=setOverBkgInd |
| 157 | void setOverlayBackgroundIndexcxx . . $ SoXtRenderArea#setOverlayBackgroundIndex(d4f767463ce0a6b3).(int index) |
| 158 | { overlaySceneMgrcxx . . $ SoXtRenderArea#overlaySceneMgr.->setBackgroundIndexcxx . . $ SoSceneManager#setBackgroundIndex(d4f767463ce0a6b3).(index); } |
| 159 | // C-api: name=getOverBkgInd |
| 160 | int getOverlayBackgroundIndexcxx . . $ SoXtRenderArea#getOverlayBackgroundIndex(455f465bc33b4cdf).() const |
| 161 | { return overlaySceneMgrcxx . . $ SoXtRenderArea#overlaySceneMgr.->getBackgroundIndexcxx . . $ SoSceneManager#getBackgroundIndex(455f465bc33b4cdf).(); } |
| 162 | |
| 163 | // |
| 164 | // Sets the colors to use when displaying in color index mode. |
| 165 | // |
| 166 | // C-api: name=setColMap |
| 167 | void setColorMapcxx . . $ SoXtRenderArea#setColorMap(dc2565f915532ad7).(int startIndex, int num, const SbColorcxx . . $ SbColor# *colors); |
| 168 | |
| 169 | // |
| 170 | // Sets the colors to use for overlay bit planes. |
| 171 | // |
| 172 | // C-api: name=setOverColMap |
| 173 | void setOverlayColorMapcxx . . $ SoXtRenderArea#setOverlayColorMap(dc2565f915532ad7).(int startIndex, int num, const SbColorcxx . . $ SbColor# *colors); |
| 174 | |
| 175 | // Sets/gets current viewport region to use for rendering |
| 176 | // C-api: name=setVPReg |
| 177 | void setViewportRegioncxx . . $ SoXtRenderArea#setViewportRegion(6b06d788389016cd).(const SbViewportRegioncxx . . $ SbViewportRegion# &newRegion) |
| 178 | { sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->getGLRenderActioncxx . . $ SoSceneManager#getGLRenderAction(3c6e1ebd9c702b1e).()->setViewportRegioncxx . . $ SoGLRenderAction#setViewportRegion(6b06d788389016cd).(newRegion); } |
| 179 | // C-api: name=getVPReg |
| 180 | const SbViewportRegioncxx . . $ SbViewportRegion# &getViewportRegioncxx . . $ SoXtRenderArea#getViewportRegion(991ad71cd09969ad).() const |
| 181 | { return sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->getGLRenderActioncxx . . $ SoSceneManager#getGLRenderAction(3c6e1ebd9c702b1e).()->getViewportRegioncxx . . $ SoGLRenderAction#getViewportRegion(991ad71cd09969ad).(); } |
| 182 | |
| 183 | // |
| 184 | // Transparency level setting methods which specifies how |
| 185 | // transparent objects are rendered (quality/speed trade off). |
| 186 | // |
| 187 | // C-api: name=setTranspType |
| 188 | void setTransparencyTypecxx . . $ SoXtRenderArea#setTransparencyType(8f19ff67a6c488dd).(SoGLRenderActioncxx . . $ SoGLRenderAction#::TransparencyTypecxx . . $ SoGLRenderAction#TransparencyType# type); |
| 189 | // C-api: name=getTranspType |
| 190 | SoGLRenderActioncxx . . $ SoGLRenderAction#::TransparencyTypecxx . . $ SoGLRenderAction#TransparencyType# getTransparencyTypecxx . . $ SoXtRenderArea#getTransparencyType(813fd8548af75531).() const |
| 191 | { return sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->getGLRenderActioncxx . . $ SoSceneManager#getGLRenderAction(3c6e1ebd9c702b1e).()->getTransparencyTypecxx . . $ SoGLRenderAction#getTransparencyType(813fd8548af75531).(); } |
| 192 | |
| 193 | |
| 194 | // |
| 195 | // Anti-aliasing methods. |
| 196 | // |
| 197 | void setAntialiasingcxx . . $ SoXtRenderArea#setAntialiasing(3e454b8ccf442868).(SbBoolcxx . . $ SbBool# smoothing, int numPasses); |
| 198 | void getAntialiasingcxx . . $ SoXtRenderArea#getAntialiasing(4bd75fe21bbdda99).(SbBoolcxx . . $ SbBool# &smoothing, int &numPasses) const |
| 199 | { sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->getAntialiasingcxx . . $ SoSceneManager#getAntialiasing(4bd75fe21bbdda99).(smoothing, numPasses); } |
| 200 | |
| 201 | // |
| 202 | // Enable/prevent window clearing from happening before a rendering |
| 203 | // starts (default is clearBeforeRender TRUE). |
| 204 | // |
| 205 | void setClearBeforeRendercxx . . $ SoXtRenderArea#setClearBeforeRender(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# trueOrFalse) |
| 206 | { clearFirstcxx . . $ SoXtRenderArea#clearFirst. = trueOrFalse; } |
| 207 | SbBoolcxx . . $ SbBool# isClearBeforeRendercxx . . $ SoXtRenderArea#isClearBeforeRender(455f465bc33b4cdf).() const |
| 208 | { return clearFirstcxx . . $ SoXtRenderArea#clearFirst.; } |
| 209 | // C-api: name=setClearBeforeOverRender |
| 210 | void setClearBeforeOverlayRendercxx . . $ SoXtRenderArea#setClearBeforeOverlayRender(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# trueOrFalse) |
| 211 | { clearOverlayFirstcxx . . $ SoXtRenderArea#clearOverlayFirst. = trueOrFalse; } |
| 212 | // C-api: name=isClearBeforeOverRender |
| 213 | SbBoolcxx . . $ SbBool# isClearBeforeOverlayRendercxx . . $ SoXtRenderArea#isClearBeforeOverlayRender(455f465bc33b4cdf).() const |
| 214 | { return clearOverlayFirstcxx . . $ SoXtRenderArea#clearOverlayFirst.; } |
| 215 | |
| 216 | // |
| 217 | // The render area will automatically redraw whenever something |
| 218 | // in the scene graph changes. Passing FALSE to setAutoRedraw() |
| 219 | // will disable this feature. NOTE: the render area will always |
| 220 | // redraw in response to window system events (e.g. resize, exposure) |
| 221 | // regardless of the setting of the auto redraw flag. |
| 222 | void setAutoRedrawcxx . . $ SoXtRenderArea#setAutoRedraw(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# trueOrFalse); |
| 223 | SbBoolcxx . . $ SbBool# isAutoRedrawcxx . . $ SoXtRenderArea#isAutoRedraw(455f465bc33b4cdf).() const { return autoRedrawcxx . . $ SoXtRenderArea#autoRedraw.; } |
| 224 | |
| 225 | // Sets/gets the priority of the redraw sensor and get the |
| 226 | // default priority number. |
| 227 | void setRedrawPrioritycxx . . $ SoXtRenderArea#setRedrawPriority(cb2f890c2fdad230).(uint32_tcxx . . $ uint32_t# priority) |
| 228 | { sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->setRedrawPrioritycxx . . $ SoSceneManager#setRedrawPriority(cb2f890c2fdad230).(priority); |
| 229 | overlaySceneMgrcxx . . $ SoXtRenderArea#overlaySceneMgr.->setRedrawPrioritycxx . . $ SoSceneManager#setRedrawPriority(cb2f890c2fdad230).(priority); } |
| 230 | uint32_tcxx . . $ uint32_t# getRedrawPrioritycxx . . $ SoXtRenderArea#getRedrawPriority(ddd8539a2fcdd4ce).() const |
| 231 | { return sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->getRedrawPrioritycxx . . $ SoSceneManager#getRedrawPriority(ddd8539a2fcdd4ce).(); } |
| 232 | static uint32_tcxx . . $ uint32_t# getDefaultRedrawPrioritycxx . . $ SoXtRenderArea#getDefaultRedrawPriority(db52760e79bf9054).() |
| 233 | { return SoSceneManagercxx . . $ SoSceneManager#::getDefaultRedrawPrioritycxx . . $ SoSceneManager#getDefaultRedrawPriority(db52760e79bf9054).(); } |
| 234 | |
| 235 | // |
| 236 | // Calling this forces the render area to be redrawn now. |
| 237 | // It is not necessary to call this method if auto redraw is enabled |
| 238 | // (which is the default). |
| 239 | // |
| 240 | void rendercxx . . $ SoXtRenderArea#render(49f6e7a06ebc5aa8).() { redrawcxx . . $ SoXtRenderArea#redraw(49f6e7a06ebc5aa8).(); } |
| 241 | // C-api: name=renderOver |
| 242 | void renderOverlaycxx . . $ SoXtRenderArea#renderOverlay(49f6e7a06ebc5aa8).() { redrawOverlaycxx . . $ SoXtRenderArea#redrawOverlay(49f6e7a06ebc5aa8).(); } |
| 243 | |
| 244 | // |
| 245 | // Schedule a redraw to happen sometime soon. This will schedule the redraw sensor |
| 246 | // if auto-redraw is TRUE (default) else cause an immediate redraw of the scene if |
| 247 | // auto-redraw if FALSE. |
| 248 | // |
| 249 | void scheduleRedrawcxx . . $ SoXtRenderArea#scheduleRedraw(49f6e7a06ebc5aa8).(); |
| 250 | // C-api: name=scheduleOverRedraw |
| 251 | void scheduleOverlayRedrawcxx . . $ SoXtRenderArea#scheduleOverlayRedraw(49f6e7a06ebc5aa8).(); |
| 252 | |
| 253 | // Call this convenience method to have this render area redraw |
| 254 | // whenever the selection list changes in the passed node. This |
| 255 | // is useful if using a highlight render action like the |
| 256 | // SoBoxHighlightRenderAction to correctly render whenever the |
| 257 | // selection changes. Pass NULL to turn this off. |
| 258 | // C-api: name=redrawOnSelChange |
| 259 | void redrawOnSelectionChangecxx . . $ SoXtRenderArea#redrawOnSelectionChange(bc31d672c7569b57).(SoSelectioncxx . . $ SoSelection# *s); |
| 260 | // C-api: name=redrawOverOnSelChange |
| 261 | void redrawOverlayOnSelectionChangecxx . . $ SoXtRenderArea#redrawOverlayOnSelectionChange(bc31d672c7569b57).(SoSelectioncxx . . $ SoSelection# *s); |
| 262 | |
| 263 | // |
| 264 | // Register an application callback for handling events that |
| 265 | // occurs in the window, instead of sending them down the graph. |
| 266 | // Callback should return TRUE if it handled the event. |
| 267 | // If callback returns FALSE, then the event will be sent |
| 268 | // to the scene graph. |
| 269 | // |
| 270 | // C-api: name=setEvCB |
| 271 | void setEventCallbackcxx . . $ SoXtRenderArea#setEventCallback(8410018df07e2848).( |
| 272 | SoXtRenderAreaEventCBcxx . . $ SoXtRenderAreaEventCB# *fcn, |
| 273 | void *userData = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 274 | { appEventHandlercxx . . $ SoXtRenderArea#appEventHandler. = fcn; appEventHandlerDatacxx . . $ SoXtRenderArea#appEventHandlerData. = userData; } |
| 275 | |
| 276 | // Access to the scene manager |
| 277 | // C-api: name=setSceneMgr |
| 278 | void setSceneManagercxx . . $ SoXtRenderArea#setSceneManager(3c408f1a5afcb233).(SoSceneManagercxx . . $ SoSceneManager# *sm) { sceneMgrcxx . . $ SoXtRenderArea#sceneMgr. = sm; } |
| 279 | // C-api: name=getSceneMgr |
| 280 | SoSceneManagercxx . . $ SoSceneManager# * getSceneManagercxx . . $ SoXtRenderArea#getSceneManager(70e0ae560043361f).() const { return sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.; } |
| 281 | // C-api: name=setOverSceneMgr |
| 282 | void setOverlaySceneManagercxx . . $ SoXtRenderArea#setOverlaySceneManager(3c408f1a5afcb233).(SoSceneManagercxx . . $ SoSceneManager# *sm) { overlaySceneMgrcxx . . $ SoXtRenderArea#overlaySceneMgr. = sm; } |
| 283 | // C-api: name=getOverSceneMgr |
| 284 | SoSceneManagercxx . . $ SoSceneManager# * getOverlaySceneManagercxx . . $ SoXtRenderArea#getOverlaySceneManager(70e0ae560043361f).() const { return overlaySceneMgrcxx . . $ SoXtRenderArea#overlaySceneMgr.; } |
| 285 | |
| 286 | // Access to GL render action |
| 287 | // C-api: name=setGLRenderAct |
| 288 | void setGLRenderActioncxx . . $ SoXtRenderArea#setGLRenderAction(5c806c737f468e18).(SoGLRenderActioncxx . . $ SoGLRenderAction# *ra) |
| 289 | { sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->setGLRenderActioncxx . . $ SoSceneManager#setGLRenderAction(5c806c737f468e18).(ra); } |
| 290 | // C-api: name=getGLRenderAct |
| 291 | SoGLRenderActioncxx . . $ SoGLRenderAction# *getGLRenderActioncxx . . $ SoXtRenderArea#getGLRenderAction(3c6e1ebd9c702b1e).() const |
| 292 | { return sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.->getGLRenderActioncxx . . $ SoSceneManager#getGLRenderAction(3c6e1ebd9c702b1e).(); } |
| 293 | |
| 294 | // Access to overlay GL render action |
| 295 | // C-api: name=setOverGLRenderAct |
| 296 | void setOverlayGLRenderActioncxx . . $ SoXtRenderArea#setOverlayGLRenderAction(5c806c737f468e18).(SoGLRenderActioncxx . . $ SoGLRenderAction# *ra) |
| 297 | { overlaySceneMgrcxx . . $ SoXtRenderArea#overlaySceneMgr.->setGLRenderActioncxx . . $ SoSceneManager#setGLRenderAction(5c806c737f468e18).(ra); } |
| 298 | // C-api: name=getOverGLRenderAct |
| 299 | SoGLRenderActioncxx . . $ SoGLRenderAction# *getOverlayGLRenderActioncxx . . $ SoXtRenderArea#getOverlayGLRenderAction(3c6e1ebd9c702b1e).() const |
| 300 | { return overlaySceneMgrcxx . . $ SoXtRenderArea#overlaySceneMgr.->getGLRenderActioncxx . . $ SoSceneManager#getGLRenderAction(3c6e1ebd9c702b1e).(); } |
| 301 | |
| 302 | protected: |
| 303 | |
| 304 | // |
| 305 | // This constructor takes a boolean whether to build the widget now. |
| 306 | // Subclasses can pass FALSE, then call SoXtRenderArea::buildWidget() |
| 307 | // when they are ready for it to be built. |
| 308 | |
| 309 | SoXtRenderAreacxx . . $ SoXtRenderArea#SoXtRenderArea(26afad19bb0e2fdd).( |
| 310 | Widgetcxx . . $ Widget# parent, |
| 311 | const char *name, |
| 312 | SbBoolcxx . . $ SbBool# buildInsideParent, |
| 313 | SbBoolcxx . . $ SbBool# getMouseInput, |
| 314 | SbBoolcxx . . $ SbBool# getKeyboardInput, |
| 315 | SbBoolcxx . . $ SbBool# buildNow); |
| 316 | |
| 317 | // |
| 318 | // redraw() calls actualRedraw(), followed by swapbuffers if necessary. |
| 319 | // actualRedraw will have the scene manager render the scene. Rendering |
| 320 | // is broken up into two routines like this so that subclasses can |
| 321 | // redefine or simply add to rendering (in actualRedraw) without having |
| 322 | // to worry about being visible, seting up the window or |
| 323 | // single/double buffer swapping. |
| 324 | // |
| 325 | virtual void redrawcxx . . $ SoXtRenderArea#redraw(49f6e7a06ebc5aa8).(); |
| 326 | virtual void actualRedrawcxx . . $ SoXtRenderArea#actualRedraw(49f6e7a06ebc5aa8).(); |
| 327 | virtual void redrawOverlaycxx . . $ SoXtRenderArea#redrawOverlay(49f6e7a06ebc5aa8).(); |
| 328 | virtual void actualOverlayRedrawcxx . . $ SoXtRenderArea#actualOverlayRedraw(49f6e7a06ebc5aa8).(); |
| 329 | |
| 330 | // |
| 331 | // Redefine these to do Inventor-specific things |
| 332 | // |
| 333 | virtual void processEventcxx . . $ SoXtRenderArea#processEvent(63113e41a3ee5b9d).(XAnyEventcxx . . $ XAnyEvent# *anyevent); |
| 334 | virtual void initGraphiccxx . . $ SoXtRenderArea#initGraphic(49f6e7a06ebc5aa8).(); |
| 335 | virtual void initOverlayGraphiccxx . . $ SoXtRenderArea#initOverlayGraphic(49f6e7a06ebc5aa8).(); |
| 336 | virtual void sizeChangedcxx . . $ SoXtRenderArea#sizeChanged(8bc400dc8eb33072).(const SbVec2scxx . . $ SbVec2s# &newSize); |
| 337 | virtual void widgetChangedcxx . . $ SoXtRenderArea#widgetChanged(cfa999c5a14729dd).(Widgetcxx . . $ Widget#); |
| 338 | |
| 339 | Widgetcxx . . $ Widget# buildWidgetcxx . . $ SoXtRenderArea#buildWidget(a686be44a4028679).(Widgetcxx . . $ Widget# parent); |
| 340 | |
| 341 | // redefine these |
| 342 | virtual const char * getDefaultWidgetNamecxx . . $ SoXtRenderArea#getDefaultWidgetName(a9f41ea0e82d88cf).() const; |
| 343 | virtual const char * getDefaultTitlecxx . . $ SoXtRenderArea#getDefaultTitle(a9f41ea0e82d88cf).() const; |
| 344 | virtual const char * getDefaultIconTitlecxx . . $ SoXtRenderArea#getDefaultIconTitle(a9f41ea0e82d88cf).() const; |
| 345 | |
| 346 | // subclasses have access to the device list for event processing |
| 347 | SbPListcxx . . $ SbPList# *deviceListcxx . . $ SoXtRenderArea#deviceList.; // list of devices |
| 348 | |
| 349 | // application event callback variables |
| 350 | SoXtRenderAreaEventCBcxx . . $ SoXtRenderAreaEventCB# *appEventHandlercxx . . $ SoXtRenderArea#appEventHandler.; |
| 351 | void *appEventHandlerDatacxx . . $ SoXtRenderArea#appEventHandlerData.; |
| 352 | // invoke the application event callback - returns what the app cb returns |
| 353 | SbBoolcxx . . $ SbBool# invokeAppCBcxx . . $ SoXtRenderArea#invokeAppCB(512c1ba9431588f7).(XAnyEventcxx . . $ XAnyEvent# *anyevent); |
| 354 | |
| 355 | private: |
| 356 | // these make rendering/redrawing happen |
| 357 | SoSceneManagercxx . . $ SoSceneManager# *sceneMgrcxx . . $ SoXtRenderArea#sceneMgr.; // this manages rendering and events |
| 358 | SoSceneManagercxx . . $ SoSceneManager# *overlaySceneMgrcxx . . $ SoXtRenderArea#overlaySceneMgr.; // manages the overlay scene graph |
| 359 | SbBoolcxx . . $ SbBool# clearFirstcxx . . $ SoXtRenderArea#clearFirst., clearOverlayFirstcxx . . $ SoXtRenderArea#clearOverlayFirst.; // call clear() before rendering |
| 360 | SbBoolcxx . . $ SbBool# autoRedrawcxx . . $ SoXtRenderArea#autoRedraw.; // if TRUE, then we automatically redraw |
| 361 | XColorcxx . . $ XColor# *mapColorscxx . . $ SoXtRenderArea#mapColors., *overlayMapColorscxx . . $ SoXtRenderArea#overlayMapColors.; // saved colors |
| 362 | int mapColorNumcxx . . $ SoXtRenderArea#mapColorNum., overlayMapColorNumcxx . . $ SoXtRenderArea#overlayMapColorNum.; // number of saved colors |
| 363 | |
| 364 | SoXtMousecxx . . $ SoXtMouse# *mouseDevicecxx . . $ SoXtRenderArea#mouseDevice.; |
| 365 | SoXtKeyboardcxx . . $ SoXtKeyboard# *keybdDevicecxx . . $ SoXtRenderArea#keybdDevice.; |
| 366 | void reinstallDevicescxx . . $ SoXtRenderArea#reinstallDevices(cfa999c5a14729dd).(Widgetcxx . . $ Widget# newWidget); |
| 367 | |
| 368 | static void selectionChangeCBcxx . . $ SoXtRenderArea#selectionChangeCB(92200bdfa0112167).(void *userData, SoSelectioncxx . . $ SoSelection# *s); |
| 369 | static void overlaySelectionChangeCBcxx . . $ SoXtRenderArea#overlaySelectionChangeCB(92200bdfa0112167).(void *userData, SoSelectioncxx . . $ SoSelection# *s); |
| 370 | SoSelectioncxx . . $ SoSelection# *selectioncxx . . $ SoXtRenderArea#selection., *overlaySelectioncxx . . $ SoXtRenderArea#overlaySelection.; |
| 371 | Widgetcxx . . $ Widget# deviceWidgetcxx . . $ SoXtRenderArea#deviceWidget.; |
| 372 | |
| 373 | // static callbacks |
| 374 | SbBoolcxx . . $ SbBool# firstEventcxx . . $ SoXtRenderArea#firstEvent.; // used to init the action SoWindowElement |
| 375 | static void windowEventCBcxx . . $ SoXtRenderArea#windowEventCB(f4042e4f3f72b4b).(Widgetcxx . . $ Widget#, SoXtRenderAreacxx . . $ SoXtRenderArea# *, XAnyEventcxx . . $ XAnyEvent# *, Booleancxx . . $ Boolean# *); |
| 376 | static void renderCBcxx . . $ SoXtRenderArea#renderCB(5a4f527593921cc6).(void *, SoSceneManagercxx . . $ SoSceneManager# *); |
| 377 | static void renderOverlayCBcxx . . $ SoXtRenderArea#renderOverlayCB(5a4f527593921cc6).(void *, SoSceneManagercxx . . $ SoSceneManager# *); |
| 378 | |
| 379 | static void visibilityChangeCBcxx . . $ SoXtRenderArea#visibilityChangeCB(d0320739773070f2).(void *pt, SbBoolcxx . . $ SbBool# visible); |
| 380 | void activatecxx . . $ SoXtRenderArea#activate(49f6e7a06ebc5aa8).(); // connects the sensor |
| 381 | void deactivatecxx . . $ SoXtRenderArea#deactivate(49f6e7a06ebc5aa8).(); // disconnects the sensor |
| 382 | |
| 383 | // this is called by both constructors |
| 384 | void constructorCommoncxx . . $ SoXtRenderArea#constructorCommon(b1146eedae1e1d0b).( |
| 385 | SbBoolcxx . . $ SbBool# getMouseInput, |
| 386 | SbBoolcxx . . $ SbBool# getKeyboardInput, |
| 387 | SbBoolcxx . . $ SbBool# buildNow); |
| 388 | }; |
| 389 | |
| 390 | |
| 391 | #endif /* _SO_XT_RENDER_AREA_H_ */ |
| 392 |