| 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 | /* |
| 38 | * Copyright (C) 1990-93 Silicon Graphics, Inc. |
| 39 | * |
| 40 | _______________________________________________________________________ |
| 41 | ______________ S I L I C O N G R A P H I C S I N C . ____________ |
| 42 | | |
| 43 | | $Revision: 1.2 $ |
| 44 | | |
| 45 | | Classes : SoXtViewer |
| 46 | | |
| 47 | | Author(s) : Alain Dumesny |
| 48 | | |
| 49 | ______________ S I L I C O N G R A P H I C S I N C . ____________ |
| 50 | _______________________________________________________________________ |
| 51 | */ |
| 52 | |
| 53 | #include <inttypes.h> |
| 54 | #include <cstdio> |
| 55 | #include <cmath> |
| 56 | #include <cstring> |
| 57 | |
| 58 | #include <X11/Intrinsic.h> |
| 59 | #include <X11/Xlib.h> |
| 60 | #include <X11/keysym.h> |
| 61 | |
| 62 | #ifdef __sgi |
| 63 | #include <X11/extensions/SGIStereo.h> |
| 64 | #endif |
| 65 | |
| 66 | #include <GL/gl.h> |
| 67 | #include <GL/glu.h> |
| 68 | #include <Inventor/SbBox.h>cxx . . $ `<file>/lib/database/include/Inventor/SbBox.h`/ |
| 69 | #include <Inventor/SbLinear.h>cxx . . $ `<file>/lib/database/include/Inventor/SbLinear.h`/ |
| 70 | #include <Inventor/SbPList.h>cxx . . $ `<file>/lib/database/include/Inventor/SbPList.h`/ |
| 71 | #include <Inventor/SbViewportRegion.h>cxx . . $ `<file>/lib/database/include/Inventor/SbViewportRegion.h`/ |
| 72 | #include <Inventor/SoDB.h>cxx . . $ `<file>/lib/database/include/Inventor/SoDB.h`/ |
| 73 | #include <Inventor/SoPath.h>cxx . . $ `<file>/lib/database/include/Inventor/SoPath.h`/ |
| 74 | #include <Inventor/SoPath.h>cxx . . $ `<file>/lib/database/include/Inventor/SoPath.h`/ |
| 75 | #include <Inventor/SoPickedPoint.h>cxx . . $ `<file>/lib/database/include/Inventor/SoPickedPoint.h`/ |
| 76 | #include <Inventor/actions/SoGetBoundingBoxAction.h>cxx . . $ `<file>/lib/database/include/Inventor/actions/SoGetBoundingBoxAction.h`/ |
| 77 | #include <Inventor/actions/SoRayPickAction.h>cxx . . $ `<file>/lib/database/include/Inventor/actions/SoRayPickAction.h`/ |
| 78 | #include <Inventor/actions/SoSearchAction.h>cxx . . $ `<file>/lib/database/include/Inventor/actions/SoSearchAction.h`/ |
| 79 | #include <Inventor/errors/SoDebugError.h>cxx . . $ `<file>/lib/database/include/Inventor/errors/SoDebugError.h`/ |
| 80 | #include <Inventor/nodes/SoPackedColor.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoPackedColor.h`/ |
| 81 | #include <Inventor/nodes/SoMaterialBinding.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoMaterialBinding.h`/ |
| 82 | #include <Inventor/nodes/SoComplexity.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoComplexity.h`/ |
| 83 | #include <Inventor/nodes/SoDirectionalLight.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoDirectionalLight.h`/ |
| 84 | #include <Inventor/nodes/SoDrawStyle.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoDrawStyle.h`/ |
| 85 | #include <Inventor/nodes/SoGroup.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoGroup.h`/ |
| 86 | #include <Inventor/nodes/SoLightModel.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoLightModel.h`/ |
| 87 | #include <Inventor/nodes/SoOrthographicCamera.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoOrthographicCamera.h`/ |
| 88 | #include <Inventor/nodes/SoPerspectiveCamera.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoPerspectiveCamera.h`/ |
| 89 | #include <Inventor/nodes/SoResetTransform.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoResetTransform.h`/ |
| 90 | #include <Inventor/nodes/SoRotation.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoRotation.h`/ |
| 91 | #include <Inventor/nodes/SoSeparator.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoSeparator.h`/ |
| 92 | #include <Inventor/nodes/SoSwitch.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoSwitch.h`/ |
| 93 | #include <Inventor/nodes/SoLocateHighlight.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoLocateHighlight.h`/ |
| 94 | #include <Inventor/sensors/SoFieldSensor.h>cxx . . $ `<file>/lib/database/include/Inventor/sensors/SoFieldSensor.h`/ |
| 95 | #include <Inventor/fields/SoSFTime.h>cxx . . $ `<file>/lib/database/include/Inventor/fields/SoSFTime.h`/ |
| 96 | #include <Inventor/Xt/devices/SoXtInputFocus.h>cxx . . $ `<file>/libSoXt/include/Inventor/Xt/devices/SoXtInputFocus.h`/ |
| 97 | #include <Inventor/Xt/SoXtClipboard.h>cxx . . $ `<file>/libSoXt/include/Inventor/Xt/SoXtClipboard.h`/ |
| 98 | #include <Inventor/Xt/viewers/SoXtViewer.h>cxx . . $ `<file>/libSoXt/include/Inventor/Xt/viewers/SoXtViewer.h`/ |
| 99 | |
| 100 | // keep a pointer to global time, since we are going to access it a lot. |
| 101 | SoSFTimecxx . . $ SoSFTime# *SoXtViewercxx . . $ SoXtViewer#::viewerRealTimecxx . . $ SoXtViewer#viewerRealTime. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 102 | |
| 103 | |
| 104 | //////////////////////////////////////////////////////////////////////// |
| 105 | // |
| 106 | // Constructor. |
| 107 | // |
| 108 | // Use: protected |
| 109 | |
| 110 | SoXtViewercxx . . $ SoXtViewer#::SoXtViewercxx . . $ SoXtViewer#SoXtViewer(ce5bf360518dc332).( |
| 111 | Widgetcxx . . $ Widget# parent, |
| 112 | const char *name, |
| 113 | SbBoolcxx . . $ SbBool# buildInsideParent, |
| 114 | SoXtViewercxx . . $ SoXtViewer#::Typecxx . . $ SoXtViewer#Type# t, |
| 115 | SbBoolcxx . . $ SbBool# buildNow) |
| 116 | : SoXtRenderAreacxx . . $ SoXtRenderArea#( |
| 117 | parent, |
| 118 | name, |
| 119 | buildInsideParent, |
| 120 | TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!, // getMouseInput |
| 121 | TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!, // getKeyboardInput |
| 122 | FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!) // buildNow |
| 123 | // |
| 124 | //////////////////////////////////////////////////////////////////////// |
| 125 | { |
| 126 | // init local vars |
| 127 | typecxx . . $ SoXtViewer#type. = t; |
| 128 | cameracxx . . $ SoXtViewer#camera. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 129 | cameraTypecxx . . $ SoXtViewer#cameraType. =cxx . . $ SoType#`operator=`(b492e65b06badd05). SoPerspectiveCameracxx . . $ SoPerspectiveCamera#::getClassTypeIdcxx . . $ SoPerspectiveCamera#getClassTypeId(c00c150378d2b968).(); |
| 130 | createdCameracxx . . $ SoXtViewer#createdCamera. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 131 | viewingFlagcxx . . $ SoXtViewer#viewingFlag. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 132 | altSwitchBackcxx . . $ SoXtViewer#altSwitchBack. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 133 | cursorEnabledFlagcxx . . $ SoXtViewer#cursorEnabledFlag. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 134 | interactiveFlagcxx . . $ SoXtViewer#interactiveFlag. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 135 | startCBListcxx . . $ SoXtViewer#startCBList. = new SoCallbackListcxx . . $ SoCallbackList#SoCallbackList(49f6e7a06ebc5aa8).; |
| 136 | finishCBListcxx . . $ SoXtViewer#finishCBList. = new SoCallbackListcxx . . $ SoCallbackList#SoCallbackList(49f6e7a06ebc5aa8).; |
| 137 | interactiveCountcxx . . $ SoXtViewer#interactiveCount. = 0; |
| 138 | bufferTypecxx . . $ SoXtViewer#bufferType. = isDoubleBuffercxx . . $ SoXtGLWidget#isDoubleBuffer(b126dc7c1de90089).() ? BUFFER_DOUBLEcxx . . $ SoXtViewer#BUFFER_DOUBLE. : BUFFER_SINGLEcxx . . $ SoXtViewer#BUFFER_SINGLE.; |
| 139 | stereoOffsetcxx . . $ SoXtViewer#stereoOffset. = 3.0; |
| 140 | #ifdef __sgi |
| 141 | useSGIStereoExt = FALSE; |
| 142 | #endif |
| 143 | sceneSizecxx . . $ SoXtViewer#sceneSize. = 0.0; // not computed yet. |
| 144 | viewerSpeedcxx . . $ SoXtViewer#viewerSpeed. = 1.0; // default. SoXtFullViewer add UI to increase/decrease |
| 145 | |
| 146 | // add Enter and Leave notify events for the viewers |
| 147 | inputFocuscxx . . $ SoXtViewer#inputFocus. = new SoXtInputFocuscxx . . $ SoXtInputFocus#; |
| 148 | registerDevicecxx . . $ SoXtRenderArea#registerDevice(887581b3a9692db2).(inputFocuscxx . . $ SoXtViewer#inputFocus.); |
| 149 | |
| 150 | if (! viewerRealTimecxx . . $ SoXtViewer#viewerRealTime.) |
| 151 | viewerRealTimecxx . . $ SoXtViewer#viewerRealTime. = (SoSFTimecxx . . $ SoSFTime# *) SoDBcxx . . $ SoDB#::getGlobalFieldcxx . . $ SoDB#getGlobalField(aabb25e694501292).("realTime"cxx . . $ SbName#SbName(85c52e162fed56f9).); |
| 152 | |
| 153 | // init auto clipping stuff |
| 154 | autoClipFlagcxx . . $ SoXtViewer#autoClipFlag. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 155 | minimumNearPlanecxx . . $ SoXtViewer#minimumNearPlane. = 0.001; |
| 156 | autoClipBboxActioncxx . . $ SoXtViewer#autoClipBboxAction. = new SoGetBoundingBoxActioncxx . . $ SoGetBoundingBoxAction#SoGetBoundingBoxAction(6b06d788389016cd).(SbVec2scxx . . $ SbViewportRegion#SbViewportRegion(edd509d4d7dd9f6).(1,1)); // ??? no valid size yet |
| 157 | |
| 158 | // copy/paste support |
| 159 | clipboardcxx . . $ SoXtViewer#clipboard. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 160 | |
| 161 | // init seek animation variables |
| 162 | seekDistancecxx . . $ SoXtViewer#seekDistance. = 50.0; |
| 163 | seekDistAsPercentagecxx . . $ SoXtViewer#seekDistAsPercentage. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 164 | seekModeFlagcxx . . $ SoXtViewer#seekModeFlag. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 165 | detailSeekFlagcxx . . $ SoXtViewer#detailSeekFlag. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 166 | seekAnimTimecxx . . $ SoXtViewer#seekAnimTime. = 2.0; |
| 167 | seekAnimationSensorcxx . . $ SoXtViewer#seekAnimationSensor. = new SoFieldSensorcxx . . $ SoFieldSensor#(SoXtViewercxx . . $ SoXtViewer#::seekAnimationSensorCBcxx . . $ SoXtViewer#seekAnimationSensorCB(c8d298b3e215c027)., this); |
| 168 | |
| 169 | // |
| 170 | // build the small internal graph (nodes used for draw style stuff) |
| 171 | // |
| 172 | sceneRootcxx . . $ SoXtViewer#sceneRoot. = new SoSeparatorcxx . . $ SoSeparator#SoSeparator(d4f767463ce0a6b3).(4); |
| 173 | drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch. = new SoSwitchcxx . . $ SoSwitch#(6); |
| 174 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode. = new SoDrawStylecxx . . $ SoDrawStyle#; |
| 175 | lightModelNodecxx . . $ SoXtViewer#lightModelNode. = new SoLightModelcxx . . $ SoLightModel#; |
| 176 | colorNodecxx . . $ SoXtViewer#colorNode. = new SoPackedColorcxx . . $ SoPackedColor#; |
| 177 | matBindingNodecxx . . $ SoXtViewer#matBindingNode. = new SoMaterialBindingcxx . . $ SoMaterialBinding#; |
| 178 | complexityNodecxx . . $ SoXtViewer#complexityNode. = new SoComplexitycxx . . $ SoComplexity#; |
| 179 | sceneGraphcxx . . $ SoXtViewer#sceneGraph. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 180 | |
| 181 | // note: we cannot setSceneGraph on the renderArea in the constructor |
| 182 | // since it calls virtual functions, and all of our members aren't |
| 183 | // initialized yet. We'll call it the first time our setSceneGraph |
| 184 | // is called. |
| 185 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->refcxx . . $ SoBase#ref(83f5f38750778ac8).(); |
| 186 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->renderCachingcxx . . $ SoSeparator#renderCaching..setValuecxx . . $ SoSFEnum#setValue(d4f767463ce0a6b3).(SoSeparatorcxx . . $ SoSeparator#::OFFcxx . . $ SoSeparator#OFF.); // no caching there |
| 187 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->renderCullingcxx . . $ SoSeparator#renderCulling..setValuecxx . . $ SoSFEnum#setValue(d4f767463ce0a6b3).(SoSeparatorcxx . . $ SoSeparator#::OFFcxx . . $ SoSeparator#OFF.); // no culling there |
| 188 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch.); |
| 189 | drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.); |
| 190 | drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(lightModelNodecxx . . $ SoXtViewer#lightModelNode.); |
| 191 | drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(colorNodecxx . . $ SoXtViewer#colorNode.); |
| 192 | drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(matBindingNodecxx . . $ SoXtViewer#matBindingNode.); |
| 193 | drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(complexityNodecxx . . $ SoXtViewer#complexityNode.); |
| 194 | |
| 195 | // set the draw style vars and fields that don't change - once we |
| 196 | // have a context, will will use glGetString() to pick a better default |
| 197 | // draw style. |
| 198 | stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle. = VIEW_AS_IScxx . . $ SoXtViewer#VIEW_AS_IS.; |
| 199 | interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. = VIEW_SAME_AS_STILLcxx . . $ SoXtViewer#VIEW_SAME_AS_STILL.; |
| 200 | checkForDrawStylecxx . . $ SoXtViewer#checkForDrawStyle. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 201 | drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch.->whichChildcxx . . $ SoSwitch#whichChild. =cxx . . $ SoSFInt32#`operator=`(7864480464b09eea). SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`!; |
| 202 | |
| 203 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->setOverridecxx . . $ SoNode#setOverride(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); // only use style field |
| 204 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->pointSizecxx . . $ SoDrawStyle#pointSize. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). 3.0; |
| 205 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->lineWidthcxx . . $ SoDrawStyle#lineWidth..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 206 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->linePatterncxx . . $ SoDrawStyle#linePattern..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 207 | |
| 208 | lightModelNodecxx . . $ SoXtViewer#lightModelNode.->setOverridecxx . . $ SoNode#setOverride(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 209 | |
| 210 | colorNodecxx . . $ SoXtViewer#colorNode.->setOverridecxx . . $ SoNode#setOverride(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 211 | |
| 212 | matBindingNodecxx . . $ SoXtViewer#matBindingNode.->setOverridecxx . . $ SoNode#setOverride(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 213 | matBindingNodecxx . . $ SoXtViewer#matBindingNode.->valuecxx . . $ SoMaterialBinding#value. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoMaterialBindingcxx . . $ SoMaterialBinding#::OVERALLcxx . . $ SoMaterialBinding#OVERALL.; |
| 214 | |
| 215 | complexityNodecxx . . $ SoXtViewer#complexityNode.->setOverridecxx . . $ SoNode#setOverride(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 216 | complexityNodecxx . . $ SoXtViewer#complexityNode.->textureQualitycxx . . $ SoComplexity#textureQuality. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). 0; // always turn texture off under switch |
| 217 | complexityNodecxx . . $ SoXtViewer#complexityNode.->valuecxx . . $ SoComplexity#value. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). 0.15; |
| 218 | |
| 219 | addStartCallbackcxx . . $ SoXtViewer#addStartCallback(584743347ba26ea5).(SoXtViewercxx . . $ SoXtViewer#::drawStyleStartCallbackcxx . . $ SoXtViewer#drawStyleStartCallback(53b15af9fcb5e041).); |
| 220 | addFinishCallbackcxx . . $ SoXtViewer#addFinishCallback(584743347ba26ea5).(SoXtViewercxx . . $ SoXtViewer#::drawStyleFinishCallbackcxx . . $ SoXtViewer#drawStyleFinishCallback(53b15af9fcb5e041).); |
| 221 | |
| 222 | // |
| 223 | // headlightGroup - we have a rotation which keeps the headlight |
| 224 | // moving whenever the camera moves, and a reset xform so |
| 225 | // that the rest of the scene is not affected by the first rot. |
| 226 | // these leaves the direction field in the headlight open for the |
| 227 | // user to edit, allowing for the direction to change w.r.t. the camera. |
| 228 | // |
| 229 | headlightGroupcxx . . $ SoXtViewer#headlightGroup. = new SoGroupcxx . . $ SoGroup#(3); |
| 230 | headlightRotcxx . . $ SoXtViewer#headlightRot. = new SoRotationcxx . . $ SoRotation#; |
| 231 | headlightNodecxx . . $ SoXtViewer#headlightNode. = new SoDirectionalLightcxx . . $ SoDirectionalLight#; |
| 232 | headlightGroupcxx . . $ SoXtViewer#headlightGroup.->refcxx . . $ SoBase#ref(83f5f38750778ac8).(); |
| 233 | headlightGroupcxx . . $ SoXtViewer#headlightGroup.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(headlightRotcxx . . $ SoXtViewer#headlightRot.); |
| 234 | headlightGroupcxx . . $ SoXtViewer#headlightGroup.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(headlightNodecxx . . $ SoXtViewer#headlightNode.); |
| 235 | headlightGroupcxx . . $ SoXtViewer#headlightGroup.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(new SoResetTransformcxx . . $ SoResetTransform#); |
| 236 | headlightNodecxx . . $ SoXtViewer#headlightNode.->directioncxx . . $ SoDirectionalLight#direction..setValuecxx . . $ SoSFVec3f#setValue(65a601b9d70571d6).(SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(.2, -.2, -.9797958971)); |
| 237 | headlightFlagcxx . . $ SoXtViewer#headlightFlag. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 238 | |
| 239 | // Build the widget tree, and let SoXtComponent know about our base widget. |
| 240 | if (buildNow) { |
| 241 | Widgetcxx . . $ Widget# w = buildWidgetcxx . . $ SoXtRenderArea#buildWidget(a686be44a4028679).(getParentWidgetcxx . . $ SoXtComponent#getParentWidget(24ba213de9f943e3).()); |
| 242 | setBaseWidgetcxx . . $ SoXtComponent#setBaseWidget(cfa999c5a14729dd).(w); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | //////////////////////////////////////////////////////////////////////// |
| 247 | // |
| 248 | // Destructor. |
| 249 | // |
| 250 | // Use: protected |
| 251 | |
| 252 | SoXtViewercxx . . $ SoXtViewer#::~cxx . . $ SoXtViewer#`~SoXtViewer`(49f6e7a06ebc5aa8).SoXtViewercxx . . $ SoXtViewer#() |
| 253 | // |
| 254 | //////////////////////////////////////////////////////////////////////// |
| 255 | { |
| 256 | // detach everything |
| 257 | if ( sceneGraphcxx . . $ SoXtViewer#sceneGraph. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) |
| 258 | setSceneGraphcxx . . $ SoXtViewer#setSceneGraph(da6c7544ccee32bd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 259 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->unrefcxx . . $ SoBase#unref(83f5f38750778ac8).(); |
| 260 | |
| 261 | // delete everything |
| 262 | delete inputFocuscxx . . $ SoXtViewer#inputFocus.; |
| 263 | delete seekAnimationSensorcxx . . $ SoXtViewer#seekAnimationSensor.; |
| 264 | delete clipboardcxx . . $ SoXtViewer#clipboard.; |
| 265 | delete autoClipBboxActioncxx . . $ SoXtViewer#autoClipBboxAction.; |
| 266 | delete startCBListcxx . . $ SoXtViewer#startCBList.; |
| 267 | delete finishCBListcxx . . $ SoXtViewer#finishCBList.; |
| 268 | headlightGroupcxx . . $ SoXtViewer#headlightGroup.->unrefcxx . . $ SoBase#unref(83f5f38750778ac8).(); |
| 269 | } |
| 270 | |
| 271 | //////////////////////////////////////////////////////////////////////// |
| 272 | // |
| 273 | // Description: |
| 274 | // Set a new user supplied scene graph. |
| 275 | // |
| 276 | // use: virtual public |
| 277 | // |
| 278 | void |
| 279 | SoXtViewercxx . . $ SoXtViewer#::setSceneGraphcxx . . $ SoXtViewer#setSceneGraph(da6c7544ccee32bd).(SoNodecxx . . $ SoNode# *newScene) |
| 280 | // |
| 281 | //////////////////////////////////////////////////////////////////////// |
| 282 | { |
| 283 | // if we haven't already given the render area a scene graph sceneRoot, |
| 284 | // give it the scene graph now. This is a one shot deal, which |
| 285 | // cannot be done in the constructor. |
| 286 | if (SoXtRenderAreacxx . . $ SoXtRenderArea#::getSceneGraphcxx . . $ SoXtRenderArea#getSceneGraph(37b0c20759e6fed3).() == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 287 | SoXtRenderAreacxx . . $ SoXtRenderArea#::setSceneGraphcxx . . $ SoXtRenderArea#setSceneGraph(da6c7544ccee32bd).(sceneRootcxx . . $ SoXtViewer#sceneRoot.); |
| 288 | |
| 289 | // draw new scene graphs to the front buffer by default since |
| 290 | // the scene will be different (we might has well see something |
| 291 | // happening for the first redraw). |
| 292 | if (isDrawToFrontBufferEnablecxx . . $ SoXtGLWidget#isDrawToFrontBufferEnable(455f465bc33b4cdf).()) |
| 293 | drawToFrontBuffercxx . . $ SoXtGLWidget#drawToFrontBuffer. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 294 | |
| 295 | // |
| 296 | // detach everything that depends on the old sceneGraph |
| 297 | // |
| 298 | if ( sceneGraphcxx . . $ SoXtViewer#sceneGraph. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) { |
| 299 | setCameracxx . . $ SoXtViewer#setCamera(67401df0e880fdc2).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 300 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->removeChildcxx . . $ SoGroup#removeChild(da6c7544ccee32bd).(sceneGraphcxx . . $ SoXtViewer#sceneGraph.); |
| 301 | } |
| 302 | |
| 303 | sceneGraphcxx . . $ SoXtViewer#sceneGraph. = newScene; |
| 304 | |
| 305 | // |
| 306 | // now assign the new sceneGraph, find or create the new camera |
| 307 | // and attach things back. |
| 308 | // |
| 309 | if ( sceneGraphcxx . . $ SoXtViewer#sceneGraph. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) { |
| 310 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(sceneGraphcxx . . $ SoXtViewer#sceneGraph.); |
| 311 | |
| 312 | // search for first camera in the scene |
| 313 | SoSearchActioncxx . . $ SoSearchAction# sacxx . . $ SoSearchAction#SoSearchAction(49f6e7a06ebc5aa8).; |
| 314 | sa.setTypecxx . . $ SoSearchAction#setType(a368ce5ca5a50910).(SoCameracxx . . $ SoCamera#::getClassTypeIdcxx . . $ SoCamera#getClassTypeId(c00c150378d2b968).()); |
| 315 | sa.setSearchingAllcxx . . $ SoSearchAction#setSearchingAll(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); // don't look under off switches |
| 316 | sa.applycxx . . $ SoAction#apply(da6c7544ccee32bd).(sceneGraphcxx . . $ SoXtViewer#sceneGraph.); |
| 317 | |
| 318 | SoCameracxx . . $ SoCamera# *newCamera = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 319 | if (sa.getPathcxx . . $ SoSearchAction#getPath(58db5280b30558ed).()) |
| 320 | newCamera = (SoCameracxx . . $ SoCamera# *)((SoFullPathcxx . . $ SoFullPath# *)sa.getPathcxx . . $ SoSearchAction#getPath(58db5280b30558ed).())->getTailcxx . . $ SoFullPath#getTail(b794963b450d51b3).(); |
| 321 | |
| 322 | // if no camera found create one of the right kind... |
| 323 | if ( newCamera == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) { |
| 324 | |
| 325 | newCamera = (SoCameracxx . . $ SoCamera#*) cameraTypecxx . . $ SoXtViewer#cameraType..createInstancecxx . . $ SoType#createInstance(45a5c5ac6be858a8).(); |
| 326 | if (newCamera == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 327 | #ifdef DEBUG |
| 328 | SoDebugError::post("SoXtViewer::setSceneGraph", |
| 329 | "unknown camera type!"); |
| 330 | #endif |
| 331 | // ??? what should we do here ? |
| 332 | cameraTypecxx . . $ SoXtViewer#cameraType. =cxx . . $ SoType#`operator=`(b492e65b06badd05). SoPerspectiveCameracxx . . $ SoPerspectiveCamera#::getClassTypeIdcxx . . $ SoPerspectiveCamera#getClassTypeId(c00c150378d2b968).(); |
| 333 | newCamera = new SoPerspectiveCameracxx . . $ SoPerspectiveCamera#; |
| 334 | } |
| 335 | createdCameracxx . . $ SoXtViewer#createdCamera. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 336 | |
| 337 | if (typecxx . . $ SoXtViewer#type. == SoXtViewercxx . . $ SoXtViewer#::BROWSERcxx . . $ SoXtViewer#BROWSER.) |
| 338 | // add camera after drawstyle stuff |
| 339 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->insertChildcxx . . $ SoGroup#insertChild(de18c6a3dadfdca6).(newCamera, 1); |
| 340 | else { |
| 341 | // check to make sure scene starts with at least a group node |
| 342 | if ( sceneGraphcxx . . $ SoXtViewer#sceneGraph.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoGroupcxx . . $ SoGroup#::getClassTypeIdcxx . . $ SoGroup#getClassTypeId(c00c150378d2b968).()) ) |
| 343 | ((SoGroupcxx . . $ SoGroup# *)sceneGraphcxx . . $ SoXtViewer#sceneGraph.)->insertChildcxx . . $ SoGroup#insertChild(de18c6a3dadfdca6).(newCamera, 0); |
| 344 | else { |
| 345 | // make scene start with a group node |
| 346 | SoGroupcxx . . $ SoGroup# *group = new SoGroupcxx . . $ SoGroup#; |
| 347 | group->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(newCamera); |
| 348 | group->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(sceneGraphcxx . . $ SoXtViewer#sceneGraph.); |
| 349 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).(group); |
| 350 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->removeChildcxx . . $ SoGroup#removeChild(da6c7544ccee32bd).(sceneGraphcxx . . $ SoXtViewer#sceneGraph.); |
| 351 | sceneGraphcxx . . $ SoXtViewer#sceneGraph. = group; |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | newCamera->viewAllcxx . . $ SoCamera#viewAll(aa1d5c094c82e02).(sceneGraphcxx . . $ SoXtViewer#sceneGraph., SbViewportRegioncxx . . $ SbViewportRegion#(getGlxSizecxx . . $ SoXtGLWidget#getGlxSize(f469ede4e6b056fc).())); |
| 356 | } |
| 357 | |
| 358 | setCameracxx . . $ SoXtViewer#setCamera(67401df0e880fdc2).(newCamera); |
| 359 | } |
| 360 | |
| 361 | // recompute the scene size variables... |
| 362 | recomputeSceneSizecxx . . $ SoXtViewer#recomputeSceneSize(49f6e7a06ebc5aa8).(); |
| 363 | } |
| 364 | |
| 365 | //////////////////////////////////////////////////////////////////////// |
| 366 | // |
| 367 | // Description: |
| 368 | // Recomputes the scene sizes... |
| 369 | // |
| 370 | // use: virtual public |
| 371 | |
| 372 | void |
| 373 | SoXtViewercxx . . $ SoXtViewer#::recomputeSceneSizecxx . . $ SoXtViewer#recomputeSceneSize(49f6e7a06ebc5aa8).() |
| 374 | // |
| 375 | //////////////////////////////////////////////////////////////////////// |
| 376 | { |
| 377 | if (! sceneGraphcxx . . $ SoXtViewer#sceneGraph. || ! sceneRootcxx . . $ SoXtViewer#sceneRoot.) { |
| 378 | sceneSizecxx . . $ SoXtViewer#sceneSize. = 0.0; |
| 379 | return; |
| 380 | } |
| 381 | |
| 382 | // Use assignment notation to disambiguate from expression (edison) |
| 383 | SoGetBoundingBoxActioncxx . . $ SoGetBoundingBoxAction# bboxAct = SoGetBoundingBoxActioncxx . . $ SoGetBoundingBoxAction#SoGetBoundingBoxAction(6b06d788389016cd).(SbViewportRegioncxx . . $ SbViewportRegion#(getGlxSizecxx . . $ SoXtGLWidget#getGlxSize(f469ede4e6b056fc).())); |
| 384 | bboxAct.applycxx . . $ SoAction#apply(da6c7544ccee32bd).(sceneRootcxx . . $ SoXtViewer#sceneRoot.); |
| 385 | SbBox3fcxx . . $ SbBox3f# bbox = bboxAct.getBoundingBoxcxx . . $ SoGetBoundingBoxAction#getBoundingBox(e568136409c83d61).(); |
| 386 | |
| 387 | if (bbox.isEmptycxx . . $ SbBox3f#isEmpty(455f465bc33b4cdf).()) { |
| 388 | sceneSizecxx . . $ SoXtViewer#sceneSize. = 0.0; |
| 389 | return; |
| 390 | } |
| 391 | |
| 392 | float x, y, z; |
| 393 | bbox.getSizecxx . . $ SbBox3f#getSize(fdac46887b4d83b1).(x, y, z); |
| 394 | sceneSizecxx . . $ SoXtViewer#sceneSize. = (x > z) ? x : z; |
| 395 | if (y > sceneSizecxx . . $ SoXtViewer#sceneSize.) |
| 396 | sceneSizecxx . . $ SoXtViewer#sceneSize. = y; |
| 397 | if (sceneSizecxx . . $ SoXtViewer#sceneSize. <= 0.0) |
| 398 | sceneSizecxx . . $ SoXtViewer#sceneSize. = 0.0; |
| 399 | } |
| 400 | |
| 401 | //////////////////////////////////////////////////////////////////////// |
| 402 | // |
| 403 | // Description: |
| 404 | // Return the user supplied scene graph. |
| 405 | // |
| 406 | // use: public, virtual |
| 407 | |
| 408 | SoNodecxx . . $ SoNode# * |
| 409 | SoXtViewercxx . . $ SoXtViewer#::getSceneGraphcxx . . $ SoXtViewer#getSceneGraph(37b0c20759e6fed3).() |
| 410 | // |
| 411 | //////////////////////////////////////////////////////////////////////// |
| 412 | { |
| 413 | return sceneGraphcxx . . $ SoXtViewer#sceneGraph.; |
| 414 | } |
| 415 | |
| 416 | |
| 417 | //////////////////////////////////////////////////////////////////////// |
| 418 | // |
| 419 | // Description: |
| 420 | // Sets the camera to use. |
| 421 | // |
| 422 | // Use: virtual public |
| 423 | void |
| 424 | SoXtViewercxx . . $ SoXtViewer#::setCameracxx . . $ SoXtViewer#setCamera(67401df0e880fdc2).(SoCameracxx . . $ SoCamera# *newCamera) |
| 425 | // |
| 426 | //////////////////////////////////////////////////////////////////////// |
| 427 | { |
| 428 | // check for trivual return |
| 429 | if (cameracxx . . $ SoXtViewer#camera. == newCamera) |
| 430 | return; |
| 431 | |
| 432 | // |
| 433 | // detach everything that depended on the old camera |
| 434 | // |
| 435 | if ( cameracxx . . $ SoXtViewer#camera. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) { |
| 436 | |
| 437 | if (headlightFlagcxx . . $ SoXtViewer#headlightFlag.) { |
| 438 | setHeadlightcxx . . $ SoXtViewer#setHeadlight(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 439 | headlightFlagcxx . . $ SoXtViewer#headlightFlag. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; // can later be turned on |
| 440 | } |
| 441 | |
| 442 | if (viewingFlagcxx . . $ SoXtViewer#viewingFlag.) { |
| 443 | setViewingcxx . . $ SoXtViewer#setViewing(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 444 | viewingFlagcxx . . $ SoXtViewer#viewingFlag. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; // can later be turned on |
| 445 | } |
| 446 | |
| 447 | // remove the camera if we created one outside of the |
| 448 | // scene graph. |
| 449 | if (createdCameracxx . . $ SoXtViewer#createdCamera. && typecxx . . $ SoXtViewer#type. == SoXtViewercxx . . $ SoXtViewer#::BROWSERcxx . . $ SoXtViewer#BROWSER.) { |
| 450 | if (sceneRootcxx . . $ SoXtViewer#sceneRoot.->findChildcxx . . $ SoGroup#findChild(25d228eba4c5059a).(cameracxx . . $ SoXtViewer#camera.) >= 0) |
| 451 | sceneRootcxx . . $ SoXtViewer#sceneRoot.->removeChildcxx . . $ SoGroup#removeChild(da6c7544ccee32bd).(cameracxx . . $ SoXtViewer#camera.); |
| 452 | createdCameracxx . . $ SoXtViewer#createdCamera. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 453 | } |
| 454 | |
| 455 | cameracxx . . $ SoXtViewer#camera.->unrefcxx . . $ SoBase#unref(83f5f38750778ac8).(); |
| 456 | } |
| 457 | |
| 458 | cameracxx . . $ SoXtViewer#camera. = newCamera; |
| 459 | |
| 460 | // |
| 461 | // attach everything that depends on the new camera |
| 462 | // |
| 463 | if ( cameracxx . . $ SoXtViewer#camera. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 464 | cameracxx . . $ SoXtViewer#camera.->refcxx . . $ SoBase#ref(83f5f38750778ac8).(); |
| 465 | |
| 466 | if (headlightFlagcxx . . $ SoXtViewer#headlightFlag.) { |
| 467 | headlightFlagcxx . . $ SoXtViewer#headlightFlag. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; // enables the routine to be called |
| 468 | setHeadlightcxx . . $ SoXtViewer#setHeadlight(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 469 | } |
| 470 | |
| 471 | if (viewingFlagcxx . . $ SoXtViewer#viewingFlag.) { |
| 472 | viewingFlagcxx . . $ SoXtViewer#viewingFlag. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; // enables the routine to be called |
| 473 | setViewingcxx . . $ SoXtViewer#setViewing(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 474 | } |
| 475 | |
| 476 | saveHomePositioncxx . . $ SoXtViewer#saveHomePosition(49f6e7a06ebc5aa8).(); |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | //////////////////////////////////////////////////////////////////////// |
| 481 | // |
| 482 | // Description: |
| 483 | // Set the camera type to create. |
| 484 | // |
| 485 | // Use: virtual public |
| 486 | void |
| 487 | SoXtViewercxx . . $ SoXtViewer#::setCameraTypecxx . . $ SoXtViewer#setCameraType(3e4432a9d5c0ee1c).(SoTypecxx . . $ SoType# type) |
| 488 | // |
| 489 | //////////////////////////////////////////////////////////////////////// |
| 490 | { |
| 491 | if (type.isDerivedFromcxx . . $ SoType#isDerivedFrom(1fd66475a268b64e).(SoPerspectiveCameracxx . . $ SoPerspectiveCamera#::getClassTypeIdcxx . . $ SoPerspectiveCamera#getClassTypeId(c00c150378d2b968).()) || |
| 492 | type.isDerivedFromcxx . . $ SoType#isDerivedFrom(1fd66475a268b64e).(SoOrthographicCameracxx . . $ SoOrthographicCamera#::getClassTypeIdcxx . . $ SoOrthographicCamera#getClassTypeId(c00c150378d2b968).())) |
| 493 | cameraTypecxx . . $ SoXtViewer#cameraType. =cxx . . $ SoType#`operator=`(b492e65b06badd05). type; |
| 494 | #ifdef DEBUG |
| 495 | else |
| 496 | SoDebugError::post("SoXtViewer::setCameraType", |
| 497 | "unknown camera type!"); |
| 498 | #endif |
| 499 | } |
| 500 | |
| 501 | //////////////////////////////////////////////////////////////////////// |
| 502 | // |
| 503 | // Description: |
| 504 | // See the whole scene from the camera |
| 505 | // |
| 506 | // Use: public |
| 507 | void |
| 508 | SoXtViewercxx . . $ SoXtViewer#::viewAllcxx . . $ SoXtViewer#viewAll(49f6e7a06ebc5aa8).() |
| 509 | // |
| 510 | //////////////////////////////////////////////////////////////////////// |
| 511 | { |
| 512 | if ( cameracxx . . $ SoXtViewer#camera. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) |
| 513 | cameracxx . . $ SoXtViewer#camera.->viewAllcxx . . $ SoCamera#viewAll(aa1d5c094c82e02).(sceneGraphcxx . . $ SoXtViewer#sceneGraph.,SbViewportRegioncxx . . $ SbViewportRegion#(getGlxSizecxx . . $ SoXtGLWidget#getGlxSize(f469ede4e6b056fc).())); |
| 514 | } |
| 515 | |
| 516 | //////////////////////////////////////////////////////////////////////// |
| 517 | // |
| 518 | // Description: |
| 519 | // Sets the viewing mode. |
| 520 | // |
| 521 | // Use: virtual public |
| 522 | void |
| 523 | SoXtViewercxx . . $ SoXtViewer#::setViewingcxx . . $ SoXtViewer#setViewing(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# flag) |
| 524 | // |
| 525 | //////////////////////////////////////////////////////////////////////// |
| 526 | { |
| 527 | if (flag == viewingFlagcxx . . $ SoXtViewer#viewingFlag.) |
| 528 | return; |
| 529 | |
| 530 | viewingFlagcxx . . $ SoXtViewer#viewingFlag. = flag; |
| 531 | |
| 532 | // if we are goind into viewing mode, then de-highlight any |
| 533 | // currently highlighted nodes (since the object will never receive |
| 534 | // any motion events). |
| 535 | if (viewingFlagcxx . . $ SoXtViewer#viewingFlag.) { |
| 536 | SoGLRenderActioncxx . . $ SoGLRenderAction# *glAct = getGLRenderActioncxx . . $ SoXtRenderArea#getGLRenderAction(3c6e1ebd9c702b1e).(); |
| 537 | if (glAct) |
| 538 | SoLocateHighlightcxx . . $ SoLocateHighlight#::turnOffCurrentHighlightcxx . . $ SoLocateHighlight#turnOffCurrentHighlight(5c806c737f468e18).(glAct); |
| 539 | } |
| 540 | } |
| 541 | |
| 542 | //////////////////////////////////////////////////////////////////////// |
| 543 | // |
| 544 | // Description: |
| 545 | // Enables/Disable the viewer cursor on the window. |
| 546 | // |
| 547 | // Use: virtual public |
| 548 | void |
| 549 | SoXtViewercxx . . $ SoXtViewer#::setCursorEnabledcxx . . $ SoXtViewer#setCursorEnabled(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# flag) |
| 550 | // |
| 551 | //////////////////////////////////////////////////////////////////////// |
| 552 | { |
| 553 | cursorEnabledFlagcxx . . $ SoXtViewer#cursorEnabledFlag. = flag; |
| 554 | } |
| 555 | |
| 556 | //////////////////////////////////////////////////////////////////////// |
| 557 | // |
| 558 | // Description: |
| 559 | // Sets the auto clipping mode |
| 560 | // |
| 561 | // Use: public |
| 562 | void |
| 563 | SoXtViewercxx . . $ SoXtViewer#::setAutoClippingcxx . . $ SoXtViewer#setAutoClipping(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# flag) |
| 564 | // |
| 565 | //////////////////////////////////////////////////////////////////////// |
| 566 | { |
| 567 | if (autoClipFlagcxx . . $ SoXtViewer#autoClipFlag. == flag) |
| 568 | return; |
| 569 | |
| 570 | autoClipFlagcxx . . $ SoXtViewer#autoClipFlag. = flag; |
| 571 | |
| 572 | // cause a redraw to correctly place the near and far plane now that |
| 573 | // auto clipping is on. |
| 574 | if (autoClipFlagcxx . . $ SoXtViewer#autoClipFlag.) |
| 575 | scheduleRedrawcxx . . $ SoXtRenderArea#scheduleRedraw(49f6e7a06ebc5aa8).(); |
| 576 | } |
| 577 | |
| 578 | //////////////////////////////////////////////////////////////////////// |
| 579 | // |
| 580 | // Description: |
| 581 | // sets stereo mode |
| 582 | // |
| 583 | // Use: virtual public |
| 584 | void |
| 585 | SoXtViewercxx . . $ SoXtViewer#::setStereoViewingcxx . . $ SoXtViewer#setStereoViewing(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# flag) |
| 586 | // |
| 587 | //////////////////////////////////////////////////////////////////////// |
| 588 | { |
| 589 | if (flag == isStereoViewingcxx . . $ SoXtViewer#isStereoViewing(b126dc7c1de90089).()) |
| 590 | return; |
| 591 | |
| 592 | // First, check to see if the OpenGL stereo visual can be created |
| 593 | setStereoBuffercxx . . $ SoXtGLWidget#setStereoBuffer(d4f767463ce0a6b3).(flag); |
| 594 | |
| 595 | #ifdef __sgi |
| 596 | // since OpenGL stereo failed, see if the SGI extension will work |
| 597 | // by checking whether the X server supports it.... |
| 598 | int first_event, first_error; |
| 599 | if (flag != isStereoViewing() && |
| 600 | XSGIStereoQueryExtension(getDisplay(), &first_event, &first_error)) { |
| 601 | |
| 602 | if (flag) { |
| 603 | // make sure the current window will support stereo |
| 604 | // ??? if we havn't been managed yet, just assume this visual |
| 605 | // ??? will support stereo viewing (see bug |
| 606 | if (! getNormalWindow()) |
| 607 | useSGIStereoExt = TRUE; |
| 608 | else if (XSGIQueryStereoMode(getDisplay(), getNormalWindow()) != |
| 609 | X_STEREO_UNSUPPORTED) |
| 610 | // stereo will be turned on in the rendering.... |
| 611 | useSGIStereoExt = TRUE; |
| 612 | |
| 613 | // save the camera original aspect ratio since it will be updated |
| 614 | // during rendering to strech the objects. We will restore it |
| 615 | // when stereo if OFF. |
| 616 | camStereoOrigAspect = camera->aspectRatio.getValue(); |
| 617 | camStereoOrigVPMapping = camera->viewportMapping.getValue(); |
| 618 | } |
| 619 | else { |
| 620 | // turn stereo off on the window |
| 621 | useSGIStereoExt = FALSE; |
| 622 | |
| 623 | // clear the left/right buffers to prevent gost images from |
| 624 | // the other view...(until the user resets the monitor with setmon) |
| 625 | if (isRGBMode()) { |
| 626 | SbColor color = getBackgroundColor(); |
| 627 | glClearColor(color[0], color[1], color[2], 0); |
| 628 | } |
| 629 | else |
| 630 | glClearIndex(getBackgroundIndex()); |
| 631 | |
| 632 | glDrawBuffer(GL_FRONT_AND_BACK); |
| 633 | |
| 634 | XSGISetStereoBuffer(getDisplay(), getNormalWindow(), STEREO_BUFFER_LEFT); |
| 635 | XSync(getDisplay(), False); |
| 636 | glClear(GL_COLOR_BUFFER_BIT); |
| 637 | |
| 638 | XSGISetStereoBuffer(getDisplay(), getNormalWindow(), STEREO_BUFFER_RIGHT); |
| 639 | XSync(getDisplay(), False); |
| 640 | glClear(GL_COLOR_BUFFER_BIT); |
| 641 | |
| 642 | glDrawBuffer( isDoubleBuffer() ? GL_BACK : GL_FRONT); |
| 643 | |
| 644 | // restore the camera original aspect ratio (saved above) |
| 645 | camera->aspectRatio = camStereoOrigAspect; |
| 646 | camera->viewportMapping = camStereoOrigVPMapping; |
| 647 | } |
| 648 | |
| 649 | // now cause a redraw to see the affect since we havn't changed |
| 650 | // the actual visual (unlike OpenGL) |
| 651 | if (flag == isStereoViewing()) |
| 652 | scheduleRedraw(); |
| 653 | } |
| 654 | #endif |
| 655 | } |
| 656 | |
| 657 | //////////////////////////////////////////////////////////////////////// |
| 658 | // |
| 659 | // Description: |
| 660 | // gets stereo mode |
| 661 | // |
| 662 | // Use: virtual public |
| 663 | SbBoolcxx . . $ SbBool# |
| 664 | SoXtViewercxx . . $ SoXtViewer#::isStereoViewingcxx . . $ SoXtViewer#isStereoViewing(b126dc7c1de90089).() |
| 665 | // |
| 666 | //////////////////////////////////////////////////////////////////////// |
| 667 | { |
| 668 | #ifdef __sgi |
| 669 | return (isStereoBuffer() || useSGIStereoExt); |
| 670 | #else |
| 671 | // done in SoXtGLWidget |
| 672 | return isStereoBuffercxx . . $ SoXtGLWidget#isStereoBuffer(b126dc7c1de90089).(); |
| 673 | #endif |
| 674 | } |
| 675 | |
| 676 | //////////////////////////////////////////////////////////////////////// |
| 677 | // |
| 678 | // Description: |
| 679 | // adds a directional light to the scene graph that is a headlight |
| 680 | // positioned over the left shoulder of the camera. It has a sensor |
| 681 | // on the camera, so that it always is pointing in the same direction |
| 682 | // as the camera. The sensor is not delayed, so that it is "always" |
| 683 | // accurate. |
| 684 | // |
| 685 | // Use: virtual public |
| 686 | // |
| 687 | void |
| 688 | SoXtViewercxx . . $ SoXtViewer#::setHeadlightcxx . . $ SoXtViewer#setHeadlight(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# insertFlag) |
| 689 | // |
| 690 | //////////////////////////////////////////////////////////////////////// |
| 691 | { |
| 692 | // check for trivial return |
| 693 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! || headlightFlagcxx . . $ SoXtViewer#headlightFlag. == insertFlag) { |
| 694 | headlightFlagcxx . . $ SoXtViewer#headlightFlag. = insertFlag; |
| 695 | return; |
| 696 | } |
| 697 | |
| 698 | // |
| 699 | // find the camera parent to insert/remove the headlight |
| 700 | // |
| 701 | SoSearchActioncxx . . $ SoSearchAction# sacxx . . $ SoSearchAction#SoSearchAction(49f6e7a06ebc5aa8).; |
| 702 | if (insertFlag) |
| 703 | sa.setNodecxx . . $ SoSearchAction#setNode(da6c7544ccee32bd).(cameracxx . . $ SoXtViewer#camera.); |
| 704 | else { |
| 705 | sa.setNodecxx . . $ SoSearchAction#setNode(da6c7544ccee32bd).(headlightGroupcxx . . $ SoXtViewer#headlightGroup.); |
| 706 | sa.setSearchingAllcxx . . $ SoSearchAction#setSearchingAll(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); // find under OFF switches for removal |
| 707 | } |
| 708 | sa.applycxx . . $ SoAction#apply(da6c7544ccee32bd).(sceneRootcxx . . $ SoXtViewer#sceneRoot.); |
| 709 | SoFullPathcxx . . $ SoFullPath# *fullPath = (SoFullPathcxx . . $ SoFullPath# *) sa.getPathcxx . . $ SoSearchAction#getPath(58db5280b30558ed).(); |
| 710 | if (!fullPath) { |
| 711 | #if DEBUG |
| 712 | SoDebugError::post("SoXtViewer::setHeadlight", |
| 713 | insertFlag ? "ERROR: cannot find camera in graph" : |
| 714 | "ERROR: cannot find headlight in graph"); |
| 715 | #endif |
| 716 | return; |
| 717 | } |
| 718 | SoGroupcxx . . $ SoGroup# *parent = (SoGroupcxx . . $ SoGroup# *) fullPath->getNodeFromTailcxx . . $ SoFullPath#getNodeFromTail(fd675789997d09c2).(1); |
| 719 | |
| 720 | headlightFlagcxx . . $ SoXtViewer#headlightFlag. = insertFlag; |
| 721 | |
| 722 | // |
| 723 | // inserts/remove the headlight group node |
| 724 | // |
| 725 | if (headlightFlagcxx . . $ SoXtViewer#headlightFlag.) { |
| 726 | int camIndex; |
| 727 | |
| 728 | // check to make sure that the camera parent is not a switch node |
| 729 | // (VRML camera viewpoints are kept under a switch node). Otherwise |
| 730 | // we will insert the headlight right before the switch node. |
| 731 | if (parent->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoSwitchcxx . . $ SoSwitch#::getClassTypeIdcxx . . $ SoSwitch#getClassTypeId(c00c150378d2b968).())) { |
| 732 | SoNodecxx . . $ SoNode# *switchNode = parent; |
| 733 | parent = (SoGroupcxx . . $ SoGroup# *) fullPath->getNodeFromTailcxx . . $ SoFullPath#getNodeFromTail(fd675789997d09c2).(2); |
| 734 | camIndex = parent->findChildcxx . . $ SoGroup#findChild(25d228eba4c5059a).(switchNode); |
| 735 | } |
| 736 | else |
| 737 | camIndex = parent->findChildcxx . . $ SoGroup#findChild(25d228eba4c5059a).(cameracxx . . $ SoXtViewer#camera.); |
| 738 | |
| 739 | // return if headlight is already there (this should be an error !) |
| 740 | if (parent->findChildcxx . . $ SoGroup#findChild(25d228eba4c5059a).(headlightGroupcxx . . $ SoXtViewer#headlightGroup.) >= 0) |
| 741 | return; |
| 742 | |
| 743 | // insert the light group right after the camera |
| 744 | if (camIndex >= 0) |
| 745 | parent->insertChildcxx . . $ SoGroup#insertChild(de18c6a3dadfdca6).(headlightGroupcxx . . $ SoXtViewer#headlightGroup., camIndex+1); |
| 746 | } |
| 747 | else { |
| 748 | if (parent->findChildcxx . . $ SoGroup#findChild(25d228eba4c5059a).(headlightGroupcxx . . $ SoXtViewer#headlightGroup.) >= 0) |
| 749 | parent->removeChildcxx . . $ SoGroup#removeChild(da6c7544ccee32bd).(headlightGroupcxx . . $ SoXtViewer#headlightGroup.); |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | //////////////////////////////////////////////////////////////////////// |
| 754 | // |
| 755 | // Description: |
| 756 | // Sets the drawing style. |
| 757 | // |
| 758 | // Use: virtual public |
| 759 | void |
| 760 | SoXtViewercxx . . $ SoXtViewer#::setDrawStylecxx . . $ SoXtViewer#setDrawStyle(ea86062ff1532cd7).( |
| 761 | SoXtViewercxx . . $ SoXtViewer#::DrawTypecxx . . $ SoXtViewer#DrawType# type, SoXtViewercxx . . $ SoXtViewer#::DrawStylecxx . . $ SoXtViewer#DrawStyle# style) |
| 762 | // |
| 763 | //////////////////////////////////////////////////////////////////////// |
| 764 | { |
| 765 | // prevent us from picking a default draw style if the user already |
| 766 | // has done so... |
| 767 | checkForDrawStylecxx . . $ SoXtViewer#checkForDrawStyle. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 768 | |
| 769 | if (type == STILLcxx . . $ SoXtViewer#STILL.) { |
| 770 | if (stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle. == style) |
| 771 | return; |
| 772 | if (style == VIEW_SAME_AS_STILLcxx . . $ SoXtViewer#VIEW_SAME_AS_STILL.) { |
| 773 | #ifdef DEBUG |
| 774 | SoDebugError::post("SoXtViewer::setDrawStyle", |
| 775 | "illegal VIEW_SAME_AS_STILL draw style passed for STILL !"); |
| 776 | #endif |
| 777 | return; |
| 778 | } |
| 779 | stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle. = style; |
| 780 | |
| 781 | if (! interactiveFlagcxx . . $ SoXtViewer#interactiveFlag. || interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_SAME_AS_STILLcxx . . $ SoXtViewer#VIEW_SAME_AS_STILL. |
| 782 | || (interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_NO_TEXTUREcxx . . $ SoXtViewer#VIEW_NO_TEXTURE. && style != VIEW_AS_IScxx . . $ SoXtViewer#VIEW_AS_IS.)) |
| 783 | setCurrentDrawStylecxx . . $ SoXtViewer#setCurrentDrawStyle(d97178de53a6022).(style); |
| 784 | else if (interactiveFlagcxx . . $ SoXtViewer#interactiveFlag. && interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_NO_TEXTUREcxx . . $ SoXtViewer#VIEW_NO_TEXTURE. && |
| 785 | style == VIEW_AS_IScxx . . $ SoXtViewer#VIEW_AS_IS.) |
| 786 | setCurrentDrawStylecxx . . $ SoXtViewer#setCurrentDrawStyle(d97178de53a6022).(interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle.); |
| 787 | } |
| 788 | else { |
| 789 | // else it type == INTERACTIVE |
| 790 | |
| 791 | if (interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == style) |
| 792 | return; |
| 793 | interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. = style; |
| 794 | |
| 795 | if (interactiveFlagcxx . . $ SoXtViewer#interactiveFlag.) { |
| 796 | if (style == VIEW_SAME_AS_STILLcxx . . $ SoXtViewer#VIEW_SAME_AS_STILL. || |
| 797 | (style == VIEW_NO_TEXTUREcxx . . $ SoXtViewer#VIEW_NO_TEXTURE. && stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle. != VIEW_AS_IScxx . . $ SoXtViewer#VIEW_AS_IS.)) |
| 798 | setCurrentDrawStylecxx . . $ SoXtViewer#setCurrentDrawStyle(d97178de53a6022).(stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle.); |
| 799 | else |
| 800 | setCurrentDrawStylecxx . . $ SoXtViewer#setCurrentDrawStyle(d97178de53a6022).(style); |
| 801 | } |
| 802 | } |
| 803 | } |
| 804 | |
| 805 | //////////////////////////////////////////////////////////////////////// |
| 806 | // |
| 807 | // Description: |
| 808 | // Sets the current drawing style. This only changes the nodes to |
| 809 | // match what is passed (called from multiple places) and doesn't |
| 810 | // affect the current state. |
| 811 | // |
| 812 | // Use: private |
| 813 | void |
| 814 | SoXtViewercxx . . $ SoXtViewer#::setCurrentDrawStylecxx . . $ SoXtViewer#setCurrentDrawStyle(d97178de53a6022).(SoXtViewercxx . . $ SoXtViewer#::DrawStylecxx . . $ SoXtViewer#DrawStyle# style) |
| 815 | // |
| 816 | //////////////////////////////////////////////////////////////////////// |
| 817 | { |
| 818 | if (style != VIEW_AS_IScxx . . $ SoXtViewer#VIEW_AS_IS.) |
| 819 | drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch.->whichChildcxx . . $ SoSwitch#whichChild. =cxx . . $ SoSFInt32#`operator=`(7864480464b09eea). SO_SWITCH_ALLcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:77:9`!; |
| 820 | |
| 821 | switch(style) { |
| 822 | case VIEW_AS_IScxx . . $ SoXtViewer#VIEW_AS_IS.: |
| 823 | drawStyleSwitchcxx . . $ SoXtViewer#drawStyleSwitch.->whichChildcxx . . $ SoSwitch#whichChild. =cxx . . $ SoSFInt32#`operator=`(7864480464b09eea). SO_SWITCH_NONEcxx . . $ `lib/database/include/Inventor/nodes/SoSwitch.h:75:9`!; |
| 824 | break; |
| 825 | |
| 826 | case VIEW_HIDDEN_LINEcxx . . $ SoXtViewer#VIEW_HIDDEN_LINE.: |
| 827 | // texture is always off under the switch node. |
| 828 | // List only stuff common to both rendering passes |
| 829 | // (the rest is done when rendering) |
| 830 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->stylecxx . . $ SoDrawStyle#style..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 831 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->pointSizecxx . . $ SoDrawStyle#pointSize..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 832 | lightModelNodecxx . . $ SoXtViewer#lightModelNode.->modelcxx . . $ SoLightModel#model. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoLightModelcxx . . $ SoLightModel#::BASE_COLORcxx . . $ SoLightModel#BASE_COLOR.; |
| 833 | lightModelNodecxx . . $ SoXtViewer#lightModelNode.->modelcxx . . $ SoLightModel#model..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 834 | complexityNodecxx . . $ SoXtViewer#complexityNode.->typecxx . . $ SoComplexity#type..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 835 | complexityNodecxx . . $ SoXtViewer#complexityNode.->valuecxx . . $ SoComplexity#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 836 | break; |
| 837 | |
| 838 | case VIEW_NO_TEXTUREcxx . . $ SoXtViewer#VIEW_NO_TEXTURE.: |
| 839 | case VIEW_LOW_COMPLEXITYcxx . . $ SoXtViewer#VIEW_LOW_COMPLEXITY.: |
| 840 | // texture is always off under the switch node |
| 841 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->stylecxx . . $ SoDrawStyle#style..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 842 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->pointSizecxx . . $ SoDrawStyle#pointSize..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 843 | lightModelNodecxx . . $ SoXtViewer#lightModelNode.->modelcxx . . $ SoLightModel#model..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 844 | colorNodecxx . . $ SoXtViewer#colorNode.->orderedRGBAcxx . . $ SoPackedColor#orderedRGBA..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 845 | matBindingNodecxx . . $ SoXtViewer#matBindingNode.->valuecxx . . $ SoMaterialBinding#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 846 | complexityNodecxx . . $ SoXtViewer#complexityNode.->typecxx . . $ SoComplexity#type..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 847 | complexityNodecxx . . $ SoXtViewer#complexityNode.->valuecxx . . $ SoComplexity#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(style != VIEW_LOW_COMPLEXITYcxx . . $ SoXtViewer#VIEW_LOW_COMPLEXITY.); |
| 848 | break; |
| 849 | |
| 850 | case VIEW_LINEcxx . . $ SoXtViewer#VIEW_LINE.: |
| 851 | case VIEW_LOW_RES_LINEcxx . . $ SoXtViewer#VIEW_LOW_RES_LINE.: |
| 852 | case VIEW_POINTcxx . . $ SoXtViewer#VIEW_POINT.: |
| 853 | case VIEW_LOW_RES_POINTcxx . . $ SoXtViewer#VIEW_LOW_RES_POINT.: |
| 854 | // texture is always off under the switch node |
| 855 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->stylecxx . . $ SoDrawStyle#style. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). (style == VIEW_LINEcxx . . $ SoXtViewer#VIEW_LINE. || style == VIEW_LOW_RES_LINEcxx . . $ SoXtViewer#VIEW_LOW_RES_LINE.) ? |
| 856 | SoDrawStylecxx . . $ SoDrawStyle#::LINEScxx . . $ SoDrawStyle#LINES. : SoDrawStylecxx . . $ SoDrawStyle#::POINTScxx . . $ SoDrawStyle#POINTS.; |
| 857 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->stylecxx . . $ SoDrawStyle#style..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 858 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->pointSizecxx . . $ SoDrawStyle#pointSize..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(style != VIEW_POINTcxx . . $ SoXtViewer#VIEW_POINT. && style != VIEW_LOW_RES_POINTcxx . . $ SoXtViewer#VIEW_LOW_RES_POINT.); |
| 859 | lightModelNodecxx . . $ SoXtViewer#lightModelNode.->modelcxx . . $ SoLightModel#model. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoLightModelcxx . . $ SoLightModel#::BASE_COLORcxx . . $ SoLightModel#BASE_COLOR.; |
| 860 | lightModelNodecxx . . $ SoXtViewer#lightModelNode.->modelcxx . . $ SoLightModel#model..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 861 | colorNodecxx . . $ SoXtViewer#colorNode.->orderedRGBAcxx . . $ SoPackedColor#orderedRGBA..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 862 | matBindingNodecxx . . $ SoXtViewer#matBindingNode.->valuecxx . . $ SoMaterialBinding#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 863 | |
| 864 | // Force a lower complexity for the low res draw styles |
| 865 | // ??? this only works if the object didn't have |
| 866 | // ??? something lower in the first place... |
| 867 | if (style == VIEW_LOW_RES_LINEcxx . . $ SoXtViewer#VIEW_LOW_RES_LINE. || style == VIEW_LOW_RES_POINTcxx . . $ SoXtViewer#VIEW_LOW_RES_POINT.) { |
| 868 | complexityNodecxx . . $ SoXtViewer#complexityNode.->typecxx . . $ SoComplexity#type. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoComplexitycxx . . $ SoComplexity#::OBJECT_SPACEcxx . . $ SoComplexity#OBJECT_SPACE.; |
| 869 | complexityNodecxx . . $ SoXtViewer#complexityNode.->typecxx . . $ SoComplexity#type..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 870 | complexityNodecxx . . $ SoXtViewer#complexityNode.->valuecxx . . $ SoComplexity#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 871 | } |
| 872 | else { |
| 873 | complexityNodecxx . . $ SoXtViewer#complexityNode.->typecxx . . $ SoComplexity#type..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 874 | complexityNodecxx . . $ SoXtViewer#complexityNode.->valuecxx . . $ SoComplexity#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 875 | } |
| 876 | break; |
| 877 | |
| 878 | case VIEW_BBOXcxx . . $ SoXtViewer#VIEW_BBOX.: |
| 879 | // texture is always off under the switch node |
| 880 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->stylecxx . . $ SoDrawStyle#style. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoDrawStylecxx . . $ SoDrawStyle#::LINEScxx . . $ SoDrawStyle#LINES.; |
| 881 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->stylecxx . . $ SoDrawStyle#style..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 882 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->pointSizecxx . . $ SoDrawStyle#pointSize..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 883 | lightModelNodecxx . . $ SoXtViewer#lightModelNode.->modelcxx . . $ SoLightModel#model. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoLightModelcxx . . $ SoLightModel#::BASE_COLORcxx . . $ SoLightModel#BASE_COLOR.; |
| 884 | lightModelNodecxx . . $ SoXtViewer#lightModelNode.->modelcxx . . $ SoLightModel#model..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 885 | colorNodecxx . . $ SoXtViewer#colorNode.->orderedRGBAcxx . . $ SoPackedColor#orderedRGBA..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 886 | matBindingNodecxx . . $ SoXtViewer#matBindingNode.->valuecxx . . $ SoMaterialBinding#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 887 | complexityNodecxx . . $ SoXtViewer#complexityNode.->typecxx . . $ SoComplexity#type. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoComplexitycxx . . $ SoComplexity#::BOUNDING_BOXcxx . . $ SoComplexity#BOUNDING_BOX.; |
| 888 | complexityNodecxx . . $ SoXtViewer#complexityNode.->typecxx . . $ SoComplexity#type..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 889 | complexityNodecxx . . $ SoXtViewer#complexityNode.->valuecxx . . $ SoComplexity#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 890 | break; |
| 891 | |
| 892 | case VIEW_SAME_AS_STILLcxx . . $ SoXtViewer#VIEW_SAME_AS_STILL.: |
| 893 | #ifdef DEBUG |
| 894 | SoDebugError::post("SoXtViewer::setCurrentDrawStyle", "VIEW_SAME_AS_STILL was passed !"); |
| 895 | #endif |
| 896 | break; |
| 897 | } |
| 898 | |
| 899 | setZbufferStatecxx . . $ SoXtViewer#setZbufferState(49f6e7a06ebc5aa8).(); |
| 900 | } |
| 901 | |
| 902 | //////////////////////////////////////////////////////////////////////// |
| 903 | // |
| 904 | // Description: |
| 905 | // Gets the drawing style. |
| 906 | // |
| 907 | // Use: public |
| 908 | SoXtViewercxx . . $ SoXtViewer#::DrawStylecxx . . $ SoXtViewer#DrawStyle# |
| 909 | SoXtViewercxx . . $ SoXtViewer#::getDrawStylecxx . . $ SoXtViewer#getDrawStyle(8ef6f1cfa24cbeb6).(SoXtViewercxx . . $ SoXtViewer#::DrawTypecxx . . $ SoXtViewer#DrawType# type) |
| 910 | // |
| 911 | //////////////////////////////////////////////////////////////////////// |
| 912 | { |
| 913 | return (type == STILLcxx . . $ SoXtViewer#STILL. ? stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle. : interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle.); |
| 914 | } |
| 915 | |
| 916 | //////////////////////////////////////////////////////////////////////// |
| 917 | // |
| 918 | // Description: |
| 919 | // redefine this routine to also correctly set the buffering type |
| 920 | // |
| 921 | // Use: virtual public |
| 922 | void |
| 923 | SoXtViewercxx . . $ SoXtViewer#::setNormalVisualcxx . . $ SoXtViewer#setNormalVisual(ebbc07a6722bc54b).(XVisualInfocxx . . $ XVisualInfo# *vis) |
| 924 | // |
| 925 | //////////////////////////////////////////////////////////////////////// |
| 926 | { |
| 927 | // call parent class |
| 928 | SoXtRenderAreacxx . . $ SoXtRenderArea#::setNormalVisualcxx . . $ SoXtGLWidget#setNormalVisual(ebbc07a6722bc54b).(vis); |
| 929 | |
| 930 | // now update the buffering type |
| 931 | if (isDoubleBuffercxx . . $ SoXtGLWidget#isDoubleBuffer(b126dc7c1de90089).()) |
| 932 | setBufferingTypecxx . . $ SoXtViewer#setBufferingType(e64d44fb0c8c5469).(BUFFER_DOUBLEcxx . . $ SoXtViewer#BUFFER_DOUBLE.); |
| 933 | else |
| 934 | setBufferingTypecxx . . $ SoXtViewer#setBufferingType(e64d44fb0c8c5469).(BUFFER_SINGLEcxx . . $ SoXtViewer#BUFFER_SINGLE.); |
| 935 | } |
| 936 | |
| 937 | //////////////////////////////////////////////////////////////////////// |
| 938 | // |
| 939 | // Description: |
| 940 | // redefine this routine from SoXtGLWidget to call the viewer |
| 941 | // SoXtViewer::setBufferingType() method which is a superset. |
| 942 | // |
| 943 | // Use: virtual public |
| 944 | // |
| 945 | void |
| 946 | SoXtViewercxx . . $ SoXtViewer#::setDoubleBuffercxx . . $ SoXtViewer#setDoubleBuffer(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# flag) |
| 947 | // |
| 948 | //////////////////////////////////////////////////////////////////////// |
| 949 | { |
| 950 | setBufferingTypecxx . . $ SoXtViewer#setBufferingType(e64d44fb0c8c5469).(flag ? SoXtViewercxx . . $ SoXtViewer#::BUFFER_DOUBLEcxx . . $ SoXtViewer#BUFFER_DOUBLE. : SoXtViewercxx . . $ SoXtViewer#::BUFFER_SINGLEcxx . . $ SoXtViewer#BUFFER_SINGLE.); |
| 951 | } |
| 952 | |
| 953 | //////////////////////////////////////////////////////////////////////// |
| 954 | // |
| 955 | // Description: |
| 956 | // Sets the buffering style. |
| 957 | // |
| 958 | // Use: virtual public |
| 959 | void |
| 960 | SoXtViewercxx . . $ SoXtViewer#::setBufferingTypecxx . . $ SoXtViewer#setBufferingType(e64d44fb0c8c5469).(SoXtViewercxx . . $ SoXtViewer#::BufferTypecxx . . $ SoXtViewer#BufferType# type) |
| 961 | // |
| 962 | //////////////////////////////////////////////////////////////////////// |
| 963 | { |
| 964 | if (bufferTypecxx . . $ SoXtViewer#bufferType. == type) |
| 965 | return; |
| 966 | |
| 967 | // remove interactive callback |
| 968 | if (bufferTypecxx . . $ SoXtViewer#bufferType. == BUFFER_INTERACTIVEcxx . . $ SoXtViewer#BUFFER_INTERACTIVE.) { |
| 969 | removeStartCallbackcxx . . $ SoXtViewer#removeStartCallback(584743347ba26ea5).(SoXtViewercxx . . $ SoXtViewer#::bufferStartCallbackcxx . . $ SoXtViewer#bufferStartCallback(53b15af9fcb5e041).); |
| 970 | removeFinishCallbackcxx . . $ SoXtViewer#removeFinishCallback(584743347ba26ea5).(SoXtViewercxx . . $ SoXtViewer#::bufferFinishCallbackcxx . . $ SoXtViewer#bufferFinishCallback(53b15af9fcb5e041).); |
| 971 | } |
| 972 | |
| 973 | bufferTypecxx . . $ SoXtViewer#bufferType. = type; |
| 974 | |
| 975 | switch(bufferTypecxx . . $ SoXtViewer#bufferType.) { |
| 976 | case BUFFER_SINGLEcxx . . $ SoXtViewer#BUFFER_SINGLE.: |
| 977 | SoXtRenderAreacxx . . $ SoXtRenderArea#::setDoubleBuffercxx . . $ SoXtGLWidget#setDoubleBuffer(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 978 | break; |
| 979 | case BUFFER_DOUBLEcxx . . $ SoXtViewer#BUFFER_DOUBLE.: |
| 980 | SoXtRenderAreacxx . . $ SoXtRenderArea#::setDoubleBuffercxx . . $ SoXtGLWidget#setDoubleBuffer(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 981 | break; |
| 982 | case BUFFER_INTERACTIVEcxx . . $ SoXtViewer#BUFFER_INTERACTIVE.: |
| 983 | SoXtRenderAreacxx . . $ SoXtRenderArea#::setDoubleBuffercxx . . $ SoXtGLWidget#setDoubleBuffer(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 984 | addStartCallbackcxx . . $ SoXtViewer#addStartCallback(584743347ba26ea5).(SoXtViewercxx . . $ SoXtViewer#::bufferStartCallbackcxx . . $ SoXtViewer#bufferStartCallback(53b15af9fcb5e041).); |
| 985 | addFinishCallbackcxx . . $ SoXtViewer#addFinishCallback(584743347ba26ea5).(SoXtViewercxx . . $ SoXtViewer#::bufferFinishCallbackcxx . . $ SoXtViewer#bufferFinishCallback(53b15af9fcb5e041).); |
| 986 | break; |
| 987 | } |
| 988 | } |
| 989 | |
| 990 | //////////////////////////////////////////////////////////////////////// |
| 991 | // |
| 992 | // Description: |
| 993 | // Externally set the viewer into/out off seek mode (default OFF). Actual |
| 994 | // seeking will not happen until the viewer decides to (ex: mouse click). |
| 995 | // |
| 996 | // Note: setting the viewer out of seek mode while the camera is being |
| 997 | // animated will stop the animation to the current location. |
| 998 | // |
| 999 | // use: virtual protected |
| 1000 | |
| 1001 | void |
| 1002 | SoXtViewercxx . . $ SoXtViewer#::setSeekModecxx . . $ SoXtViewer#setSeekMode(d4f767463ce0a6b3).(SbBoolcxx . . $ SbBool# flag) |
| 1003 | // |
| 1004 | //////////////////////////////////////////////////////////////////////// |
| 1005 | { |
| 1006 | if (!isViewingcxx . . $ SoXtViewer#isViewing(455f465bc33b4cdf).()) |
| 1007 | return; |
| 1008 | |
| 1009 | // check if seek is being turned off while seek animation is happening |
| 1010 | if ( !flag && seekAnimationSensorcxx . . $ SoXtViewer#seekAnimationSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).() ) { |
| 1011 | seekAnimationSensorcxx . . $ SoXtViewer#seekAnimationSensor.->detachcxx . . $ SoFieldSensor#detach(49f6e7a06ebc5aa8).(); |
| 1012 | seekAnimationSensorcxx . . $ SoXtViewer#seekAnimationSensor.->unschedulecxx . . $ SoDataSensor#unschedule(49f6e7a06ebc5aa8).(); |
| 1013 | interactiveCountDeccxx . . $ SoXtViewer#interactiveCountDec(49f6e7a06ebc5aa8).(); |
| 1014 | } |
| 1015 | |
| 1016 | seekModeFlagcxx . . $ SoXtViewer#seekModeFlag. = flag; |
| 1017 | } |
| 1018 | |
| 1019 | //////////////////////////////////////////////////////////////////////// |
| 1020 | // |
| 1021 | // Description: |
| 1022 | // Adjust the camera clipping planes before a redraw. |
| 1023 | // |
| 1024 | // use: virtual protected. |
| 1025 | |
| 1026 | void |
| 1027 | SoXtViewercxx . . $ SoXtViewer#::actualRedrawcxx . . $ SoXtViewer#actualRedraw(49f6e7a06ebc5aa8).() |
| 1028 | // |
| 1029 | //////////////////////////////////////////////////////////////////////// |
| 1030 | { |
| 1031 | if (isAutoClippingcxx . . $ SoXtViewer#isAutoClipping(455f465bc33b4cdf).() && ! isStereoViewingcxx . . $ SoXtViewer#isStereoViewing(b126dc7c1de90089).()) |
| 1032 | adjustCameraClippingPlanescxx . . $ SoXtViewer#adjustCameraClippingPlanes(49f6e7a06ebc5aa8).(); |
| 1033 | |
| 1034 | // update the headlight if necessary |
| 1035 | if (headlightFlagcxx . . $ SoXtViewer#headlightFlag. && cameracxx . . $ SoXtViewer#camera.) |
| 1036 | headlightRotcxx . . $ SoXtViewer#headlightRot.->rotationcxx . . $ SoRotation#rotation..setValuecxx . . $ SoSFRotation#setValue(8b1048b3fc01a89c).(cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).()); |
| 1037 | |
| 1038 | // make sure that we have a valid sceneSize value - but don't compute |
| 1039 | // a new sceneSize value for every redraw since the walking speed should |
| 1040 | // really be constant. |
| 1041 | if (sceneSizecxx . . $ SoXtViewer#sceneSize. == 0.0) |
| 1042 | recomputeSceneSizecxx . . $ SoXtViewer#recomputeSceneSize(49f6e7a06ebc5aa8).(); |
| 1043 | |
| 1044 | // |
| 1045 | // Check to see if we are in stereo mode, if so draw the scene |
| 1046 | // twice with the camera offseted between the two views, else |
| 1047 | // do a simple redraw. |
| 1048 | // |
| 1049 | |
| 1050 | if ( isStereoViewingcxx . . $ SoXtViewer#isStereoViewing(b126dc7c1de90089).() && cameracxx . . $ SoXtViewer#camera. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 1051 | |
| 1052 | // Check the camera type, since stereo is different: |
| 1053 | // |
| 1054 | // Ortho camera: setereo is accomplished by simply rorating |
| 1055 | // the camera (around the point of interest) by 6 degree. |
| 1056 | // |
| 1057 | // Perspective camera: we translate the camera and rotate |
| 1058 | // them to look at the same point of interest (idealy we also would |
| 1059 | // make sure the plane of convergence is exactly the same for |
| 1060 | // both perspective views, unfortunatly we cannot do this with |
| 1061 | // the current symetric view volumes). |
| 1062 | // |
| 1063 | |
| 1064 | // save the camera original values to restore the camera after |
| 1065 | // both views are rendered. This means we will use this in between |
| 1066 | // left and right view for things like picking. |
| 1067 | SbVec3fcxx . . $ SbVec3f# camOrigPos = cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).(); |
| 1068 | SbRotationcxx . . $ SbRotation# camOrigRot = cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 1069 | |
| 1070 | // get the camera focal point |
| 1071 | SbMatrixcxx . . $ SbMatrix# mxcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).; |
| 1072 | mx =cxx . . $ SbMatrix#`operator=`(63101dd9e6974539). camOrigRot; |
| 1073 | SbVec3fcxx . . $ SbVec3f# forwardcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).( -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][0], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][1], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][2]); |
| 1074 | float radius = cameracxx . . $ SoXtViewer#camera.->focalDistancecxx . . $ SoCamera#focalDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 1075 | SbVec3fcxx . . $ SbVec3f# center = camOrigPos +cxx . . $ operator+(af63bf8d0639b76b). radius *cxx . . $ `operator*`(c40767b2d90b93cf). forward; |
| 1076 | |
| 1077 | #ifdef __sgi |
| 1078 | // |
| 1079 | // if we are splitting the screen in half (loose vertical resolution) |
| 1080 | // then change the aspect ratio to squish the objects to make them |
| 1081 | // look square again through the stereo glasses. This is done for |
| 1082 | // every redraw since we need to manually update the aspect ourself. |
| 1083 | // |
| 1084 | if (useSGIStereoExt) { |
| 1085 | SbVec2s windowSize = getGlxSize(); |
| 1086 | camera->aspectRatio = 0.5 * windowSize[0] / (float) windowSize[1]; |
| 1087 | camera->viewportMapping = SoCamera::LEAVE_ALONE; |
| 1088 | } |
| 1089 | #endif |
| 1090 | |
| 1091 | // |
| 1092 | // change the camera for the LEFT eye view, and render |
| 1093 | // |
| 1094 | #ifdef __sgi |
| 1095 | if (useSGIStereoExt) { |
| 1096 | XSGISetStereoBuffer(getDisplay(), getNormalWindow(), STEREO_BUFFER_LEFT); |
| 1097 | XSync(getDisplay(), False); |
| 1098 | } |
| 1099 | else |
| 1100 | #endif |
| 1101 | glDrawBuffer( (isDoubleBuffercxx . . $ SoXtGLWidget#isDoubleBuffer(b126dc7c1de90089).() && !drawToFrontBuffercxx . . $ SoXtGLWidget#drawToFrontBuffer.) ? |
| 1102 | GL_BACK_LEFTcxx . . $ `<external>/11565930711847777359/gl.h:439:9`! : GL_FRONT_LEFTcxx . . $ `<external>/11565930711847777359/gl.h:437:9`!); |
| 1103 | // rotate the camera by - stereoOffset/2 degrees |
| 1104 | cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation. =cxx . . $ SoSFRotation#`operator=`(a110af7e76887ee8). |
| 1105 | SbRotationcxx . . $ SbRotation#SbRotation(91fd4afec15735a5).(SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0, 1, 0), - stereoOffsetcxx . . $ SoXtViewer#stereoOffset. * M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`! / 360.0) *cxx . . $ `operator*`(78dcfe9615ed8d2d). camOrigRot; |
| 1106 | |
| 1107 | // reposition camera to look at pt of interest |
| 1108 | mx =cxx . . $ SbMatrix#`operator=`(63101dd9e6974539). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 1109 | forward.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][0], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][1], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][2]); |
| 1110 | cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). center -cxx . . $ operator-(af63bf8d0639b76b). radius *cxx . . $ `operator*`(c40767b2d90b93cf). forward; |
| 1111 | |
| 1112 | if (isAutoClippingcxx . . $ SoXtViewer#isAutoClipping(455f465bc33b4cdf).()) |
| 1113 | adjustCameraClippingPlanescxx . . $ SoXtViewer#adjustCameraClippingPlanes(49f6e7a06ebc5aa8).(); |
| 1114 | doRenderingcxx . . $ SoXtViewer#doRendering(49f6e7a06ebc5aa8).(); |
| 1115 | |
| 1116 | // |
| 1117 | // change the camera for the RIGHT eye view, and render |
| 1118 | // |
| 1119 | #ifdef __sgi |
| 1120 | if (useSGIStereoExt) { |
| 1121 | XSGISetStereoBuffer(getDisplay(), getNormalWindow(), STEREO_BUFFER_RIGHT); |
| 1122 | XSync(getDisplay(), False); |
| 1123 | } |
| 1124 | else |
| 1125 | #endif |
| 1126 | glDrawBuffer( (isDoubleBuffercxx . . $ SoXtGLWidget#isDoubleBuffer(b126dc7c1de90089).() && !drawToFrontBuffercxx . . $ SoXtGLWidget#drawToFrontBuffer.) ? |
| 1127 | GL_BACK_RIGHTcxx . . $ `<external>/11565930711847777359/gl.h:440:9`! : GL_FRONT_RIGHTcxx . . $ `<external>/11565930711847777359/gl.h:438:9`!); |
| 1128 | // rotate the camera by + stereoOffset/2 degrees |
| 1129 | cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation. =cxx . . $ SoSFRotation#`operator=`(a110af7e76887ee8). |
| 1130 | SbRotationcxx . . $ SbRotation#SbRotation(91fd4afec15735a5).(SbVec3fcxx . . $ SbVec3f#SbVec3f(bd1040fe176e0786).(0, 1, 0), stereoOffsetcxx . . $ SoXtViewer#stereoOffset. * M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`! / 360.0) *cxx . . $ `operator*`(78dcfe9615ed8d2d). camOrigRot; |
| 1131 | |
| 1132 | // reposition camera to look at pt of interest |
| 1133 | mx =cxx . . $ SbMatrix#`operator=`(63101dd9e6974539). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 1134 | forward.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).( -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][0], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][1], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][2]); |
| 1135 | cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). center -cxx . . $ operator-(af63bf8d0639b76b). radius *cxx . . $ `operator*`(c40767b2d90b93cf). forward; |
| 1136 | |
| 1137 | if (isAutoClippingcxx . . $ SoXtViewer#isAutoClipping(455f465bc33b4cdf).()) |
| 1138 | adjustCameraClippingPlanescxx . . $ SoXtViewer#adjustCameraClippingPlanes(49f6e7a06ebc5aa8).(); |
| 1139 | doRenderingcxx . . $ SoXtViewer#doRendering(49f6e7a06ebc5aa8).(); |
| 1140 | |
| 1141 | |
| 1142 | // |
| 1143 | // reset the camera original values now that we are done rendering |
| 1144 | // the stereo views (leave aspect ratio to do correct picking). |
| 1145 | cameracxx . . $ SoXtViewer#camera.->enableNotifycxx . . $ SoFieldContainer#enableNotify(7864480464b09eea).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); // don't cause a redraw |
| 1146 | cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). camOrigPos; |
| 1147 | cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation. =cxx . . $ SoSFRotation#`operator=`(a110af7e76887ee8). camOrigRot; |
| 1148 | cameracxx . . $ SoXtViewer#camera.->enableNotifycxx . . $ SoFieldContainer#enableNotify(7864480464b09eea).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 1149 | |
| 1150 | #ifdef __sgi |
| 1151 | if (! useSGIStereoExt) |
| 1152 | #endif |
| 1153 | // restore to draw to both buffer (viewer feedback) |
| 1154 | glDrawBuffer( (isDoubleBuffercxx . . $ SoXtGLWidget#isDoubleBuffer(b126dc7c1de90089).() && !drawToFrontBuffercxx . . $ SoXtGLWidget#drawToFrontBuffer.) ? |
| 1155 | GL_BACKcxx . . $ `<external>/11565930711847777359/gl.h:237:9`! : GL_FRONTcxx . . $ `<external>/11565930711847777359/gl.h:236:9`!); |
| 1156 | } |
| 1157 | // |
| 1158 | // else not stereo viewing, so do the regular rendering.... |
| 1159 | // |
| 1160 | else |
| 1161 | doRenderingcxx . . $ SoXtViewer#doRendering(49f6e7a06ebc5aa8).(); |
| 1162 | } |
| 1163 | |
| 1164 | //////////////////////////////////////////////////////////////////////// |
| 1165 | // |
| 1166 | // Description: |
| 1167 | // Do a multiple pass rendering if necessary, else simply call |
| 1168 | // SoXtRenderAre::actualRedraw() method. |
| 1169 | // |
| 1170 | // use: private |
| 1171 | void |
| 1172 | SoXtViewercxx . . $ SoXtViewer#::doRenderingcxx . . $ SoXtViewer#doRendering(49f6e7a06ebc5aa8).() |
| 1173 | // |
| 1174 | //////////////////////////////////////////////////////////////////////// |
| 1175 | { |
| 1176 | // |
| 1177 | // check if we need two pass rendering for hidden line rendering |
| 1178 | // |
| 1179 | |
| 1180 | SbBoolcxx . . $ SbBool# drawHiddenLine = |
| 1181 | (stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle. == VIEW_HIDDEN_LINEcxx . . $ SoXtViewer#VIEW_HIDDEN_LINE. && (! interactiveFlagcxx . . $ SoXtViewer#interactiveFlag. || |
| 1182 | interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_NO_TEXTUREcxx . . $ SoXtViewer#VIEW_NO_TEXTURE. || |
| 1183 | interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_LOW_COMPLEXITYcxx . . $ SoXtViewer#VIEW_LOW_COMPLEXITY. || |
| 1184 | interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_SAME_AS_STILLcxx . . $ SoXtViewer#VIEW_SAME_AS_STILL.)) |
| 1185 | || (interactiveFlagcxx . . $ SoXtViewer#interactiveFlag. && interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_HIDDEN_LINEcxx . . $ SoXtViewer#VIEW_HIDDEN_LINE.); |
| 1186 | |
| 1187 | if (cameracxx . . $ SoXtViewer#camera. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! && drawHiddenLine) { |
| 1188 | |
| 1189 | // ??? what do we do about highlights ?? |
| 1190 | |
| 1191 | // the smaller the near clipping plane is relative to the far |
| 1192 | // plane, the smaller the zbuffer offset needs to be (because |
| 1193 | // the granularity will be pretty big). The closer the clipping |
| 1194 | // planes are relative to each other, the bigger the zbuffer offset |
| 1195 | // needs to be (because the zbuffer granularity will be small). |
| 1196 | // The scale factor was found empirically to work best with the |
| 1197 | // current settings of near/far. |
| 1198 | float zOffset = cameracxx . . $ SoXtViewer#camera.->nearDistancecxx . . $ SoCamera#nearDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).() / |
| 1199 | (40 * cameracxx . . $ SoXtViewer#camera.->farDistancecxx . . $ SoCamera#farDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).()); |
| 1200 | |
| 1201 | // |
| 1202 | // render the first pass as solid, using the background color |
| 1203 | // for the object base color. |
| 1204 | // |
| 1205 | |
| 1206 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->stylecxx . . $ SoDrawStyle#style. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoDrawStylecxx . . $ SoDrawStyle#::FILLEDcxx . . $ SoDrawStyle#FILLED.; |
| 1207 | colorNodecxx . . $ SoXtViewer#colorNode.->orderedRGBAcxx . . $ SoPackedColor#orderedRGBA. =cxx . . $ SoMFUInt32#`operator=`(2141b656ce2cc063). getBackgroundColorcxx . . $ SoXtRenderArea#getBackgroundColor(d23318ddecff63dd).().getPackedValuecxx . . $ SbColor#getPackedValue(b4a4f3d4caa63b62).(); |
| 1208 | colorNodecxx . . $ SoXtViewer#colorNode.->orderedRGBAcxx . . $ SoPackedColor#orderedRGBA..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 1209 | matBindingNodecxx . . $ SoXtViewer#matBindingNode.->valuecxx . . $ SoMaterialBinding#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 1210 | |
| 1211 | // ??? this should match the SoXtRenderArea::actualRedraw() |
| 1212 | // ??? method exactly (apart for not clearing the z-buffer) |
| 1213 | glDepthRange(zOffset, 1); // enable wireframe to be draw on top |
| 1214 | getSceneManagercxx . . $ SoXtRenderArea#getSceneManager(70e0ae560043361f).()->rendercxx . . $ SoSceneManager#render(3e454b8ccf442868).(isClearBeforeRendercxx . . $ SoXtRenderArea#isClearBeforeRender(455f465bc33b4cdf).(), TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 1215 | |
| 1216 | // |
| 1217 | // render the second pass as wireframe |
| 1218 | // (the first pass rendered the objects solid with base color |
| 1219 | // set to the background color to set the zbuffer values) |
| 1220 | // |
| 1221 | |
| 1222 | drawStyleNodecxx . . $ SoXtViewer#drawStyleNode.->stylecxx . . $ SoDrawStyle#style. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). SoDrawStylecxx . . $ SoDrawStyle#::LINEScxx . . $ SoDrawStyle#LINES.; |
| 1223 | colorNodecxx . . $ SoXtViewer#colorNode.->orderedRGBAcxx . . $ SoPackedColor#orderedRGBA..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 1224 | matBindingNodecxx . . $ SoXtViewer#matBindingNode.->valuecxx . . $ SoMaterialBinding#value..setIgnoredcxx . . $ SoField#setIgnored(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 1225 | |
| 1226 | // ??? this should match the SoXtRenderArea::actualRedraw() |
| 1227 | // ??? method exactly (apart for not clearing the color and z-buffer) |
| 1228 | glDepthRange(0,1-zOffset); // enable wireframe to be draw on top |
| 1229 | getSceneManagercxx . . $ SoXtRenderArea#getSceneManager(70e0ae560043361f).()->rendercxx . . $ SoSceneManager#render(3e454b8ccf442868).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!, FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 1230 | |
| 1231 | glDepthRange(0, 1); // restore the range |
| 1232 | } |
| 1233 | else { |
| 1234 | // ??? this should match the SoXtRenderArea::actualRedraw() |
| 1235 | // ??? method exactly (apart for not clearing the z-buffer) |
| 1236 | getSceneManagercxx . . $ SoXtRenderArea#getSceneManager(70e0ae560043361f).()->rendercxx . . $ SoSceneManager#render(3e454b8ccf442868).(isClearBeforeRendercxx . . $ SoXtRenderArea#isClearBeforeRender(455f465bc33b4cdf).(), ! isZbufferOffcxx . . $ SoXtViewer#isZbufferOff(b126dc7c1de90089).()); |
| 1237 | } |
| 1238 | } |
| 1239 | |
| 1240 | //////////////////////////////////////////////////////////////////////// |
| 1241 | // |
| 1242 | // Description: |
| 1243 | // This is called when we are first mapped - this will check the |
| 1244 | // configuration of the machine we are running on and decide on what |
| 1245 | // draw style we should pick. |
| 1246 | // |
| 1247 | // use: virtual protected |
| 1248 | |
| 1249 | void |
| 1250 | SoXtViewercxx . . $ SoXtViewer#::afterRealizeHookcxx . . $ SoXtViewer#afterRealizeHook(49f6e7a06ebc5aa8).() |
| 1251 | // |
| 1252 | //////////////////////////////////////////////////////////////////////// |
| 1253 | { |
| 1254 | // call the base class |
| 1255 | SoXtRenderAreacxx . . $ SoXtRenderArea#::afterRealizeHookcxx . . $ SoXtComponent#afterRealizeHook(49f6e7a06ebc5aa8).(); |
| 1256 | |
| 1257 | // only do this once and only IF the user hasn't overwritten this |
| 1258 | if (! checkForDrawStylecxx . . $ SoXtViewer#checkForDrawStyle.) |
| 1259 | return; |
| 1260 | checkForDrawStylecxx . . $ SoXtViewer#checkForDrawStyle. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1261 | |
| 1262 | SbBoolcxx . . $ SbBool# useTexture = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; // true by default (and for new machines) |
| 1263 | const char *renderer = (const char *) glGetString(GL_RENDERERcxx . . $ `<external>/11565930711847777359/gl.h:654:9`!); |
| 1264 | |
| 1265 | // |
| 1266 | // On the following SGI machines we don't want texture rendering |
| 1267 | // to be turned on by default (for speed reason) - machines not listed |
| 1268 | // below are assumed to be fast enough to leave VIEW_AS_IS draw style. |
| 1269 | // |
| 1270 | |
| 1271 | if (strncmp((const char *)glGetString(GL_VENDORcxx . . $ `<external>/11565930711847777359/gl.h:653:9`!), "SGI", 3) == 0) { |
| 1272 | |
| 1273 | // Indy and XL |
| 1274 | if (useTexture && strncmp(renderer, "NEWPORT", 7) == 0) |
| 1275 | useTexture = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1276 | // Personal Iris |
| 1277 | if (useTexture && strncmp(renderer, "GR1", 3) == 0) |
| 1278 | useTexture = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1279 | // VGX and VGXT |
| 1280 | if (useTexture && strncmp(renderer, "VGX", 3) == 0) |
| 1281 | useTexture = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1282 | // Indigo Entry |
| 1283 | if (useTexture && |
| 1284 | strncmp(renderer, "LG1", 3) == 0 || |
| 1285 | strncmp(renderer, "LIGHT", 5) == 0) |
| 1286 | useTexture = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1287 | // XS, XZ, Elan, and Extreme |
| 1288 | if (useTexture && ( |
| 1289 | strncmp(renderer, "GR2", 3) == 0 || |
| 1290 | strncmp(renderer, "GR3", 3) == 0 || |
| 1291 | strncmp(renderer, "GU1", 3) == 0)) |
| 1292 | useTexture = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1293 | } |
| 1294 | |
| 1295 | if (! useTexture) |
| 1296 | setDrawStylecxx . . $ SoXtViewer#setDrawStyle(ea86062ff1532cd7).(SoXtViewercxx . . $ SoXtViewer#::INTERACTIVEcxx . . $ SoXtViewer#INTERACTIVE., SoXtViewercxx . . $ SoXtViewer#::VIEW_NO_TEXTUREcxx . . $ SoXtViewer#VIEW_NO_TEXTURE.); |
| 1297 | } |
| 1298 | |
| 1299 | //////////////////////////////////////////////////////////////////////// |
| 1300 | // |
| 1301 | // Description: |
| 1302 | // Returns TRUE if the zbuffer should be off (based on the viewer |
| 1303 | // draw styles). |
| 1304 | // |
| 1305 | // Use: private |
| 1306 | |
| 1307 | SbBoolcxx . . $ SbBool# |
| 1308 | SoXtViewercxx . . $ SoXtViewer#::isZbufferOffcxx . . $ SoXtViewer#isZbufferOff(b126dc7c1de90089).() |
| 1309 | // |
| 1310 | //////////////////////////////////////////////////////////////////////// |
| 1311 | { |
| 1312 | DrawStylecxx . . $ SoXtViewer#DrawStyle# style = (interactiveFlagcxx . . $ SoXtViewer#interactiveFlag. ? interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. : stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle.); |
| 1313 | if (interactiveFlagcxx . . $ SoXtViewer#interactiveFlag. && interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_SAME_AS_STILLcxx . . $ SoXtViewer#VIEW_SAME_AS_STILL.) |
| 1314 | style = stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle.; |
| 1315 | |
| 1316 | // for these draw styles, turn the zbuffer off |
| 1317 | return (style == VIEW_LOW_RES_LINEcxx . . $ SoXtViewer#VIEW_LOW_RES_LINE. || style == VIEW_LOW_RES_POINTcxx . . $ SoXtViewer#VIEW_LOW_RES_POINT. |
| 1318 | || style == VIEW_BBOXcxx . . $ SoXtViewer#VIEW_BBOX.); |
| 1319 | } |
| 1320 | |
| 1321 | //////////////////////////////////////////////////////////////////////// |
| 1322 | // |
| 1323 | // Description: |
| 1324 | // Sets the zbuffer state on the current window. This is called whenever |
| 1325 | // the windows changes (called by SoXtGLWidget::widgetChanged()) or when |
| 1326 | // the viewer draw style changes. |
| 1327 | // |
| 1328 | // Use: private |
| 1329 | |
| 1330 | void |
| 1331 | SoXtViewercxx . . $ SoXtViewer#::setZbufferStatecxx . . $ SoXtViewer#setZbufferState(49f6e7a06ebc5aa8).() |
| 1332 | // |
| 1333 | //////////////////////////////////////////////////////////////////////// |
| 1334 | { |
| 1335 | if (getNormalWindowcxx . . $ SoXtGLWidget#getNormalWindow(f708dce9a8856c70).() == (Windowcxx . . $ Window#) NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1336 | return; |
| 1337 | |
| 1338 | glXMakeCurrent(getDisplaycxx . . $ SoXtComponent#getDisplay(17eb9fe335efbb88).(), getNormalWindowcxx . . $ SoXtGLWidget#getNormalWindow(f708dce9a8856c70).(), getNormalContextcxx . . $ SoXtGLWidget#getNormalContext(de005d43f0a9bab4).()); |
| 1339 | |
| 1340 | if (isZbufferOffcxx . . $ SoXtViewer#isZbufferOff(b126dc7c1de90089).()) |
| 1341 | glDisable(GL_DEPTH_TESTcxx . . $ `<external>/11565930711847777359/gl.h:267:9`!); |
| 1342 | else |
| 1343 | glEnable(GL_DEPTH_TESTcxx . . $ `<external>/11565930711847777359/gl.h:267:9`!); |
| 1344 | } |
| 1345 | |
| 1346 | //////////////////////////////////////////////////////////////////////// |
| 1347 | // |
| 1348 | // Description: |
| 1349 | // saves the camera values for later restore. |
| 1350 | // |
| 1351 | // Use: virtual public |
| 1352 | |
| 1353 | void |
| 1354 | SoXtViewercxx . . $ SoXtViewer#::saveHomePositioncxx . . $ SoXtViewer#saveHomePosition(49f6e7a06ebc5aa8).() |
| 1355 | // |
| 1356 | //////////////////////////////////////////////////////////////////////// |
| 1357 | { |
| 1358 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1359 | return; |
| 1360 | |
| 1361 | origPositioncxx . . $ SoXtViewer#origPosition. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).(); |
| 1362 | origOrientationcxx . . $ SoXtViewer#origOrientation. =cxx . . $ SbRotation#`operator=`(9cd62c86def1db72). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 1363 | origNearDistancecxx . . $ SoXtViewer#origNearDistance. = cameracxx . . $ SoXtViewer#camera.->nearDistancecxx . . $ SoCamera#nearDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 1364 | origFarDistancecxx . . $ SoXtViewer#origFarDistance. = cameracxx . . $ SoXtViewer#camera.->farDistancecxx . . $ SoCamera#farDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 1365 | origFocalDistancecxx . . $ SoXtViewer#origFocalDistance. = cameracxx . . $ SoXtViewer#camera.->focalDistancecxx . . $ SoCamera#focalDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 1366 | |
| 1367 | // save camera height (changed by zooming) |
| 1368 | if (cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoPerspectiveCameracxx . . $ SoPerspectiveCamera#::getClassTypeIdcxx . . $ SoPerspectiveCamera#getClassTypeId(c00c150378d2b968).())) |
| 1369 | origHeightcxx . . $ SoXtViewer#origHeight. = ((SoPerspectiveCameracxx . . $ SoPerspectiveCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightAnglecxx . . $ SoPerspectiveCamera#heightAngle..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 1370 | else if (cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoOrthographicCameracxx . . $ SoOrthographicCamera#::getClassTypeIdcxx . . $ SoOrthographicCamera#getClassTypeId(c00c150378d2b968).())) |
| 1371 | origHeightcxx . . $ SoXtViewer#origHeight. = ((SoOrthographicCameracxx . . $ SoOrthographicCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightcxx . . $ SoOrthographicCamera#height..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 1372 | } |
| 1373 | |
| 1374 | //////////////////////////////////////////////////////////////////////// |
| 1375 | // |
| 1376 | // Description: |
| 1377 | // reset the camera to it's saved values. |
| 1378 | // |
| 1379 | // Use: virtual public |
| 1380 | |
| 1381 | void |
| 1382 | SoXtViewercxx . . $ SoXtViewer#::resetToHomePositioncxx . . $ SoXtViewer#resetToHomePosition(49f6e7a06ebc5aa8).() |
| 1383 | // |
| 1384 | //////////////////////////////////////////////////////////////////////// |
| 1385 | { |
| 1386 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1387 | return; |
| 1388 | |
| 1389 | cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). origPositioncxx . . $ SoXtViewer#origPosition.; |
| 1390 | cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation. =cxx . . $ SoSFRotation#`operator=`(a110af7e76887ee8). origOrientationcxx . . $ SoXtViewer#origOrientation.; |
| 1391 | cameracxx . . $ SoXtViewer#camera.->nearDistancecxx . . $ SoCamera#nearDistance. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). origNearDistancecxx . . $ SoXtViewer#origNearDistance.; |
| 1392 | cameracxx . . $ SoXtViewer#camera.->farDistancecxx . . $ SoCamera#farDistance. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). origFarDistancecxx . . $ SoXtViewer#origFarDistance.; |
| 1393 | cameracxx . . $ SoXtViewer#camera.->focalDistancecxx . . $ SoCamera#focalDistance. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). origFocalDistancecxx . . $ SoXtViewer#origFocalDistance.; |
| 1394 | |
| 1395 | // restore camera height (changed by zooming) |
| 1396 | if (cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoPerspectiveCameracxx . . $ SoPerspectiveCamera#::getClassTypeIdcxx . . $ SoPerspectiveCamera#getClassTypeId(c00c150378d2b968).())) |
| 1397 | ((SoPerspectiveCameracxx . . $ SoPerspectiveCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightAnglecxx . . $ SoPerspectiveCamera#heightAngle..setValuecxx . . $ SoSFFloat#setValue(9364e6e7bff7660).(origHeightcxx . . $ SoXtViewer#origHeight.); |
| 1398 | else if (cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoOrthographicCameracxx . . $ SoOrthographicCamera#::getClassTypeIdcxx . . $ SoOrthographicCamera#getClassTypeId(c00c150378d2b968).())) |
| 1399 | ((SoOrthographicCameracxx . . $ SoOrthographicCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightcxx . . $ SoOrthographicCamera#height..setValuecxx . . $ SoSFFloat#setValue(9364e6e7bff7660).(origHeightcxx . . $ SoXtViewer#origHeight.); |
| 1400 | } |
| 1401 | |
| 1402 | //////////////////////////////////////////////////////////////////////// |
| 1403 | // |
| 1404 | // Description: _ HACK BUG WORKAOUND _ |
| 1405 | // |
| 1406 | // This updates the event own internal knowledge about which buttons and |
| 1407 | // modifiers keys are down based of the event itself. |
| 1408 | // |
| 1409 | // ??? for some reason Xt does NOT update the event button and modifier |
| 1410 | // ??? state until AFTER the event has been sent to the widget. Knowing |
| 1411 | // ??? which mouse buttons and which modifiers keys are down when receiving |
| 1412 | // ??? ANY event (uncluding the event itself) is VERY useful and make |
| 1413 | // ??? the viewer mode chaging code MUCH simpler. |
| 1414 | // |
| 1415 | // Use: private - BUG WORKAROUND |
| 1416 | static void |
| 1417 | updateEventStatecxx . . $ updateEventState(63113e41a3ee5b9d).(XAnyEventcxx . . $ XAnyEvent# *xe) |
| 1418 | // |
| 1419 | //////////////////////////////////////////////////////////////////////// |
| 1420 | { |
| 1421 | XButtonEventcxx . . $ XButtonEvent# *be; |
| 1422 | XKeyEventcxx . . $ XKeyEvent# *ke; |
| 1423 | KeySymcxx . . $ KeySym# keysym; |
| 1424 | |
| 1425 | switch(xe->typecxx . . $ $anonymous_type_17d7f07cf933eea7_53#type.) { |
| 1426 | case ButtonPresscxx . . $ `<external>/1208737181511191802/X.h:183:9`!: |
| 1427 | be = (XButtonEventcxx . . $ XButtonEvent# *)xe; |
| 1428 | if (be->buttoncxx . . $ $anonymous_type_17d7f07cf933eea7_23#button. == Button1cxx . . $ `<external>/1208737181511191802/X.h:259:9`!) |
| 1429 | be->statecxx . . $ $anonymous_type_17d7f07cf933eea7_23#state. = (be->statecxx . . $ $anonymous_type_17d7f07cf933eea7_23#state. | Button1Maskcxx . . $ `<external>/1208737181511191802/X.h:246:9`!); |
| 1430 | else if (be->buttoncxx . . $ $anonymous_type_17d7f07cf933eea7_23#button. == Button2cxx . . $ `<external>/1208737181511191802/X.h:260:9`!) |
| 1431 | be->statecxx . . $ $anonymous_type_17d7f07cf933eea7_23#state. = (be->statecxx . . $ $anonymous_type_17d7f07cf933eea7_23#state. | Button2Maskcxx . . $ `<external>/1208737181511191802/X.h:247:9`!); |
| 1432 | break; |
| 1433 | |
| 1434 | case ButtonReleasecxx . . $ `<external>/1208737181511191802/X.h:184:9`!: |
| 1435 | be = (XButtonEventcxx . . $ XButtonEvent# *)xe; |
| 1436 | if (be->buttoncxx . . $ $anonymous_type_17d7f07cf933eea7_23#button. == Button1cxx . . $ `<external>/1208737181511191802/X.h:259:9`!) |
| 1437 | be->statecxx . . $ $anonymous_type_17d7f07cf933eea7_23#state. = (be->statecxx . . $ $anonymous_type_17d7f07cf933eea7_23#state. & ~Button1Maskcxx . . $ `<external>/1208737181511191802/X.h:246:9`!); |
| 1438 | else if (be->buttoncxx . . $ $anonymous_type_17d7f07cf933eea7_23#button. == Button2cxx . . $ `<external>/1208737181511191802/X.h:260:9`!) |
| 1439 | be->statecxx . . $ $anonymous_type_17d7f07cf933eea7_23#state. = (be->statecxx . . $ $anonymous_type_17d7f07cf933eea7_23#state. & ~Button2Maskcxx . . $ `<external>/1208737181511191802/X.h:247:9`!); |
| 1440 | break; |
| 1441 | |
| 1442 | case KeyPresscxx . . $ `<external>/1208737181511191802/X.h:181:9`!: |
| 1443 | case KeyReleasecxx . . $ `<external>/1208737181511191802/X.h:182:9`!: |
| 1444 | ke = (XKeyEventcxx . . $ XKeyEvent# *)xe; |
| 1445 | keysym = XLookupKeysym(ke, 0); |
| 1446 | |
| 1447 | if (keysym == XK_Control_Lcxx . . $ `/usr/include/X11/keysymdef.h:393:9`! || keysym == XK_Control_Rcxx . . $ `/usr/include/X11/keysymdef.h:394:9`!) { |
| 1448 | if (xe->typecxx . . $ $anonymous_type_17d7f07cf933eea7_53#type. == KeyPresscxx . . $ `<external>/1208737181511191802/X.h:181:9`!) |
| 1449 | ke->statecxx . . $ $anonymous_type_17d7f07cf933eea7_22#state. = (ke->statecxx . . $ $anonymous_type_17d7f07cf933eea7_22#state. | ControlMaskcxx . . $ `<external>/1208737181511191802/X.h:223:9`!); |
| 1450 | else |
| 1451 | ke->statecxx . . $ $anonymous_type_17d7f07cf933eea7_22#state. = (ke->statecxx . . $ $anonymous_type_17d7f07cf933eea7_22#state. & ~ControlMaskcxx . . $ `<external>/1208737181511191802/X.h:223:9`!); |
| 1452 | } |
| 1453 | break; |
| 1454 | } |
| 1455 | } |
| 1456 | |
| 1457 | //////////////////////////////////////////////////////////////////////// |
| 1458 | // |
| 1459 | // Description: |
| 1460 | // Process a common set of events which are shared accross all |
| 1461 | // viewers. Returning TRUE if the event was processed. |
| 1462 | // |
| 1463 | // Use: protected |
| 1464 | SbBoolcxx . . $ SbBool# |
| 1465 | SoXtViewercxx . . $ SoXtViewer#::processCommonEventscxx . . $ SoXtViewer#processCommonEvents(512c1ba9431588f7).(XAnyEventcxx . . $ XAnyEvent# *xe) |
| 1466 | // |
| 1467 | //////////////////////////////////////////////////////////////////////// |
| 1468 | { |
| 1469 | KeySymcxx . . $ KeySym# keysym; |
| 1470 | |
| 1471 | // check if the application wants to handle the event itself |
| 1472 | // instead of giving it to the viewer. This can be used to disable |
| 1473 | // some simple viewer functionality (like the Arrow keys or Esc key). |
| 1474 | // ??? this is a simple work around for bug #113991 - Xt translation |
| 1475 | // ??? tables would be better than dealing with events directly. |
| 1476 | if (SoXtRenderAreacxx . . $ SoXtRenderArea#::invokeAppCBcxx . . $ SoXtRenderArea#invokeAppCB(512c1ba9431588f7).(xe)) |
| 1477 | return TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 1478 | |
| 1479 | // |
| 1480 | // check for special key which turns viewing on/off |
| 1481 | // |
| 1482 | if (xe->typecxx . . $ $anonymous_type_17d7f07cf933eea7_53#type. == KeyPresscxx . . $ `<external>/1208737181511191802/X.h:181:9`!) { |
| 1483 | XKeyEventcxx . . $ XKeyEvent# *ke = (XKeyEventcxx . . $ XKeyEvent# *)xe; |
| 1484 | keysym = XLookupKeysym(ke, 0); |
| 1485 | if (keysym == XK_Escapecxx . . $ `/usr/include/X11/keysymdef.h:208:9`!) { |
| 1486 | setViewingcxx . . $ SoXtViewer#setViewing(d4f767463ce0a6b3).( !isViewingcxx . . $ SoXtViewer#isViewing(455f465bc33b4cdf).() ); // toggle the viewing mode... |
| 1487 | return TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 1488 | } |
| 1489 | else if (!isViewingcxx . . $ SoXtViewer#isViewing(455f465bc33b4cdf).() && (keysym == XK_Alt_Lcxx . . $ `/usr/include/X11/keysymdef.h:400:9`! || keysym == XK_Alt_Rcxx . . $ `/usr/include/X11/keysymdef.h:401:9`!) |
| 1490 | && !(ke->statecxx . . $ $anonymous_type_17d7f07cf933eea7_22#state. & Button1Maskcxx . . $ `<external>/1208737181511191802/X.h:246:9`! || ke->statecxx . . $ $anonymous_type_17d7f07cf933eea7_22#state. & Button2Maskcxx . . $ `<external>/1208737181511191802/X.h:247:9`!)) { |
| 1491 | // Alt-key goes from PICK to VIEW if |
| 1492 | // 1] we are not in VIEW mode already |
| 1493 | // 2] no mouse buttons are pressed |
| 1494 | // |
| 1495 | altSwitchBackcxx . . $ SoXtViewer#altSwitchBack. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; // later return back |
| 1496 | setViewingcxx . . $ SoXtViewer#setViewing(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 1497 | return TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 1498 | } |
| 1499 | } |
| 1500 | else if (xe->typecxx . . $ $anonymous_type_17d7f07cf933eea7_53#type. == KeyReleasecxx . . $ `<external>/1208737181511191802/X.h:182:9`!) { |
| 1501 | keysym = XLookupKeysym((XKeyEventcxx . . $ XKeyEvent# *)xe, 0); |
| 1502 | if (altSwitchBackcxx . . $ SoXtViewer#altSwitchBack. && (keysym == XK_Alt_Lcxx . . $ `/usr/include/X11/keysymdef.h:400:9`! || keysym == XK_Alt_Rcxx . . $ `/usr/include/X11/keysymdef.h:401:9`!)) { |
| 1503 | // if Alt-key, then return to PICK (if we had switched) |
| 1504 | setViewingcxx . . $ SoXtViewer#setViewing(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 1505 | altSwitchBackcxx . . $ SoXtViewer#altSwitchBack. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; // clear the flag |
| 1506 | return TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 1507 | } |
| 1508 | } |
| 1509 | else if (xe->typecxx . . $ $anonymous_type_17d7f07cf933eea7_53#type. == EnterNotifycxx . . $ `<external>/1208737181511191802/X.h:186:9`!) { |
| 1510 | XCrossingEventcxx . . $ XCrossingEvent# *ce = (XCrossingEventcxx . . $ XCrossingEvent# *)xe; |
| 1511 | // |
| 1512 | // because the application might use Alt-key for motif menu |
| 1513 | // accelerators we might not receive a key-up event, so make sure |
| 1514 | // to reset any Alt mode (temporary viewing) when the mouse re-enters |
| 1515 | // the window. |
| 1516 | // |
| 1517 | if (! isViewingcxx . . $ SoXtViewer#isViewing(455f465bc33b4cdf).() && ce->statecxx . . $ $anonymous_type_17d7f07cf933eea7_25#state. & Mod1Maskcxx . . $ `<external>/1208737181511191802/X.h:224:9`!) { |
| 1518 | altSwitchBackcxx . . $ SoXtViewer#altSwitchBack. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; // later return back |
| 1519 | setViewingcxx . . $ SoXtViewer#setViewing(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 1520 | } |
| 1521 | else if (altSwitchBackcxx . . $ SoXtViewer#altSwitchBack. && !(ce->statecxx . . $ $anonymous_type_17d7f07cf933eea7_25#state. & Mod1Maskcxx . . $ `<external>/1208737181511191802/X.h:224:9`!)) { |
| 1522 | setViewingcxx . . $ SoXtViewer#setViewing(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 1523 | altSwitchBackcxx . . $ SoXtViewer#altSwitchBack. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; // clear the flag |
| 1524 | } |
| 1525 | } |
| 1526 | |
| 1527 | // send the event to the scene graph if viewing is off |
| 1528 | if ( !isViewingcxx . . $ SoXtViewer#isViewing(455f465bc33b4cdf).() ) { |
| 1529 | // prevent renderArea from sending the event to the app twice |
| 1530 | // since it is done above... |
| 1531 | SoXtRenderAreaEventCBcxx . . $ SoXtRenderAreaEventCB# *saveFunc = appEventHandlercxx . . $ SoXtRenderArea#appEventHandler.; |
| 1532 | appEventHandlercxx . . $ SoXtRenderArea#appEventHandler. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1533 | SoXtRenderAreacxx . . $ SoXtRenderArea#::processEventcxx . . $ SoXtRenderArea#processEvent(63113e41a3ee5b9d).(xe); |
| 1534 | appEventHandlercxx . . $ SoXtRenderArea#appEventHandler. = saveFunc; |
| 1535 | |
| 1536 | return TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 1537 | } |
| 1538 | |
| 1539 | // if no camera discard events |
| 1540 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1541 | return TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 1542 | |
| 1543 | SbBoolcxx . . $ SbBool# handled = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 1544 | |
| 1545 | // ??? workaround what seem to be an Xt bug... |
| 1546 | updateEventStatecxx . . $ updateEventState(63113e41a3ee5b9d).(xe); |
| 1547 | |
| 1548 | switch(xe->typecxx . . $ $anonymous_type_17d7f07cf933eea7_53#type.) { |
| 1549 | case KeyPresscxx . . $ `<external>/1208737181511191802/X.h:181:9`!: |
| 1550 | switch ( keysym ) { |
| 1551 | case XK_Homecxx . . $ `/usr/include/X11/keysymdef.h:248:9`!: |
| 1552 | resetToHomePositioncxx . . $ SoXtViewer#resetToHomePosition(49f6e7a06ebc5aa8).(); |
| 1553 | break; |
| 1554 | case XK_scxx . . $ `/usr/include/X11/keysymdef.h:708:9`!: |
| 1555 | setSeekModecxx . . $ SoXtViewer#setSeekMode(d4f767463ce0a6b3).( !isSeekModecxx . . $ SoXtViewer#isSeekMode(b126dc7c1de90089).() ); |
| 1556 | // ??? this is kind of a hack, but it is needed |
| 1557 | // ??? until a better solution is found |
| 1558 | if ( isSeekModecxx . . $ SoXtViewer#isSeekMode(b126dc7c1de90089).() && interactiveCountcxx . . $ SoXtViewer#interactiveCount. != 0 ) { |
| 1559 | interactiveCountcxx . . $ SoXtViewer#interactiveCount. = 0; |
| 1560 | finishCBListcxx . . $ SoXtViewer#finishCBList.->invokeCallbackscxx . . $ SoCallbackList#invokeCallbacks(5d22bdacc48458e8).(this); |
| 1561 | } |
| 1562 | break; |
| 1563 | case XK_Leftcxx . . $ `/usr/include/X11/keysymdef.h:249:9`!: |
| 1564 | case XK_Upcxx . . $ `/usr/include/X11/keysymdef.h:250:9`!: |
| 1565 | case XK_Rightcxx . . $ `/usr/include/X11/keysymdef.h:251:9`!: |
| 1566 | case XK_Downcxx . . $ `/usr/include/X11/keysymdef.h:252:9`!: |
| 1567 | arrowKeyPressedcxx . . $ SoXtViewer#arrowKeyPressed(2c44cd906ae4e829).(keysym); |
| 1568 | break; |
| 1569 | default: |
| 1570 | handled = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1571 | break; |
| 1572 | } |
| 1573 | break; |
| 1574 | |
| 1575 | default: |
| 1576 | handled = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1577 | break; |
| 1578 | } |
| 1579 | |
| 1580 | return handled; |
| 1581 | } |
| 1582 | |
| 1583 | //////////////////////////////////////////////////////////////////////// |
| 1584 | // |
| 1585 | // Description: |
| 1586 | // Increment the intercative viewing counter. |
| 1587 | // |
| 1588 | // Use: protected. |
| 1589 | |
| 1590 | void |
| 1591 | SoXtViewercxx . . $ SoXtViewer#::interactiveCountInccxx . . $ SoXtViewer#interactiveCountInc(49f6e7a06ebc5aa8).() |
| 1592 | // |
| 1593 | //////////////////////////////////////////////////////////////////////// |
| 1594 | { |
| 1595 | interactiveCountcxx . . $ SoXtViewer#interactiveCount.++; |
| 1596 | |
| 1597 | if (interactiveCountcxx . . $ SoXtViewer#interactiveCount. == 1) |
| 1598 | startCBListcxx . . $ SoXtViewer#startCBList.->invokeCallbackscxx . . $ SoCallbackList#invokeCallbacks(5d22bdacc48458e8).(this); |
| 1599 | } |
| 1600 | |
| 1601 | //////////////////////////////////////////////////////////////////////// |
| 1602 | // |
| 1603 | // Description: |
| 1604 | // Decrement the intercative viewing counter. |
| 1605 | // |
| 1606 | // Use: protected. |
| 1607 | |
| 1608 | void |
| 1609 | SoXtViewercxx . . $ SoXtViewer#::interactiveCountDeccxx . . $ SoXtViewer#interactiveCountDec(49f6e7a06ebc5aa8).() |
| 1610 | // |
| 1611 | //////////////////////////////////////////////////////////////////////// |
| 1612 | { |
| 1613 | if (interactiveCountcxx . . $ SoXtViewer#interactiveCount. > 0) { |
| 1614 | interactiveCountcxx . . $ SoXtViewer#interactiveCount.--; |
| 1615 | if (interactiveCountcxx . . $ SoXtViewer#interactiveCount. == 0) |
| 1616 | finishCBListcxx . . $ SoXtViewer#finishCBList.->invokeCallbackscxx . . $ SoCallbackList#invokeCallbacks(5d22bdacc48458e8).(this); |
| 1617 | } |
| 1618 | } |
| 1619 | |
| 1620 | //////////////////////////////////////////////////////////////////////// |
| 1621 | // |
| 1622 | // Description: |
| 1623 | // This routine is used by subclasses to initiate the seek animation. Given a |
| 1624 | // screen mouse location, this routine will return the picked point |
| 1625 | // and the normal at that point. It will also schedule the sensor to animate |
| 1626 | // if necessary. The routine retuns TRUE if something got picked... |
| 1627 | // |
| 1628 | // Note: if detailSeek is on, the point and normal correspond to the exact |
| 1629 | // 3D location under the cursor. |
| 1630 | // if detailSeek if off, the object bbox center and the camera |
| 1631 | // orientation are instead returned. |
| 1632 | // |
| 1633 | // Use: protected. |
| 1634 | |
| 1635 | SbBoolcxx . . $ SbBool# |
| 1636 | SoXtViewercxx . . $ SoXtViewer#::seekToPointcxx . . $ SoXtViewer#seekToPoint(296200a081bb1025).(const SbVec2scxx . . $ SbVec2s# &mouseLocation) |
| 1637 | // |
| 1638 | //////////////////////////////////////////////////////////////////////// |
| 1639 | { |
| 1640 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 1641 | setSeekModecxx . . $ SoXtViewer#setSeekMode(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 1642 | return FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1643 | } |
| 1644 | |
| 1645 | // do the picking |
| 1646 | // Use assignment notation to disambiguate from expression (edison) |
| 1647 | SoRayPickActioncxx . . $ SoRayPickAction# pick = SoRayPickActioncxx . . $ SoRayPickAction#SoRayPickAction(6b06d788389016cd).(SbViewportRegioncxx . . $ SbViewportRegion#(getGlxSizecxx . . $ SoXtGLWidget#getGlxSize(f469ede4e6b056fc).())); |
| 1648 | pick.setPointcxx . . $ SoRayPickAction#setPoint(8bc400dc8eb33072).(mouseLocation); |
| 1649 | pick.setRadiuscxx . . $ SoRayPickAction#setRadius(9364e6e7bff7660).(1.0); |
| 1650 | pick.setPickAllcxx . . $ SoRayPickAction#setPickAll(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); // pick only the closest object |
| 1651 | pick.applycxx . . $ SoAction#apply(da6c7544ccee32bd).(sceneRootcxx . . $ SoXtViewer#sceneRoot.); |
| 1652 | |
| 1653 | // makes sure something got picked |
| 1654 | SoPickedPointcxx . . $ SoPickedPoint# *pp = pick.getPickedPointcxx . . $ SoRayPickAction#getPickedPoint(5412072a3cb7e313).(); |
| 1655 | if ( pp == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! ) { |
| 1656 | setSeekModecxx . . $ SoXtViewer#setSeekMode(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 1657 | return FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1658 | } |
| 1659 | |
| 1660 | // |
| 1661 | // Get picked point and normal if detailtSeek |
| 1662 | // |
| 1663 | if (detailSeekFlagcxx . . $ SoXtViewer#detailSeekFlag.) { |
| 1664 | |
| 1665 | seekPointcxx . . $ SoXtViewer#seekPoint. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). pp->getPointcxx . . $ SoPickedPoint#getPoint(b5c384c15c94bb12).(); |
| 1666 | seekNormalcxx . . $ SoXtViewer#seekNormal. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). pp->getNormalcxx . . $ SoPickedPoint#getNormal(b5c384c15c94bb12).(); |
| 1667 | |
| 1668 | // check to make sure normal points torward the camera, else |
| 1669 | // flip the normal around |
| 1670 | if ( seekNormalcxx . . $ SoXtViewer#seekNormal..dotcxx . . $ SbVec3f#dot(adcfb95606509c95).(cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).() -cxx . . $ operator-(af63bf8d0639b76b). seekPointcxx . . $ SoXtViewer#seekPoint.) < 0 ) |
| 1671 | seekNormalcxx . . $ SoXtViewer#seekNormal..negatecxx . . $ SbVec3f#negate(49f6e7a06ebc5aa8).(); |
| 1672 | } |
| 1673 | // |
| 1674 | // else get object bounding box as the seek point and the camera |
| 1675 | // orientation as the normal. |
| 1676 | // |
| 1677 | else { |
| 1678 | // get center of object's bounding box |
| 1679 | // Use assignment notation to disambiguate from expression (edison) |
| 1680 | SoGetBoundingBoxActioncxx . . $ SoGetBoundingBoxAction# bba = SoGetBoundingBoxActioncxx . . $ SoGetBoundingBoxAction#SoGetBoundingBoxAction(6b06d788389016cd).(SbViewportRegioncxx . . $ SbViewportRegion#(getGlxSizecxx . . $ SoXtGLWidget#getGlxSize(f469ede4e6b056fc).())); |
| 1681 | bba.applycxx . . $ SoAction#apply(eed4dbbaf0eca0f1).(pp->getPathcxx . . $ SoPickedPoint#getPath(58db5280b30558ed).()); |
| 1682 | SbBox3fcxx . . $ SbBox3f# bbox = bba.getBoundingBoxcxx . . $ SoGetBoundingBoxAction#getBoundingBox(e568136409c83d61).(); |
| 1683 | seekPointcxx . . $ SoXtViewer#seekPoint. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). bbox.getCentercxx . . $ SbBox3f#getCenter(db3a50f11c44d732).(); |
| 1684 | |
| 1685 | // keep the camera oriented the same way |
| 1686 | SbMatrixcxx . . $ SbMatrix# mxcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).; |
| 1687 | mx =cxx . . $ SbMatrix#`operator=`(63101dd9e6974539). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 1688 | seekNormalcxx . . $ SoXtViewer#seekNormal..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][0], mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][1], mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][2]); |
| 1689 | } |
| 1690 | |
| 1691 | |
| 1692 | // |
| 1693 | // now check if animation sensor needs to be scheduled |
| 1694 | // |
| 1695 | |
| 1696 | computeSeekVariablescxx . . $ SoXtViewer#computeSeekVariables. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 1697 | if (seekAnimTimecxx . . $ SoXtViewer#seekAnimTime. == 0) { |
| 1698 | |
| 1699 | // jump to new location, no animation needed |
| 1700 | interpolateSeekAnimationcxx . . $ SoXtViewer#interpolateSeekAnimation(9364e6e7bff7660).(1.0); |
| 1701 | } |
| 1702 | else { |
| 1703 | // schedule sensor and call viewer start callbacks |
| 1704 | if ( ! seekAnimationSensorcxx . . $ SoXtViewer#seekAnimationSensor.->getAttachedFieldcxx . . $ SoFieldSensor#getAttachedField(c4a4d937024b6702).() ) { |
| 1705 | seekAnimationSensorcxx . . $ SoXtViewer#seekAnimationSensor.->attachcxx . . $ SoFieldSensor#attach(6a35cc9f7090653f).(viewerRealTimecxx . . $ SoXtViewer#viewerRealTime.); |
| 1706 | seekAnimationSensorcxx . . $ SoXtViewer#seekAnimationSensor.->schedulecxx . . $ SoDelayQueueSensor#schedule(49f6e7a06ebc5aa8).(); |
| 1707 | interactiveCountInccxx . . $ SoXtViewer#interactiveCountInc(49f6e7a06ebc5aa8).(); |
| 1708 | } |
| 1709 | |
| 1710 | seekStartTimecxx . . $ SoXtViewer#seekStartTime. =cxx . . $ SbTime#`operator=`(73027bd0a2429d7a). viewerRealTimecxx . . $ SoXtViewer#viewerRealTime.->getValuecxx . . $ SoSFTime#getValue(cf36f2df8ef835a6).(); |
| 1711 | } |
| 1712 | |
| 1713 | return TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; // successfull |
| 1714 | } |
| 1715 | |
| 1716 | //////////////////////////////////////////////////////////////////////// |
| 1717 | // |
| 1718 | // Description: |
| 1719 | // computes what the final camera seek orientation should be. |
| 1720 | // |
| 1721 | // Use: virtual protected |
| 1722 | |
| 1723 | void |
| 1724 | SoXtViewercxx . . $ SoXtViewer#::computeSeekFinalOrientationcxx . . $ SoXtViewer#computeSeekFinalOrientation(49f6e7a06ebc5aa8).() |
| 1725 | // |
| 1726 | //////////////////////////////////////////////////////////////////////// |
| 1727 | { |
| 1728 | SbMatrixcxx . . $ SbMatrix# mxcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).; |
| 1729 | SbVec3fcxx . . $ SbVec3f# viewVectorcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).; |
| 1730 | |
| 1731 | // find the camera final orientation |
| 1732 | if ( isDetailSeekcxx . . $ SoXtViewer#isDetailSeek(b126dc7c1de90089).() ) { |
| 1733 | |
| 1734 | // get the camera new orientation |
| 1735 | mx =cxx . . $ SbMatrix#`operator=`(63101dd9e6974539). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 1736 | viewVector.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][0], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][1], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][2]); |
| 1737 | SbRotationcxx . . $ SbRotation# changeOrientcxx . . $ SbRotation#SbRotation(49f6e7a06ebc5aa8).; |
| 1738 | changeOrient.setValuecxx . . $ SbRotation#setValue(f162005ec5d48f00).(viewVector, seekPointcxx . . $ SoXtViewer#seekPoint. -cxx . . $ operator-(af63bf8d0639b76b). cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).()); |
| 1739 | newCamOrientationcxx . . $ SoXtViewer#newCamOrientation. =cxx . . $ SbRotation#`operator=`(9cd62c86def1db72). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).() *cxx . . $ `operator*`(78dcfe9615ed8d2d). changeOrient; |
| 1740 | } |
| 1741 | else |
| 1742 | newCamOrientationcxx . . $ SoXtViewer#newCamOrientation. =cxx . . $ SbRotation#`operator=`(9cd62c86def1db72). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 1743 | } |
| 1744 | |
| 1745 | //////////////////////////////////////////////////////////////////////// |
| 1746 | // |
| 1747 | // Description: |
| 1748 | // |
| 1749 | // Use: virtual protected |
| 1750 | |
| 1751 | void |
| 1752 | SoXtViewercxx . . $ SoXtViewer#::interpolateSeekAnimationcxx . . $ SoXtViewer#interpolateSeekAnimation(9364e6e7bff7660).(float t) |
| 1753 | // |
| 1754 | //////////////////////////////////////////////////////////////////////// |
| 1755 | { |
| 1756 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1757 | return; |
| 1758 | |
| 1759 | // |
| 1760 | // check if camera new and old position/orientation have already |
| 1761 | // been computed. |
| 1762 | // |
| 1763 | if (computeSeekVariablescxx . . $ SoXtViewer#computeSeekVariables.) { |
| 1764 | SbMatrixcxx . . $ SbMatrix# mxcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).; |
| 1765 | SbVec3fcxx . . $ SbVec3f# viewVectorcxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).; |
| 1766 | |
| 1767 | // save camera starting point |
| 1768 | oldCamPositioncxx . . $ SoXtViewer#oldCamPosition. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).(); |
| 1769 | oldCamOrientationcxx . . $ SoXtViewer#oldCamOrientation. =cxx . . $ SbRotation#`operator=`(9cd62c86def1db72). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 1770 | |
| 1771 | // compute the distance the camera will be from the seek point |
| 1772 | // and update the camera focalDistance. |
| 1773 | float dist; |
| 1774 | if ( seekDistAsPercentagecxx . . $ SoXtViewer#seekDistAsPercentage. ) { |
| 1775 | SbVec3fcxx . . $ SbVec3f# seekVec(seekPointcxx . . $ SoXtViewer#seekPoint. -cxx . . $ operator-(af63bf8d0639b76b). cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).()); |
| 1776 | dist = seekVec.lengthcxx . . $ SbVec3f#length(5036dfe8d4170af2).() * (seekDistancecxx . . $ SoXtViewer#seekDistance. / 100.0); |
| 1777 | } |
| 1778 | else |
| 1779 | dist = seekDistancecxx . . $ SoXtViewer#seekDistance.; |
| 1780 | cameracxx . . $ SoXtViewer#camera.->focalDistancecxx . . $ SoCamera#focalDistance. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). dist; |
| 1781 | |
| 1782 | // let subclasses have a chance to redefine what the |
| 1783 | // camera final orientation should be. |
| 1784 | computeSeekFinalOrientationcxx . . $ SoXtViewer#computeSeekFinalOrientation(49f6e7a06ebc5aa8).(); |
| 1785 | |
| 1786 | // find the camera final position based on orientation and distance |
| 1787 | mx =cxx . . $ SbMatrix#`operator=`(63101dd9e6974539). newCamOrientationcxx . . $ SoXtViewer#newCamOrientation.; |
| 1788 | viewVector.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][0], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][1], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).2][2]); |
| 1789 | newCamPositioncxx . . $ SoXtViewer#newCamPosition. =cxx . . $ SbVec3f#`operator=`(c7808628d070cfbe). seekPointcxx . . $ SoXtViewer#seekPoint. -cxx . . $ operator-(af63bf8d0639b76b). dist *cxx . . $ `operator*`(c40767b2d90b93cf). viewVector; |
| 1790 | |
| 1791 | computeSeekVariablescxx . . $ SoXtViewer#computeSeekVariables. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; |
| 1792 | } |
| 1793 | |
| 1794 | |
| 1795 | // |
| 1796 | // Now position the camera according to the animation time |
| 1797 | // |
| 1798 | |
| 1799 | // use and ease-in ease-out approach |
| 1800 | float cos_t = 0.5 - 0.5 * cosf(t * M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`!); |
| 1801 | |
| 1802 | // get camera new rotation |
| 1803 | cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation. =cxx . . $ SoSFRotation#`operator=`(a110af7e76887ee8). SbRotationcxx . . $ SbRotation#::slerpcxx . . $ SbRotation#slerp(516bea3fee0bfab9).(oldCamOrientationcxx . . $ SoXtViewer#oldCamOrientation., newCamOrientationcxx . . $ SoXtViewer#newCamOrientation., cos_t); |
| 1804 | |
| 1805 | // get camera new position |
| 1806 | cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). oldCamPositioncxx . . $ SoXtViewer#oldCamPosition. +cxx . . $ operator+(af63bf8d0639b76b). (newCamPositioncxx . . $ SoXtViewer#newCamPosition. -cxx . . $ operator-(af63bf8d0639b76b). oldCamPositioncxx . . $ SoXtViewer#oldCamPosition.) *cxx . . $ `operator*`(8301011090c64e0f). cos_t; |
| 1807 | } |
| 1808 | |
| 1809 | //////////////////////////////////////////////////////////////////////// |
| 1810 | // |
| 1811 | // Description: |
| 1812 | // Adjust the camera clipping planes based on the scene bounding |
| 1813 | // box. (called before every redraws) |
| 1814 | // |
| 1815 | // use: virtual protected |
| 1816 | |
| 1817 | void |
| 1818 | SoXtViewercxx . . $ SoXtViewer#::adjustCameraClippingPlanescxx . . $ SoXtViewer#adjustCameraClippingPlanes(49f6e7a06ebc5aa8).() |
| 1819 | // |
| 1820 | //////////////////////////////////////////////////////////////////////// |
| 1821 | { |
| 1822 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1823 | return; |
| 1824 | |
| 1825 | // get the scene bounding box |
| 1826 | autoClipBboxActioncxx . . $ SoXtViewer#autoClipBboxAction.->setViewportRegioncxx . . $ SoGetBoundingBoxAction#setViewportRegion(6b06d788389016cd).(SbViewportRegioncxx . . $ SbViewportRegion#(getGlxSizecxx . . $ SoXtGLWidget#getGlxSize(f469ede4e6b056fc).())); |
| 1827 | autoClipBboxActioncxx . . $ SoXtViewer#autoClipBboxAction.->applycxx . . $ SoAction#apply(da6c7544ccee32bd).(sceneRootcxx . . $ SoXtViewer#sceneRoot.); |
| 1828 | |
| 1829 | SbXfBox3fcxx . . $ SbXfBox3f# xfbbox = autoClipBboxActioncxx . . $ SoXtViewer#autoClipBboxAction.->getXfBoundingBoxcxx . . $ SoGetBoundingBoxAction#getXfBoundingBox(f59fe64234294cf4).(); |
| 1830 | |
| 1831 | // get camera transformation and apply to xfbbox |
| 1832 | // to align the bounding box to camera space. |
| 1833 | // This will enable us to simply use the z values of the |
| 1834 | // transformed bbox for near and far plane values. |
| 1835 | SbMatrixcxx . . $ SbMatrix# mxcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).; |
| 1836 | mx.setTranslatecxx . . $ SbMatrix#setTranslate(65a601b9d70571d6).(-cxx . . $ SbVec3f#operator-(db3a50f11c44d732). cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).()); |
| 1837 | xfbbox.transformcxx . . $ SbXfBox3f#transform(37d2f951b3ffd7a6).(mx); |
| 1838 | mx =cxx . . $ SbMatrix#`operator=`(63101dd9e6974539). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).().inversecxx . . $ SbRotation#inverse(ab9eafb24c82872e).(); |
| 1839 | xfbbox.transformcxx . . $ SbXfBox3f#transform(37d2f951b3ffd7a6).(mx); |
| 1840 | |
| 1841 | // get screen align bbox and figure the near and far plane values |
| 1842 | SbBox3fcxx . . $ SbBox3f# bbox = xfbbox.projectcxx . . $ SbXfBox3f#project(e568136409c83d61).(); |
| 1843 | // take negative value and opposite to what one might think |
| 1844 | // because the camera points down the -Z axis |
| 1845 | float far = - bbox.getMincxx . . $ SbBox3f#getMin(43204b2a3e64f32b).()[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).2]; |
| 1846 | float near = - bbox.getMaxcxx . . $ SbBox3f#getMax(43204b2a3e64f32b).()[cxx . . $ SbVec3f#`operator[]`(5dbdaf238659ae67).2]; |
| 1847 | |
| 1848 | // scene is behind the camera so don't change the planes |
| 1849 | if (far < 0) |
| 1850 | return; |
| 1851 | |
| 1852 | // check for minimum near plane value (Value will be negative |
| 1853 | // when the camera is inside the bounding box). |
| 1854 | // Note: there needs to be a minimum near value for perspective |
| 1855 | // camera because of zbuffer resolution problem (plus the values |
| 1856 | // has to be positive). There is no such restriction for |
| 1857 | // an Orthographic camera (you can see behind you). |
| 1858 | if (! cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoOrthographicCameracxx . . $ SoOrthographicCamera#::getClassTypeIdcxx . . $ SoOrthographicCamera#getClassTypeId(c00c150378d2b968).())) { |
| 1859 | if (near < (minimumNearPlanecxx . . $ SoXtViewer#minimumNearPlane. * far)) |
| 1860 | near = minimumNearPlanecxx . . $ SoXtViewer#minimumNearPlane. * far; |
| 1861 | } |
| 1862 | |
| 1863 | // give the near and far distances a little bit of slack in case |
| 1864 | // the object lies against the bounding box, otherwise the object |
| 1865 | // will be poping in and out of view. |
| 1866 | // (example: a cube is the same as it's bbox) |
| 1867 | near *= 0.999; |
| 1868 | far *= 1.001; |
| 1869 | |
| 1870 | // finally assign camera plane values |
| 1871 | if (cameracxx . . $ SoXtViewer#camera.->nearDistancecxx . . $ SoCamera#nearDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).() != near) |
| 1872 | cameracxx . . $ SoXtViewer#camera.->nearDistancecxx . . $ SoCamera#nearDistance. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). near; |
| 1873 | if (cameracxx . . $ SoXtViewer#camera.->farDistancecxx . . $ SoCamera#farDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).() != far) |
| 1874 | cameracxx . . $ SoXtViewer#camera.->farDistancecxx . . $ SoCamera#farDistance. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). far; |
| 1875 | } |
| 1876 | |
| 1877 | //////////////////////////////////////////////////////////////////////// |
| 1878 | // |
| 1879 | // Copy the camera onto the clipboard. |
| 1880 | // |
| 1881 | // Use: private |
| 1882 | // |
| 1883 | void |
| 1884 | SoXtViewercxx . . $ SoXtViewer#::copyViewcxx . . $ SoXtViewer#copyView(2c44cd906ae4e829).(Timecxx . . $ Time# eventTime) |
| 1885 | // |
| 1886 | //////////////////////////////////////////////////////////////////////// |
| 1887 | { |
| 1888 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1889 | return; |
| 1890 | |
| 1891 | if (clipboardcxx . . $ SoXtViewer#clipboard. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1892 | clipboardcxx . . $ SoXtViewer#clipboard. = new SoXtClipboardcxx . . $ SoXtClipboard#(getWidgetcxx . . $ SoXtComponent#getWidget(24ba213de9f943e3).()); |
| 1893 | |
| 1894 | clipboardcxx . . $ SoXtViewer#clipboard.->copycxx . . $ SoXtClipboard#copy(68a2dd7e4b406e23).(cameracxx . . $ SoXtViewer#camera., eventTime); |
| 1895 | } |
| 1896 | |
| 1897 | //////////////////////////////////////////////////////////////////////// |
| 1898 | // |
| 1899 | // Retrieve the selection from the X server and paste it when it |
| 1900 | // arrives (in our pasteDone callback). |
| 1901 | // |
| 1902 | // Use: private |
| 1903 | // |
| 1904 | void |
| 1905 | SoXtViewercxx . . $ SoXtViewer#::pasteViewcxx . . $ SoXtViewer#pasteView(2c44cd906ae4e829).(Timecxx . . $ Time# eventTime) |
| 1906 | // |
| 1907 | //////////////////////////////////////////////////////////////////////// |
| 1908 | { |
| 1909 | if (clipboardcxx . . $ SoXtViewer#clipboard. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1910 | clipboardcxx . . $ SoXtViewer#clipboard. = new SoXtClipboardcxx . . $ SoXtClipboard#(getWidgetcxx . . $ SoXtComponent#getWidget(24ba213de9f943e3).()); |
| 1911 | |
| 1912 | clipboardcxx . . $ SoXtViewer#clipboard.->pastecxx . . $ SoXtClipboard#paste(3d5e5d94d85a12cf).(eventTime, SoXtViewercxx . . $ SoXtViewer#::pasteDoneCBcxx . . $ SoXtViewer#pasteDoneCB(b9152ec4638eb195)., this); |
| 1913 | } |
| 1914 | |
| 1915 | |
| 1916 | //////////////////////////////////////////////////////////////////////// |
| 1917 | // |
| 1918 | // This is called by Xt when the data is ready to be pasted. |
| 1919 | // |
| 1920 | // Use: static, private |
| 1921 | // |
| 1922 | void |
| 1923 | SoXtViewercxx . . $ SoXtViewer#::pasteDoneCBcxx . . $ SoXtViewer#pasteDoneCB(b9152ec4638eb195).(void *userData, SoPathListcxx . . $ SoPathList# *pathList) |
| 1924 | // |
| 1925 | //////////////////////////////////////////////////////////////////////// |
| 1926 | { |
| 1927 | SoCameracxx . . $ SoCamera# *newCamera = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1928 | |
| 1929 | // search for a camera in the paste data |
| 1930 | for (int i = 0; i < pathList->getLengthcxx . . $ SbPList#getLength(455f465bc33b4cdf).(); i++) { |
| 1931 | SoFullPathcxx . . $ SoFullPath# *fullP = (SoFullPathcxx . . $ SoFullPath# *) (*pathList)[cxx . . $ SoPathList#`operator[]`(81b2b9099fcfac9c).i]; |
| 1932 | if (fullP->getTailcxx . . $ SoFullPath#getTail(b794963b450d51b3).()->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoCameracxx . . $ SoCamera#::getClassTypeIdcxx . . $ SoCamera#getClassTypeId(c00c150378d2b968).())) { |
| 1933 | newCamera = (SoCameracxx . . $ SoCamera# *) fullP->getTailcxx . . $ SoFullPath#getTail(b794963b450d51b3).(); |
| 1934 | break; |
| 1935 | } |
| 1936 | } |
| 1937 | |
| 1938 | if (newCamera != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1939 | ((SoXtViewercxx . . $ SoXtViewer# *) userData)->changeCameraValuescxx . . $ SoXtViewer#changeCameraValues(67401df0e880fdc2).(newCamera); |
| 1940 | |
| 1941 | // We delete the callback data when done with it. |
| 1942 | delete pathList; |
| 1943 | } |
| 1944 | |
| 1945 | //////////////////////////////////////////////////////////////////////// |
| 1946 | // |
| 1947 | // Change the values of our camera to newCamera. |
| 1948 | //??? animate from old values to new? |
| 1949 | // |
| 1950 | // Use: virtual, protected |
| 1951 | // |
| 1952 | void |
| 1953 | SoXtViewercxx . . $ SoXtViewer#::changeCameraValuescxx . . $ SoXtViewer#changeCameraValues(67401df0e880fdc2).(SoCameracxx . . $ SoCamera# *newCamera) |
| 1954 | // |
| 1955 | //////////////////////////////////////////////////////////////////////// |
| 1956 | { |
| 1957 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1958 | return; |
| 1959 | |
| 1960 | // only paste cameras of the same type |
| 1961 | if (cameracxx . . $ SoXtViewer#camera.->getTypeIdcxx . . $ SoCamera#getTypeId(70775439ff16cb15).() !=cxx . . $ SoType#`operator!=`(1fd66475a268b64e). newCamera->getTypeIdcxx . . $ SoCamera#getTypeId(70775439ff16cb15).()) |
| 1962 | return; |
| 1963 | |
| 1964 | // give our camera the values of the new camera |
| 1965 | cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position. =cxx . . $ SoSFVec3f#`operator=`(bdd5d8f2d0d19240). newCamera->positioncxx . . $ SoCamera#position.; |
| 1966 | cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation. =cxx . . $ SoSFRotation#`operator=`(ee5edffba8070393). newCamera->orientationcxx . . $ SoCamera#orientation.; |
| 1967 | cameracxx . . $ SoXtViewer#camera.->nearDistancecxx . . $ SoCamera#nearDistance. =cxx . . $ SoSFFloat#`operator=`(22108649baa7c4fc). newCamera->nearDistancecxx . . $ SoCamera#nearDistance.; |
| 1968 | cameracxx . . $ SoXtViewer#camera.->farDistancecxx . . $ SoCamera#farDistance. =cxx . . $ SoSFFloat#`operator=`(22108649baa7c4fc). newCamera->farDistancecxx . . $ SoCamera#farDistance.; |
| 1969 | cameracxx . . $ SoXtViewer#camera.->focalDistancecxx . . $ SoCamera#focalDistance. =cxx . . $ SoSFFloat#`operator=`(22108649baa7c4fc). newCamera->focalDistancecxx . . $ SoCamera#focalDistance.; |
| 1970 | |
| 1971 | // get the height or heightAngle |
| 1972 | if (cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoPerspectiveCameracxx . . $ SoPerspectiveCamera#::getClassTypeIdcxx . . $ SoPerspectiveCamera#getClassTypeId(c00c150378d2b968).())) |
| 1973 | ((SoPerspectiveCameracxx . . $ SoPerspectiveCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightAnglecxx . . $ SoPerspectiveCamera#heightAngle. =cxx . . $ SoSFFloat#`operator=`(22108649baa7c4fc). |
| 1974 | ((SoPerspectiveCameracxx . . $ SoPerspectiveCamera# *)newCamera)->heightAnglecxx . . $ SoPerspectiveCamera#heightAngle.; |
| 1975 | else |
| 1976 | ((SoOrthographicCameracxx . . $ SoOrthographicCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightcxx . . $ SoOrthographicCamera#height. =cxx . . $ SoSFFloat#`operator=`(22108649baa7c4fc). |
| 1977 | ((SoOrthographicCameracxx . . $ SoOrthographicCamera# *)newCamera)->heightcxx . . $ SoOrthographicCamera#height.; |
| 1978 | } |
| 1979 | |
| 1980 | //////////////////////////////////////////////////////////////////////// |
| 1981 | // |
| 1982 | // Description: |
| 1983 | // Toggles the current camera type (perspective <--> orthographic) |
| 1984 | // |
| 1985 | // Use: virtual protected |
| 1986 | // |
| 1987 | void |
| 1988 | SoXtViewercxx . . $ SoXtViewer#::toggleCameraTypecxx . . $ SoXtViewer#toggleCameraType(49f6e7a06ebc5aa8).() |
| 1989 | // |
| 1990 | //////////////////////////////////////////////////////////////////////// |
| 1991 | { |
| 1992 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 1993 | return; |
| 1994 | |
| 1995 | // create the camera of the opposite kind and compute the wanted height |
| 1996 | // or heightAngle of the new camera. |
| 1997 | SoCameracxx . . $ SoCamera# *newCam; |
| 1998 | if (cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoPerspectiveCameracxx . . $ SoPerspectiveCamera#::getClassTypeIdcxx . . $ SoPerspectiveCamera#getClassTypeId(c00c150378d2b968).())) { |
| 1999 | float angle = ((SoPerspectiveCameracxx . . $ SoPerspectiveCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightAnglecxx . . $ SoPerspectiveCamera#heightAngle..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 2000 | float height = cameracxx . . $ SoXtViewer#camera.->focalDistancecxx . . $ SoCamera#focalDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).() * tanf(angle/2); |
| 2001 | newCam = new SoOrthographicCameracxx . . $ SoOrthographicCamera#; |
| 2002 | ((SoOrthographicCameracxx . . $ SoOrthographicCamera# *)newCam)->heightcxx . . $ SoOrthographicCamera#height. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). 2 * height; |
| 2003 | } |
| 2004 | else if (cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoOrthographicCameracxx . . $ SoOrthographicCamera#::getClassTypeIdcxx . . $ SoOrthographicCamera#getClassTypeId(c00c150378d2b968).())) { |
| 2005 | float height = ((SoOrthographicCameracxx . . $ SoOrthographicCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightcxx . . $ SoOrthographicCamera#height..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).() / 2; |
| 2006 | float angle = atanf(height / cameracxx . . $ SoXtViewer#camera.->focalDistancecxx . . $ SoCamera#focalDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).()); |
| 2007 | newCam = new SoPerspectiveCameracxx . . $ SoPerspectiveCamera#; |
| 2008 | ((SoPerspectiveCameracxx . . $ SoPerspectiveCamera# *)newCam)->heightAnglecxx . . $ SoPerspectiveCamera#heightAngle. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). 2 * angle; |
| 2009 | } |
| 2010 | else { |
| 2011 | #ifdef DEBUG |
| 2012 | SoDebugError::post("SoXtViewer::toggleCameraType", "unknown camera type!"); |
| 2013 | #endif |
| 2014 | return; |
| 2015 | } |
| 2016 | |
| 2017 | newCam->refcxx . . $ SoBase#ref(83f5f38750778ac8).(); |
| 2018 | |
| 2019 | // copy common stuff from the old to the new camera |
| 2020 | newCam->viewportMappingcxx . . $ SoCamera#viewportMapping. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). cameracxx . . $ SoXtViewer#camera.->viewportMappingcxx . . $ SoCamera#viewportMapping..getValuecxx . . $ SoSFEnum#getValue(455f465bc33b4cdf).(); |
| 2021 | newCam->positioncxx . . $ SoCamera#position. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).(); |
| 2022 | newCam->orientationcxx . . $ SoCamera#orientation. =cxx . . $ SoSFRotation#`operator=`(a110af7e76887ee8). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 2023 | newCam->aspectRatiocxx . . $ SoCamera#aspectRatio. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). cameracxx . . $ SoXtViewer#camera.->aspectRatiocxx . . $ SoCamera#aspectRatio..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 2024 | newCam->focalDistancecxx . . $ SoCamera#focalDistance. =cxx . . $ SoSFFloat#`operator=`(fbcf3211dfe1bfd1). cameracxx . . $ SoXtViewer#camera.->focalDistancecxx . . $ SoCamera#focalDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 2025 | |
| 2026 | // search for the old camera and replace it by the new camera |
| 2027 | SoSearchActioncxx . . $ SoSearchAction# sacxx . . $ SoSearchAction#SoSearchAction(49f6e7a06ebc5aa8).; |
| 2028 | sa.setNodecxx . . $ SoSearchAction#setNode(da6c7544ccee32bd).(cameracxx . . $ SoXtViewer#camera.); |
| 2029 | sa.applycxx . . $ SoAction#apply(da6c7544ccee32bd).(sceneRootcxx . . $ SoXtViewer#sceneRoot.); |
| 2030 | SoFullPathcxx . . $ SoFullPath# *fullCamPath = (SoFullPathcxx . . $ SoFullPath# *) sa.getPathcxx . . $ SoSearchAction#getPath(58db5280b30558ed).(); |
| 2031 | if (fullCamPath) { |
| 2032 | SoGroupcxx . . $ SoGroup# *parent = (SoGroupcxx . . $ SoGroup# *)fullCamPath->getNodecxx . . $ SoPath#getNode(fd675789997d09c2).(fullCamPath->getLengthcxx . . $ SoFullPath#getLength(455f465bc33b4cdf).() - 2); |
| 2033 | parent->insertChildcxx . . $ SoGroup#insertChild(de18c6a3dadfdca6).(newCam, parent->findChildcxx . . $ SoGroup#findChild(25d228eba4c5059a).(cameracxx . . $ SoXtViewer#camera.)); |
| 2034 | SoCameracxx . . $ SoCamera# *oldCam = cameracxx . . $ SoXtViewer#camera.; |
| 2035 | setCameracxx . . $ SoXtViewer#setCamera(67401df0e880fdc2).(newCam); |
| 2036 | |
| 2037 | // remove the old camera if it is still there (setCamera() might |
| 2038 | // have removed it) and set the created flag to true (for next time) |
| 2039 | if (parent->findChildcxx . . $ SoGroup#findChild(25d228eba4c5059a).(oldCam) >= 0) |
| 2040 | parent->removeChildcxx . . $ SoGroup#removeChild(da6c7544ccee32bd).(oldCam); |
| 2041 | createdCameracxx . . $ SoXtViewer#createdCamera. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; |
| 2042 | } |
| 2043 | #ifdef DEBUG |
| 2044 | else |
| 2045 | SoDebugError::post("SoXtViewer::toggleCameraType", "camera not found!"); |
| 2046 | #endif |
| 2047 | |
| 2048 | newCam->unrefcxx . . $ SoBase#unref(83f5f38750778ac8).(); |
| 2049 | } |
| 2050 | |
| 2051 | //////////////////////////////////////////////////////////////////////// |
| 2052 | // |
| 2053 | // Description: |
| 2054 | // Called by the processCommonEvent routine whenever the arrow keys |
| 2055 | // are pressed. Translate the camera in the viewing plane in the arrow |
| 2056 | // direction half a screen at a time. |
| 2057 | // |
| 2058 | // Use: private |
| 2059 | // |
| 2060 | void |
| 2061 | SoXtViewercxx . . $ SoXtViewer#::arrowKeyPressedcxx . . $ SoXtViewer#arrowKeyPressed(2c44cd906ae4e829).(KeySymcxx . . $ KeySym# key) |
| 2062 | // |
| 2063 | //////////////////////////////////////////////////////////////////////// |
| 2064 | { |
| 2065 | if (cameracxx . . $ SoXtViewer#camera. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 2066 | return; |
| 2067 | |
| 2068 | // get the camera near plane height value |
| 2069 | float dist; |
| 2070 | if (cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoPerspectiveCameracxx . . $ SoPerspectiveCamera#::getClassTypeIdcxx . . $ SoPerspectiveCamera#getClassTypeId(c00c150378d2b968).())) { |
| 2071 | float angle = ((SoPerspectiveCameracxx . . $ SoPerspectiveCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightAnglecxx . . $ SoPerspectiveCamera#heightAngle..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 2072 | float length = cameracxx . . $ SoXtViewer#camera.->nearDistancecxx . . $ SoCamera#nearDistance..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 2073 | dist = length * tanf(angle); |
| 2074 | } |
| 2075 | else if (cameracxx . . $ SoXtViewer#camera.->isOfTypecxx . . $ SoBase#isOfType(1fd66475a268b64e).(SoOrthographicCameracxx . . $ SoOrthographicCamera#::getClassTypeIdcxx . . $ SoOrthographicCamera#getClassTypeId(c00c150378d2b968).())) |
| 2076 | dist = ((SoOrthographicCameracxx . . $ SoOrthographicCamera# *)cameracxx . . $ SoXtViewer#camera.)->heightcxx . . $ SoOrthographicCamera#height..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 2077 | dist /= 2.0; |
| 2078 | |
| 2079 | // get camera right/left/up/down direction |
| 2080 | SbMatrixcxx . . $ SbMatrix# mxcxx . . $ SbMatrix#SbMatrix(49f6e7a06ebc5aa8).; |
| 2081 | mx =cxx . . $ SbMatrix#`operator=`(63101dd9e6974539). cameracxx . . $ SoXtViewer#camera.->orientationcxx . . $ SoCamera#orientation..getValuecxx . . $ SoSFRotation#getValue(cd68af149be99fa7).(); |
| 2082 | SbVec3fcxx . . $ SbVec3f# dircxx . . $ SbVec3f#SbVec3f(49f6e7a06ebc5aa8).; |
| 2083 | switch(key) { |
| 2084 | case XK_Upcxx . . $ `/usr/include/X11/keysymdef.h:250:9`!: |
| 2085 | dir.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).1][0], mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).1][1], mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).1][2]); |
| 2086 | break; |
| 2087 | case XK_Downcxx . . $ `/usr/include/X11/keysymdef.h:252:9`!: |
| 2088 | dir.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).1][0], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).1][1], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).1][2]); |
| 2089 | break; |
| 2090 | case XK_Rightcxx . . $ `/usr/include/X11/keysymdef.h:251:9`!: |
| 2091 | dir.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).0][0], mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).0][1], mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).0][2]); |
| 2092 | dist *= cameracxx . . $ SoXtViewer#camera.->aspectRatiocxx . . $ SoCamera#aspectRatio..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 2093 | break; |
| 2094 | case XK_Leftcxx . . $ `/usr/include/X11/keysymdef.h:249:9`!: |
| 2095 | dir.setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(-mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).0][0], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).0][1], -mx[cxx . . $ SbMatrix#`operator[]`(14bcf4d013640fef).0][2]); |
| 2096 | dist *= cameracxx . . $ SoXtViewer#camera.->aspectRatiocxx . . $ SoCamera#aspectRatio..getValuecxx . . $ SoSFFloat#getValue(5036dfe8d4170af2).(); |
| 2097 | break; |
| 2098 | } |
| 2099 | |
| 2100 | // finally reposition the camera |
| 2101 | cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position. =cxx . . $ SoSFVec3f#`operator=`(861f7885f8980b32). cameracxx . . $ SoXtViewer#camera.->positioncxx . . $ SoCamera#position..getValuecxx . . $ SoSFVec3f#getValue(b5c384c15c94bb12).() +cxx . . $ operator+(af63bf8d0639b76b). dist *cxx . . $ `operator*`(c40767b2d90b93cf). dir; |
| 2102 | } |
| 2103 | |
| 2104 | // |
| 2105 | //////////////////////////////////////////////////////////////////////// |
| 2106 | // static callbacks stubs |
| 2107 | //////////////////////////////////////////////////////////////////////// |
| 2108 | // |
| 2109 | |
| 2110 | |
| 2111 | |
| 2112 | void |
| 2113 | SoXtViewercxx . . $ SoXtViewer#::bufferStartCallbackcxx . . $ SoXtViewer#bufferStartCallback(53b15af9fcb5e041).(void *, SoXtViewercxx . . $ SoXtViewer# *v) |
| 2114 | { |
| 2115 | v->SoXtRenderAreacxx . . $ SoXtRenderArea#::setDoubleBuffercxx . . $ SoXtGLWidget#setDoubleBuffer(d4f767463ce0a6b3).(TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!); |
| 2116 | } |
| 2117 | |
| 2118 | void |
| 2119 | SoXtViewercxx . . $ SoXtViewer#::bufferFinishCallbackcxx . . $ SoXtViewer#bufferFinishCallback(53b15af9fcb5e041).(void *, SoXtViewercxx . . $ SoXtViewer# *v) |
| 2120 | { |
| 2121 | v->SoXtRenderAreacxx . . $ SoXtRenderArea#::setDoubleBuffercxx . . $ SoXtGLWidget#setDoubleBuffer(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 2122 | } |
| 2123 | |
| 2124 | void |
| 2125 | SoXtViewercxx . . $ SoXtViewer#::drawStyleStartCallbackcxx . . $ SoXtViewer#drawStyleStartCallback(53b15af9fcb5e041).(void *, SoXtViewercxx . . $ SoXtViewer# *v) |
| 2126 | { |
| 2127 | v->interactiveFlagcxx . . $ SoXtViewer#interactiveFlag. = TRUEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:111:9`!; // must happen first |
| 2128 | |
| 2129 | // if still and move draw styles are the same, return... |
| 2130 | if (v->interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_SAME_AS_STILLcxx . . $ SoXtViewer#VIEW_SAME_AS_STILL. || |
| 2131 | v->interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == v->stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle.) |
| 2132 | return; |
| 2133 | |
| 2134 | // if we have "MOVE NO TEXTURE", then we have nothing |
| 2135 | // to do if we have a current draw style (since they all have |
| 2136 | // texturing turned off in the first place). |
| 2137 | if (v->interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_NO_TEXTUREcxx . . $ SoXtViewer#VIEW_NO_TEXTURE. && |
| 2138 | v->stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle. != VIEW_AS_IScxx . . $ SoXtViewer#VIEW_AS_IS.) |
| 2139 | return; |
| 2140 | |
| 2141 | v->setCurrentDrawStylecxx . . $ SoXtViewer#setCurrentDrawStyle(d97178de53a6022).(v->interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle.); |
| 2142 | } |
| 2143 | |
| 2144 | void |
| 2145 | SoXtViewercxx . . $ SoXtViewer#::drawStyleFinishCallbackcxx . . $ SoXtViewer#drawStyleFinishCallback(53b15af9fcb5e041).(void *, SoXtViewercxx . . $ SoXtViewer# *v) |
| 2146 | { |
| 2147 | v->interactiveFlagcxx . . $ SoXtViewer#interactiveFlag. = FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!; // must happen first |
| 2148 | |
| 2149 | // if still and move draw styles are the same, return... |
| 2150 | if (v->interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_SAME_AS_STILLcxx . . $ SoXtViewer#VIEW_SAME_AS_STILL. || |
| 2151 | v->interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == v->stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle.) |
| 2152 | return; |
| 2153 | |
| 2154 | // if we have "MOVE NO TEXTURE", then we have nothing |
| 2155 | // to do if we have a current draw style (since they all have |
| 2156 | // texturing turned off in the first place). |
| 2157 | if (v->interactiveDrawStylecxx . . $ SoXtViewer#interactiveDrawStyle. == VIEW_NO_TEXTUREcxx . . $ SoXtViewer#VIEW_NO_TEXTURE. && |
| 2158 | v->stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle. != VIEW_AS_IScxx . . $ SoXtViewer#VIEW_AS_IS.) |
| 2159 | return; |
| 2160 | |
| 2161 | v->setCurrentDrawStylecxx . . $ SoXtViewer#setCurrentDrawStyle(d97178de53a6022).(v->stillDrawStylecxx . . $ SoXtViewer#stillDrawStyle.); |
| 2162 | } |
| 2163 | |
| 2164 | //////////////////////////////////////////////////////////////////////// |
| 2165 | // |
| 2166 | // Called whenever the seek animation sensor fires. Finds the amount |
| 2167 | // of time since we started the seek and call the subclasses routine |
| 2168 | // to do the correct interpolation. |
| 2169 | // |
| 2170 | // Use: static private |
| 2171 | // |
| 2172 | void |
| 2173 | SoXtViewercxx . . $ SoXtViewer#::seekAnimationSensorCBcxx . . $ SoXtViewer#seekAnimationSensorCB(c8d298b3e215c027).(void *p, SoSensorcxx . . $ SoSensor# *) |
| 2174 | // |
| 2175 | //////////////////////////////////////////////////////////////////////// |
| 2176 | { |
| 2177 | SoXtViewercxx . . $ SoXtViewer# *v = (SoXtViewercxx . . $ SoXtViewer# *)p; |
| 2178 | |
| 2179 | // get the time difference |
| 2180 | SbTimecxx . . $ SbTime# time = viewerRealTimecxx . . $ SoXtViewer#viewerRealTime.->getValuecxx . . $ SoSFTime#getValue(cf36f2df8ef835a6).(); |
| 2181 | float sec = float((time -cxx . . $ operator-(22f32cf074e3d57c). v->seekStartTimecxx . . $ SoXtViewer#seekStartTime.).getValuecxx . . $ SbTime#getValue(21b6c25e127938e2).()); |
| 2182 | if (sec == 0.0) |
| 2183 | sec = 1.0/72.0; // at least one frame (needed for first call) |
| 2184 | float t = (sec / v->seekAnimTimecxx . . $ SoXtViewer#seekAnimTime.); |
| 2185 | |
| 2186 | // check to make sure the values are correctly clipped |
| 2187 | if (t > 1.0) |
| 2188 | t = 1.0; |
| 2189 | else if ((1.0 - t) < 0.0001) |
| 2190 | t = 1.0; // this will be the last one... |
| 2191 | |
| 2192 | // call subclasses to interpolate the animation |
| 2193 | v->interpolateSeekAnimationcxx . . $ SoXtViewer#interpolateSeekAnimation(9364e6e7bff7660).(t); |
| 2194 | |
| 2195 | // stops seek if this was the last interval |
| 2196 | if (t == 1.0) |
| 2197 | v->setSeekModecxx . . $ SoXtViewer#setSeekMode(d4f767463ce0a6b3).(FALSEcxx . . $ `<external>/3673480128541058774/Intrinsic.h:110:9`!); |
| 2198 | } |
| 2199 | |
| 2200 | |
| 2201 | |
| 2202 | // |
| 2203 | //////////////////////////////////////////////////////////////////////// |
| 2204 | // viewer feedback convenience routines |
| 2205 | //////////////////////////////////////////////////////////////////////// |
| 2206 | // |
| 2207 | |
| 2208 | |
| 2209 | |
| 2210 | /* |
| 2211 | * Defines |
| 2212 | */ |
| 2213 | |
| 2214 | // color used in feedback |
| 2215 | #define DARK_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2215:9`! glColor3ub(90, 90, 90) |
| 2216 | #define LIGHT_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2216:9`! glColor3ub(230, 230, 230) |
| 2217 | |
| 2218 | #define LINE_THINcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2218:9`! 3 // line thickness used in feedback |
| 2219 | #define LINE_THICKcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2219:9`! (LINE_THINcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2218:9`! + 2) |
| 2220 | #define CROSScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2220:9`! 8 // size of cross hair at screen center for Roll |
| 2221 | #define RADIUScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2221:9`! 15 // radius of center circle (in pix) for Roll |
| 2222 | #define ANGLE_LENcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2222:9`! 14 // angular size in degrees of Roll anchor |
| 2223 | |
| 2224 | |
| 2225 | /* |
| 2226 | * Globals |
| 2227 | */ |
| 2228 | |
| 2229 | #define ARROW_SIZEcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2229:9`! 6.0 // size in pix of arrow head |
| 2230 | |
| 2231 | // anchor arrow head description |
| 2232 | static float arrow_datacxx . . $ arrow_data.[3][3] = { |
| 2233 | { -ARROW_SIZEcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2229:9`!, 0, 0 }, |
| 2234 | { 0, 2*ARROW_SIZEcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2229:9`!, 0 }, |
| 2235 | { ARROW_SIZEcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2229:9`!, 0, 0 } |
| 2236 | }; |
| 2237 | |
| 2238 | |
| 2239 | /* |
| 2240 | * Macros |
| 2241 | */ |
| 2242 | |
| 2243 | #define DRAW_ARROW_MACROcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2243:9`! \ |
| 2244 | DARK_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2215:9`!; \ |
| 2245 | glBegin(GL_POLYGONcxx . . $ `<external>/11565930711847777359/gl.h:165:9`!); \ |
| 2246 | glVertex3fv(arrow_data[0]); \ |
| 2247 | glVertex3fv(arrow_data[1]); \ |
| 2248 | glVertex3fv(arrow_data[2]); \ |
| 2249 | glEnd(); \ |
| 2250 | LIGHT_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2216:9`!; \ |
| 2251 | glLineWidth(1); \ |
| 2252 | glBegin(GL_LINE_LOOPcxx . . $ `<external>/11565930711847777359/gl.h:158:9`!); \ |
| 2253 | glVertex3fv(arrow_data[0]); \ |
| 2254 | glVertex3fv(arrow_data[1]); \ |
| 2255 | glVertex3fv(arrow_data[2]); \ |
| 2256 | glEnd(); |
| 2257 | |
| 2258 | //////////////////////////////////////////////////////////////////////// |
| 2259 | // |
| 2260 | // Description: |
| 2261 | // Sets the default ortho projection when doing viewer feedback. The |
| 2262 | // zbuffer/lighting is automatically turned off. |
| 2263 | // |
| 2264 | // Use: static protected |
| 2265 | // |
| 2266 | void |
| 2267 | SoXtViewercxx . . $ SoXtViewer#::setFeedbackOrthoProjectioncxx . . $ SoXtViewer#setFeedbackOrthoProjection(8bc400dc8eb33072).(const SbVec2scxx . . $ SbVec2s# &size) |
| 2268 | // |
| 2269 | //////////////////////////////////////////////////////////////////////// |
| 2270 | { |
| 2271 | // push the gl state to revert it back later.... |
| 2272 | glPushAttrib(GL_DEPTH_BUFFER_BITcxx . . $ `<external>/11565930711847777359/gl.h:676:9`! | GL_LIGHTING_BITcxx . . $ `<external>/11565930711847777359/gl.h:674:9`! | GL_LINE_BITcxx . . $ `<external>/11565930711847777359/gl.h:670:9`!); |
| 2273 | |
| 2274 | // ??? should we worry about restoring this matrix later ? |
| 2275 | glViewport(0, 0, size[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).0], size[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).1]); |
| 2276 | glMatrixMode(GL_PROJECTIONcxx . . $ `<external>/11565930711847777359/gl.h:212:9`!); |
| 2277 | glLoadIdentity(); |
| 2278 | glOrtho(0, size[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).0], 0, size[cxx . . $ SbVec2s#`operator[]`(1e601d28ecbc4f85).1], -1, 1); |
| 2279 | |
| 2280 | // disable zbuffer and lighting.... |
| 2281 | glDisable(GL_DEPTH_TESTcxx . . $ `<external>/11565930711847777359/gl.h:267:9`!); |
| 2282 | glDisable(GL_LIGHTINGcxx . . $ `<external>/11565930711847777359/gl.h:276:9`!); |
| 2283 | } |
| 2284 | |
| 2285 | //////////////////////////////////////////////////////////////////////// |
| 2286 | // |
| 2287 | // Description: |
| 2288 | // restores the state that was changed when setFeedbackOrthoProjection() |
| 2289 | // is called. |
| 2290 | // |
| 2291 | // Use: static protected |
| 2292 | // |
| 2293 | void |
| 2294 | SoXtViewercxx . . $ SoXtViewer#::restoreGLStateAfterFeedbackcxx . . $ SoXtViewer#restoreGLStateAfterFeedback(49f6e7a06ebc5aa8).() |
| 2295 | // |
| 2296 | //////////////////////////////////////////////////////////////////////// |
| 2297 | { |
| 2298 | // restore the gl state that were saved in setFeedbackOrthoProjection() |
| 2299 | glPopAttrib(); |
| 2300 | } |
| 2301 | |
| 2302 | //////////////////////////////////////////////////////////////////////// |
| 2303 | // |
| 2304 | // Description: |
| 2305 | // Draws a simple 2 colored cross at the given location. |
| 2306 | // |
| 2307 | // Use: static protected |
| 2308 | // |
| 2309 | void |
| 2310 | SoXtViewercxx . . $ SoXtViewer#::drawViewerCrossFeedbackcxx . . $ SoXtViewer#drawViewerCrossFeedback(edd509d4d7dd9f6).(SbVec2scxx . . $ SbVec2s# loc) |
| 2311 | // |
| 2312 | //////////////////////////////////////////////////////////////////////// |
| 2313 | { |
| 2314 | LIGHT_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2216:9`!; |
| 2315 | glLineWidth(4); |
| 2316 | glBegin(GL_LINEScxx . . $ `<external>/11565930711847777359/gl.h:157:9`!); |
| 2317 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0]-CROSScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2220:9`!, loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]); |
| 2318 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0]+CROSScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2220:9`!, loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]); |
| 2319 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]-CROSScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2220:9`!); |
| 2320 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]+CROSScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2220:9`!); |
| 2321 | glEnd(); |
| 2322 | |
| 2323 | DARK_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2215:9`!; |
| 2324 | glLineWidth(2); |
| 2325 | glBegin(GL_LINEScxx . . $ `<external>/11565930711847777359/gl.h:157:9`!); |
| 2326 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0]-CROSScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2220:9`!+1, loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]); |
| 2327 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0]+CROSScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2220:9`!-1, loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]); |
| 2328 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]-CROSScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2220:9`!+1); |
| 2329 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]+CROSScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2220:9`!-1); |
| 2330 | glEnd(); |
| 2331 | } |
| 2332 | |
| 2333 | //////////////////////////////////////////////////////////////////////// |
| 2334 | // |
| 2335 | // Description: |
| 2336 | // draws the anchor roll feedback given the point of rotation and the |
| 2337 | // current mouse location. |
| 2338 | // |
| 2339 | // Use: static protected |
| 2340 | // |
| 2341 | void |
| 2342 | SoXtViewercxx . . $ SoXtViewer#::drawViewerRollFeedbackcxx . . $ SoXtViewer#drawViewerRollFeedback(260a85bad1045f88).(SbVec2scxx . . $ SbVec2s# center, SbVec2scxx . . $ SbVec2s# loc) |
| 2343 | // |
| 2344 | //////////////////////////////////////////////////////////////////////// |
| 2345 | { |
| 2346 | // get angle and distance of mouse from center of rotation |
| 2347 | float ang, dist; |
| 2348 | float vx = loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0] - center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0]; |
| 2349 | float vy = loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1] - center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]; |
| 2350 | if (vx==0 && vy==0) { |
| 2351 | ang = 0; |
| 2352 | dist = 3; // minimum size (given the circle thickness) |
| 2353 | } |
| 2354 | else { |
| 2355 | ang = atan2(vy, vx) * 180.0 / M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`!; |
| 2356 | dist = sqrtf(vx*vx + vy*vy); |
| 2357 | if (dist < 3) |
| 2358 | dist = 3; // minimum size (given the circle thickness) |
| 2359 | } |
| 2360 | float cirAng = -ang + 90; // gluPartialDisk() angle is REALLY backward !! |
| 2361 | |
| 2362 | static GLUquadricObj *quad = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2363 | if (! quad) quad = gluNewQuadric(); |
| 2364 | |
| 2365 | // draw all of the circles (first inner, then outer) |
| 2366 | glTranslatef(center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1], 0); |
| 2367 | LIGHT_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2216:9`!; |
| 2368 | gluDisk(quad, RADIUScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2221:9`!, RADIUScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2221:9`!+LINE_THICKcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2219:9`!, 20, 2); |
| 2369 | gluPartialDisk(quad, dist-2, dist+LINE_THICKcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2219:9`!-2, 20, 2, cirAng - ANGLE_LENcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2222:9`!, 2 * ANGLE_LENcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2222:9`!); |
| 2370 | DARK_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2215:9`!; |
| 2371 | gluDisk(quad, RADIUScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2221:9`!+1, RADIUScxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2221:9`!+LINE_THICKcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2219:9`!-1, 20, 2); |
| 2372 | gluPartialDisk(quad, dist-1, dist+LINE_THICKcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2219:9`!-3, 20, 2, cirAng - ANGLE_LENcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2222:9`!, 2 * ANGLE_LENcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2222:9`!); |
| 2373 | glTranslatef(-center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], -center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1], 0); // undo the translation |
| 2374 | |
| 2375 | // draw connecting line from center to outer circle |
| 2376 | glLineWidth(LINE_THICKcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2219:9`!); |
| 2377 | LIGHT_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2216:9`!; |
| 2378 | glBegin(GL_LINEScxx . . $ `<external>/11565930711847777359/gl.h:157:9`!); |
| 2379 | glVertex2s(center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]); |
| 2380 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]); |
| 2381 | glEnd(); |
| 2382 | glLineWidth(LINE_THINcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2218:9`!); |
| 2383 | DARK_COLORcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2215:9`!; |
| 2384 | glBegin(GL_LINEScxx . . $ `<external>/11565930711847777359/gl.h:157:9`!); |
| 2385 | glVertex2s(center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]); |
| 2386 | glVertex2s(loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], loc[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1]); |
| 2387 | glEnd(); |
| 2388 | |
| 2389 | // draw the CCW arrow |
| 2390 | glPushMatrix(); |
| 2391 | glTranslatef(center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1], 0); |
| 2392 | glRotatef(ang+ANGLE_LENcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2222:9`!, 0, 0, 1); |
| 2393 | glTranslatef(dist, 0, 0); |
| 2394 | DRAW_ARROW_MACROcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2243:9`! |
| 2395 | glPopMatrix(); |
| 2396 | |
| 2397 | // draw the CW arrow |
| 2398 | glPushMatrix(); |
| 2399 | glTranslatef(center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).0], center[cxx . . $ SbVec2s#`operator[]`(3a1bfc038f5ec6).1], 0); |
| 2400 | glRotatef(ang-ANGLE_LENcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2222:9`!, 0, 0, 1); |
| 2401 | glTranslatef(dist, 0, 0); |
| 2402 | glScalef(1, -1, 1); |
| 2403 | DRAW_ARROW_MACROcxx . . $ `libSoXt/src/viewers/SoXtViewer.c++:2243:9`! |
| 2404 | glPopMatrix(); |
| 2405 | } |
| 2406 |