| 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 | | Classes: |
| 38 | | Interface |
| 39 | | |
| 40 | | Author(s): Paul Isaacs |
| 41 | | |
| 42 | */ |
| 43 | |
| 44 | |
| 45 | #include <unistd.h> |
| 46 | #include <cstdlib> |
| 47 | #include <cstdio> |
| 48 | #include <Inventor/SbLinear.h>cxx . . $ `<file>/lib/database/include/Inventor/SbLinear.h`/ |
| 49 | #include <Inventor/SoDB.h>cxx . . $ `<file>/lib/database/include/Inventor/SoDB.h`/ |
| 50 | |
| 51 | #include <Xm/MessageB.h> |
| 52 | |
| 53 | #include <Inventor/actions/SoBoxHighlightRenderAction.h>cxx . . $ `<file>/lib/interaction/include/Inventor/actions/SoBoxHighlightRenderAction.h`/ |
| 54 | #include <Inventor/actions/SoWriteAction.h>cxx . . $ `<file>/lib/database/include/Inventor/actions/SoWriteAction.h`/ |
| 55 | #include <Inventor/manips/SoHandleBoxManip.h>cxx . . $ `<file>/lib/interaction/include/Inventor/manips/SoHandleBoxManip.h`/ |
| 56 | #include <Inventor/manips/SoTrackballManip.h>cxx . . $ `<file>/lib/interaction/include/Inventor/manips/SoTrackballManip.h`/ |
| 57 | #include <Inventor/nodes/SoSelection.h>cxx . . $ `<file>/lib/interaction/include/Inventor/nodes/SoSelection.h`/ |
| 58 | #include <Inventor/nodes/SoSeparator.h>cxx . . $ `<file>/lib/database/include/Inventor/nodes/SoSeparator.h`/ |
| 59 | #include <Inventor/Xt/SoXt.h>cxx . . $ `<file>/libSoXt/include/Inventor/Xt/SoXt.h`/ |
| 60 | #include <Inventor/Xt/SoXtClipboard.h>cxx . . $ `<file>/libSoXt/include/Inventor/Xt/SoXtClipboard.h`/ |
| 61 | #include <Inventor/Xt/viewers/SoXtViewer.h>cxx . . $ `<file>/libSoXt/include/Inventor/Xt/viewers/SoXtViewer.h`/ |
| 62 | |
| 63 | #include "GeneralizedCylinder.h"cxx . . $ `<file>/apps/nodes/GeneralizedCylinder/GeneralizedCylinder.h`/ |
| 64 | #include "WorldInfo.h"cxx . . $ `<file>/apps/demos/noodle/WorldInfo.h`/ |
| 65 | #include "PullDowns.h"cxx . . $ `<file>/apps/demos/noodle/PullDowns.h`/ |
| 66 | #include "Interface.h"cxx . . $ `<file>/apps/demos/noodle/Interface.h`/ |
| 67 | #include "NoodleTextureGizmo.h"cxx . . $ `<file>/apps/demos/noodle/NoodleTextureGizmo.h`/ |
| 68 | #include "NoodleSurfaceGizmo.h"cxx . . $ `<file>/apps/demos/noodle/NoodleSurfaceGizmo.h`/ |
| 69 | |
| 70 | #define SCREENcxx . . $ `apps/demos/noodle/Interface.c++:70:9`!(w) XScreenNumberOfScreen(XtScreen(w)) |
| 71 | |
| 72 | extern SoNodecxx . . $ SoNode# *createProfileGraphcxx . . $ createProfileGraph(8003b3a0f44ac93).( Widgetcxx . . $ Widget#, GeneralizedCylindercxx . . $ GeneralizedCylinder# *); |
| 73 | extern SoNodecxx . . $ SoNode# *createCrossSectionGraphcxx . . $ createCrossSectionGraph(8003b3a0f44ac93).( Widgetcxx . . $ Widget#, GeneralizedCylindercxx . . $ GeneralizedCylinder# *); |
| 74 | extern SoNodecxx . . $ SoNode# *createSpineGraphcxx . . $ createSpineGraph(8003b3a0f44ac93).( Widgetcxx . . $ Widget#, GeneralizedCylindercxx . . $ GeneralizedCylinder# *); |
| 75 | extern SoNodecxx . . $ SoNode# *createTwistGraphcxx . . $ createTwistGraph(8003b3a0f44ac93).( Widgetcxx . . $ Widget#, GeneralizedCylindercxx . . $ GeneralizedCylinder# *); |
| 76 | |
| 77 | Interfacecxx . . $ Interface#::Interfacecxx . . $ Interface#Interface(49f6e7a06ebc5aa8).() |
| 78 | { |
| 79 | // Initialize other variables. |
| 80 | bgColorcxx . . $ Interface#bgColor..setValuecxx . . $ SbVec3f#setValue(4e87f9d875f2d08d).(0,0,0); |
| 81 | worldInfocxx . . $ Interface#worldInfo. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 82 | mgrWidgetcxx . . $ Interface#mgrWidget. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 83 | mainViewercxx . . $ Interface#mainViewer. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 84 | menuItemscxx . . $ Interface#menuItems. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 85 | myTextureGizmocxx . . $ Interface#myTextureGizmo. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 86 | mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 87 | |
| 88 | profileViewercxx . . $ Interface#profileViewer. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 89 | sectionViewercxx . . $ Interface#sectionViewer. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 90 | spineViewercxx . . $ Interface#spineViewer. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 91 | twistViewercxx . . $ Interface#twistViewer. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 92 | |
| 93 | closeProfileButtoncxx . . $ Interface#closeProfileButton. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 94 | closeSectionButtoncxx . . $ Interface#closeSectionButton. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 95 | closeSpineButtoncxx . . $ Interface#closeSpineButton. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 96 | closeTwistButtoncxx . . $ Interface#closeTwistButton. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 97 | } |
| 98 | |
| 99 | Interfacecxx . . $ Interface#::~cxx . . $ Interface#`~Interface`(49f6e7a06ebc5aa8).Interfacecxx . . $ Interface#() |
| 100 | { |
| 101 | worldInfocxx . . $ Interface#worldInfo. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 102 | if (myTextureGizmocxx . . $ Interface#myTextureGizmo.) |
| 103 | delete myTextureGizmocxx . . $ Interface#myTextureGizmo.; |
| 104 | if (mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo.) |
| 105 | delete mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo.; |
| 106 | } |
| 107 | |
| 108 | void |
| 109 | Interfacecxx . . $ Interface#::setWorldInfocxx . . $ Interface#setWorldInfo(85c7e633e21cda26).( WorldInfocxx . . $ WorldInfo# *newWorldInfo ) |
| 110 | { |
| 111 | if (newWorldInfo == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 112 | return; |
| 113 | |
| 114 | worldInfocxx . . $ Interface#worldInfo. = newWorldInfo; |
| 115 | SoSelectioncxx . . $ SoSelection# *s = worldInfocxx . . $ Interface#worldInfo.->getSelectorNodecxx . . $ WorldInfo#getSelectorNode(d2cc05f0bd33ac2b).(); |
| 116 | s->addSelectionCallbackcxx . . $ SoSelection#addSelectionCallback(ff1755b9772ad8d8).( &Interfacecxx . . $ Interface#::selectionCBcxx . . $ Interface#selectionCB(f7f5995fb031ad3c)., this ); |
| 117 | } |
| 118 | |
| 119 | ///////////////////////////////////////////////////////////////////// |
| 120 | // Reads the scene given by filename and puts the results into worldInfo. |
| 121 | // Returns pointer to top of scene graph. |
| 122 | // If filename is NULL, uses name already found in worldInfo. |
| 123 | // If filename and worldInfo are both NULL, it is an error. |
| 124 | SoSeparatorcxx . . $ SoSeparator# * |
| 125 | Interfacecxx . . $ Interface#::readScenecxx . . $ Interface#readScene(19b1fedcea669102).( char *newFileName, SbBoolcxx . . $ SbBool# okIfNoName ) |
| 126 | { |
| 127 | if (newFileName == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! && |
| 128 | (worldInfocxx . . $ Interface#worldInfo. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! || worldInfocxx . . $ Interface#worldInfo.->getFileNamecxx . . $ WorldInfo#getFileName(41208ce6ca65dd58).() == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!)) { |
| 129 | if ( ! okIfNoName ) { |
| 130 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Interface::readScene programming error:" |
| 131 | "Can\'t read scene because no filename given and \n" |
| 132 | "Interface has worldInfo equal to NULL\n"); |
| 133 | } |
| 134 | return (NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 135 | } |
| 136 | |
| 137 | SoInputcxx . . $ SoInput# incxx . . $ SoInput#SoInput(49f6e7a06ebc5aa8).; |
| 138 | SoSeparatorcxx . . $ SoSeparator# *root; |
| 139 | FILE *filePtr = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 140 | |
| 141 | if (newFileName != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! && worldInfocxx . . $ Interface#worldInfo. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 142 | worldInfocxx . . $ Interface#worldInfo.->setFileNamecxx . . $ WorldInfo#setFileName(fda57c8427c60377).( newFileName ); |
| 143 | |
| 144 | const char *fName |
| 145 | = (worldInfocxx . . $ Interface#worldInfo. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) ? newFileName : worldInfocxx . . $ Interface#worldInfo.->getFileNamecxx . . $ WorldInfo#getFileName(41208ce6ca65dd58).(); |
| 146 | |
| 147 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Reading file %s...\n", fName ); |
| 148 | |
| 149 | const char *slashPtr; |
| 150 | char *searchPath = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 151 | |
| 152 | filePtr = fopen(fName, "r"); |
| 153 | if (filePtr == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) { |
| 154 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Error opening file %s\n", fName); |
| 155 | return (NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 156 | } |
| 157 | |
| 158 | // |
| 159 | // If the filename includes a directory path, add the |
| 160 | // directory name to the list of directories where to look |
| 161 | // for files referenced in the input file (e.g. SoFile nodes) |
| 162 | // |
| 163 | if ((slashPtr = strrchr(fName, '/')) != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) { |
| 164 | searchPath = strdup(fName); |
| 165 | searchPath[slashPtr - fName] = '\0'; |
| 166 | in.addDirectoryFirstcxx . . $ SoInput#addDirectoryFirst(85c52e162fed56f9).(searchPath); |
| 167 | } |
| 168 | |
| 169 | in.setFilePointercxx . . $ SoInput#setFilePointer(8d4262d45fc644ab).(filePtr); |
| 170 | root = SoDBcxx . . $ SoDB#::readAllcxx . . $ SoDB#readAll(e6adbfcd7bb1cb98).(&in); |
| 171 | if (root == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 172 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Error reading file %s\n", fName); |
| 173 | |
| 174 | fclose(filePtr); |
| 175 | if ( worldInfocxx . . $ Interface#worldInfo. != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 176 | worldInfocxx . . $ Interface#worldInfo.->setScenecxx . . $ WorldInfo#setScene(b1470ecfbec0fb1b).( root ); |
| 177 | return root; |
| 178 | } |
| 179 | |
| 180 | ///////////////////////////////////////////////////////////////////// |
| 181 | // Writes the scene contained in worldInfo. |
| 182 | // If asVanilla==FALSE, uses special GeneralizedCylinder class in the file. |
| 183 | // If asVanilla==TRUE, uses only standard Inventor nodes. |
| 184 | // If filename is NULL, uses name already found in worldInfo. |
| 185 | // If filename and worldInfo->getFileName() are both NULL, it is an error. |
| 186 | void |
| 187 | Interfacecxx . . $ Interface#::writeToFilecxx . . $ Interface#writeToFile(577809987ad7a468).( SbBoolcxx . . $ SbBool# asVanilla, char *newFileName ) |
| 188 | { |
| 189 | if ( worldInfocxx . . $ Interface#worldInfo. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! || |
| 190 | (newFileName == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! && worldInfocxx . . $ Interface#worldInfo.->getFileNamecxx . . $ WorldInfo#getFileName(41208ce6ca65dd58).() == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!)) { |
| 191 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Interface::writeToFile programming error:" |
| 192 | "Can\'t write scene because no filename given or \n" |
| 193 | "Interface has worldInfo equal to NULL\n"); |
| 194 | return; |
| 195 | } |
| 196 | |
| 197 | SoWriteActioncxx . . $ SoWriteAction# wacxx . . $ SoWriteAction#SoWriteAction(49f6e7a06ebc5aa8).; |
| 198 | |
| 199 | if (newFileName != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! ) |
| 200 | worldInfocxx . . $ Interface#worldInfo.->setFileNamecxx . . $ WorldInfo#setFileName(fda57c8427c60377).( newFileName ); |
| 201 | |
| 202 | const char *fName = worldInfocxx . . $ Interface#worldInfo.->getFileNamecxx . . $ WorldInfo#getFileName(41208ce6ca65dd58).(); |
| 203 | |
| 204 | if (! wa.getOutputcxx . . $ SoWriteAction#getOutput(daf9692406936d14).()->openFilecxx . . $ SoOutput#openFile(5c4306d8553b3696).(fName)) { |
| 205 | char str[100]; |
| 206 | strcpy(str, "Error creating file: "); |
| 207 | strcat(str, fName); |
| 208 | SoXtcxx . . $ SoXt#::createSimpleErrorDialogcxx . . $ SoXt#createSimpleErrorDialog(f9dbcb154b73d276).(mgrWidgetcxx . . $ Interface#mgrWidget., |
| 209 | "File Write Error Dialog", str); |
| 210 | } |
| 211 | else { |
| 212 | // Temporarily remove manips from scene |
| 213 | SoTypecxx . . $ SoType# savedManipType = worldInfocxx . . $ Interface#worldInfo.->getManipTypecxx . . $ WorldInfo#getManipType(c00c150378d2b968).(); |
| 214 | worldInfocxx . . $ Interface#worldInfo.->setManipTypecxx . . $ WorldInfo#setManipType(3e4432a9d5c0ee1c).( SoTransformcxx . . $ SoTransform#::getClassTypeIdcxx . . $ SoTransform#getClassTypeId(c00c150378d2b968).() ); |
| 215 | |
| 216 | // Get the scene from worldInfo and write it out. |
| 217 | SoSeparatorcxx . . $ SoSeparator# *scene; |
| 218 | if ( asVanilla ) |
| 219 | scene = worldInfocxx . . $ Interface#worldInfo.->getVanillaSceneCopycxx . . $ WorldInfo#getVanillaSceneCopy(144169e46c9b0e8a).(); |
| 220 | else |
| 221 | scene = worldInfocxx . . $ Interface#worldInfo.->getScenecxx . . $ WorldInfo#getScene(144169e46c9b0e8a).(); |
| 222 | |
| 223 | |
| 224 | scene->refcxx . . $ SoBase#ref(83f5f38750778ac8).(); |
| 225 | wa.applycxx . . $ SoAction#apply(da6c7544ccee32bd).(scene); |
| 226 | wa.getOutputcxx . . $ SoWriteAction#getOutput(daf9692406936d14).()->closeFilecxx . . $ SoOutput#closeFile(49f6e7a06ebc5aa8).(); |
| 227 | scene->unrefcxx . . $ SoBase#unref(83f5f38750778ac8).(); |
| 228 | |
| 229 | // Restore manips to scene. |
| 230 | worldInfocxx . . $ Interface#worldInfo.->setManipTypecxx . . $ WorldInfo#setManipType(3e4432a9d5c0ee1c).( savedManipType ); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | /////////////////////////////////////////////////////////////////// |
| 235 | // |
| 236 | // If scene isn't empty, check if user wants to save scene first. |
| 237 | // If not, then create an empty scene so user can start over. |
| 238 | // |
| 239 | void |
| 240 | Interfacecxx . . $ Interface#::fileNewEventcxx . . $ Interface#fileNewEvent(49f6e7a06ebc5aa8).() |
| 241 | { |
| 242 | if (worldInfocxx . . $ Interface#worldInfo.->isSceneEmptycxx . . $ WorldInfo#isSceneEmpty(b126dc7c1de90089).() == FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ) { |
| 243 | createOkayCancelDialogcxx . . $ Interface#createOkayCancelDialog(81ca78dcc608f36c).(mgrWidgetcxx . . $ Interface#mgrWidget., |
| 244 | Interfacecxx . . $ Interface#::newSceneCBcxx . . $ Interface#newSceneCB(ced67b223103c42b)., |
| 245 | "New Scene Error Dialog", |
| 246 | "Your current scene is not empty.", |
| 247 | "Hit OK to continue, CANCEL if you want to Save first."); |
| 248 | |
| 249 | } |
| 250 | else |
| 251 | Interfacecxx . . $ Interface#::newSceneCBcxx . . $ Interface#newSceneCB(ced67b223103c42b).(NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, (XtPointercxx . . $ XtPointer#) this, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 252 | } |
| 253 | |
| 254 | /////////////////////////////////////////////////////////////////// |
| 255 | // |
| 256 | // If scene not empty, check if user wants to save scene first. |
| 257 | // If not, bring up the file dialog box and read a new scene from file. |
| 258 | // |
| 259 | void |
| 260 | Interfacecxx . . $ Interface#::fileOpenEventcxx . . $ Interface#fileOpenEvent(49f6e7a06ebc5aa8).() |
| 261 | { |
| 262 | if (worldInfocxx . . $ Interface#worldInfo.->isSceneEmptycxx . . $ WorldInfo#isSceneEmpty(b126dc7c1de90089).() == FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ) { |
| 263 | createOkayCancelDialogcxx . . $ Interface#createOkayCancelDialog(81ca78dcc608f36c).(mgrWidgetcxx . . $ Interface#mgrWidget., |
| 264 | Interfacecxx . . $ Interface#::openSceneCBcxx . . $ Interface#openSceneCB(ced67b223103c42b)., |
| 265 | "Open Scene Error Dialog", |
| 266 | "Your current scene is not empty.", |
| 267 | "Hit OK to continue, CANCEL if you want to Save first."); |
| 268 | |
| 269 | } |
| 270 | else |
| 271 | Interfacecxx . . $ Interface#::openSceneCBcxx . . $ Interface#openSceneCB(ced67b223103c42b).(NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, (XtPointercxx . . $ XtPointer#) this, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 272 | } |
| 273 | |
| 274 | /////////////////////////////////////////////////////////////////// |
| 275 | // |
| 276 | // If scene is empty, show a dialog and return. |
| 277 | // If there is more than one file in the list, direct them to Save As... |
| 278 | // If everything's okay, ask the world for the scene and write it out. |
| 279 | // |
| 280 | void |
| 281 | Interfacecxx . . $ Interface#::fileSaveEventcxx . . $ Interface#fileSaveEvent(49f6e7a06ebc5aa8).() |
| 282 | { |
| 283 | if (worldInfocxx . . $ Interface#worldInfo.->isSceneEmptycxx . . $ WorldInfo#isSceneEmpty(b126dc7c1de90089).() == TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! ) { |
| 284 | SoXtcxx . . $ SoXt#::createSimpleErrorDialogcxx . . $ SoXt#createSimpleErrorDialog(f9dbcb154b73d276).(mgrWidgetcxx . . $ Interface#mgrWidget., |
| 285 | "File Save Empty Error Dialog", |
| 286 | "The current scene is empty. Create a scene first,", |
| 287 | "or fix my code to grey out this menu item."); |
| 288 | } |
| 289 | else |
| 290 | writeToFilecxx . . $ Interface#writeToFile(577809987ad7a468).( FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ); |
| 291 | } |
| 292 | |
| 293 | /////////////////////////////////////////////////////////////////// |
| 294 | // |
| 295 | // If the scene is empty, show a dialog and return. |
| 296 | // If everything's okay, ask the world for the scene and write it out. |
| 297 | // |
| 298 | void |
| 299 | Interfacecxx . . $ Interface#::fileSaveAsEventcxx . . $ Interface#fileSaveAsEvent(49f6e7a06ebc5aa8).() |
| 300 | { |
| 301 | if (worldInfocxx . . $ Interface#worldInfo.->isSceneEmptycxx . . $ WorldInfo#isSceneEmpty(b126dc7c1de90089).() == TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! ) { |
| 302 | SoXtcxx . . $ SoXt#::createSimpleErrorDialogcxx . . $ SoXt#createSimpleErrorDialog(f9dbcb154b73d276).(mgrWidgetcxx . . $ Interface#mgrWidget., |
| 303 | "File Save As Empty Error Dialog", |
| 304 | "The current scene is empty. Create a scene first,", |
| 305 | "or fix my code to grey out this menu item."); |
| 306 | } |
| 307 | else |
| 308 | showFileSelectionDialogcxx . . $ Interface#showFileSelectionDialog(41d996c60813b5d0).( (XtCallbackProccxx . . $ XtCallbackProc#) Interfacecxx . . $ Interface#::writeToFileCBcxx . . $ Interface#writeToFileCB(23cdf17a8f279c9d). ); |
| 309 | } |
| 310 | |
| 311 | /////////////////////////////////////////////////////////////////// |
| 312 | // |
| 313 | // If the scene is empty, show a dialog and return. |
| 314 | // If everything's okay, ask the world for the scene and write it out. |
| 315 | // |
| 316 | void |
| 317 | Interfacecxx . . $ Interface#::fileSaveVanillaEventcxx . . $ Interface#fileSaveVanillaEvent(49f6e7a06ebc5aa8).() |
| 318 | { |
| 319 | if (worldInfocxx . . $ Interface#worldInfo.->isSceneEmptycxx . . $ WorldInfo#isSceneEmpty(b126dc7c1de90089).() == TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`! ) { |
| 320 | SoXtcxx . . $ SoXt#::createSimpleErrorDialogcxx . . $ SoXt#createSimpleErrorDialog(f9dbcb154b73d276).(mgrWidgetcxx . . $ Interface#mgrWidget., |
| 321 | "File Save As Empty Error Dialog", |
| 322 | "The current scene is empty. Create a scene first,", |
| 323 | "or fix my code to grey out this menu item."); |
| 324 | } |
| 325 | else |
| 326 | showFileSelectionDialogcxx . . $ Interface#showFileSelectionDialog(41d996c60813b5d0).( (XtCallbackProccxx . . $ XtCallbackProc#) Interfacecxx . . $ Interface#::writeToVanillaFileCBcxx . . $ Interface#writeToVanillaFileCB(23cdf17a8f279c9d). ); |
| 327 | } |
| 328 | |
| 329 | /////////////////////////////////////////////////////////////////// |
| 330 | // |
| 331 | // If the scene is not empty, see if the user would like to save. |
| 332 | // Otherwise, quit. |
| 333 | // |
| 334 | void |
| 335 | Interfacecxx . . $ Interface#::fileQuitEventcxx . . $ Interface#fileQuitEvent(49f6e7a06ebc5aa8).() |
| 336 | { |
| 337 | if (worldInfocxx . . $ Interface#worldInfo.->isSceneEmptycxx . . $ WorldInfo#isSceneEmpty(b126dc7c1de90089).() == FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ) { |
| 338 | createOkayCancelDialogcxx . . $ Interface#createOkayCancelDialog(81ca78dcc608f36c).(mgrWidgetcxx . . $ Interface#mgrWidget., |
| 339 | Interfacecxx . . $ Interface#::quitProgramCBcxx . . $ Interface#quitProgramCB(ced67b223103c42b)., |
| 340 | "Quit Error Dialog", |
| 341 | "Your current scene is not empty.", |
| 342 | "Hit OK to Quit anyway, CANCEL if you want to Save first."); |
| 343 | |
| 344 | } |
| 345 | else |
| 346 | Interfacecxx . . $ Interface#::quitProgramCBcxx . . $ Interface#quitProgramCB(ced67b223103c42b).(NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, (XtPointercxx . . $ XtPointer#) this, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 347 | } |
| 348 | |
| 349 | //////////////////////////////////////////////////////////////////////// |
| 350 | // |
| 351 | // creates a dialog box. |
| 352 | // Prints a message and has two buttons: |
| 353 | // CANCEL and OK. |
| 354 | // |
| 355 | // When calling this, you must pass a callback for when the |
| 356 | // OK button is pressed. |
| 357 | // |
| 358 | void |
| 359 | Interfacecxx . . $ Interface#::createOkayCancelDialogcxx . . $ Interface#createOkayCancelDialog(81ca78dcc608f36c).(Widgetcxx . . $ Widget# widget, XtCallbackProccxx . . $ XtCallbackProc# okCB, |
| 360 | char *dialogTitle, char *str1, char *str2) |
| 361 | { |
| 362 | Widgetcxx . . $ Widget# shell = SoXtcxx . . $ SoXt#::getShellWidgetcxx . . $ SoXt#getShellWidget(a686be44a4028679).(widget); |
| 363 | if (shell == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 364 | return; |
| 365 | |
| 366 | Argcxx . . $ Arg# args[5]; |
| 367 | XmString xmstr = XmStringCreateSimple(str1); |
| 368 | xmstr = XmStringConcat(xmstr, XmStringSeparatorCreate()); |
| 369 | xmstr = XmStringConcat(xmstr, XmStringCreateSimple(str2)); |
| 370 | |
| 371 | int n = 0; |
| 372 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[n], XmNautoUnmanagecxx . . $ `<external>/427401153941432933/XmStrDefs.h:2409:9`!, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); n++; |
| 373 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[n], XtNtitlecxx . . $ `<external>/5585922817170358163/Shell.h:275:9`!, dialogTitle); n++; |
| 374 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[n], XmNmessageStringcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3018:9`!, xmstr); n++; |
| 375 | Widgetcxx . . $ Widget# dialog = XmCreateErrorDialog(shell, "Error Dialog", args, n); |
| 376 | XmStringFree(xmstr); |
| 377 | |
| 378 | XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON)); |
| 379 | |
| 380 | // First, destroy the dialog box. |
| 381 | // Then, call the passed callback. |
| 382 | XtAddCallback(dialog, XmNokCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3117:9`!, |
| 383 | (XtCallbackProccxx . . $ XtCallbackProc#) Interfacecxx . . $ Interface#::destroyDialogCBcxx . . $ Interface#destroyDialogCB(ced67b223103c42b)., (XtPointercxx . . $ XtPointer#)this); |
| 384 | XtAddCallback(dialog, XmNokCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3117:9`!, |
| 385 | (XtCallbackProccxx . . $ XtCallbackProc#) okCB, (XtPointercxx . . $ XtPointer#)this); |
| 386 | |
| 387 | // If the user cancels, we'll always want to destroy the dialog. |
| 388 | // register callback to destroy (and not just unmap) the dialog |
| 389 | XtAddCallback(dialog, XmNcancelCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2475:9`!, |
| 390 | (XtCallbackProccxx . . $ XtCallbackProc#) Interfacecxx . . $ Interface#::destroyDialogCBcxx . . $ Interface#destroyDialogCB(ced67b223103c42b)., (XtPointercxx . . $ XtPointer#)this); |
| 391 | |
| 392 | XtManageChild(dialog); |
| 393 | } |
| 394 | |
| 395 | /////////////////////////////////////////////////////////////////// |
| 396 | // |
| 397 | // Brings up the "About..." dialog |
| 398 | // |
| 399 | void |
| 400 | Interfacecxx . . $ Interface#::showAboutDialogcxx . . $ Interface#showAboutDialog(49f6e7a06ebc5aa8).() |
| 401 | { |
| 402 | if (access(IVDEMOBINDIRcxx . . $ `<built-in>:433:9`!"/noodle.about.pdf", R_OKcxx . . $ `<external>/12628407106812493757/unistd.h:281:9`!) != 0) { |
| 403 | system("xmessage 'Sorry, could not find " |
| 404 | IVDEMOBINDIRcxx . . $ `<built-in>:433:9`!"/noodle.about.pdf' > /dev/null"); |
| 405 | return; |
| 406 | } |
| 407 | |
| 408 | char command[2*PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!+100]; |
| 409 | sprintf(command, "which " PDFVIEWERcxx . . $ `<built-in>:439:9`! " > /dev/null"); |
| 410 | |
| 411 | int err = system(command); |
| 412 | if (err) { |
| 413 | system("xmessage 'You must install " PDFVIEWERcxx . . $ `<built-in>:439:9`! |
| 414 | " for this function to work' > /dev/null"); |
| 415 | return; |
| 416 | } |
| 417 | |
| 418 | sprintf(command, PDFVIEWERcxx . . $ `<built-in>:439:9`! " " IVDEMOBINDIRcxx . . $ `<built-in>:433:9`!"/noodle.about.pdf &"); |
| 419 | system(command); |
| 420 | } |
| 421 | |
| 422 | /////////////////////////////////////////////////////////////////// |
| 423 | // |
| 424 | // Use a motif file selection dialog to get the new filename. |
| 425 | // When calling this, you must pass a callback for when the |
| 426 | // OK button is pressed. |
| 427 | // |
| 428 | void |
| 429 | Interfacecxx . . $ Interface#::showFileSelectionDialogcxx . . $ Interface#showFileSelectionDialog(41d996c60813b5d0).( XtCallbackProccxx . . $ XtCallbackProc# okCB ) |
| 430 | { |
| 431 | static Widgetcxx . . $ Widget# fileDialog = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 432 | |
| 433 | if (fileDialog == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) { |
| 434 | Argcxx . . $ Arg# args[5]; |
| 435 | int n = 0; |
| 436 | |
| 437 | // Unmanage when ok/cancel are pressed |
| 438 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[n], XmNautoUnmanagecxx . . $ `<external>/427401153941432933/XmStrDefs.h:2409:9`!, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!); n++; |
| 439 | fileDialog = XmCreateFileSelectionDialog( |
| 440 | XtParent(mgrWidgetcxx . . $ Interface#mgrWidget.), "File Dialog", args, n); |
| 441 | |
| 442 | XtAddCallback(fileDialog, XmNokCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3117:9`!, |
| 443 | (XtCallbackProccxx . . $ XtCallbackProc#)okCB, (XtPointercxx . . $ XtPointer#) this); |
| 444 | } |
| 445 | else { |
| 446 | // We need to remove the old callback, |
| 447 | // then install the one we were passed, since this file selector |
| 448 | // is used for both reading and writing files. |
| 449 | XtRemoveAllCallbacks(fileDialog, XmNokCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3117:9`! ); |
| 450 | XtAddCallback(fileDialog, XmNokCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3117:9`!, |
| 451 | (XtCallbackProccxx . . $ XtCallbackProc#)okCB, this); |
| 452 | } |
| 453 | |
| 454 | // Manage the dialog |
| 455 | XtManageChild(fileDialog); |
| 456 | } |
| 457 | |
| 458 | |
| 459 | ////////////////////////////////////////////////////////////// |
| 460 | // Gets rid of dialog box. |
| 461 | void |
| 462 | Interfacecxx . . $ Interface#::destroyDialogCBcxx . . $ Interface#destroyDialogCB(ced67b223103c42b).(Widgetcxx . . $ Widget# dialog, void *, void *) |
| 463 | { |
| 464 | XtDestroyWidget(dialog); |
| 465 | } |
| 466 | |
| 467 | ////////////////////////////////////////////////////////////// |
| 468 | // Makes a brand new scene. |
| 469 | // |
| 470 | void |
| 471 | Interfacecxx . . $ Interface#::newSceneCBcxx . . $ Interface#newSceneCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, void *userData, void *) |
| 472 | { |
| 473 | Interfacecxx . . $ Interface# *myself = (Interfacecxx . . $ Interface# *) userData; |
| 474 | // Create a new scene with one Noodle under a separator. |
| 475 | SoSeparatorcxx . . $ SoSeparator# *newRoot = new SoSeparatorcxx . . $ SoSeparator#SoSeparator(49f6e7a06ebc5aa8).; |
| 476 | newRoot->refcxx . . $ SoBase#ref(83f5f38750778ac8).(); |
| 477 | newRoot->addChildcxx . . $ SoGroup#addChild(da6c7544ccee32bd).( new GeneralizedCylindercxx . . $ GeneralizedCylinder# ); |
| 478 | |
| 479 | myself->getWorldInfocxx . . $ Interface#getWorldInfo(f6b336ba76bc5c1c).()->setScenecxx . . $ WorldInfo#setScene(b1470ecfbec0fb1b).( newRoot ); |
| 480 | newRoot->unrefcxx . . $ SoBase#unref(83f5f38750778ac8).(); |
| 481 | } |
| 482 | |
| 483 | ////////////////////////////////////////////////////////////// |
| 484 | // Brings up file selection widget and reads scene from selected file. |
| 485 | // |
| 486 | void |
| 487 | Interfacecxx . . $ Interface#::openSceneCBcxx . . $ Interface#openSceneCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, void *userData, void *) |
| 488 | { |
| 489 | ((Interfacecxx . . $ Interface# *)userData)->showFileSelectionDialogcxx . . $ Interface#showFileSelectionDialog(41d996c60813b5d0).( |
| 490 | (XtCallbackProccxx . . $ XtCallbackProc#) Interfacecxx . . $ Interface#::readFromFileCBcxx . . $ Interface#readFromFileCB(23cdf17a8f279c9d). ); |
| 491 | } |
| 492 | |
| 493 | ////////////////////////////////////////////////////////////// |
| 494 | // Brings up file selection widget and reads scene from selected file. |
| 495 | // Callback routine that gets called when the new filename |
| 496 | // has been entered. |
| 497 | // |
| 498 | // Reads the scene and gives it to 'worldInfo' |
| 499 | // |
| 500 | void |
| 501 | Interfacecxx . . $ Interface#::readFromFileCBcxx . . $ Interface#readFromFileCB(23cdf17a8f279c9d).(Widgetcxx . . $ Widget#, void *userData, |
| 502 | XmFileSelectionBoxCallbackStruct *data) |
| 503 | { |
| 504 | // Get the file name |
| 505 | char *filename; |
| 506 | XmStringGetLtoR(data->value, |
| 507 | (XmStringCharSet) XmSTRING_DEFAULT_CHARSETcxx . . $ `<external>/427401153941432933/XmStrDefs.h:5447:9`!, &filename); |
| 508 | |
| 509 | ((Interfacecxx . . $ Interface# *)userData)->readScenecxx . . $ Interface#readScene(19b1fedcea669102).( filename ); |
| 510 | |
| 511 | XtFree(filename); |
| 512 | } |
| 513 | |
| 514 | ////////////////////////////////////////////////////////////// |
| 515 | // Callback routine that gets called when the new filename |
| 516 | // has been entered. |
| 517 | // |
| 518 | // Writes the scene held by 'worldInfo' |
| 519 | // |
| 520 | void |
| 521 | Interfacecxx . . $ Interface#::writeToFileCBcxx . . $ Interface#writeToFileCB(23cdf17a8f279c9d).(Widgetcxx . . $ Widget#, void *userData, |
| 522 | XmFileSelectionBoxCallbackStruct *data) |
| 523 | { |
| 524 | // Get the file name |
| 525 | char *filename; |
| 526 | XmStringGetLtoR(data->value, |
| 527 | (XmStringCharSet) XmSTRING_DEFAULT_CHARSETcxx . . $ `<external>/427401153941432933/XmStrDefs.h:5447:9`!, &filename); |
| 528 | |
| 529 | ((Interfacecxx . . $ Interface# *)userData)->writeToFilecxx . . $ Interface#writeToFile(577809987ad7a468).( FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!, filename ); |
| 530 | |
| 531 | XtFree(filename); |
| 532 | } |
| 533 | |
| 534 | ////////////////////////////////////////////////////////////// |
| 535 | // Callback routine that gets called when the new filename |
| 536 | // has been entered. |
| 537 | // |
| 538 | // Writes the scene AS A STANDARD INVENTOR FILE WITHOUT GENERALIZED CYLINDERS |
| 539 | // to file held by 'worldInfo' |
| 540 | // |
| 541 | void |
| 542 | Interfacecxx . . $ Interface#::writeToVanillaFileCBcxx . . $ Interface#writeToVanillaFileCB(23cdf17a8f279c9d).(Widgetcxx . . $ Widget#, void *userData, |
| 543 | XmFileSelectionBoxCallbackStruct *data) |
| 544 | { |
| 545 | // Get the file name |
| 546 | char *filename; |
| 547 | XmStringGetLtoR(data->value, |
| 548 | (XmStringCharSet) XmSTRING_DEFAULT_CHARSETcxx . . $ `<external>/427401153941432933/XmStrDefs.h:5447:9`!, &filename); |
| 549 | |
| 550 | // TRUE means to write it 'vanilla style' |
| 551 | ((Interfacecxx . . $ Interface# *) userData)->writeToFilecxx . . $ Interface#writeToFile(577809987ad7a468).( TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!, filename ); |
| 552 | |
| 553 | XtFree(filename); |
| 554 | } |
| 555 | |
| 556 | void |
| 557 | Interfacecxx . . $ Interface#::quitProgramCBcxx . . $ Interface#quitProgramCB(ced67b223103c42b).(Widgetcxx . . $ Widget#, void *, void *) |
| 558 | { |
| 559 | exit(0); |
| 560 | } |
| 561 | |
| 562 | /////////////////////////////////////////////////////////////////// |
| 563 | // |
| 564 | // Process the topbar menu events. |
| 565 | void |
| 566 | Interfacecxx . . $ Interface#::processTopbarEventcxx . . $ Interface#processTopbarEvent(274eff8a90d752a6).(Widgetcxx . . $ Widget#, |
| 567 | NoodleMenuItemcxx . . $ NoodleMenuItem# *data, XmAnyCallbackStruct *cbstruct ) |
| 568 | { |
| 569 | Interfacecxx . . $ Interface# *myself = data->ownerInterfacecxx . . $ NoodleMenuItem#ownerInterface.; |
| 570 | WorldInfocxx . . $ WorldInfo# *myWorld = myself->worldInfocxx . . $ Interface#worldInfo.; |
| 571 | GeneralizedCylindercxx . . $ GeneralizedCylinder# *myNoodle = myWorld->getCurrentNoodlecxx . . $ WorldInfo#getCurrentNoodle(996da8effa49e3ca).(); |
| 572 | |
| 573 | static SoXtClipboardcxx . . $ SoXtClipboard# *theClipboard = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 574 | |
| 575 | switch (data->idcxx . . $ NoodleMenuItem#id.) { |
| 576 | |
| 577 | // |
| 578 | // File |
| 579 | // |
| 580 | |
| 581 | case MM_FILE_NEWcxx . . $ MM_FILE_NEW.: |
| 582 | myself->fileNewEventcxx . . $ Interface#fileNewEvent(49f6e7a06ebc5aa8).(); |
| 583 | break; |
| 584 | |
| 585 | case MM_FILE_OPENcxx . . $ MM_FILE_OPEN.: |
| 586 | myself->fileOpenEventcxx . . $ Interface#fileOpenEvent(49f6e7a06ebc5aa8).(); |
| 587 | break; |
| 588 | |
| 589 | case MM_FILE_SAVEcxx . . $ MM_FILE_SAVE.: |
| 590 | myself->fileSaveEventcxx . . $ Interface#fileSaveEvent(49f6e7a06ebc5aa8).(); |
| 591 | break; |
| 592 | |
| 593 | case MM_FILE_SAVE_AScxx . . $ MM_FILE_SAVE_AS.: |
| 594 | myself->fileSaveAsEventcxx . . $ Interface#fileSaveAsEvent(49f6e7a06ebc5aa8).(); |
| 595 | break; |
| 596 | |
| 597 | case MM_FILE_SAVE_VANILLAcxx . . $ MM_FILE_SAVE_VANILLA.: |
| 598 | myself->fileSaveVanillaEventcxx . . $ Interface#fileSaveVanillaEvent(49f6e7a06ebc5aa8).(); |
| 599 | break; |
| 600 | |
| 601 | case MM_FILE_QUITcxx . . $ MM_FILE_QUIT.: |
| 602 | myself->fileQuitEventcxx . . $ Interface#fileQuitEvent(49f6e7a06ebc5aa8).(); |
| 603 | break; |
| 604 | |
| 605 | // |
| 606 | // Edit |
| 607 | // |
| 608 | |
| 609 | case MM_EDIT_NEWcxx . . $ MM_EDIT_NEW.: |
| 610 | // Add the current selection to the list of deleted objects. |
| 611 | myWorld->addNewNoodlecxx . . $ WorldInfo#addNewNoodle(996da8effa49e3ca).(); |
| 612 | break; |
| 613 | |
| 614 | case MM_EDIT_DELETEcxx . . $ MM_EDIT_DELETE.: |
| 615 | // Add the current selection to the list of deleted objects. |
| 616 | myWorld->deleteCurrentNoodlecxx . . $ WorldInfo#deleteCurrentNoodle(49f6e7a06ebc5aa8).(); |
| 617 | // Set the primary selection to NULL... |
| 618 | myself->setPrimarySelectioncxx . . $ Interface#setPrimarySelection(5f519fe7cd1d61ca).(NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 619 | break; |
| 620 | |
| 621 | case MM_EDIT_UNDELETEcxx . . $ MM_EDIT_UNDELETE.: |
| 622 | // Undelete the most recently deleted object. |
| 623 | myWorld->undeleteNoodlecxx . . $ WorldInfo#undeleteNoodle(996da8effa49e3ca).(); |
| 624 | break; |
| 625 | |
| 626 | case MM_EDIT_COPYcxx . . $ MM_EDIT_COPY.: |
| 627 | case MM_EDIT_COPY_ALLcxx . . $ MM_EDIT_COPY_ALL.: |
| 628 | // Establish what we are copying |
| 629 | SoNodecxx . . $ SoNode# *copyStuff; |
| 630 | if (data->idcxx . . $ NoodleMenuItem#id. == MM_EDIT_COPYcxx . . $ MM_EDIT_COPY.) |
| 631 | copyStuff = myNoodle; |
| 632 | else |
| 633 | copyStuff = myWorld->getScenecxx . . $ WorldInfo#getScene(144169e46c9b0e8a).(); |
| 634 | |
| 635 | // Make a clipboard |
| 636 | if (theClipboard == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 637 | theClipboard = new SoXtClipboardcxx . . $ SoXtClipboard#(myself->mainViewercxx . . $ Interface#mainViewer.->getWidgetcxx . . $ SoXtComponent#getWidget(24ba213de9f943e3).()); |
| 638 | |
| 639 | // Copy into clipboard |
| 640 | if ( copyStuff != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! ) |
| 641 | theClipboard->copycxx . . $ SoXtClipboard#copy(68a2dd7e4b406e23).( copyStuff, cbstruct->event->xbuttoncxx . . $ _XEvent#xbutton..timecxx . . $ $anonymous_type_17d7f07cf933eea7_23#time.); |
| 642 | break; |
| 643 | |
| 644 | // |
| 645 | // Options |
| 646 | // |
| 647 | |
| 648 | case MM_SHAPE_FACE_SETcxx . . $ MM_SHAPE_FACE_SET.: |
| 649 | if ( myNoodle && XmToggleButtonGetState( data->widgetcxx . . $ NoodleMenuItem#widget. ) ) { |
| 650 | myNoodle->renderShapeTypecxx . . $ GeneralizedCylinder#renderShapeType. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). GeneralizedCylindercxx . . $ GeneralizedCylinder#::FACE_SETcxx . . $ GeneralizedCylinder#FACE_SET.; |
| 651 | myself->setRenderStyleRadioButtonscxx . . $ Interface#setRenderStyleRadioButtons(a2bd165566b2e07e).( GeneralizedCylindercxx . . $ GeneralizedCylinder#::FACE_SETcxx . . $ GeneralizedCylinder#FACE_SET. ); |
| 652 | } |
| 653 | break; |
| 654 | case MM_SHAPE_TRI_STRIPcxx . . $ MM_SHAPE_TRI_STRIP.: |
| 655 | if ( myNoodle && XmToggleButtonGetState( data->widgetcxx . . $ NoodleMenuItem#widget. ) ) { |
| 656 | myNoodle->renderShapeTypecxx . . $ GeneralizedCylinder#renderShapeType. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). GeneralizedCylindercxx . . $ GeneralizedCylinder#::TRIANGLE_STRIP_SETcxx . . $ GeneralizedCylinder#TRIANGLE_STRIP_SET.; |
| 657 | myself->setRenderStyleRadioButtonscxx . . $ Interface#setRenderStyleRadioButtons(a2bd165566b2e07e).(GeneralizedCylindercxx . . $ GeneralizedCylinder#::TRIANGLE_STRIP_SETcxx . . $ GeneralizedCylinder#TRIANGLE_STRIP_SET.); |
| 658 | } |
| 659 | break; |
| 660 | case MM_SHAPE_QUAD_MESHcxx . . $ MM_SHAPE_QUAD_MESH.: |
| 661 | if ( myNoodle && XmToggleButtonGetState( data->widgetcxx . . $ NoodleMenuItem#widget. ) ) { |
| 662 | myNoodle->renderShapeTypecxx . . $ GeneralizedCylinder#renderShapeType. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). GeneralizedCylindercxx . . $ GeneralizedCylinder#::QUAD_MESHcxx . . $ GeneralizedCylinder#QUAD_MESH.; |
| 663 | myself->setRenderStyleRadioButtonscxx . . $ Interface#setRenderStyleRadioButtons(a2bd165566b2e07e).(GeneralizedCylindercxx . . $ GeneralizedCylinder#::QUAD_MESHcxx . . $ GeneralizedCylinder#QUAD_MESH.); |
| 664 | } |
| 665 | break; |
| 666 | case MM_SHAPE_CUBIC_SPLINEcxx . . $ MM_SHAPE_CUBIC_SPLINE.: |
| 667 | if ( myNoodle && XmToggleButtonGetState( data->widgetcxx . . $ NoodleMenuItem#widget. ) ) { |
| 668 | myNoodle->renderShapeTypecxx . . $ GeneralizedCylinder#renderShapeType. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). GeneralizedCylindercxx . . $ GeneralizedCylinder#::CUBIC_SPLINE_SURFACEcxx . . $ GeneralizedCylinder#CUBIC_SPLINE_SURFACE.; |
| 669 | myself->setRenderStyleRadioButtonscxx . . $ Interface#setRenderStyleRadioButtons(a2bd165566b2e07e).(GeneralizedCylindercxx . . $ GeneralizedCylinder#::CUBIC_SPLINE_SURFACEcxx . . $ GeneralizedCylinder#CUBIC_SPLINE_SURFACE.); |
| 670 | } |
| 671 | break; |
| 672 | case MM_SHAPE_CUBIC_TO_EDGEcxx . . $ MM_SHAPE_CUBIC_TO_EDGE.: |
| 673 | if ( myNoodle && XmToggleButtonGetState( data->widgetcxx . . $ NoodleMenuItem#widget. ) ) { |
| 674 | myNoodle->renderShapeTypecxx . . $ GeneralizedCylinder#renderShapeType. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). GeneralizedCylindercxx . . $ GeneralizedCylinder#::CUBIC_TO_EDGE_SURFACEcxx . . $ GeneralizedCylinder#CUBIC_TO_EDGE_SURFACE.; |
| 675 | myself->setRenderStyleRadioButtonscxx . . $ Interface#setRenderStyleRadioButtons(a2bd165566b2e07e).(GeneralizedCylindercxx . . $ GeneralizedCylinder#::CUBIC_TO_EDGE_SURFACEcxx . . $ GeneralizedCylinder#CUBIC_TO_EDGE_SURFACE.); |
| 676 | } |
| 677 | break; |
| 678 | case MM_SHAPE_BEZIERcxx . . $ MM_SHAPE_BEZIER.: |
| 679 | if ( myNoodle && XmToggleButtonGetState( data->widgetcxx . . $ NoodleMenuItem#widget. ) ) { |
| 680 | myNoodle->renderShapeTypecxx . . $ GeneralizedCylinder#renderShapeType. =cxx . . $ SoSFEnum#`operator=`(7864480464b09eea). GeneralizedCylindercxx . . $ GeneralizedCylinder#::BEZIER_SURFACEcxx . . $ GeneralizedCylinder#BEZIER_SURFACE.; |
| 681 | myself->setRenderStyleRadioButtonscxx . . $ Interface#setRenderStyleRadioButtons(a2bd165566b2e07e).(GeneralizedCylindercxx . . $ GeneralizedCylinder#::BEZIER_SURFACEcxx . . $ GeneralizedCylinder#BEZIER_SURFACE.); |
| 682 | } |
| 683 | break; |
| 684 | |
| 685 | case MM_PARTS_SIDEScxx . . $ MM_PARTS_SIDES.: |
| 686 | if (myNoodle != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! ) { |
| 687 | GeneralizedCylindercxx . . $ GeneralizedCylinder# *c = myNoodle; |
| 688 | if (c->withSidescxx . . $ GeneralizedCylinder#withSides..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).()) |
| 689 | c->withSidescxx . . $ GeneralizedCylinder#withSides. =cxx . . $ SoSFShort#`operator=`(14a1761c3ef4450f). FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 690 | else |
| 691 | c->withSidescxx . . $ GeneralizedCylinder#withSides. =cxx . . $ SoSFShort#`operator=`(14a1761c3ef4450f). TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!; |
| 692 | } |
| 693 | break; |
| 694 | case MM_PARTS_TOP_CAPcxx . . $ MM_PARTS_TOP_CAP.: |
| 695 | if (myNoodle != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! ) { |
| 696 | GeneralizedCylindercxx . . $ GeneralizedCylinder# *c = myNoodle; |
| 697 | if (c->withTopCapcxx . . $ GeneralizedCylinder#withTopCap..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).()) |
| 698 | c->withTopCapcxx . . $ GeneralizedCylinder#withTopCap. =cxx . . $ SoSFShort#`operator=`(14a1761c3ef4450f). FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 699 | else |
| 700 | c->withTopCapcxx . . $ GeneralizedCylinder#withTopCap. =cxx . . $ SoSFShort#`operator=`(14a1761c3ef4450f). TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!; |
| 701 | } |
| 702 | break; |
| 703 | case MM_PARTS_BOT_CAPcxx . . $ MM_PARTS_BOT_CAP.: |
| 704 | if (myNoodle != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! ) { |
| 705 | GeneralizedCylindercxx . . $ GeneralizedCylinder# *c = myNoodle; |
| 706 | if (c->withBottomCapcxx . . $ GeneralizedCylinder#withBottomCap..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).()) |
| 707 | c->withBottomCapcxx . . $ GeneralizedCylinder#withBottomCap. =cxx . . $ SoSFShort#`operator=`(14a1761c3ef4450f). FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 708 | else |
| 709 | c->withBottomCapcxx . . $ GeneralizedCylinder#withBottomCap. =cxx . . $ SoSFShort#`operator=`(14a1761c3ef4450f). TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!; |
| 710 | } |
| 711 | break; |
| 712 | |
| 713 | // |
| 714 | // Manips |
| 715 | // |
| 716 | case MM_MANIPS_HBOXcxx . . $ MM_MANIPS_HBOX.: |
| 717 | if ( XmToggleButtonGetState( data->widgetcxx . . $ NoodleMenuItem#widget. ) ) { |
| 718 | if (myWorld->getManipTypecxx . . $ WorldInfo#getManipType(c00c150378d2b968).() !=cxx . . $ SoType#`operator!=`(1fd66475a268b64e). SoHandleBoxManipcxx . . $ SoHandleBoxManip#::getClassTypeIdcxx . . $ SoHandleBoxManip#getClassTypeId(c00c150378d2b968).()) { |
| 719 | |
| 720 | // Don't show bounding box (check action type to be safe...) |
| 721 | SoGLRenderActioncxx . . $ SoGLRenderAction# *ra = myself->mainViewercxx . . $ Interface#mainViewer.->getGLRenderActioncxx . . $ SoXtRenderArea#getGLRenderAction(3c6e1ebd9c702b1e).(); |
| 722 | if (ra->isOfTypecxx . . $ SoAction#isOfType(1fd66475a268b64e).( SoBoxHighlightRenderActioncxx . . $ SoBoxHighlightRenderAction#::getClassTypeIdcxx . . $ SoBoxHighlightRenderAction#getClassTypeId(c00c150378d2b968).())) |
| 723 | ((SoBoxHighlightRenderActioncxx . . $ SoBoxHighlightRenderAction# *) ra)->setVisiblecxx . . $ SoBoxHighlightRenderAction#setVisible(d4f767463ce0a6b3).(FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 724 | |
| 725 | myWorld->setManipTypecxx . . $ WorldInfo#setManipType(3e4432a9d5c0ee1c).( SoHandleBoxManipcxx . . $ SoHandleBoxManip#::getClassTypeIdcxx . . $ SoHandleBoxManip#getClassTypeId(c00c150378d2b968).() ); |
| 726 | myself->setManipTypeRadioButtonscxx . . $ Interface#setManipTypeRadioButtons(50c4a1f7c08652f).( SoHandleBoxManipcxx . . $ SoHandleBoxManip#::getClassTypeIdcxx . . $ SoHandleBoxManip#getClassTypeId(c00c150378d2b968).() ); |
| 727 | } |
| 728 | } |
| 729 | break; |
| 730 | case MM_MANIPS_TRACKBALLcxx . . $ MM_MANIPS_TRACKBALL.: |
| 731 | if ( XmToggleButtonGetState( data->widgetcxx . . $ NoodleMenuItem#widget. ) ) { |
| 732 | if (myWorld->getManipTypecxx . . $ WorldInfo#getManipType(c00c150378d2b968).() !=cxx . . $ SoType#`operator!=`(1fd66475a268b64e). SoTrackballManipcxx . . $ SoTrackballManip#::getClassTypeIdcxx . . $ SoTrackballManip#getClassTypeId(c00c150378d2b968).()) { |
| 733 | |
| 734 | // Don't show bounding box (check action type to be safe...) |
| 735 | SoGLRenderActioncxx . . $ SoGLRenderAction# *ra = myself->mainViewercxx . . $ Interface#mainViewer.->getGLRenderActioncxx . . $ SoXtRenderArea#getGLRenderAction(3c6e1ebd9c702b1e).(); |
| 736 | if (ra->isOfTypecxx . . $ SoAction#isOfType(1fd66475a268b64e).( SoBoxHighlightRenderActioncxx . . $ SoBoxHighlightRenderAction#::getClassTypeIdcxx . . $ SoBoxHighlightRenderAction#getClassTypeId(c00c150378d2b968).())) |
| 737 | ((SoBoxHighlightRenderActioncxx . . $ SoBoxHighlightRenderAction# *) ra)->setVisiblecxx . . $ SoBoxHighlightRenderAction#setVisible(d4f767463ce0a6b3).(FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 738 | |
| 739 | myWorld->setManipTypecxx . . $ WorldInfo#setManipType(3e4432a9d5c0ee1c).( SoTrackballManipcxx . . $ SoTrackballManip#::getClassTypeIdcxx . . $ SoTrackballManip#getClassTypeId(c00c150378d2b968).() ); |
| 740 | myself->setManipTypeRadioButtonscxx . . $ Interface#setManipTypeRadioButtons(50c4a1f7c08652f).( SoTrackballManipcxx . . $ SoTrackballManip#::getClassTypeIdcxx . . $ SoTrackballManip#getClassTypeId(c00c150378d2b968).() ); |
| 741 | } |
| 742 | } |
| 743 | break; |
| 744 | case MM_MANIPS_NONEcxx . . $ MM_MANIPS_NONE.: |
| 745 | if ( XmToggleButtonGetState( data->widgetcxx . . $ NoodleMenuItem#widget. ) ) { |
| 746 | if (myWorld->getManipTypecxx . . $ WorldInfo#getManipType(c00c150378d2b968).() !=cxx . . $ SoType#`operator!=`(1fd66475a268b64e). SoTransformcxx . . $ SoTransform#::getClassTypeIdcxx . . $ SoTransform#getClassTypeId(c00c150378d2b968).() ) { |
| 747 | |
| 748 | // Do show bounding box (check renderaction type to be safe...) |
| 749 | SoGLRenderActioncxx . . $ SoGLRenderAction# *ra = myself->mainViewercxx . . $ Interface#mainViewer.->getGLRenderActioncxx . . $ SoXtRenderArea#getGLRenderAction(3c6e1ebd9c702b1e).(); |
| 750 | if (ra->isOfTypecxx . . $ SoAction#isOfType(1fd66475a268b64e).( SoBoxHighlightRenderActioncxx . . $ SoBoxHighlightRenderAction#::getClassTypeIdcxx . . $ SoBoxHighlightRenderAction#getClassTypeId(c00c150378d2b968).())) |
| 751 | ((SoBoxHighlightRenderActioncxx . . $ SoBoxHighlightRenderAction# *) ra)->setVisiblecxx . . $ SoBoxHighlightRenderAction#setVisible(d4f767463ce0a6b3).(TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!); |
| 752 | |
| 753 | myWorld->setManipTypecxx . . $ WorldInfo#setManipType(3e4432a9d5c0ee1c).( SoTransformcxx . . $ SoTransform#::getClassTypeIdcxx . . $ SoTransform#getClassTypeId(c00c150378d2b968).() ); |
| 754 | myself->setManipTypeRadioButtonscxx . . $ Interface#setManipTypeRadioButtons(50c4a1f7c08652f).( SoTransformcxx . . $ SoTransform#::getClassTypeIdcxx . . $ SoTransform#getClassTypeId(c00c150378d2b968).() ); |
| 755 | } |
| 756 | } |
| 757 | break; |
| 758 | |
| 759 | case MM_GIZMOS_TEXTUREcxx . . $ MM_GIZMOS_TEXTURE.: |
| 760 | { |
| 761 | // Create a texture gizmo, if it does not exist. |
| 762 | if (myself->myTextureGizmocxx . . $ Interface#myTextureGizmo. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! ) { |
| 763 | myself->myTextureGizmocxx . . $ Interface#myTextureGizmo. = new NoodleTextureGizmocxx . . $ NoodleTextureGizmo#NoodleTextureGizmo(13a1a66a4f5d094a).(); |
| 764 | myself->myTextureGizmocxx . . $ Interface#myTextureGizmo.->setTitlecxx . . $ SoXtComponent#setTitle(85c52e162fed56f9).( "Texture Gizmo" ); |
| 765 | // Set the noodle for the gizmo. |
| 766 | myself->myTextureGizmocxx . . $ Interface#myTextureGizmo.->setNoodlecxx . . $ NoodleTextureGizmo#setNoodle(5f519fe7cd1d61ca).( myNoodle ); |
| 767 | } |
| 768 | // Show the texture gizmo. |
| 769 | myself->myTextureGizmocxx . . $ Interface#myTextureGizmo.->showcxx . . $ SoXtComponent#show(49f6e7a06ebc5aa8).(); |
| 770 | } |
| 771 | break; |
| 772 | |
| 773 | case MM_GIZMOS_SURFACEcxx . . $ MM_GIZMOS_SURFACE.: |
| 774 | { |
| 775 | if (myself->mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! ) { |
| 776 | // Create a surface gizmo, if it does not exist. |
| 777 | myself->mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo. = new NoodleSurfaceGizmocxx . . $ NoodleSurfaceGizmo#NoodleSurfaceGizmo(13a1a66a4f5d094a).(); |
| 778 | myself->mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo.->setTitlecxx . . $ SoXtComponent#setTitle(85c52e162fed56f9).( "Surface Gizmo" ); |
| 779 | // Set the noodle for the gizmo. |
| 780 | myself->mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo.->setNoodlecxx . . $ NoodleSurfaceGizmo#setNoodle(5f519fe7cd1d61ca).( myNoodle ); |
| 781 | } |
| 782 | // Show the surface gizmo. |
| 783 | myself->mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo.->showcxx . . $ SoXtComponent#show(49f6e7a06ebc5aa8).(); |
| 784 | } |
| 785 | break; |
| 786 | |
| 787 | // |
| 788 | // About |
| 789 | // |
| 790 | case MM_ABOUT_ABOUTcxx . . $ MM_ABOUT_ABOUT.: |
| 791 | myself->showAboutDialogcxx . . $ Interface#showAboutDialog(49f6e7a06ebc5aa8).(); |
| 792 | break; |
| 793 | |
| 794 | } |
| 795 | } |
| 796 | |
| 797 | /////////////////////////////////////////////////////////////////// |
| 798 | // |
| 799 | // Makes all settings of the interface reflect the given object |
| 800 | void |
| 801 | Interfacecxx . . $ Interface#::setPrimarySelectioncxx . . $ Interface#setPrimarySelection(5f519fe7cd1d61ca).( GeneralizedCylindercxx . . $ GeneralizedCylinder# *g ) |
| 802 | { |
| 803 | if (menuItemscxx . . $ Interface#menuItems. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 804 | return; |
| 805 | |
| 806 | SbBoolcxx . . $ SbBool# bv; |
| 807 | |
| 808 | // Render Style: |
| 809 | if (g == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 810 | setRenderStyleRadioButtonscxx . . $ Interface#setRenderStyleRadioButtons(a2bd165566b2e07e).( GeneralizedCylindercxx . . $ GeneralizedCylinder#::FACE_SETcxx . . $ GeneralizedCylinder#FACE_SET. ); |
| 811 | else |
| 812 | setRenderStyleRadioButtonscxx . . $ Interface#setRenderStyleRadioButtons(a2bd165566b2e07e).( (GeneralizedCylindercxx . . $ GeneralizedCylinder#::RenderShapeTypecxx . . $ GeneralizedCylinder#RenderShapeType#) |
| 813 | g->renderShapeTypecxx . . $ GeneralizedCylinder#renderShapeType..getValuecxx . . $ SoSFEnum#getValue(455f465bc33b4cdf).()); |
| 814 | |
| 815 | // Parts on or off: |
| 816 | bv = (g) ? g->withSidescxx . . $ GeneralizedCylinder#withSides..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).() : FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 817 | XmToggleButtonSetState( menuItemscxx . . $ Interface#menuItems.[MM_PARTS_SIDEScxx . . $ MM_PARTS_SIDES.].widgetcxx . . $ NoodleMenuItem#widget.,bv,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 818 | bv = (g) ? g->withTopCapcxx . . $ GeneralizedCylinder#withTopCap..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).() : FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 819 | XmToggleButtonSetState( menuItemscxx . . $ Interface#menuItems.[MM_PARTS_TOP_CAPcxx . . $ MM_PARTS_TOP_CAP.].widgetcxx . . $ NoodleMenuItem#widget.,bv,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 820 | bv = (g) ? g->withBottomCapcxx . . $ GeneralizedCylinder#withBottomCap..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).() : FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 821 | XmToggleButtonSetState( menuItemscxx . . $ Interface#menuItems.[MM_PARTS_BOT_CAPcxx . . $ MM_PARTS_BOT_CAP.].widgetcxx . . $ NoodleMenuItem#widget.,bv,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 822 | |
| 823 | // Manip Type: |
| 824 | SoNodecxx . . $ SoNode# *xf = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 825 | if ( g ) |
| 826 | xf = g->getPartcxx . . $ SoBaseKit#getPart(795225bb0fb495d5).( "transform"cxx . . $ SbName#SbName(85c52e162fed56f9)., FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ); |
| 827 | if ( ! xf ) |
| 828 | setManipTypeRadioButtonscxx . . $ Interface#setManipTypeRadioButtons(50c4a1f7c08652f).( SoTransformcxx . . $ SoTransform#::getClassTypeIdcxx . . $ SoTransform#getClassTypeId(c00c150378d2b968).() ); |
| 829 | else |
| 830 | setManipTypeRadioButtonscxx . . $ Interface#setManipTypeRadioButtons(50c4a1f7c08652f).( xf->getTypeIdcxx . . $ SoBase#getTypeId(70775439ff16cb15).() ); |
| 831 | |
| 832 | // Texture |
| 833 | if (myTextureGizmocxx . . $ Interface#myTextureGizmo.) |
| 834 | myTextureGizmocxx . . $ Interface#myTextureGizmo.->setNoodlecxx . . $ NoodleTextureGizmo#setNoodle(5f519fe7cd1d61ca).( g ); |
| 835 | |
| 836 | // Surface |
| 837 | if (mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo.) |
| 838 | mySurfaceGizmocxx . . $ Interface#mySurfaceGizmo.->setNoodlecxx . . $ NoodleSurfaceGizmo#setNoodle(5f519fe7cd1d61ca).( g ); |
| 839 | |
| 840 | // Tell the curve viewers to build new scenes... |
| 841 | if (profileViewercxx . . $ Interface#profileViewer.) |
| 842 | profileViewercxx . . $ Interface#profileViewer.->setSceneGraphcxx . . $ SoXtViewer#setSceneGraph(da6c7544ccee32bd).( |
| 843 | createProfileGraphcxx . . $ createProfileGraph(8003b3a0f44ac93).(profileViewercxx . . $ Interface#profileViewer.->getWidgetcxx . . $ SoXtComponent#getWidget(24ba213de9f943e3).(), g)); |
| 844 | if (sectionViewercxx . . $ Interface#sectionViewer.) |
| 845 | sectionViewercxx . . $ Interface#sectionViewer.->setSceneGraphcxx . . $ SoXtViewer#setSceneGraph(da6c7544ccee32bd).( |
| 846 | createCrossSectionGraphcxx . . $ createCrossSectionGraph(8003b3a0f44ac93).(sectionViewercxx . . $ Interface#sectionViewer.->getWidgetcxx . . $ SoXtComponent#getWidget(24ba213de9f943e3).(),g)); |
| 847 | if (spineViewercxx . . $ Interface#spineViewer.) |
| 848 | spineViewercxx . . $ Interface#spineViewer.->setSceneGraphcxx . . $ SoXtViewer#setSceneGraph(da6c7544ccee32bd).( |
| 849 | createSpineGraphcxx . . $ createSpineGraph(8003b3a0f44ac93).(spineViewercxx . . $ Interface#spineViewer.->getWidgetcxx . . $ SoXtComponent#getWidget(24ba213de9f943e3).(), g)); |
| 850 | if (twistViewercxx . . $ Interface#twistViewer.) |
| 851 | twistViewercxx . . $ Interface#twistViewer.->setSceneGraphcxx . . $ SoXtViewer#setSceneGraph(da6c7544ccee32bd).( |
| 852 | createTwistGraphcxx . . $ createTwistGraph(8003b3a0f44ac93).(twistViewercxx . . $ Interface#twistViewer.->getWidgetcxx . . $ SoXtComponent#getWidget(24ba213de9f943e3).(), g)); |
| 853 | |
| 854 | // Curve information for each of the four editors... |
| 855 | bv = (g) ? g->profileClosedcxx . . $ GeneralizedCylinder#profileClosed..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).() : FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 856 | XmToggleButtonSetState(closeProfileButtoncxx . . $ Interface#closeProfileButton., bv, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ); |
| 857 | bv = (g) ? g->crossSectionClosedcxx . . $ GeneralizedCylinder#crossSectionClosed..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).() : FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 858 | XmToggleButtonSetState(closeSectionButtoncxx . . $ Interface#closeSectionButton., bv, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ); |
| 859 | bv = (g) ? g->spineClosedcxx . . $ GeneralizedCylinder#spineClosed..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).() : FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 860 | XmToggleButtonSetState(closeSpineButtoncxx . . $ Interface#closeSpineButton., bv, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ); |
| 861 | bv = (g) ? g->twistClosedcxx . . $ GeneralizedCylinder#twistClosed..getValuecxx . . $ SoSFShort#getValue(524863554b4a534e).() : FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!; |
| 862 | XmToggleButtonSetState(closeTwistButtoncxx . . $ Interface#closeTwistButton., bv, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ); |
| 863 | |
| 864 | } |
| 865 | |
| 866 | void |
| 867 | Interfacecxx . . $ Interface#::setRenderStyleRadioButtonscxx . . $ Interface#setRenderStyleRadioButtons(a2bd165566b2e07e).( GeneralizedCylindercxx . . $ GeneralizedCylinder#::RenderShapeTypecxx . . $ GeneralizedCylinder#RenderShapeType# shapeType ) |
| 868 | { |
| 869 | // First turn all radio buttons to FALSE... |
| 870 | XmToggleButtonSetState(menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_FACE_SETcxx . . $ MM_SHAPE_FACE_SET.].widgetcxx . . $ NoodleMenuItem#widget.,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 871 | XmToggleButtonSetState(menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_TRI_STRIPcxx . . $ MM_SHAPE_TRI_STRIP.].widgetcxx . . $ NoodleMenuItem#widget.,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 872 | XmToggleButtonSetState(menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_QUAD_MESHcxx . . $ MM_SHAPE_QUAD_MESH.].widgetcxx . . $ NoodleMenuItem#widget.,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 873 | XmToggleButtonSetState(menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_CUBIC_SPLINEcxx . . $ MM_SHAPE_CUBIC_SPLINE.].widgetcxx . . $ NoodleMenuItem#widget.,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 874 | XmToggleButtonSetState(menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_CUBIC_TO_EDGEcxx . . $ MM_SHAPE_CUBIC_TO_EDGE.].widgetcxx . . $ NoodleMenuItem#widget.,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 875 | XmToggleButtonSetState(menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_BEZIERcxx . . $ MM_SHAPE_BEZIER.].widgetcxx . . $ NoodleMenuItem#widget.,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 876 | |
| 877 | // Set the appropriate radio button for shape rendering type. |
| 878 | Widgetcxx . . $ Widget# onWidget = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 879 | switch(shapeType) { |
| 880 | case GeneralizedCylindercxx . . $ GeneralizedCylinder#::FACE_SETcxx . . $ GeneralizedCylinder#FACE_SET.: |
| 881 | onWidget = menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_FACE_SETcxx . . $ MM_SHAPE_FACE_SET.].widgetcxx . . $ NoodleMenuItem#widget.; |
| 882 | break; |
| 883 | case GeneralizedCylindercxx . . $ GeneralizedCylinder#::TRIANGLE_STRIP_SETcxx . . $ GeneralizedCylinder#TRIANGLE_STRIP_SET.: |
| 884 | onWidget = menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_TRI_STRIPcxx . . $ MM_SHAPE_TRI_STRIP.].widgetcxx . . $ NoodleMenuItem#widget.; |
| 885 | break; |
| 886 | case GeneralizedCylindercxx . . $ GeneralizedCylinder#::QUAD_MESHcxx . . $ GeneralizedCylinder#QUAD_MESH.: |
| 887 | onWidget = menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_QUAD_MESHcxx . . $ MM_SHAPE_QUAD_MESH.].widgetcxx . . $ NoodleMenuItem#widget.; |
| 888 | break; |
| 889 | case GeneralizedCylindercxx . . $ GeneralizedCylinder#::CUBIC_SPLINE_SURFACEcxx . . $ GeneralizedCylinder#CUBIC_SPLINE_SURFACE.: |
| 890 | onWidget = menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_CUBIC_SPLINEcxx . . $ MM_SHAPE_CUBIC_SPLINE.].widgetcxx . . $ NoodleMenuItem#widget.; |
| 891 | break; |
| 892 | case GeneralizedCylindercxx . . $ GeneralizedCylinder#::CUBIC_TO_EDGE_SURFACEcxx . . $ GeneralizedCylinder#CUBIC_TO_EDGE_SURFACE.: |
| 893 | onWidget = menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_CUBIC_TO_EDGEcxx . . $ MM_SHAPE_CUBIC_TO_EDGE.].widgetcxx . . $ NoodleMenuItem#widget.; |
| 894 | break; |
| 895 | case GeneralizedCylindercxx . . $ GeneralizedCylinder#::BEZIER_SURFACEcxx . . $ GeneralizedCylinder#BEZIER_SURFACE.: |
| 896 | onWidget = menuItemscxx . . $ Interface#menuItems.[MM_SHAPE_BEZIERcxx . . $ MM_SHAPE_BEZIER.].widgetcxx . . $ NoodleMenuItem#widget.; |
| 897 | break; |
| 898 | } |
| 899 | if (onWidget) |
| 900 | XmToggleButtonSetState( onWidget, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ); |
| 901 | } |
| 902 | |
| 903 | void |
| 904 | Interfacecxx . . $ Interface#::setManipTypeRadioButtonscxx . . $ Interface#setManipTypeRadioButtons(50c4a1f7c08652f).( const SoTypecxx . . $ SoType# &manipType ) |
| 905 | { |
| 906 | // First turn all radio buttons to FALSE... |
| 907 | XmToggleButtonSetState(menuItemscxx . . $ Interface#menuItems.[MM_MANIPS_HBOXcxx . . $ MM_MANIPS_HBOX.].widgetcxx . . $ NoodleMenuItem#widget.,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 908 | XmToggleButtonSetState(menuItemscxx . . $ Interface#menuItems.[MM_MANIPS_TRACKBALLcxx . . $ MM_MANIPS_TRACKBALL.].widgetcxx . . $ NoodleMenuItem#widget.,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 909 | XmToggleButtonSetState(menuItemscxx . . $ Interface#menuItems.[MM_MANIPS_NONEcxx . . $ MM_MANIPS_NONE.].widgetcxx . . $ NoodleMenuItem#widget.,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!,FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 910 | |
| 911 | // Set the appropriate radio button for manip type. |
| 912 | Widgetcxx . . $ Widget# onWidget = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 913 | if ( manipType.isDerivedFromcxx . . $ SoType#isDerivedFrom(1fd66475a268b64e).( SoHandleBoxManipcxx . . $ SoHandleBoxManip#::getClassTypeIdcxx . . $ SoHandleBoxManip#getClassTypeId(c00c150378d2b968).() ) ) |
| 914 | onWidget = menuItemscxx . . $ Interface#menuItems.[MM_MANIPS_HBOXcxx . . $ MM_MANIPS_HBOX.].widgetcxx . . $ NoodleMenuItem#widget.; |
| 915 | else if ( manipType.isDerivedFromcxx . . $ SoType#isDerivedFrom(1fd66475a268b64e).( SoTrackballManipcxx . . $ SoTrackballManip#::getClassTypeIdcxx . . $ SoTrackballManip#getClassTypeId(c00c150378d2b968).()) ) |
| 916 | onWidget = menuItemscxx . . $ Interface#menuItems.[MM_MANIPS_TRACKBALLcxx . . $ MM_MANIPS_TRACKBALL.].widgetcxx . . $ NoodleMenuItem#widget.; |
| 917 | else |
| 918 | onWidget = menuItemscxx . . $ Interface#menuItems.[MM_MANIPS_NONEcxx . . $ MM_MANIPS_NONE.].widgetcxx . . $ NoodleMenuItem#widget.; |
| 919 | |
| 920 | if (onWidget) |
| 921 | XmToggleButtonSetState( onWidget, TRUEcxx . . $ `lib/database/include/Inventor/SbBasic.h:80:12`!, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`! ); |
| 922 | } |
| 923 | |
| 924 | /////////////////////////////////////////////////////////////////////// |
| 925 | // |
| 926 | // Callback registered on WorldInfo's selection node to invoke |
| 927 | // setPrimarySelection() on the new selection. |
| 928 | // |
| 929 | void |
| 930 | Interfacecxx . . $ Interface#::selectionCBcxx . . $ Interface#selectionCB(f7f5995fb031ad3c).( void *userData, SoPathcxx . . $ SoPath# *selectPath ) |
| 931 | { |
| 932 | // Return if pickFilter truncated path down to nothing. |
| 933 | if (selectPath->getLengthcxx . . $ SoPath#getLength(455f465bc33b4cdf).() == 0) |
| 934 | return; |
| 935 | |
| 936 | Interfacecxx . . $ Interface# *myself = (Interfacecxx . . $ Interface# *) userData; |
| 937 | |
| 938 | SoNodeKitPathcxx . . $ SoNodeKitPath# *nkPath = (SoNodeKitPathcxx . . $ SoNodeKitPath# *) selectPath; |
| 939 | GeneralizedCylindercxx . . $ GeneralizedCylinder# *g = (GeneralizedCylindercxx . . $ GeneralizedCylinder# *) nkPath->getTailcxx . . $ SoNodeKitPath#getTail(b794963b450d51b3).(); |
| 940 | |
| 941 | myself->setPrimarySelectioncxx . . $ Interface#setPrimarySelection(5f519fe7cd1d61ca).( g ); |
| 942 | } |
| 943 | |
| 944 | /////////////////////////////////////////////////////////////////////// |
| 945 | // |
| 946 | // Create the top menu bar and the associated menus |
| 947 | // |
| 948 | Widgetcxx . . $ Widget# |
| 949 | Interfacecxx . . $ Interface#::buildcxx . . $ Interface#build(a686be44a4028679).( Widgetcxx . . $ Widget# parentWidget ) |
| 950 | { |
| 951 | mgrWidgetcxx . . $ Interface#mgrWidget. = parentWidget; |
| 952 | if (mgrWidgetcxx . . $ Interface#mgrWidget. == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 953 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Error. NULL passed to Interface::build\n"); |
| 954 | |
| 955 | menuItemscxx . . $ Interface#menuItems. = new NoodleMenuItemcxx . . $ NoodleMenuItem#[MM_MENU_NUMcxx . . $ MM_MENU_NUM.]; |
| 956 | int i; |
| 957 | for (i=0; i<MM_MENU_NUMcxx . . $ MM_MENU_NUM.; i++) { |
| 958 | menuItemscxx . . $ Interface#menuItems.[i].idcxx . . $ NoodleMenuItem#id. = i; |
| 959 | menuItemscxx . . $ Interface#menuItems.[i].widgetcxx . . $ NoodleMenuItem#widget. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 960 | menuItemscxx . . $ Interface#menuItems.[i].ownerInterfacecxx . . $ NoodleMenuItem#ownerInterface. = this; |
| 961 | } |
| 962 | |
| 963 | // |
| 964 | // Create the topbar menu |
| 965 | // |
| 966 | Widgetcxx . . $ Widget# menuWidget = XmCreateMenuBar(mgrWidgetcxx . . $ Interface#mgrWidget., "menuBar", NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, 0); |
| 967 | |
| 968 | Argcxx . . $ Arg# popupargs[4]; |
| 969 | int popupn = 0; |
| 970 | #ifdef MENUS_IN_POPUP |
| 971 | Widget shell = SoXt::getShellWidget(menuWidget); |
| 972 | SoXt::getPopupArgs(XtDisplay(menuWidget), SCREEN(menuWidget), |
| 973 | popupargs, &popupn); |
| 974 | #endif |
| 975 | |
| 976 | int itemCount = XtNumbercxx . . $ `<external>/3673480128541058774/Intrinsic.h:114:9`!(pulldownData); |
| 977 | WidgetListcxx . . $ WidgetList# buttons = (WidgetListcxx . . $ WidgetList#) XtMalloc(itemCount * sizeof(Widgetcxx . . $ Widget#)); |
| 978 | |
| 979 | |
| 980 | Argcxx . . $ Arg# args[12]; |
| 981 | int n; |
| 982 | for (i=0; i<itemCount; i++) { |
| 983 | // |
| 984 | // Make Topbar menu button |
| 985 | // |
| 986 | Widgetcxx . . $ Widget# subMenu = |
| 987 | XmCreatePulldownMenu(menuWidget, "subMenu", popupargs, popupn); |
| 988 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[0], XmNtearOffModelcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3420:9`!, XmTEAR_OFF_ENABLED); |
| 989 | XtSetValues(subMenu, args, 1); |
| 990 | |
| 991 | #ifdef MENUS_IN_POPUP |
| 992 | // register callbacks to load/unload the pulldown colormap when the |
| 993 | // pulldown menu is posted. |
| 994 | SoXt::registerColormapLoad(subMenu, shell); |
| 995 | #endif |
| 996 | |
| 997 | int id = pulldownDatacxx . . $ pulldownData.[i].idcxx . . $ NoodleMenu#id.; |
| 998 | menuItemscxx . . $ Interface#menuItems.[id].widgetcxx . . $ NoodleMenuItem#widget. = subMenu; |
| 999 | |
| 1000 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[0], XmNsubMenuIdcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3408:9`!, subMenu); |
| 1001 | buttons[i] = XtCreateWidget(pulldownDatacxx . . $ pulldownData.[i].namecxx . . $ NoodleMenu#name., |
| 1002 | xmCascadeButtonGadgetClass, menuWidget, args, 1); |
| 1003 | |
| 1004 | // |
| 1005 | // Make subMenu buttons |
| 1006 | // |
| 1007 | int subItemCount = pulldownDatacxx . . $ pulldownData.[i].subItemCountcxx . . $ NoodleMenu#subItemCount.; |
| 1008 | WidgetListcxx . . $ WidgetList# subButtons = |
| 1009 | (WidgetListcxx . . $ WidgetList#) XtMalloc(subItemCount * sizeof(Widgetcxx . . $ Widget#)); |
| 1010 | |
| 1011 | for (int j=0; j<subItemCount; j++) { |
| 1012 | if (pulldownDatacxx . . $ pulldownData.[i].subMenucxx . . $ NoodleMenu#subMenu.[j].buttonTypecxx . . $ NoodleButtonInfo#buttonType. == MM_SEPARATORcxx . . $ MM_SEPARATOR.) { |
| 1013 | subButtons[j] = XtCreateWidget( |
| 1014 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, xmSeparatorGadgetClass, subMenu, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, 0); |
| 1015 | } |
| 1016 | else { |
| 1017 | Stringcxx . . $ String# callbackReason; |
| 1018 | |
| 1019 | switch (pulldownDatacxx . . $ pulldownData.[i].subMenucxx . . $ NoodleMenu#subMenu.[j].buttonTypecxx . . $ NoodleButtonInfo#buttonType.) { |
| 1020 | case MM_PUSH_BUTTONcxx . . $ MM_PUSH_BUTTON.: |
| 1021 | widgetClass = xmPushButtonGadgetClass; |
| 1022 | callbackReason = XmNactivateCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2349:9`!; |
| 1023 | n = 0; |
| 1024 | break; |
| 1025 | case MM_TOGGLE_BUTTONcxx . . $ MM_TOGGLE_BUTTON.: |
| 1026 | widgetClass = xmToggleButtonGadgetClass; |
| 1027 | callbackReason = XmNvalueChangedCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3531:9`!; |
| 1028 | n = 0; |
| 1029 | break; |
| 1030 | case MM_RADIO_BUTTONcxx . . $ MM_RADIO_BUTTON.: |
| 1031 | widgetClass = xmToggleButtonGadgetClass; |
| 1032 | callbackReason = XmNvalueChangedCallbackcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3531:9`!; |
| 1033 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[0], XmNindicatorTypecxx . . $ `<external>/427401153941432933/XmStrDefs.h:2847:9`!, XmONE_OF_MANY); |
| 1034 | n = 1; |
| 1035 | break; |
| 1036 | case MM_SEPARATORcxx . . $ MM_SEPARATOR.: |
| 1037 | n = 0; |
| 1038 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, |
| 1039 | "Programming Error in Interface::build\n"); |
| 1040 | break; |
| 1041 | default: |
| 1042 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, |
| 1043 | "noodle INTERNAL ERROR: bad buttonType\n"); |
| 1044 | break; |
| 1045 | } |
| 1046 | |
| 1047 | // |
| 1048 | // Check for keyboard accelerator |
| 1049 | // |
| 1050 | char *accel = pulldownDatacxx . . $ pulldownData.[i].subMenucxx . . $ NoodleMenu#subMenu.[j].acceleratorcxx . . $ NoodleButtonInfo#accelerator.; |
| 1051 | char *accelText = pulldownDatacxx . . $ pulldownData.[i].subMenucxx . . $ NoodleMenu#subMenu.[j].accelTextcxx . . $ NoodleButtonInfo#accelText.; |
| 1052 | XmString xmstr = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1053 | if (accel != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) { |
| 1054 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[n], XmNacceleratorcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2343:9`!, accel); n++; |
| 1055 | |
| 1056 | if (accelText != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) { |
| 1057 | xmstr = XmStringCreate(accelText, |
| 1058 | XmSTRING_DEFAULT_CHARSETcxx . . $ `<external>/427401153941432933/XmStrDefs.h:5447:9`!); |
| 1059 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[n], XmNacceleratorTextcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2346:9`!, xmstr); n++; |
| 1060 | } |
| 1061 | } |
| 1062 | |
| 1063 | subButtons[j] = XtCreateWidget( |
| 1064 | pulldownDatacxx . . $ pulldownData.[i].subMenucxx . . $ NoodleMenu#subMenu.[j].namecxx . . $ NoodleButtonInfo#name., |
| 1065 | widgetClass, subMenu, args, n); |
| 1066 | if (xmstr != NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 1067 | XmStringFree(xmstr); |
| 1068 | id = pulldownDatacxx . . $ pulldownData.[i].subMenucxx . . $ NoodleMenu#subMenu.[j].idcxx . . $ NoodleButtonInfo#id.; |
| 1069 | menuItemscxx . . $ Interface#menuItems.[id].widgetcxx . . $ NoodleMenuItem#widget. = subButtons[j]; |
| 1070 | XtAddCallback(subButtons[j], callbackReason, |
| 1071 | (XtCallbackProccxx . . $ XtCallbackProc#)Interfacecxx . . $ Interface#::processTopbarEventcxx . . $ Interface#processTopbarEvent(274eff8a90d752a6)., |
| 1072 | (XtPointercxx . . $ XtPointer#) &menuItemscxx . . $ Interface#menuItems.[id]); |
| 1073 | |
| 1074 | // If a toggle, set the starting state: |
| 1075 | if (pulldownDatacxx . . $ pulldownData.[i].subMenucxx . . $ NoodleMenu#subMenu.[j].buttonTypecxx . . $ NoodleButtonInfo#buttonType. == MM_TOGGLE_BUTTONcxx . . $ MM_TOGGLE_BUTTON. || |
| 1076 | pulldownDatacxx . . $ pulldownData.[i].subMenucxx . . $ NoodleMenu#subMenu.[j].buttonTypecxx . . $ NoodleButtonInfo#buttonType. == MM_RADIO_BUTTONcxx . . $ MM_RADIO_BUTTON.){ |
| 1077 | SbBoolcxx . . $ SbBool# isOn; |
| 1078 | isOn = pulldownDatacxx . . $ pulldownData.[i].subMenucxx . . $ NoodleMenu#subMenu.[j].isOncxx . . $ NoodleButtonInfo#isOn.; |
| 1079 | |
| 1080 | XmToggleButtonGadgetSetState(subButtons[j], isOn, FALSEcxx . . $ `lib/database/include/Inventor/SbBasic.h:79:12`!); |
| 1081 | } |
| 1082 | } |
| 1083 | } |
| 1084 | XtManageChildren(subButtons, subItemCount); |
| 1085 | XtFree((char *)subButtons); |
| 1086 | } |
| 1087 | XtManageChildren(buttons, itemCount); |
| 1088 | XtFree((char *)buttons); |
| 1089 | |
| 1090 | // |
| 1091 | // Layout the menu bar |
| 1092 | // |
| 1093 | n = 0; |
| 1094 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[n], XmNtopAttachmentcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3453:9`!, XmATTACH_FORM); n++; |
| 1095 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[n], XmNleftAttachmentcxx . . $ `<external>/427401153941432933/XmStrDefs.h:2898:9`!, XmATTACH_FORM); n++; |
| 1096 | XtSetArgcxx . . $ `<external>/3673480128541058774/Intrinsic.h:1160:9`!(args[n], XmNrightAttachmentcxx . . $ `<external>/427401153941432933/XmStrDefs.h:3231:9`!, XmATTACH_FORM); n++; |
| 1097 | XtSetValues(menuWidget, args, n); |
| 1098 | XtManageChild(menuWidget); |
| 1099 | |
| 1100 | return (menuWidget); |
| 1101 | } |