.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
74 | 80 | this.copy = this.group = copy; |
---|
75 | 81 | //selectees = this.group.selectees; |
---|
76 | 82 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 83 | + SetupMenu2(this); //objEditor); |
---|
78 | 84 | SetupUI2(objEditor); |
---|
79 | 85 | objEditor.SetupUI(true); |
---|
80 | 86 | SetupViews(objEditor); |
---|
81 | 87 | |
---|
82 | 88 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 89 | + |
---|
| 90 | + if (copy.versions == null) |
---|
| 91 | + { |
---|
| 92 | + copy.versions = new byte[100][]; |
---|
| 93 | + copy.versionindex = -1; |
---|
| 94 | + |
---|
| 95 | + Save(true); |
---|
| 96 | + } |
---|
83 | 97 | } |
---|
84 | 98 | |
---|
85 | 99 | void CloneSelection(boolean supports) |
---|
86 | 100 | { |
---|
| 101 | + if (Globals.REPLACEONMAKE) |
---|
| 102 | + Save(); |
---|
| 103 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 104 | + Globals.REPLACEONMAKE = false; |
---|
87 | 105 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 106 | //Object3D obj; |
---|
89 | 107 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 112 | |
---|
95 | 113 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 114 | } |
---|
| 115 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 116 | } |
---|
98 | 117 | |
---|
99 | 118 | void CloneClipboard(boolean supports) |
---|
100 | 119 | { |
---|
101 | | - assert(GrafreeD.clipboard.parent == null); |
---|
102 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
103 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
104 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
105 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 120 | + assert(Grafreed.clipboard.parent == null); |
---|
| 121 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 122 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 123 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 124 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 125 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 126 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 127 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 128 | } |
---|
110 | 129 | |
---|
111 | 130 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 138 | // obj.support = null; |
---|
120 | 139 | if (!supports) |
---|
121 | 140 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 141 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 142 | obj.parent = parent; |
---|
124 | 143 | // obj.support = support; |
---|
125 | 144 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 167 | |
---|
149 | 168 | //JTextField nameField; |
---|
150 | 169 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 170 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 171 | { |
---|
153 | | - if (Globals.ADVANCED) |
---|
154 | | - { |
---|
155 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
156 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
157 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
158 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
159 | | - oe.cameraMenu.add("-"); |
---|
160 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
161 | | - openWindowItem.addActionListener(this); |
---|
162 | | - editLeafItem.addActionListener(this); |
---|
163 | | - lookAtItem.addActionListener(this); |
---|
164 | | - //lookFromItem.addActinoListener(this); |
---|
165 | | - //switchItem.addActionListener(this); |
---|
166 | | - } |
---|
167 | | - |
---|
| 172 | + oe.jTree = new cTree(); |
---|
| 173 | + |
---|
168 | 174 | Menu menu; |
---|
169 | 175 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 176 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 177 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 178 | + |
---|
| 179 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 180 | +// undoItem.addActionListener(this); |
---|
| 181 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 182 | +// redoItem.addActionListener(this); |
---|
| 183 | +// menu.add("-"); |
---|
| 184 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 185 | duplicateItem.addActionListener(this); |
---|
| 186 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 187 | + cloneItem.addActionListener(this); |
---|
| 188 | + if (Globals.ADVANCED) |
---|
| 189 | + { |
---|
| 190 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 191 | + cloneSupportItem.addActionListener(this); |
---|
| 192 | + } |
---|
| 193 | + menu.add("-"); |
---|
174 | 194 | cutItem = menu.add(new MenuItem("Cut")); |
---|
175 | 195 | cutItem.addActionListener(this); |
---|
176 | 196 | copyItem = menu.add(new MenuItem("Copy")); |
---|
177 | 197 | copyItem.addActionListener(this); |
---|
178 | 198 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
179 | 199 | pasteItem.addActionListener(this); |
---|
180 | | - menu.add("-"); |
---|
181 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
182 | | - cloneItem.addActionListener(this); |
---|
183 | | - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
184 | | - cloneSupportItem.addActionListener(this); |
---|
| 200 | + |
---|
185 | 201 | menu.add("-"); |
---|
186 | 202 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
187 | 203 | pasteIntoItem.addActionListener(this); |
---|
.. | .. |
---|
192 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
193 | 209 | // pasteExpandItem.addActionListener(this); |
---|
194 | 210 | menu.add("-"); |
---|
195 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
196 | | - clearItem.addActionListener(this); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
197 | 213 | |
---|
198 | 214 | if (Globals.ADVANCED) |
---|
199 | 215 | { |
---|
.. | .. |
---|
201 | 217 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
202 | 218 | clearAllItem.addActionListener(this); |
---|
203 | 219 | } |
---|
| 220 | + |
---|
| 221 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 222 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 223 | + //zBufferItem.addActionListener(this); |
---|
| 224 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 225 | + //normalLensItem.addActionListener(this); |
---|
| 226 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 227 | + restoreCameraItem.addActionListener(this); |
---|
| 228 | + |
---|
| 229 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 230 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 231 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 232 | +// cameraMenu.add("-"); |
---|
| 233 | +// |
---|
| 234 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 235 | +// toggleTextureItem.addItemListener(this); |
---|
| 236 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 237 | +// |
---|
| 238 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 239 | +// toggleSwitchItem.addItemListener(this); |
---|
| 240 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 241 | + |
---|
| 242 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 243 | + toggleHandleItem.addItemListener(this); |
---|
| 244 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 245 | + |
---|
| 246 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 247 | + togglePaintItem.addItemListener(this); |
---|
| 248 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 249 | + |
---|
| 250 | + if (Globals.ADVANCED) |
---|
| 251 | + { |
---|
| 252 | + cameraMenu.add("-"); |
---|
| 253 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 254 | + toggleLiveItem.addItemListener(this); |
---|
| 255 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
204 | 256 | |
---|
| 257 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 258 | + stepItem.addActionListener(this); |
---|
| 259 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 260 | + // toggleDLItem.addItemListener(this); |
---|
| 261 | + // toggleDLItem.setState(false); |
---|
| 262 | + |
---|
| 263 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 264 | + toggleRenderItem.addItemListener(this); |
---|
| 265 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 266 | + |
---|
| 267 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 268 | + toggleDebugItem.addItemListener(this); |
---|
| 269 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 270 | + |
---|
| 271 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 272 | + toggleFrustumItem.addItemListener(this); |
---|
| 273 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 274 | + |
---|
| 275 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 276 | + toggleFootContactItem.addItemListener(this); |
---|
| 277 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 278 | + |
---|
| 279 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 280 | + toggleTimelineItem.addItemListener(this); |
---|
| 281 | + } |
---|
| 282 | + |
---|
| 283 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 284 | +// toggleRootItem.addItemListener(this); |
---|
| 285 | +// toggleRootItem.setState(false); |
---|
| 286 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 287 | +// animationItem.addItemListener(this); |
---|
| 288 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 289 | + cameraMenu.add("-"); |
---|
| 290 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 291 | + editCameraItem.addActionListener(this); |
---|
| 292 | + |
---|
| 293 | + if (Globals.ADVANCED) |
---|
| 294 | + { |
---|
| 295 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 296 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 297 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 298 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 299 | + oe.cameraMenu.add("-"); |
---|
| 300 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 301 | + openWindowItem.addActionListener(this); |
---|
| 302 | + editLeafItem.addActionListener(this); |
---|
| 303 | + lookAtItem.addActionListener(this); |
---|
| 304 | + //lookFromItem.addActinoListener(this); |
---|
| 305 | + //switchViewItem.addActionListener(this); |
---|
| 306 | + } |
---|
| 307 | + |
---|
205 | 308 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
206 | 309 | if (Globals.ADVANCED) |
---|
207 | 310 | { |
---|
208 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
209 | | - resetMeshItem.addActionListener(this); |
---|
210 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
211 | | - stepAllItem.addActionListener(this); |
---|
212 | 311 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
213 | 312 | revertMeshItem.addActionListener(this); |
---|
214 | 313 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
248 | 347 | } |
---|
249 | 348 | |
---|
250 | 349 | oe.menuBar.add(menu = new Menu("Group")); |
---|
251 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
252 | | - grabItem.addActionListener(this); |
---|
| 350 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 351 | +// grabItem.addActionListener(this); |
---|
253 | 352 | backItem = menu.add(new MenuItem("Back")); |
---|
254 | 353 | backItem.addActionListener(this); |
---|
255 | 354 | frontItem = menu.add(new MenuItem("Front")); |
---|
256 | 355 | frontItem.addActionListener(this); |
---|
257 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
258 | | - compositeItem.addActionListener(this); |
---|
| 356 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 357 | +// compositeItem.addActionListener(this); |
---|
| 358 | + |
---|
| 359 | + if (Globals.ADVANCED) |
---|
| 360 | + { |
---|
259 | 361 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
260 | 362 | hideItem.addActionListener(this); |
---|
| 363 | + } |
---|
261 | 364 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
262 | 365 | ungroupItem.addActionListener(this); |
---|
263 | | - menu.add("-"); |
---|
264 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
265 | | - randomItem.addActionListener(this); |
---|
| 366 | + |
---|
| 367 | +// menu.add("-"); |
---|
| 368 | +// |
---|
| 369 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 370 | +// switchItem.addActionListener(this); |
---|
| 371 | + if (Globals.ADVANCED) |
---|
| 372 | + { |
---|
266 | 373 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
267 | 374 | switchGeoItem.addActionListener(this); |
---|
268 | 375 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
270 | 377 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
271 | 378 | morphItem.addActionListener(this); |
---|
272 | 379 | |
---|
273 | | - if (Globals.ADVANCED) |
---|
274 | | - { |
---|
| 380 | + menu.add("-"); |
---|
275 | 381 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
276 | 382 | physicsItem.addActionListener(this); |
---|
277 | 383 | frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
278 | 384 | frameselectorItem.addActionListener(this); |
---|
279 | 385 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
280 | 386 | scriptNodeItem.addActionListener(this); |
---|
281 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
282 | | - cameraItem.addActionListener(this); |
---|
283 | 387 | } |
---|
284 | 388 | |
---|
285 | 389 | oe.menuBar.add(menu = new Menu("Object")); |
---|
286 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
287 | | - textureItem.addActionListener(this); |
---|
| 390 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 391 | +// textureItem.addActionListener(this); |
---|
288 | 392 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
289 | 393 | billboardItem.addActionListener(this); |
---|
290 | 394 | csgItem = menu.add(new MenuItem("CSG")); |
---|
291 | 395 | csgItem.addActionListener(this); |
---|
292 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 396 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
293 | 397 | shadowXItem.addActionListener(this); |
---|
294 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 398 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
295 | 399 | shadowYItem.addActionListener(this); |
---|
296 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 400 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
297 | 401 | shadowZItem.addActionListener(this); |
---|
298 | | - if (Globals.ADVANCED) |
---|
299 | | - { |
---|
300 | | - linkerItem = menu.add(new MenuItem("Linker")); |
---|
301 | | - linkerItem.addActionListener(this); |
---|
302 | 402 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
303 | 403 | attributeItem.addActionListener(this); |
---|
| 404 | + |
---|
| 405 | + if (Globals.ADVANCED) |
---|
| 406 | + { |
---|
| 407 | + menu.add("-"); |
---|
| 408 | + linkerItem = menu.add(new MenuItem("Linker")); |
---|
| 409 | + linkerItem.addActionListener(this); |
---|
304 | 410 | templateItem = menu.add(new MenuItem("Template")); |
---|
305 | 411 | templateItem.addActionListener(this); |
---|
306 | 412 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
307 | 413 | pointflowItem.addActionListener(this); |
---|
308 | | - menu.add("-"); |
---|
309 | 414 | } |
---|
| 415 | + menu.add("-"); |
---|
310 | 416 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
311 | 417 | resetTransformItem.addActionListener(this); |
---|
312 | 418 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
313 | 419 | resetCentroidItem.addActionListener(this); |
---|
314 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
315 | | - transformgeometryItem.addActionListener(this); |
---|
| 420 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 421 | + resetCentroidXZItem.addActionListener(this); |
---|
| 422 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 423 | + transformGeometryItem.addActionListener(this); |
---|
| 424 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 425 | + transformChildrenItem.addActionListener(this); |
---|
316 | 426 | |
---|
317 | 427 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
318 | 428 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
325 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
326 | 436 | if (Globals.ADVANCED) |
---|
327 | 437 | { |
---|
328 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
329 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
330 | 440 | } |
---|
331 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
361 | 471 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
362 | 472 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
363 | 473 | clearMaterialsItem.addActionListener(this); |
---|
| 474 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 475 | + resetAllItem.addActionListener(this); |
---|
| 476 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 477 | + stepAllItem.addActionListener(this); |
---|
364 | 478 | menu.add("-"); |
---|
365 | 479 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
366 | 480 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
381 | 495 | markleavesItem.addActionListener(this); |
---|
382 | 496 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
383 | 497 | unmarkleavesItem.addActionListener(this); |
---|
| 498 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 499 | + rewindleavesItem.addActionListener(this); |
---|
| 500 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 501 | + unrewindleavesItem.addActionListener(this); |
---|
| 502 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 503 | + randomleavesItem.addActionListener(this); |
---|
| 504 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 505 | + unrandomleavesItem.addActionListener(this); |
---|
384 | 506 | menu.add("-"); |
---|
385 | 507 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
386 | 508 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
415 | 537 | sortbysizeItem.addActionListener(this); |
---|
416 | 538 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
417 | 539 | sortbynameItem.addActionListener(this); |
---|
| 540 | + menu.add("-"); |
---|
| 541 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 542 | + shareGeometriesItem.addActionListener(this); |
---|
| 543 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 544 | + mergeGeometriesItem.addActionListener(this); |
---|
418 | 545 | if (Globals.ADVANCED) |
---|
419 | 546 | { |
---|
420 | | - menu.add("-"); |
---|
| 547 | + // Pretty much the same as duplicate and clone. |
---|
421 | 548 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
422 | 549 | extractGeometriesItem.addActionListener(this); |
---|
423 | 550 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
424 | 551 | cloneGeometriesItem.addActionListener(this); |
---|
425 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
426 | | - shareGeometriesItem.addActionListener(this); |
---|
427 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
428 | | - mergeGeometriesItem.addActionListener(this); |
---|
429 | 552 | } |
---|
430 | 553 | |
---|
431 | 554 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
432 | 555 | buildCreateMenu(menu); |
---|
433 | 556 | |
---|
434 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
435 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
436 | | - importGFDItem.addActionListener(this); |
---|
437 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
438 | | - importVRMLX3DItem.addActionListener(this); |
---|
439 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
440 | | - importOBJItem.addActionListener(this); |
---|
441 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
442 | | - import3DSItem.addActionListener(this); |
---|
443 | | - |
---|
444 | 557 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
445 | 558 | buildToolsMenu(menu); |
---|
446 | 559 | } |
---|
447 | 560 | |
---|
| 561 | + |
---|
448 | 562 | void SetupUI2(ObjEditor oe) |
---|
449 | 563 | { |
---|
| 564 | + // June 2019 |
---|
| 565 | + if (oe == null) |
---|
| 566 | + { |
---|
| 567 | + //super.SetupUI2(this); |
---|
| 568 | + //return; |
---|
| 569 | + } |
---|
| 570 | + |
---|
| 571 | + if (copy != group) |
---|
| 572 | + { |
---|
| 573 | + //super.SetupUI2(this); |
---|
| 574 | + } |
---|
| 575 | + |
---|
450 | 576 | //new Exception().printStackTrace(); |
---|
451 | 577 | |
---|
452 | 578 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
475 | 601 | oe.radioPanel.add(dummyButton); |
---|
476 | 602 | oe.buttonGroup.add(dummyButton); |
---|
477 | 603 | */ |
---|
| 604 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 605 | + |
---|
| 606 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 607 | + |
---|
478 | 608 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
479 | 609 | |
---|
480 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
481 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 610 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + //minButton.setToolTipText("Minimize window"); |
---|
| 612 | + //minButton.addActionListener(this); |
---|
| 613 | + |
---|
| 614 | + if (Globals.ADVANCED) |
---|
| 615 | + { |
---|
| 616 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 617 | + maxButton.setToolTipText("Maximize window"); |
---|
| 618 | + maxButton.addActionListener(this); |
---|
| 619 | + } |
---|
| 620 | + |
---|
| 621 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 622 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 623 | + fullButton.addActionListener(this); |
---|
| 624 | + |
---|
| 625 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 626 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 627 | + screenfitButton.addActionListener(this); |
---|
| 628 | + |
---|
| 629 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 631 | + restoreCameraButton.addActionListener(this); |
---|
| 632 | + |
---|
| 633 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + saveButton.setToolTipText("New version"); |
---|
| 635 | + saveButton.addActionListener(this); |
---|
| 636 | + |
---|
| 637 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 638 | + undoButton.setToolTipText("Previous version"); |
---|
| 639 | + undoButton.addActionListener(this); |
---|
| 640 | + undoButton.setEnabled(false); |
---|
| 641 | + |
---|
| 642 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 643 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 644 | + restoreButton.setToolTipText("Restore current"); |
---|
| 645 | + restoreButton.addActionListener(this); |
---|
| 646 | + restoreButton.setEnabled(false); |
---|
| 647 | + |
---|
| 648 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + replaceButton.setToolTipText("Replace current"); |
---|
| 650 | + replaceButton.addActionListener(this); |
---|
| 651 | + replaceButton.setEnabled(false); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(updown); |
---|
| 654 | + |
---|
| 655 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + redoButton.setToolTipText("Next version"); |
---|
| 657 | + redoButton.addActionListener(this); |
---|
| 658 | + redoButton.setEnabled(false); |
---|
| 659 | + |
---|
| 660 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 661 | + liveCB.setToolTipText("Enable animation"); |
---|
482 | 662 | liveCB.addItemListener(this); |
---|
483 | 663 | |
---|
484 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
485 | 665 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
486 | 666 | oneStepButton.addActionListener(this); |
---|
487 | 667 | |
---|
488 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 668 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
489 | 669 | fastCB.setToolTipText("Fast mode"); |
---|
490 | 670 | fastCB.addItemListener(this); |
---|
491 | 671 | |
---|
492 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
493 | | - trackCB.setToolTipText("Enable tracking"); |
---|
494 | | - trackCB.addItemListener(this); |
---|
495 | | - |
---|
496 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
497 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
498 | | - screenfitButton.addActionListener(this); |
---|
| 672 | + //oe.toolboxPanel.Return(); |
---|
| 673 | + |
---|
| 674 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 675 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 676 | +// trackCB.addItemListener(this); |
---|
499 | 677 | |
---|
500 | 678 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
501 | 679 | // screenfitpointButton.addActionListener(this); |
---|
502 | 680 | |
---|
503 | 681 | if (Globals.ADVANCED) |
---|
504 | 682 | { |
---|
505 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 683 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
506 | 684 | snapobjectButton.addActionListener(this); |
---|
507 | 685 | snapobjectButton.setToolTipText("Snap Object"); |
---|
508 | 686 | } |
---|
509 | 687 | |
---|
510 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
511 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
512 | | - flashSelectionButton.addActionListener(this); |
---|
| 688 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
513 | 689 | |
---|
514 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
515 | | - |
---|
516 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
517 | | - twoButton.setToolTipText("Show center view only"); |
---|
518 | | - twoButton.addActionListener(this); |
---|
519 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 690 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
520 | 691 | fourButton.addActionListener(this); |
---|
521 | 692 | fourButton.setToolTipText("Show left panel only"); |
---|
522 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
523 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 693 | + |
---|
| 694 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + twoButton.setToolTipText("Show right view only"); |
---|
| 696 | + twoButton.addActionListener(this); |
---|
| 697 | + this.fullscreenLayout = twoButton; |
---|
| 698 | + |
---|
| 699 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 700 | + sixButton.setToolTipText("Show left and right"); |
---|
524 | 701 | sixButton.addActionListener(this); |
---|
525 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
526 | | - threeButton.setToolTipText("2-column layout right"); |
---|
527 | | - threeButton.addActionListener(this); |
---|
528 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
529 | | - sevenButton.setToolTipText("3-column layout"); |
---|
530 | | - sevenButton.addActionListener(this); |
---|
| 702 | +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 703 | +// threeButton.setToolTipText("2-column layout right"); |
---|
| 704 | +// threeButton.addActionListener(this); |
---|
| 705 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 706 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 707 | +// sevenButton.addActionListener(this); |
---|
531 | 708 | // |
---|
532 | 709 | |
---|
533 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 710 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
535 | 712 | rootButton.addActionListener(this); |
---|
536 | 713 | |
---|
537 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 714 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
538 | 715 | closeButton.setToolTipText("Close tab"); |
---|
539 | 716 | closeButton.addActionListener(this); |
---|
540 | 717 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
541 | 718 | //clearButton.addActionListener(this); |
---|
542 | | - |
---|
543 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 719 | + |
---|
| 720 | + // INSERT |
---|
| 721 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 722 | + gridButton.setToolTipText("Create grid"); |
---|
| 723 | + gridButton.addActionListener(this); |
---|
| 724 | + |
---|
| 725 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 726 | + boxButton.setToolTipText("Create box"); |
---|
| 727 | + boxButton.addActionListener(this); |
---|
| 728 | + |
---|
| 729 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 731 | + sphereButton.addActionListener(this); |
---|
| 732 | + |
---|
| 733 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 734 | + coneButton.setToolTipText("Create cone"); |
---|
| 735 | + coneButton.addActionListener(this); |
---|
| 736 | + |
---|
| 737 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + torusButton.setToolTipText("Create torus"); |
---|
| 739 | + torusButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 742 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 743 | + superButton.addActionListener(this); |
---|
| 744 | + |
---|
| 745 | + if (Globals.ADVANCED) |
---|
| 746 | + { |
---|
| 747 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 749 | + kleinButton.addActionListener(this); |
---|
| 750 | + } |
---|
544 | 751 | |
---|
545 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
546 | | - editButton.setToolTipText("Edit selection"); |
---|
| 752 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 753 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 754 | + particlesButton.addActionListener(this); |
---|
| 755 | + |
---|
| 756 | + oe.toolboxPanel.Return(); |
---|
| 757 | + |
---|
| 758 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 759 | + groupButton.setToolTipText("Create group"); |
---|
| 760 | + groupButton.addActionListener(this); |
---|
| 761 | + |
---|
| 762 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 763 | + compositeButton.setToolTipText("Create composite"); |
---|
| 764 | + compositeButton.addActionListener(this); |
---|
| 765 | + |
---|
| 766 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 767 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 768 | + switchButton.addActionListener(this); |
---|
| 769 | + |
---|
| 770 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 771 | + loopButton.setToolTipText("Create loop"); |
---|
| 772 | + loopButton.addActionListener(this); |
---|
| 773 | + |
---|
| 774 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 775 | + textureButton.setToolTipText("Create texture"); |
---|
| 776 | + textureButton.addActionListener(this); |
---|
| 777 | + |
---|
| 778 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 779 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 780 | + overlayButton.addActionListener(this); |
---|
| 781 | + |
---|
| 782 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 783 | + lightButton.setToolTipText("Create light"); |
---|
| 784 | + lightButton.addActionListener(this); |
---|
| 785 | + |
---|
| 786 | + for (int i=6; --i>=0;) |
---|
| 787 | + { |
---|
| 788 | + oe.toolboxPanel.Return(); |
---|
| 789 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 790 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 791 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 792 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 793 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 794 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 795 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 796 | + } |
---|
| 797 | + |
---|
| 798 | + // EDIT panel |
---|
| 799 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 800 | + editButton.setToolTipText("Pin selection controls"); |
---|
547 | 801 | editButton.addActionListener(this); |
---|
548 | 802 | |
---|
549 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
550 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 803 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 804 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
551 | 805 | uneditButton.addActionListener(this); |
---|
552 | 806 | |
---|
553 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
554 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 807 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 808 | + allParamsButton.setToolTipText("Show all controle"); |
---|
555 | 809 | allParamsButton.addActionListener(this); |
---|
556 | 810 | |
---|
557 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 811 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
558 | 812 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
559 | 813 | clearPanelButton.addActionListener(this); |
---|
560 | 814 | |
---|
561 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 815 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
562 | 816 | unselectButton.setToolTipText("Unselect"); |
---|
563 | 817 | unselectButton.addActionListener(this); |
---|
564 | 818 | |
---|
565 | | - commandsPanel.preferredHeight = 1; |
---|
| 819 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 820 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 821 | + flashSelectionButton.addActionListener(this); |
---|
566 | 822 | |
---|
567 | | - oe.treePanel.add(commandsPanel); |
---|
568 | | - oe.treePanel.Return(); |
---|
| 823 | + editCommandsPanel.preferredHeight = 1; |
---|
| 824 | + |
---|
| 825 | + SetPinStates(false); |
---|
| 826 | +// oe.treePanel.add(commandsPanel); |
---|
| 827 | +// oe.treePanel.Return(); |
---|
569 | 828 | |
---|
570 | 829 | // oe.aConstraints.gridx += 1; |
---|
571 | 830 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
582 | 841 | |
---|
583 | 842 | JScrollPane jSP; |
---|
584 | 843 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
585 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 844 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
586 | 845 | ResetModel(); |
---|
587 | 846 | |
---|
588 | 847 | oe.treePanel.add(jSPPanel); |
---|
589 | 848 | oe.treePanel.Return(); |
---|
590 | 849 | |
---|
591 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
592 | | - |
---|
593 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
594 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
595 | | - colorCB.addItemListener(this); |
---|
596 | | - |
---|
597 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
598 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
599 | | - materialCB.addItemListener(this); |
---|
600 | | - |
---|
601 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
602 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
603 | | - textureCB.addItemListener(this); |
---|
604 | | - |
---|
605 | | - copyOptionsPanel.preferredHeight = 1; |
---|
606 | 850 | oe.treePanel.add(copyOptionsPanel); |
---|
607 | 851 | oe.treePanel.Return(); |
---|
| 852 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 853 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 854 | + sliderPane.preferredHeight = 1; |
---|
608 | 855 | |
---|
609 | 856 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
610 | 857 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
627 | 874 | dgr.addDragGestureListener(this); |
---|
628 | 875 | }catch(Exception e) {} |
---|
629 | 876 | */ |
---|
630 | | - radio.layout = sevenButton; |
---|
| 877 | + radio.layout = sixButton; // sevenButton; |
---|
631 | 878 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
632 | 879 | } |
---|
633 | 880 | |
---|
634 | 881 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
635 | 882 | { |
---|
| 883 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 884 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 885 | + colorCB.addItemListener(this); |
---|
| 886 | + |
---|
| 887 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 888 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 889 | + materialCB.addItemListener(this); |
---|
| 890 | + |
---|
| 891 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 892 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 893 | + textureCB.addItemListener(this); |
---|
| 894 | + |
---|
| 895 | + panel.Return(); |
---|
| 896 | + |
---|
636 | 897 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
637 | 898 | boxCB.setToolTipText("Display bounding boxes"); |
---|
638 | 899 | boxCB.addItemListener(this); |
---|
639 | 900 | |
---|
640 | 901 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
641 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 902 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
642 | 903 | zoomBoxCB.addItemListener(this); |
---|
643 | 904 | |
---|
644 | | - if (Globals.ADVANCED) |
---|
| 905 | + if (true) // Globals.ADVANCED) |
---|
645 | 906 | { |
---|
646 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
647 | | - supportCB.setToolTipText("Enable rigging"); |
---|
648 | | - supportCB.addItemListener(this); |
---|
| 907 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 908 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 909 | +// supportCB.addItemListener(this); |
---|
| 910 | + |
---|
| 911 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 912 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 913 | + freezeCB.addItemListener(this); |
---|
649 | 914 | |
---|
650 | 915 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
651 | 916 | // localCB.addItemListener(this); |
---|
652 | 917 | |
---|
| 918 | + panel.Return(); |
---|
| 919 | + |
---|
653 | 920 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
654 | 921 | crowdCB.setToolTipText("Used for crowds"); |
---|
655 | 922 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
666 | 933 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
667 | 934 | // speakerMocapCB.addItemListener(this); |
---|
668 | 935 | |
---|
| 936 | + panel.Return(); |
---|
| 937 | + |
---|
669 | 938 | if (false) |
---|
670 | 939 | { |
---|
671 | 940 | // handled in scripts |
---|
.. | .. |
---|
680 | 949 | //constraints.gridy += 1; |
---|
681 | 950 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
682 | 951 | smoothfocusCB.addItemListener(this); |
---|
| 952 | + panel.Return(); |
---|
683 | 953 | } |
---|
684 | 954 | |
---|
685 | 955 | //constraints.gridx += 1; |
---|
686 | 956 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
687 | 957 | // debugCB.addItemListener(this); |
---|
688 | 958 | |
---|
| 959 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 960 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 961 | + trackCB.addItemListener(this); |
---|
| 962 | + |
---|
689 | 963 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 964 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
690 | 965 | oeilCB.addItemListener(this); |
---|
691 | 966 | |
---|
| 967 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 968 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 969 | + shadowCB.addItemListener(this); |
---|
| 970 | + |
---|
| 971 | + panel.Return(); |
---|
| 972 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 973 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 974 | + toggleTextureCB.addItemListener(this); |
---|
| 975 | + |
---|
| 976 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 977 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 978 | + toggleSwitchCB.addItemListener(this); |
---|
| 979 | + |
---|
| 980 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 981 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 982 | + autokeepCB.addItemListener(this); |
---|
| 983 | + |
---|
| 984 | + panel.Return(); |
---|
| 985 | + if (Globals.ADVANCED) |
---|
| 986 | + { |
---|
692 | 987 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
693 | 988 | lookAtCB.setToolTipText("Look-at target"); |
---|
694 | 989 | lookAtCB.addItemListener(this); |
---|
| 990 | + } |
---|
695 | 991 | |
---|
696 | 992 | } |
---|
697 | 993 | |
---|
698 | 994 | cGridBag fill = new cGridBag(); |
---|
699 | | - |
---|
700 | 995 | fill.preferredHeight = 200; |
---|
| 996 | + cGridBag fill2 = new cGridBag(); |
---|
| 997 | + fill2.preferredHeight = 200; |
---|
| 998 | + cGridBag fill3 = new cGridBag(); |
---|
| 999 | + fill3.preferredHeight = 200; |
---|
701 | 1000 | |
---|
702 | 1001 | panel.add(fill); |
---|
| 1002 | + panel.add(fill2); |
---|
| 1003 | + panel.add(fill3); |
---|
703 | 1004 | |
---|
704 | 1005 | } |
---|
705 | 1006 | |
---|
706 | 1007 | void EditObject(Object3D obj) |
---|
707 | 1008 | { |
---|
708 | 1009 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1010 | + |
---|
| 1011 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1012 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1013 | + if (!radioButton.hadMaterial) |
---|
| 1014 | + { |
---|
| 1015 | + obj.material = new cMaterial(); |
---|
| 1016 | + } |
---|
| 1017 | + |
---|
709 | 1018 | radioButton.SetObject(obj); |
---|
710 | | - radioButton.layout = sevenButton; |
---|
| 1019 | + radioButton.layout = sixButton; // sevenButton; |
---|
711 | 1020 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
712 | 1021 | radioButton.addActionListener(this); |
---|
713 | 1022 | radioPanel.add(radioButton); |
---|
714 | 1023 | buttonGroup.add(radioButton); |
---|
715 | 1024 | radioButton.doClick(); |
---|
716 | 1025 | } |
---|
| 1026 | + |
---|
717 | 1027 | void SetupViews(ObjEditor oe) |
---|
718 | 1028 | { |
---|
| 1029 | + theFrame = this; |
---|
| 1030 | + |
---|
719 | 1031 | oe.SetupViews(); |
---|
720 | 1032 | |
---|
721 | 1033 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
724 | 1036 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
725 | 1037 | } |
---|
726 | 1038 | |
---|
727 | | - JCheckBox liveCB; |
---|
728 | | - JCheckBox supportCB; |
---|
729 | | - JCheckBox localCB; |
---|
730 | | - JCheckBox crowdCB; |
---|
731 | | - JCheckBox smoothCB; |
---|
732 | | - JCheckBox fastCB; |
---|
733 | | - JCheckBox slowCB; |
---|
734 | | - JCheckBox boxCB; |
---|
735 | | - JCheckBox zoomBoxCB; |
---|
736 | | - JCheckBox trackCB; |
---|
737 | | - JCheckBox smoothfocusCB; |
---|
| 1039 | + cToggleButton liveCB; |
---|
| 1040 | + cCheckBox supportCB; |
---|
| 1041 | + cCheckBox localCB; |
---|
| 1042 | + cCheckBox crowdCB; |
---|
| 1043 | + cCheckBox smoothCB; |
---|
| 1044 | + cToggleButton fastCB; |
---|
| 1045 | + cCheckBox slowCB; |
---|
| 1046 | + cCheckBox boxCB; |
---|
| 1047 | + cCheckBox zoomBoxCB; |
---|
| 1048 | + cCheckBox freezeCB; |
---|
| 1049 | + //cToggleButton trackCB; |
---|
| 1050 | + cCheckBox trackCB; |
---|
| 1051 | + cCheckBox smoothfocusCB; |
---|
738 | 1052 | // JCheckBox speakerMocapCB; |
---|
739 | | - JCheckBox speakerCameraCB; |
---|
740 | | - JCheckBox speakerFocusCB; |
---|
741 | | - JCheckBox debugCB; |
---|
742 | | - JCheckBox oeilCB; |
---|
743 | | - JCheckBox lookAtCB; |
---|
| 1053 | + cCheckBox speakerCameraCB; |
---|
| 1054 | + cCheckBox speakerFocusCB; |
---|
| 1055 | + cCheckBox debugCB; |
---|
| 1056 | + |
---|
| 1057 | + cCheckBox oeilCB; |
---|
| 1058 | + cCheckBox shadowCB; |
---|
| 1059 | + cCheckBox autokeepCB; |
---|
| 1060 | + cCheckBox lookAtCB; |
---|
744 | 1061 | |
---|
745 | 1062 | // static int COLOR = 1; |
---|
746 | 1063 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
748 | 1065 | |
---|
749 | 1066 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
750 | 1067 | |
---|
751 | | - JCheckBox colorCB; |
---|
752 | | - JCheckBox materialCB; |
---|
753 | | - JCheckBox textureCB; |
---|
| 1068 | + cCheckBox colorCB; |
---|
| 1069 | + cCheckBox materialCB; |
---|
| 1070 | + cCheckBox textureCB; |
---|
754 | 1071 | |
---|
755 | 1072 | public void itemStateChanged(ItemEvent e) |
---|
756 | 1073 | { |
---|
.. | .. |
---|
778 | 1095 | } else if(e.getSource() == liveCB) |
---|
779 | 1096 | { |
---|
780 | 1097 | cameraView.ToggleLive(); |
---|
| 1098 | + refreshContents(false); |
---|
781 | 1099 | } |
---|
782 | 1100 | else if(e.getSource() == supportCB) |
---|
783 | 1101 | { |
---|
.. | .. |
---|
842 | 1160 | { |
---|
843 | 1161 | cameraView.ToggleOeil(); |
---|
844 | 1162 | } |
---|
| 1163 | + else if(e.getSource() == shadowCB) |
---|
| 1164 | + { |
---|
| 1165 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1166 | + } |
---|
| 1167 | + else if(e.getSource() == freezeCB) |
---|
| 1168 | + { |
---|
| 1169 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1170 | + } |
---|
| 1171 | + else if(e.getSource() == autokeepCB) |
---|
| 1172 | + { |
---|
| 1173 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1174 | + } |
---|
845 | 1175 | else if(e.getSource() == lookAtCB) |
---|
846 | 1176 | { |
---|
847 | 1177 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
858 | 1188 | |
---|
859 | 1189 | /**/ |
---|
860 | 1190 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
861 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1191 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1192 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
862 | 1193 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
863 | 1194 | // We can't move the root node or an empty selection |
---|
864 | 1195 | return; |
---|
.. | .. |
---|
921 | 1252 | } |
---|
922 | 1253 | } |
---|
923 | 1254 | |
---|
924 | | - String string = (String) object; |
---|
925 | | - |
---|
926 | 1255 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
927 | 1256 | // if( object instanceof java.io.File[]) |
---|
928 | 1257 | // { |
---|
.. | .. |
---|
930 | 1259 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
931 | 1260 | // return; |
---|
932 | 1261 | // } |
---|
933 | | - if (string.charAt(0) == '/') |
---|
| 1262 | + |
---|
| 1263 | + String string = object.toString(); |
---|
| 1264 | + |
---|
| 1265 | + // File path for Mac and Windows |
---|
| 1266 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
934 | 1267 | { |
---|
935 | 1268 | // file(s) |
---|
936 | 1269 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
957 | 1290 | |
---|
958 | 1291 | flashIt = false; |
---|
959 | 1292 | CameraPane pane = (CameraPane) target; |
---|
960 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1293 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
961 | 1294 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
962 | 1295 | |
---|
963 | 1296 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
973 | 1306 | |
---|
974 | 1307 | assert target == objEditor.jTree; |
---|
975 | 1308 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1309 | + Object3D destinationLeaf; |
---|
976 | 1310 | try { |
---|
977 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1311 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
978 | 1312 | } catch (Exception e) { |
---|
979 | 1313 | System.out.println("destinationPath : " + destinationPath); |
---|
980 | 1314 | return; |
---|
981 | 1315 | } |
---|
982 | 1316 | |
---|
983 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1317 | + for (int i=group.selection.size(); --i>=0;) |
---|
984 | 1318 | { |
---|
| 1319 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1320 | + |
---|
| 1321 | + // Cannot move into itself |
---|
| 1322 | + if (child == destinationLeaf) |
---|
| 1323 | + return; |
---|
| 1324 | + } |
---|
| 1325 | + |
---|
| 1326 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1327 | +// { |
---|
985 | 1328 | loadClipboard(true); |
---|
986 | 1329 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
987 | 1330 | pasteInto(false, false); |
---|
988 | | - } else { |
---|
989 | | - loadClipboard(false); |
---|
990 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
991 | | - pasteInto(false, false); // true); // ??? |
---|
992 | | - } |
---|
| 1331 | +// } else { |
---|
| 1332 | +// loadClipboard(false); |
---|
| 1333 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1334 | +// pasteInto(false, false); // true); // ??? |
---|
| 1335 | +// } |
---|
993 | 1336 | } |
---|
994 | 1337 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
995 | 1338 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1094 | 1437 | { |
---|
1095 | 1438 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1096 | 1439 | //heightFieldItem.addActionListener(this); |
---|
1097 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1098 | | - gridItem.addActionListener(this); |
---|
1099 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1100 | | - rectoidItem.addActionListener(this); |
---|
1101 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1102 | | - ellipsoidItem.addActionListener(this); |
---|
1103 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1104 | | - coneItem.addActionListener(this); |
---|
1105 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1106 | | - torusItem.addActionListener(this); |
---|
1107 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1108 | | - superItem.addActionListener(this); |
---|
| 1440 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1441 | +// gridItem.addActionListener(this); |
---|
| 1442 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1443 | +// rectoidItem.addActionListener(this); |
---|
| 1444 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1445 | +// ellipsoidItem.addActionListener(this); |
---|
| 1446 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1447 | +// coneItem.addActionListener(this); |
---|
| 1448 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1449 | +// torusItem.addActionListener(this); |
---|
| 1450 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1451 | +// superItem.addActionListener(this); |
---|
| 1452 | + |
---|
| 1453 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1454 | + cameraItem.addActionListener(this); |
---|
| 1455 | + |
---|
| 1456 | + if (!Globals.ADVANCED) |
---|
| 1457 | + { |
---|
1109 | 1458 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1110 | 1459 | kleinItem.addActionListener(this); |
---|
1111 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1112 | | - particleItem.addActionListener(this); |
---|
| 1460 | + } |
---|
| 1461 | + |
---|
| 1462 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1463 | +// particleItem.addActionListener(this); |
---|
1113 | 1464 | if (Globals.ADVANCED) |
---|
1114 | 1465 | { |
---|
1115 | 1466 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1135 | 1486 | } |
---|
1136 | 1487 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1137 | 1488 | bezierItem.addActionListener(this); |
---|
1138 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1139 | | - overlayItem.addActionListener(this); |
---|
1140 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1141 | | - lightItem.addActionListener(this); |
---|
| 1489 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1490 | +// overlayItem.addActionListener(this); |
---|
| 1491 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1492 | +// lightItem.addActionListener(this); |
---|
1142 | 1493 | menu.add("-"); |
---|
1143 | 1494 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1144 | 1495 | //superLoopItem.addActionListener(this); |
---|
1145 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1146 | | - loopItem.addActionListener(this); |
---|
| 1496 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1497 | +// loopItem.addActionListener(this); |
---|
1147 | 1498 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1148 | 1499 | doubleItem.addActionListener(this); |
---|
1149 | 1500 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1159 | 1510 | animationItem.addItemListener(this); |
---|
1160 | 1511 | animationItem.setState(Globals.ANIMATION); |
---|
1161 | 1512 | |
---|
| 1513 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1514 | + archiveItem.addActionListener(this); |
---|
| 1515 | + |
---|
1162 | 1516 | menu.add("-"); |
---|
1163 | 1517 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1164 | 1518 | parseverticesItem.addActionListener(this); |
---|
1165 | 1519 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1166 | 1520 | textureFieldItem.addActionListener(this); |
---|
1167 | | - alignItem = menu.add(new MenuItem("Align Object")); |
---|
| 1521 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1168 | 1522 | alignItem.addActionListener(this); |
---|
1169 | 1523 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1170 | 1524 | reduceMorphItem.addActionListener(this); |
---|
1171 | 1525 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1172 | 1526 | reduce34MorphItem.addActionListener(this); |
---|
1173 | | - |
---|
| 1527 | + menu.add("-"); |
---|
| 1528 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1529 | + memoryItem.addActionListener(this); |
---|
1174 | 1530 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1175 | 1531 | computeAOItem.addActionListener(this); |
---|
1176 | 1532 | |
---|
.. | .. |
---|
1179 | 1535 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1180 | 1536 | mirrorItem.addActionListener(this); |
---|
1181 | 1537 | menu.add("-"); |
---|
1182 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1183 | | - memoryItem.addActionListener(this); |
---|
1184 | 1538 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1185 | 1539 | analyzeItem.addActionListener(this); |
---|
1186 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1540 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1187 | 1541 | dumpItem.addActionListener(this); |
---|
1188 | 1542 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1189 | 1543 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1324 | 1678 | shadow.material = new cMaterial(obj.material); |
---|
1325 | 1679 | shadow.material.diffuse = 0.0001f; |
---|
1326 | 1680 | shadow.material.specular = 0.0001f; |
---|
| 1681 | + //shadow.projectedVertices[1].x = 300; |
---|
1327 | 1682 | |
---|
1328 | 1683 | makeSomething(shadow); |
---|
1329 | 1684 | } |
---|
| 1685 | + |
---|
| 1686 | + private void ClearUnpinned() |
---|
| 1687 | + { |
---|
| 1688 | + //for (Object3D obj : listUI) |
---|
| 1689 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1690 | + { |
---|
| 1691 | + Object3D obj = listUI.elementAt(i); |
---|
| 1692 | + if (!obj.pinned) |
---|
| 1693 | + { |
---|
| 1694 | + obj.CloseUI(); |
---|
| 1695 | + listUI.remove(i); |
---|
| 1696 | + } |
---|
| 1697 | + } |
---|
| 1698 | + } |
---|
| 1699 | + |
---|
| 1700 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1701 | + { |
---|
| 1702 | + // if (!(elem instanceof Composite)) |
---|
| 1703 | + // newWindow = false; |
---|
| 1704 | + listUI.add(elem); |
---|
| 1705 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1706 | + System.out.println("edit : " + elem); |
---|
| 1707 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1708 | + } |
---|
1330 | 1709 | |
---|
1331 | 1710 | /** |
---|
1332 | 1711 | * applyExample |
---|
.. | .. |
---|
1530 | 1909 | |
---|
1531 | 1910 | void Overwrite(int mask) |
---|
1532 | 1911 | { |
---|
1533 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1912 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1534 | 1913 | { |
---|
1535 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1914 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1536 | 1915 | |
---|
1537 | 1916 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1538 | 1917 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1571 | 1950 | { |
---|
1572 | 1951 | ScreenFit(); |
---|
1573 | 1952 | } else |
---|
1574 | | - if (source == switchItem) |
---|
| 1953 | + if (source == switchViewItem) |
---|
1575 | 1954 | { |
---|
1576 | 1955 | cVector v1 = new cVector(); |
---|
1577 | 1956 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1580 | 1959 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1581 | 1960 | objEditor.cameraView.repaint(); |
---|
1582 | 1961 | } else |
---|
1583 | | - if (source == rectoidItem) |
---|
| 1962 | + if (source == rectoidItem || source == boxButton) |
---|
1584 | 1963 | { |
---|
1585 | 1964 | makeSomething(new Box()); |
---|
1586 | 1965 | } else |
---|
1587 | | - if (source == particleItem) |
---|
| 1966 | + if (source == particleItem || source == particlesButton) |
---|
1588 | 1967 | { |
---|
1589 | 1968 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1590 | 1969 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1663 | 2042 | |
---|
1664 | 2043 | makeSomething(obj); |
---|
1665 | 2044 | } else |
---|
1666 | | - if (source == gridItem) |
---|
| 2045 | + if (source == gridItem || source == gridButton) |
---|
1667 | 2046 | { |
---|
1668 | 2047 | makeSomething(new Grid()); |
---|
1669 | 2048 | } else |
---|
1670 | | - if (source == ellipsoidItem) |
---|
| 2049 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1671 | 2050 | { |
---|
1672 | 2051 | makeSomething(new Sphere()); |
---|
1673 | 2052 | } else |
---|
1674 | | - if (source == coneItem) |
---|
| 2053 | + if (source == coneItem || source == coneButton) |
---|
1675 | 2054 | { |
---|
1676 | 2055 | makeSomething(new Cone()); |
---|
1677 | 2056 | } else |
---|
1678 | | - if (source == torusItem) |
---|
| 2057 | + if (source == torusItem || source == torusButton) |
---|
1679 | 2058 | { |
---|
1680 | 2059 | makeSomething(new Torus()); |
---|
1681 | 2060 | } else |
---|
1682 | | - if (source == superItem) |
---|
| 2061 | + if (source == superItem || source == superButton) |
---|
1683 | 2062 | { |
---|
1684 | 2063 | makeSomething(new Superellipsoid()); |
---|
1685 | 2064 | } else |
---|
1686 | | - if (source == kleinItem) |
---|
| 2065 | + if (source == kleinItem || source == kleinButton) |
---|
1687 | 2066 | { |
---|
1688 | 2067 | makeSomething(new Klein()); |
---|
1689 | 2068 | } else |
---|
.. | .. |
---|
1703 | 2082 | { |
---|
1704 | 2083 | makeSomething(new BezierSurface()); |
---|
1705 | 2084 | } else |
---|
1706 | | - if (source == overlayItem) |
---|
| 2085 | + if (source == overlayItem || source == overlayButton) |
---|
1707 | 2086 | { |
---|
1708 | 2087 | /* |
---|
1709 | 2088 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1751 | 2130 | s.setup(); |
---|
1752 | 2131 | makeSomething(s); |
---|
1753 | 2132 | } else |
---|
1754 | | - if (source == lightItem) |
---|
| 2133 | + if (source == lightItem || source == lightButton) |
---|
1755 | 2134 | { |
---|
1756 | 2135 | makeSomething(new Light()); |
---|
1757 | 2136 | } else |
---|
.. | .. |
---|
1801 | 2180 | |
---|
1802 | 2181 | group(g); |
---|
1803 | 2182 | } else |
---|
1804 | | - if (source == loopItem) |
---|
| 2183 | + if (source == loopItem || source == loopButton) |
---|
1805 | 2184 | { |
---|
1806 | 2185 | Composite csg = new GroupLeaf(); |
---|
1807 | 2186 | csg.count = 5; |
---|
1808 | 2187 | group(csg); |
---|
1809 | | - Composite child = new cGroup(); |
---|
| 2188 | + Composite child = new cGroup("Branch"); |
---|
1810 | 2189 | csg.addChild(child); |
---|
1811 | 2190 | child.addChild(csg); |
---|
1812 | 2191 | } else |
---|
1813 | 2192 | if (source == doubleItem) |
---|
1814 | 2193 | { |
---|
1815 | | - Composite csg = new GroupLeaf(); |
---|
| 2194 | + Composite csg = new GroupLeaf("Fork"); |
---|
1816 | 2195 | csg.count = 5; |
---|
1817 | 2196 | group(csg); |
---|
1818 | | - Composite child = new cGroup(); |
---|
| 2197 | + Composite child = new cGroup("Branch A"); |
---|
1819 | 2198 | csg.addChild(child); |
---|
1820 | 2199 | child.addChild(csg); |
---|
1821 | | - child = new cGroup(); |
---|
| 2200 | + child = new cGroup("Branch B"); |
---|
1822 | 2201 | csg.addChild(child); |
---|
1823 | 2202 | child.addChild(csg); |
---|
1824 | 2203 | } else |
---|
1825 | 2204 | if (source == tripleItem) |
---|
1826 | 2205 | { |
---|
1827 | | - Composite csg = new GroupLeaf(); |
---|
| 2206 | + Composite csg = new GroupLeaf("Trident"); |
---|
1828 | 2207 | csg.count = 4; |
---|
1829 | 2208 | group(csg); |
---|
1830 | 2209 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1836 | 2215 | child = new cGroup(); |
---|
1837 | 2216 | csg.addChild(child); |
---|
1838 | 2217 | child.addChild(csg); |
---|
1839 | | - } else |
---|
1840 | | - |
---|
1841 | | - if (source == importGFDItem) |
---|
1842 | | - { |
---|
1843 | | - ImportGFD(); |
---|
1844 | | - } else |
---|
1845 | | - if (source == importVRMLX3DItem) |
---|
1846 | | - { |
---|
1847 | | - ImportVRMLX3D(); |
---|
1848 | | - } else |
---|
1849 | | - if (source == import3DSItem) |
---|
1850 | | - { |
---|
1851 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1852 | | - } else |
---|
1853 | | - if (source == importOBJItem) |
---|
1854 | | - { |
---|
1855 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1856 | 2218 | } else |
---|
1857 | 2219 | if (source == computeAOItem) |
---|
1858 | 2220 | { |
---|
.. | .. |
---|
1872 | 2234 | if (source == invariantsItem) |
---|
1873 | 2235 | { |
---|
1874 | 2236 | System.out.println("Invariants:"); |
---|
1875 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2237 | + Grafreed.grafreeD.universe.invariants(); |
---|
1876 | 2238 | } else |
---|
1877 | 2239 | if (source == memoryItem) |
---|
1878 | 2240 | { |
---|
.. | .. |
---|
1891 | 2253 | { |
---|
1892 | 2254 | DumpObject(); |
---|
1893 | 2255 | } else |
---|
| 2256 | + if (source == minButton) |
---|
| 2257 | + { |
---|
| 2258 | + Minimize(); |
---|
| 2259 | + } else |
---|
| 2260 | + if (source == maxButton) |
---|
| 2261 | + { |
---|
| 2262 | + Maximize(); |
---|
| 2263 | + } else |
---|
| 2264 | + if (source == fullButton) |
---|
| 2265 | + { |
---|
| 2266 | + ToggleFullScreen(); |
---|
| 2267 | + } else |
---|
| 2268 | + if (source == undoButton) |
---|
| 2269 | + { |
---|
| 2270 | + // Go to previous version |
---|
| 2271 | + //if (!Undo()) |
---|
| 2272 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2273 | + Undo(); |
---|
| 2274 | + } else |
---|
| 2275 | + if (source == restoreButton) |
---|
| 2276 | + { |
---|
| 2277 | + // Restore current version |
---|
| 2278 | + Restore(); |
---|
| 2279 | + } else |
---|
| 2280 | + if (source == replaceButton) |
---|
| 2281 | + { |
---|
| 2282 | + // Overwrite current version |
---|
| 2283 | + Replace(); |
---|
| 2284 | + } else |
---|
| 2285 | + if (source == redoButton) |
---|
| 2286 | + { |
---|
| 2287 | + // Go to next version |
---|
| 2288 | + Redo(); |
---|
| 2289 | + } else |
---|
| 2290 | + if (source == saveButton) |
---|
| 2291 | + { |
---|
| 2292 | + // Save a new version |
---|
| 2293 | + if (!Save(true)) |
---|
| 2294 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2295 | + } else |
---|
1894 | 2296 | if (source == oneStepButton) |
---|
1895 | 2297 | { |
---|
1896 | 2298 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1898 | 2300 | } else |
---|
1899 | 2301 | if (source == screenfitButton) |
---|
1900 | 2302 | { |
---|
1901 | | - //Reload(lastConverter, lastFilename, true); |
---|
1902 | 2303 | ScreenFit(); |
---|
1903 | 2304 | } else |
---|
1904 | 2305 | if (source == screenfitpointButton) |
---|
1905 | 2306 | { |
---|
1906 | | - //Reload(lastConverter, lastFilename, true); |
---|
1907 | 2307 | ScreenFitPoint(); |
---|
1908 | 2308 | } else |
---|
1909 | 2309 | if (source == snapobjectButton) |
---|
1910 | 2310 | { |
---|
1911 | | - //Reload(lastConverter, lastFilename, true); |
---|
1912 | 2311 | SnapObject(); |
---|
1913 | 2312 | } else |
---|
1914 | 2313 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1945 | 2344 | { |
---|
1946 | 2345 | loadClipboard(true); |
---|
1947 | 2346 | } else |
---|
| 2347 | + if (source == undoItem) |
---|
| 2348 | + { |
---|
| 2349 | + Undo(); |
---|
| 2350 | + } else |
---|
| 2351 | + if (source == redoItem) |
---|
| 2352 | + { |
---|
| 2353 | + Redo(); |
---|
| 2354 | + } else |
---|
1948 | 2355 | if (source == duplicateItem) |
---|
1949 | 2356 | { |
---|
1950 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2357 | + Object3D keep = Grafreed.clipboard; |
---|
1951 | 2358 | loadClipboard(false); |
---|
1952 | 2359 | paste(false); |
---|
1953 | | - GrafreeD.clipboard = keep; |
---|
| 2360 | + Grafreed.clipboard = keep; |
---|
1954 | 2361 | } else |
---|
1955 | 2362 | if (source == cloneItem) |
---|
1956 | 2363 | { |
---|
.. | .. |
---|
2170 | 2577 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2171 | 2578 | // refreshContents(); |
---|
2172 | 2579 | // } |
---|
2173 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2580 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2174 | 2581 | { |
---|
2175 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2582 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2176 | 2583 | |
---|
2177 | 2584 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2178 | 2585 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2222 | 2629 | } else |
---|
2223 | 2630 | if (source == setMasterItem) |
---|
2224 | 2631 | { |
---|
2225 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2632 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2226 | 2633 | { |
---|
2227 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2634 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2228 | 2635 | |
---|
2229 | 2636 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2230 | 2637 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2237 | 2644 | { |
---|
2238 | 2645 | if (group.selection.size() == 1) |
---|
2239 | 2646 | { |
---|
2240 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2647 | + if (Grafreed.clipboard.size() == 1) |
---|
2241 | 2648 | { |
---|
2242 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2649 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2243 | 2650 | |
---|
2244 | 2651 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2245 | 2652 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2256 | 2663 | { |
---|
2257 | 2664 | RevertMeshes(); |
---|
2258 | 2665 | } else |
---|
2259 | | - if (source == resetMeshItem) |
---|
| 2666 | + if (source == resetAllItem) |
---|
2260 | 2667 | { |
---|
2261 | 2668 | ResetAll(); |
---|
2262 | 2669 | } else |
---|
.. | .. |
---|
2264 | 2671 | { |
---|
2265 | 2672 | StepAll(); |
---|
2266 | 2673 | } else |
---|
2267 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2674 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2268 | 2675 | { |
---|
2269 | 2676 | //int indices[] = jList.getSelectedIndices(); |
---|
2270 | 2677 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2276 | 2683 | { |
---|
2277 | 2684 | ClearSelection(true); |
---|
2278 | 2685 | } else |
---|
2279 | | - if (source == grabItem) |
---|
| 2686 | + if (source == grabItem || source == groupButton) |
---|
2280 | 2687 | { |
---|
2281 | | - group(new cGroup(), true); |
---|
| 2688 | + group(new cGroup(), false); // true); |
---|
2282 | 2689 | } else |
---|
2283 | 2690 | if (source == hideItem) |
---|
2284 | 2691 | { |
---|
.. | .. |
---|
2296 | 2703 | { |
---|
2297 | 2704 | makeSomething(new Camera()); |
---|
2298 | 2705 | } else |
---|
2299 | | - if (source == compositeItem) |
---|
| 2706 | + if (source == compositeItem || source == compositeButton) |
---|
2300 | 2707 | { |
---|
2301 | 2708 | group(new Composite()); |
---|
2302 | 2709 | } else |
---|
2303 | | - if (source == randomItem) |
---|
| 2710 | + if (source == switchItem || source == switchButton) |
---|
2304 | 2711 | { |
---|
2305 | 2712 | RandomNode random = new RandomNode(); |
---|
2306 | 2713 | group(random); |
---|
.. | .. |
---|
2402 | 2809 | { |
---|
2403 | 2810 | group(new cLinker()); |
---|
2404 | 2811 | } else |
---|
2405 | | - if (source == textureItem) |
---|
| 2812 | + if (source == textureItem || source == textureButton) |
---|
2406 | 2813 | { |
---|
2407 | 2814 | group(new TextureNode()); |
---|
2408 | 2815 | } else |
---|
.. | .. |
---|
2422 | 2829 | { |
---|
2423 | 2830 | CastShadow(2); |
---|
2424 | 2831 | } else |
---|
2425 | | - if (source == ungroupItem) |
---|
| 2832 | + if (source == ungroupItem || source == ungroupButton) |
---|
2426 | 2833 | { |
---|
2427 | | - //ungroup(); |
---|
| 2834 | + boolean hasRoot = false; |
---|
| 2835 | + |
---|
2428 | 2836 | for (int i=0; i<group.selection.size(); i++) |
---|
2429 | 2837 | { |
---|
2430 | | - Ungroup(group.selection.get(i)); |
---|
| 2838 | + if (group.selection.get(i) == group) |
---|
| 2839 | + { |
---|
| 2840 | + hasRoot = true; |
---|
| 2841 | + break; |
---|
| 2842 | + } |
---|
2431 | 2843 | } |
---|
2432 | 2844 | |
---|
2433 | | - ClearSelection(false); |
---|
2434 | | - |
---|
2435 | | - refreshContents(); |
---|
| 2845 | + if (!hasRoot) |
---|
| 2846 | + { |
---|
| 2847 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2848 | + { |
---|
| 2849 | + Ungroup(group.selection.get(i)); |
---|
| 2850 | + } |
---|
| 2851 | + |
---|
| 2852 | + ClearSelection(false); |
---|
| 2853 | + |
---|
| 2854 | + refreshContents(); |
---|
| 2855 | + } |
---|
2436 | 2856 | } else |
---|
2437 | 2857 | if (source == genUVItem) |
---|
2438 | 2858 | { |
---|
.. | .. |
---|
2444 | 2864 | } else |
---|
2445 | 2865 | if (source == genNormalsMESHItem) |
---|
2446 | 2866 | { |
---|
2447 | | - GenNormals(true); // TODO |
---|
| 2867 | + GenNormalsMESH(); |
---|
2448 | 2868 | } else |
---|
2449 | 2869 | if (source == genNormalsORGANItem) |
---|
2450 | 2870 | { |
---|
.. | .. |
---|
2509 | 2929 | if (source == unmarkleavesItem) |
---|
2510 | 2930 | { |
---|
2511 | 2931 | MarkLeaves(false); |
---|
| 2932 | + } else |
---|
| 2933 | + if (source == rewindleavesItem) |
---|
| 2934 | + { |
---|
| 2935 | + RewindLeaves(true); |
---|
| 2936 | + } else |
---|
| 2937 | + if (source == unrewindleavesItem) |
---|
| 2938 | + { |
---|
| 2939 | + RewindLeaves(false); |
---|
| 2940 | + } else |
---|
| 2941 | + if (source == randomleavesItem) |
---|
| 2942 | + { |
---|
| 2943 | + RandomLeaves(true); |
---|
| 2944 | + } else |
---|
| 2945 | + if (source == unrandomleavesItem) |
---|
| 2946 | + { |
---|
| 2947 | + RandomLeaves(false); |
---|
2512 | 2948 | } else |
---|
2513 | 2949 | if (source == flipVItem) |
---|
2514 | 2950 | { |
---|
.. | .. |
---|
2594 | 3030 | { |
---|
2595 | 3031 | SmoothMesh(); |
---|
2596 | 3032 | } else |
---|
2597 | | - if (source == transformgeometryItem) |
---|
| 3033 | + if (source == transformGeometryItem) |
---|
2598 | 3034 | { |
---|
2599 | 3035 | TransformGeometry(); |
---|
| 3036 | + } else |
---|
| 3037 | + if (source == transformChildrenItem) |
---|
| 3038 | + { |
---|
| 3039 | + TransformChildren(); |
---|
2600 | 3040 | } else |
---|
2601 | 3041 | if (source == resetTransformItem) |
---|
2602 | 3042 | { |
---|
.. | .. |
---|
2604 | 3044 | } else |
---|
2605 | 3045 | if (source == resetCentroidItem) |
---|
2606 | 3046 | { |
---|
2607 | | - ResetCentroid(); |
---|
| 3047 | + ResetCentroid(true); |
---|
| 3048 | + } else |
---|
| 3049 | + if (source == resetCentroidXZItem) |
---|
| 3050 | + { |
---|
| 3051 | + ResetCentroid(false); |
---|
2608 | 3052 | } else |
---|
2609 | 3053 | if (source == resetParentItem) |
---|
2610 | 3054 | { |
---|
.. | .. |
---|
2736 | 3180 | if (source == twoButton) |
---|
2737 | 3181 | { |
---|
2738 | 3182 | radio.layout = twoButton; |
---|
| 3183 | + |
---|
| 3184 | + if (CameraPane.FULLSCREEN) |
---|
| 3185 | + fullscreenLayout = radio.layout; |
---|
| 3186 | + |
---|
2739 | 3187 | // bug |
---|
2740 | 3188 | //gridPanel.setDividerLocation(1.0); |
---|
2741 | 3189 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2768 | 3216 | bigThree.ClearUI(); |
---|
2769 | 3217 | bigThree.add(centralPanel); |
---|
2770 | 3218 | bigThree.FlushUI(); |
---|
| 3219 | + |
---|
| 3220 | + cameraView.requestFocusInWindow(); |
---|
| 3221 | + |
---|
| 3222 | +// refreshContents(true); |
---|
| 3223 | +// |
---|
| 3224 | +// try |
---|
| 3225 | +// { |
---|
| 3226 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3227 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3228 | +// bot.mouseMove(100, 100); |
---|
| 3229 | +// bot.mousePress(mask); |
---|
| 3230 | +// bot.mouseRelease(mask); |
---|
| 3231 | +// } |
---|
| 3232 | +// catch (Exception e) |
---|
| 3233 | +// { |
---|
| 3234 | +// |
---|
| 3235 | +// } |
---|
| 3236 | + |
---|
2771 | 3237 | } else |
---|
2772 | 3238 | if (source == threeButton) |
---|
2773 | 3239 | { |
---|
2774 | 3240 | radio.layout = threeButton; |
---|
| 3241 | + |
---|
| 3242 | + if (CameraPane.FULLSCREEN) |
---|
| 3243 | + fullscreenLayout = radio.layout; |
---|
2775 | 3244 | |
---|
2776 | 3245 | // bigThree.remove(scenePanel); |
---|
2777 | 3246 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2804 | 3273 | bigThree.add(centralPanel); |
---|
2805 | 3274 | bigThree.add(XYZPanel); |
---|
2806 | 3275 | bigThree.FlushUI(); |
---|
| 3276 | + |
---|
| 3277 | + cameraView.requestFocusInWindow(); |
---|
2807 | 3278 | } else |
---|
2808 | 3279 | if (source == fourButton) |
---|
2809 | 3280 | { |
---|
2810 | 3281 | radio.layout = fourButton; |
---|
| 3282 | + |
---|
| 3283 | + if (CameraPane.FULLSCREEN) |
---|
| 3284 | + fullscreenLayout = radio.layout; |
---|
2811 | 3285 | |
---|
2812 | 3286 | // bigThree.remove(scenePanel); |
---|
2813 | 3287 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2839 | 3313 | bigThree.ClearUI(); |
---|
2840 | 3314 | bigThree.add(scenePanel); |
---|
2841 | 3315 | bigThree.FlushUI(); |
---|
| 3316 | + |
---|
| 3317 | + cameraView.requestFocusInWindow(); |
---|
2842 | 3318 | } else |
---|
2843 | 3319 | if (source == sixButton) |
---|
2844 | 3320 | { |
---|
2845 | 3321 | radio.layout = sixButton; |
---|
| 3322 | + |
---|
| 3323 | + if (CameraPane.FULLSCREEN) |
---|
| 3324 | + fullscreenLayout = radio.layout; |
---|
2846 | 3325 | |
---|
2847 | 3326 | // bigThree.remove(scenePanel); |
---|
2848 | 3327 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2875 | 3354 | bigThree.add(scenePanel); |
---|
2876 | 3355 | bigThree.add(centralPanel); |
---|
2877 | 3356 | bigThree.FlushUI(); |
---|
| 3357 | + |
---|
| 3358 | + cameraView.requestFocusInWindow(); |
---|
2878 | 3359 | } else |
---|
2879 | 3360 | if (source == sevenButton) |
---|
2880 | 3361 | { |
---|
2881 | 3362 | radio.layout = sevenButton; |
---|
| 3363 | + |
---|
| 3364 | + if (CameraPane.FULLSCREEN) |
---|
| 3365 | + fullscreenLayout = radio.layout; |
---|
2882 | 3366 | |
---|
2883 | 3367 | // bigThree.remove(scenePanel); |
---|
2884 | 3368 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2912 | 3396 | bigThree.add(centralPanel); |
---|
2913 | 3397 | bigThree.add(XYZPanel); |
---|
2914 | 3398 | bigThree.FlushUI(); |
---|
| 3399 | + |
---|
| 3400 | + cameraView.requestFocusInWindow(); |
---|
2915 | 3401 | } else |
---|
2916 | 3402 | if (source == rootButton) |
---|
2917 | 3403 | { |
---|
.. | .. |
---|
2923 | 3409 | EditObject(obj); |
---|
2924 | 3410 | } |
---|
2925 | 3411 | |
---|
| 3412 | + cameraView.requestFocusInWindow(); |
---|
2926 | 3413 | refreshContents(true); |
---|
2927 | 3414 | } else |
---|
2928 | 3415 | if (source == closeButton) |
---|
.. | .. |
---|
2932 | 3419 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2933 | 3420 | { |
---|
2934 | 3421 | ab = (cRadio)e.nextElement(); |
---|
2935 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3422 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2936 | 3423 | { |
---|
| 3424 | + // Patch to avoid bug with transparency. |
---|
| 3425 | + if (!ab.hadMaterial) |
---|
| 3426 | + { |
---|
| 3427 | + ab.object.material = null; |
---|
| 3428 | + } |
---|
| 3429 | + |
---|
2937 | 3430 | buttonGroup.remove(ab); |
---|
2938 | 3431 | radioPanel.remove(ab); |
---|
2939 | 3432 | |
---|
2940 | | - ab.GetObject().editWindow = null; |
---|
| 3433 | + //ab.GetObject().editWindow = null; |
---|
| 3434 | + ab.GetObject().manipWindow = null; |
---|
2941 | 3435 | // ab.GetObject().objectUI = null; // ????????? |
---|
2942 | 3436 | |
---|
2943 | 3437 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2944 | 3438 | break; |
---|
2945 | 3439 | } |
---|
2946 | 3440 | } |
---|
| 3441 | + |
---|
| 3442 | + cameraView.requestFocusInWindow(); |
---|
2947 | 3443 | refreshContents(true); |
---|
2948 | 3444 | } else |
---|
2949 | 3445 | if (source == editItem || source == editButton) |
---|
2950 | 3446 | { |
---|
| 3447 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3448 | + { |
---|
| 3449 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3450 | + child.pinned = true; |
---|
| 3451 | + } |
---|
| 3452 | + |
---|
2951 | 3453 | EditSelection(false); |
---|
2952 | 3454 | } else |
---|
2953 | 3455 | if (source == uneditButton) |
---|
.. | .. |
---|
2957 | 3459 | Object3D child = (Object3D)e.nextElement(); |
---|
2958 | 3460 | if(child.editWindow != null) |
---|
2959 | 3461 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3462 | + child.pinned = false; |
---|
2960 | 3463 | child.CloseUI(); |
---|
2961 | 3464 | listUI.remove(child); |
---|
2962 | 3465 | |
---|
2963 | | - child.editWindow = null; // ??????????? |
---|
| 3466 | + //child.editWindow = null; // ??????????? |
---|
2964 | 3467 | } |
---|
2965 | 3468 | objEditor.ctrlPanel.FlushUI(); |
---|
2966 | 3469 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
2973 | 3476 | //copy.ClearUI(); |
---|
2974 | 3477 | for (Object3D obj : listUI) |
---|
2975 | 3478 | { |
---|
| 3479 | + obj.pinned = false; |
---|
2976 | 3480 | obj.CloseUI(); |
---|
2977 | 3481 | } |
---|
2978 | 3482 | listUI.clear(); |
---|
.. | .. |
---|
2982 | 3486 | { |
---|
2983 | 3487 | assert(copy == group); |
---|
2984 | 3488 | |
---|
2985 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3489 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2986 | 3490 | |
---|
2987 | 3491 | for (Object3D obj : listUI) |
---|
2988 | 3492 | { |
---|
.. | .. |
---|
3031 | 3535 | } |
---|
3032 | 3536 | |
---|
3033 | 3537 | copy = group; |
---|
| 3538 | + |
---|
| 3539 | + SetUndoStates(); |
---|
| 3540 | + |
---|
3034 | 3541 | //Globals.theRenderer.object = group; |
---|
3035 | 3542 | if(!useclient) |
---|
3036 | 3543 | { |
---|
.. | .. |
---|
3046 | 3553 | frontView.object = group; |
---|
3047 | 3554 | sideView.object = group; |
---|
3048 | 3555 | } |
---|
3049 | | - group.editWindow = this; |
---|
| 3556 | + |
---|
| 3557 | +// fix "+" issue |
---|
| 3558 | + //group.editWindow = this; |
---|
| 3559 | + group.manipWindow = this; |
---|
| 3560 | + |
---|
3050 | 3561 | /* |
---|
3051 | 3562 | currentLayout = radio.layout; |
---|
3052 | 3563 | if (currentLayout == null) |
---|
3053 | 3564 | currentLayout = sevenButton; |
---|
3054 | 3565 | */ |
---|
3055 | 3566 | radio.layout.doClick(); |
---|
| 3567 | + |
---|
| 3568 | + ClearUnpinned(); |
---|
| 3569 | + //Grafreed.Assert(group != null); |
---|
| 3570 | + //Grafreed.Assert(group.selection != null); |
---|
| 3571 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3572 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3573 | + EditSelection(false); |
---|
3056 | 3574 | keepparent = group.parent; |
---|
3057 | 3575 | // PARENT = NULL or not??? |
---|
3058 | 3576 | //group.parent = null; // ROOT |
---|
3059 | 3577 | //group.attributes = -1; |
---|
3060 | 3578 | ResetModel(); |
---|
| 3579 | + |
---|
| 3580 | + cameraView.requestFocusInWindow(); |
---|
3061 | 3581 | refreshContents(true); |
---|
3062 | | - } |
---|
| 3582 | + } else if (event.getSource() == editCameraItem) |
---|
| 3583 | + { |
---|
| 3584 | + cameraView.ProtectCamera(); |
---|
| 3585 | + cameraView.repaint(); |
---|
| 3586 | + return; |
---|
| 3587 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3588 | + { |
---|
| 3589 | + cameraView.RevertCamera(); |
---|
| 3590 | + cameraView.repaint(); |
---|
| 3591 | + return; |
---|
| 3592 | + // } else if (event.getSource() == textureButton) |
---|
| 3593 | + // { |
---|
| 3594 | + // return; // true; |
---|
| 3595 | + } |
---|
3063 | 3596 | else |
---|
3064 | 3597 | { |
---|
3065 | 3598 | //return super.action(event, arg); |
---|
.. | .. |
---|
3068 | 3601 | } |
---|
3069 | 3602 | |
---|
3070 | 3603 | boolean useclient = false; |
---|
3071 | | - cRadio radio; |
---|
3072 | 3604 | |
---|
3073 | 3605 | void ToggleRoot() |
---|
3074 | 3606 | { |
---|
.. | .. |
---|
3120 | 3652 | refreshContents(); |
---|
3121 | 3653 | } |
---|
3122 | 3654 | |
---|
| 3655 | + void TransformChildren() |
---|
| 3656 | + { |
---|
| 3657 | + Object3D obj; |
---|
| 3658 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3659 | + { |
---|
| 3660 | + obj = (Object3D)e.nextElement(); |
---|
| 3661 | + obj.KeepTextureMatrices(); |
---|
| 3662 | + obj.TransformChildren(); |
---|
| 3663 | + obj.RestoreTextureMatrices(); |
---|
| 3664 | + |
---|
| 3665 | +// if (obj.parent == null) |
---|
| 3666 | +// { |
---|
| 3667 | +// System.out.println("NULL PARENT!"); |
---|
| 3668 | +// new Exception().printStackTrace(); |
---|
| 3669 | +// } |
---|
| 3670 | +// else |
---|
| 3671 | +// TouchTransform(obj); |
---|
| 3672 | +// //obj.parent.Touch(); |
---|
| 3673 | + } |
---|
| 3674 | + |
---|
| 3675 | + refreshContents(); |
---|
| 3676 | + } |
---|
3123 | 3677 | |
---|
3124 | 3678 | void ResetTransform() |
---|
3125 | 3679 | { |
---|
.. | .. |
---|
3232 | 3786 | refreshContents(); |
---|
3233 | 3787 | } |
---|
3234 | 3788 | |
---|
3235 | | - void ResetCentroid() |
---|
| 3789 | + void ResetCentroid(boolean full) |
---|
3236 | 3790 | { |
---|
3237 | 3791 | Object3D obj; |
---|
3238 | 3792 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3247 | 3801 | LA.matIdentity(Object3D.mat); |
---|
3248 | 3802 | obj.getBounds(minima, maxima, false); |
---|
3249 | 3803 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3250 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3804 | + if (full) |
---|
| 3805 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3251 | 3806 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3252 | 3807 | obj.TransformMesh(Object3D.mat); |
---|
| 3808 | + |
---|
3253 | 3809 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3254 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3810 | + if (full) |
---|
| 3811 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3255 | 3812 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3813 | + |
---|
3256 | 3814 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3257 | 3815 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3258 | 3816 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3281 | 3839 | |
---|
3282 | 3840 | int size = obj.MemorySize(); |
---|
3283 | 3841 | |
---|
3284 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3842 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3843 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3285 | 3844 | } |
---|
3286 | 3845 | } |
---|
3287 | 3846 | catch (Exception e) |
---|
.. | .. |
---|
3318 | 3877 | obj = (Object3D)e.nextElement(); |
---|
3319 | 3878 | |
---|
3320 | 3879 | System.out.println("Object is: " + obj); |
---|
3321 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3880 | + Grafreed.AnalyzeObject(obj); |
---|
3322 | 3881 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3323 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3882 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3324 | 3883 | |
---|
3325 | 3884 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3326 | 3885 | } |
---|
.. | .. |
---|
3362 | 3921 | void GenNormals(boolean crease) |
---|
3363 | 3922 | { |
---|
3364 | 3923 | group.GenNormalsS(crease); |
---|
| 3924 | + |
---|
| 3925 | + refreshContents(); |
---|
| 3926 | + } |
---|
| 3927 | + |
---|
| 3928 | + void GenNormalsMESH() |
---|
| 3929 | + { |
---|
| 3930 | + group.GenNormalsMeshS(); |
---|
3365 | 3931 | |
---|
3366 | 3932 | refreshContents(); |
---|
3367 | 3933 | } |
---|
.. | .. |
---|
3534 | 4100 | |
---|
3535 | 4101 | void ParseVertices() |
---|
3536 | 4102 | { |
---|
3537 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3538 | | - GrafreeD.epsequal = true; |
---|
| 4103 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4104 | + Grafreed.epsequal = true; |
---|
3539 | 4105 | |
---|
3540 | 4106 | for (int i=0; i<group.selection.size(); i++) |
---|
3541 | 4107 | { |
---|
.. | .. |
---|
3560 | 4126 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3561 | 4127 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3562 | 4128 | |
---|
3563 | | - g.add(GrafreeD.clipboard); |
---|
| 4129 | + g.add(Grafreed.clipboard); |
---|
3564 | 4130 | |
---|
3565 | 4131 | buffer.add(g); |
---|
3566 | 4132 | } |
---|
.. | .. |
---|
3575 | 4141 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3576 | 4142 | } |
---|
3577 | 4143 | |
---|
3578 | | - GrafreeD.epsequal = epsequal; |
---|
| 4144 | + Grafreed.epsequal = epsequal; |
---|
3579 | 4145 | |
---|
3580 | 4146 | refreshContents(); |
---|
3581 | 4147 | } |
---|
.. | .. |
---|
3593 | 4159 | String pigment = Object3D.GetPigment(tex); |
---|
3594 | 4160 | //String bump = Object3D.GetBump(tex); |
---|
3595 | 4161 | |
---|
3596 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4162 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4163 | + |
---|
| 4164 | + try |
---|
| 4165 | + { |
---|
| 4166 | + texturedata = Globals.theRenderer.GetTextureData(tex.pigmenttexture, pigment, false, node.texres); |
---|
| 4167 | + } |
---|
| 4168 | + catch (Exception e) |
---|
| 4169 | + { |
---|
| 4170 | + System.err.println("FAIL: " + node); |
---|
| 4171 | + } |
---|
3597 | 4172 | |
---|
3598 | 4173 | double s = v.s; |
---|
3599 | 4174 | |
---|
.. | .. |
---|
3725 | 4300 | return; |
---|
3726 | 4301 | |
---|
3727 | 4302 | Object3D poses = group.selection.get(0); |
---|
3728 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4303 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3729 | 4304 | |
---|
3730 | 4305 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3731 | 4306 | |
---|
.. | .. |
---|
3919 | 4494 | |
---|
3920 | 4495 | void ClipMesh() |
---|
3921 | 4496 | { |
---|
3922 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4497 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3923 | 4498 | { |
---|
3924 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4499 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3925 | 4500 | |
---|
3926 | 4501 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3927 | 4502 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3930 | 4505 | // { |
---|
3931 | 4506 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3932 | 4507 | // } |
---|
3933 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4508 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3934 | 4509 | } |
---|
3935 | 4510 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3936 | 4511 | System.out.println("DONE."); |
---|
.. | .. |
---|
3977 | 4552 | void MarkLeaves(boolean hide) |
---|
3978 | 4553 | { |
---|
3979 | 4554 | group.selection.MarkLeaves(hide); |
---|
| 4555 | + refreshContents(); |
---|
| 4556 | + } |
---|
| 4557 | + |
---|
| 4558 | + void RewindLeaves(boolean hide) |
---|
| 4559 | + { |
---|
| 4560 | + group.selection.RewindLeaves(hide); |
---|
| 4561 | + refreshContents(); |
---|
| 4562 | + } |
---|
| 4563 | + |
---|
| 4564 | + void RandomLeaves(boolean hide) |
---|
| 4565 | + { |
---|
| 4566 | + group.selection.RandomLeaves(hide); |
---|
3980 | 4567 | refreshContents(); |
---|
3981 | 4568 | } |
---|
3982 | 4569 | |
---|
.. | .. |
---|
4051 | 4638 | // } |
---|
4052 | 4639 | // } |
---|
4053 | 4640 | |
---|
4054 | | - static boolean allparams = true; |
---|
4055 | | - |
---|
4056 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4057 | | - |
---|
4058 | 4641 | void EditSelection(boolean newWindow) |
---|
4059 | 4642 | { |
---|
| 4643 | + if (group.selection == null) |
---|
| 4644 | + { |
---|
| 4645 | + EditElement(group, newWindow); // ? new |
---|
| 4646 | + return; |
---|
| 4647 | + } |
---|
| 4648 | + |
---|
4060 | 4649 | // aConstraints.gridy = 0; |
---|
4061 | 4650 | for (int i=0; i<group.selection.size(); i++) |
---|
4062 | 4651 | { |
---|
4063 | 4652 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4064 | 4653 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4065 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4654 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4066 | 4655 | |
---|
4067 | 4656 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4068 | | - if(elem != group) |
---|
| 4657 | + if(elem != group || !newWindow) |
---|
4069 | 4658 | { |
---|
4070 | | - // if (!(elem instanceof Composite)) |
---|
4071 | | - // newWindow = false; |
---|
4072 | | - listUI.add(elem); |
---|
4073 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4074 | | - System.out.println("edit : " + elem); |
---|
4075 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4659 | + EditElement(elem, newWindow); // ? new |
---|
4076 | 4660 | } |
---|
4077 | 4661 | } |
---|
4078 | 4662 | } |
---|
.. | .. |
---|
4147 | 4731 | //new Exception().printStackTrace(); |
---|
4148 | 4732 | |
---|
4149 | 4733 | freezemodel = true; |
---|
4150 | | - |
---|
| 4734 | + ClearUnpinned(); |
---|
| 4735 | + |
---|
4151 | 4736 | /**/ |
---|
4152 | 4737 | //switch (event.id) |
---|
4153 | 4738 | { |
---|
.. | .. |
---|
4155 | 4740 | //case 702: // Event.LIST_DESELECT |
---|
4156 | 4741 | group.deselectAll(); |
---|
4157 | 4742 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4158 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4159 | 4743 | if (tps != null) |
---|
4160 | 4744 | { |
---|
4161 | 4745 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4164 | 4748 | |
---|
4165 | 4749 | //if (child.parent != null) |
---|
4166 | 4750 | //child.parent.addSelectee(child); |
---|
| 4751 | + objEditor.SetMaterial(child); |
---|
4167 | 4752 | group.addSelectee(child); |
---|
4168 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4169 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4170 | | - System.err.println("info : " + child.GetPath()); |
---|
4171 | 4753 | } |
---|
4172 | 4754 | } |
---|
4173 | 4755 | // else |
---|
.. | .. |
---|
4177 | 4759 | // System.err.println("info : " + group.GetPath()); |
---|
4178 | 4760 | // } |
---|
4179 | 4761 | |
---|
4180 | | - objEditor.SetText(); // jan 2014 |
---|
4181 | | - |
---|
4182 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4762 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4183 | 4763 | CameraPane.flash = true; |
---|
4184 | 4764 | |
---|
4185 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4765 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4186 | 4766 | // a camera |
---|
4187 | 4767 | { |
---|
4188 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4189 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4768 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4769 | + { |
---|
| 4770 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4771 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4772 | + } |
---|
4190 | 4773 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4191 | 4774 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4192 | 4775 | } |
---|
4193 | 4776 | |
---|
| 4777 | + if (tps != null && tps.length == 1) |
---|
| 4778 | + { |
---|
| 4779 | + EditSelection(false); |
---|
| 4780 | + } |
---|
| 4781 | + |
---|
| 4782 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4783 | + |
---|
4194 | 4784 | refreshContents(); |
---|
4195 | 4785 | //return true; |
---|
4196 | 4786 | } |
---|
.. | .. |
---|
4199 | 4789 | |
---|
4200 | 4790 | freezemodel = false; |
---|
4201 | 4791 | } |
---|
| 4792 | + |
---|
| 4793 | + void SetPinStates(boolean enabled) |
---|
| 4794 | + { |
---|
| 4795 | + editButton.setEnabled(enabled); |
---|
| 4796 | + uneditButton.setEnabled(enabled); |
---|
| 4797 | + unselectButton.setEnabled(enabled); |
---|
| 4798 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4799 | + } |
---|
| 4800 | + |
---|
| 4801 | + void refreshContents(boolean cp) |
---|
| 4802 | + { |
---|
| 4803 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4804 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4805 | + { |
---|
| 4806 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4807 | + |
---|
| 4808 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4809 | + { |
---|
| 4810 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4811 | + |
---|
| 4812 | + objEditor.AddInfo(child, this, true); |
---|
| 4813 | + System.err.println("info : " + child.GetPath()); |
---|
| 4814 | + } |
---|
| 4815 | + |
---|
| 4816 | + objEditor.SetText(); // jan 2014 |
---|
| 4817 | + } |
---|
| 4818 | + |
---|
| 4819 | + super.refreshContents(cp); |
---|
| 4820 | + } |
---|
4202 | 4821 | |
---|
4203 | 4822 | void linkSomething(Object3D thing) |
---|
4204 | 4823 | { |
---|
.. | .. |
---|
4270 | 4889 | { |
---|
4271 | 4890 | if (group.selection.isEmpty()) |
---|
4272 | 4891 | return; |
---|
4273 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4892 | + |
---|
| 4893 | + Grafreed.clipboardIsTempGroup = false; |
---|
4274 | 4894 | Composite tGroup = null; |
---|
4275 | 4895 | if (group.selection.size() > 0) // 1) |
---|
4276 | 4896 | { |
---|
4277 | 4897 | tGroup = new cGroup(); |
---|
4278 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4898 | + Grafreed.clipboardIsTempGroup = true; |
---|
4279 | 4899 | } |
---|
4280 | 4900 | |
---|
4281 | 4901 | if (cut) |
---|
4282 | 4902 | { |
---|
| 4903 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4904 | +// Save(); |
---|
4283 | 4905 | //int indices[] = jList.getSelectedIndices(); |
---|
4284 | 4906 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4285 | 4907 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4315 | 4937 | //System.out.println("cut " + child); |
---|
4316 | 4938 | //System.out.println("parent = " + child.parent); |
---|
4317 | 4939 | // tmp.addChild(child); |
---|
4318 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4940 | + if (Grafreed.clipboardIsTempGroup) |
---|
4319 | 4941 | tGroup.add/*Child*/(tmp); |
---|
4320 | 4942 | else |
---|
4321 | | - GrafreeD.clipboard = tmp; |
---|
| 4943 | + Grafreed.clipboard = tmp; |
---|
4322 | 4944 | } |
---|
4323 | 4945 | else |
---|
4324 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4946 | + if (Grafreed.clipboardIsTempGroup) |
---|
4325 | 4947 | tGroup.add/*Child*/(child); |
---|
4326 | 4948 | else |
---|
4327 | | - GrafreeD.clipboard = child; |
---|
| 4949 | + Grafreed.clipboard = child; |
---|
4328 | 4950 | } |
---|
4329 | 4951 | |
---|
4330 | 4952 | //ResetModel(); |
---|
.. | .. |
---|
4356 | 4978 | //System.out.println("cut " + elem); |
---|
4357 | 4979 | //System.out.println("parent = " + elem.parent); |
---|
4358 | 4980 | // tmp.addChild(elem); |
---|
4359 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4981 | + if (Grafreed.clipboardIsTempGroup) |
---|
4360 | 4982 | tGroup.add/*Child*/(tmp); |
---|
4361 | 4983 | else |
---|
4362 | | - GrafreeD.clipboard = tmp; |
---|
| 4984 | + Grafreed.clipboard = tmp; |
---|
4363 | 4985 | } |
---|
4364 | 4986 | else |
---|
4365 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4987 | + if (Grafreed.clipboardIsTempGroup) |
---|
4366 | 4988 | tGroup.add/*Child*/(child); |
---|
4367 | 4989 | else |
---|
4368 | | - GrafreeD.clipboard = child; |
---|
| 4990 | + Grafreed.clipboard = child; |
---|
4369 | 4991 | } |
---|
4370 | 4992 | |
---|
4371 | 4993 | } |
---|
4372 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4373 | | - GrafreeD.clipboard = tGroup; |
---|
| 4994 | + |
---|
| 4995 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4996 | + Grafreed.clipboard = tGroup; |
---|
| 4997 | + |
---|
4374 | 4998 | if (cut) |
---|
4375 | 4999 | { |
---|
4376 | 5000 | ResetModel(); |
---|
.. | .. |
---|
4380 | 5004 | |
---|
4381 | 5005 | void paste(boolean expand) |
---|
4382 | 5006 | { |
---|
| 5007 | + if (Globals.REPLACEONMAKE) |
---|
| 5008 | + Save(); |
---|
| 5009 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5010 | + Globals.REPLACEONMAKE = false; |
---|
4383 | 5011 | // if (GrafreeD.clipboard == null) |
---|
4384 | 5012 | // return; |
---|
4385 | 5013 | boolean first = true; |
---|
4386 | 5014 | |
---|
4387 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5015 | + if (Grafreed.clipboardIsTempGroup) |
---|
4388 | 5016 | { |
---|
4389 | 5017 | Composite temp; |
---|
4390 | 5018 | |
---|
.. | .. |
---|
4395 | 5023 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4396 | 5024 | */ |
---|
4397 | 5025 | Object3D elem; |
---|
4398 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5026 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4399 | 5027 | { |
---|
4400 | 5028 | Object3D child = (Object3D)e.nextElement(); |
---|
4401 | 5029 | |
---|
.. | .. |
---|
4429 | 5057 | //Object3D cb = Applet3D.clipboard; |
---|
4430 | 5058 | //temp.addChild(cb); |
---|
4431 | 5059 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4432 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4433 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4434 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4435 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4436 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5060 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5061 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5062 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5063 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5064 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4437 | 5065 | else |
---|
4438 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4439 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5066 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5067 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4440 | 5068 | } |
---|
4441 | 5069 | |
---|
| 5070 | + Globals.REPLACEONMAKE = keep; |
---|
4442 | 5071 | ResetModel(); |
---|
4443 | 5072 | refreshContents(); |
---|
4444 | 5073 | } |
---|
.. | .. |
---|
4485 | 5114 | { |
---|
4486 | 5115 | boolean first = true; |
---|
4487 | 5116 | |
---|
4488 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5117 | + if (Grafreed.clipboardIsTempGroup) |
---|
4489 | 5118 | { |
---|
4490 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5119 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4491 | 5120 | Object3D copy; |
---|
4492 | 5121 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4493 | 5122 | { |
---|
.. | .. |
---|
4497 | 5126 | } |
---|
4498 | 5127 | } else |
---|
4499 | 5128 | { |
---|
4500 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5129 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4501 | 5130 | } |
---|
4502 | 5131 | } |
---|
4503 | 5132 | } |
---|
.. | .. |
---|
4574 | 5203 | |
---|
4575 | 5204 | void group(Object3D csg, boolean grab) |
---|
4576 | 5205 | { |
---|
| 5206 | + if (Globals.REPLACEONMAKE) |
---|
| 5207 | + Save(); |
---|
| 5208 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5209 | + Globals.REPLACEONMAKE = false; |
---|
4577 | 5210 | if (//false) // why?? |
---|
4578 | 5211 | !group.selection.isEmpty()) |
---|
4579 | 5212 | { |
---|
.. | .. |
---|
4687 | 5320 | //node.add(csg); |
---|
4688 | 5321 | //makeSomething(node); |
---|
4689 | 5322 | makeSomething(csg); |
---|
| 5323 | + Globals.REPLACEONMAKE = keep; |
---|
4690 | 5324 | } |
---|
4691 | 5325 | |
---|
4692 | 5326 | void Ungroup(Object3D g) |
---|
4693 | 5327 | { |
---|
| 5328 | + if (Globals.REPLACEONMAKE) |
---|
| 5329 | + Save(); |
---|
| 5330 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5331 | + Globals.REPLACEONMAKE = false; |
---|
4694 | 5332 | if (g instanceof HiddenObject) |
---|
4695 | 5333 | { |
---|
4696 | 5334 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4707 | 5345 | objEditor.makeSomething(g.get(i), false); |
---|
4708 | 5346 | } |
---|
4709 | 5347 | } |
---|
| 5348 | + Globals.REPLACEONMAKE = keep; |
---|
4710 | 5349 | } |
---|
4711 | 5350 | |
---|
4712 | 5351 | void ungroup() |
---|
.. | .. |
---|
4902 | 5541 | } |
---|
4903 | 5542 | */ |
---|
4904 | 5543 | |
---|
4905 | | - void ImportGFD() |
---|
4906 | | - { |
---|
4907 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4908 | | - browser.show(); |
---|
4909 | | - String filename = browser.getFile(); |
---|
4910 | | - if (filename != null && filename.length() > 0) |
---|
4911 | | - { |
---|
4912 | | - String fullname = browser.getDirectory() + filename; |
---|
4913 | | - |
---|
4914 | | - //Object3D readobj = |
---|
4915 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4916 | | - //makeSomething(readobj); |
---|
4917 | | - } |
---|
4918 | | - } |
---|
4919 | | - |
---|
4920 | 5544 | /* |
---|
4921 | 5545 | public void Callback(Object obj) |
---|
4922 | 5546 | { |
---|
.. | .. |
---|
4940 | 5564 | } |
---|
4941 | 5565 | */ |
---|
4942 | 5566 | |
---|
4943 | | - void ImportVRMLX3D() |
---|
4944 | | - { |
---|
4945 | | - if (GrafreeD.standAlone) |
---|
4946 | | - { |
---|
4947 | | - /**/ |
---|
4948 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4949 | | - browser.show(); |
---|
4950 | | - String filename = browser.getFile(); |
---|
4951 | | - if (filename != null && filename.length() > 0) |
---|
4952 | | - { |
---|
4953 | | - String fullname = browser.getDirectory() + filename; |
---|
4954 | | - LoadVRMLX3D(fullname); |
---|
4955 | | - } |
---|
4956 | | - /**/ |
---|
4957 | | - } |
---|
4958 | | - } |
---|
4959 | | - |
---|
4960 | 5567 | String GetFile(String dialogName) |
---|
4961 | 5568 | { |
---|
4962 | | - if (GrafreeD.standAlone) |
---|
| 5569 | + if (Grafreed.standAlone) |
---|
4963 | 5570 | { |
---|
4964 | 5571 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4965 | 5572 | browser.show(); |
---|
.. | .. |
---|
5027 | 5634 | cButton clearpanelButton; |
---|
5028 | 5635 | cButton unselectButton; |
---|
5029 | 5636 | |
---|
| 5637 | + cButton restoreCameraButton; |
---|
| 5638 | + |
---|
| 5639 | + cButton saveButton; |
---|
5030 | 5640 | cButton oneStepButton; |
---|
| 5641 | + |
---|
| 5642 | + cButton groupButton; |
---|
| 5643 | + cButton ungroupButton; |
---|
| 5644 | + cButton compositeButton; |
---|
| 5645 | + cButton switchButton; |
---|
| 5646 | + cButton loopButton; |
---|
| 5647 | + cButton textureButton; |
---|
| 5648 | + |
---|
| 5649 | + cButton gridButton; |
---|
| 5650 | + cButton boxButton; |
---|
| 5651 | + cButton sphereButton; |
---|
| 5652 | + cButton coneButton; |
---|
| 5653 | + cButton torusButton; |
---|
| 5654 | + cButton superButton; |
---|
| 5655 | + cButton kleinButton; |
---|
| 5656 | + cButton particlesButton; |
---|
| 5657 | + cButton overlayButton; |
---|
| 5658 | + cButton lightButton; |
---|
5031 | 5659 | |
---|
5032 | 5660 | cButton screenfitButton; |
---|
5033 | 5661 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5040 | 5668 | |
---|
5041 | 5669 | cButton setsupportButton; |
---|
5042 | 5670 | |
---|
5043 | | - cButton twoButton; |
---|
5044 | | - cButton sixButton; |
---|
5045 | | - cButton threeButton; |
---|
5046 | | - cButton sevenButton; |
---|
5047 | | - cButton fourButton; // full panel |
---|
5048 | | - cButton oneButton; // full XYZ |
---|
5049 | | - //cButton currentLayout; |
---|
5050 | | - |
---|
5051 | 5671 | // |
---|
5052 | 5672 | //Composite |
---|
5053 | 5673 | Object3D // to do !! |
---|
.. | .. |
---|
5057 | 5677 | //JTree jTree; |
---|
5058 | 5678 | private MenuItem lookAtItem; |
---|
5059 | 5679 | private MenuItem lookFromItem; |
---|
5060 | | - private MenuItem switchItem; |
---|
| 5680 | + private MenuItem switchViewItem; |
---|
5061 | 5681 | private MenuItem cutItem; |
---|
5062 | | - private MenuItem duplicateItem; |
---|
| 5682 | + private MenuItem undoItem; |
---|
| 5683 | + private MenuItem redoItem; |
---|
| 5684 | + private JMenuItem duplicateItem; |
---|
5063 | 5685 | private MenuItem cloneItem; |
---|
5064 | 5686 | private MenuItem cloneSupportItem; |
---|
5065 | 5687 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5072 | 5694 | private MenuItem linkverticesItem; |
---|
5073 | 5695 | private MenuItem relinkverticesItem; |
---|
5074 | 5696 | private MenuItem setMasterItem; |
---|
5075 | | - private MenuItem resetMeshItem; |
---|
| 5697 | + private MenuItem resetAllItem; |
---|
5076 | 5698 | private MenuItem stepAllItem; |
---|
5077 | 5699 | private MenuItem revertMeshItem; |
---|
5078 | 5700 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5087 | 5709 | private MenuItem pasteLinkItem; |
---|
5088 | 5710 | private MenuItem pasteCloneItem; |
---|
5089 | 5711 | private MenuItem pasteExpandItem; |
---|
5090 | | - private MenuItem clearItem; |
---|
| 5712 | + private MenuItem deleteItem; |
---|
5091 | 5713 | private MenuItem clearAllItem; |
---|
5092 | 5714 | private MenuItem genUVItem; |
---|
5093 | 5715 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5122 | 5744 | private MenuItem showleavesItem; |
---|
5123 | 5745 | private MenuItem markleavesItem; |
---|
5124 | 5746 | private MenuItem unmarkleavesItem; |
---|
| 5747 | + private MenuItem rewindleavesItem; |
---|
| 5748 | + private MenuItem unrewindleavesItem; |
---|
| 5749 | + private MenuItem randomleavesItem; |
---|
| 5750 | + private MenuItem unrandomleavesItem; |
---|
5125 | 5751 | |
---|
5126 | 5752 | private MenuItem flipVItem; |
---|
5127 | 5753 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5133 | 5759 | private MenuItem panoTexturesItem; |
---|
5134 | 5760 | |
---|
5135 | 5761 | private MenuItem resetCentroidItem; |
---|
5136 | | - private MenuItem transformgeometryItem; |
---|
| 5762 | + private MenuItem resetCentroidXZItem; |
---|
5137 | 5763 | private MenuItem resetTransformItem; |
---|
| 5764 | + private MenuItem transformGeometryItem; |
---|
| 5765 | + private MenuItem transformChildrenItem; |
---|
5138 | 5766 | private MenuItem hideItem; |
---|
5139 | 5767 | private MenuItem grabItem; |
---|
5140 | 5768 | private MenuItem backItem; |
---|
5141 | 5769 | private MenuItem frontItem; |
---|
5142 | 5770 | private MenuItem cameraItem; |
---|
5143 | 5771 | private MenuItem compositeItem; |
---|
5144 | | - private MenuItem randomItem; |
---|
| 5772 | + private MenuItem switchItem; |
---|
5145 | 5773 | private MenuItem physicsItem; |
---|
5146 | 5774 | private MenuItem frameselectorItem; |
---|
5147 | 5775 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5203 | 5831 | private MenuItem doubleItem; |
---|
5204 | 5832 | private MenuItem tripleItem; |
---|
5205 | 5833 | |
---|
5206 | | - private MenuItem importGFDItem; |
---|
5207 | | - private MenuItem importVRMLX3DItem; |
---|
5208 | | - private MenuItem import3DSItem; |
---|
5209 | | - private MenuItem importOBJItem; |
---|
5210 | | - |
---|
5211 | 5834 | private MenuItem computeAOItem; |
---|
5212 | 5835 | private MenuItem recompileItem; |
---|
5213 | 5836 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5217 | 5840 | private MenuItem analyzeItem; |
---|
5218 | 5841 | private MenuItem dumpItem; |
---|
5219 | 5842 | //boolean freezemodel = false; |
---|
| 5843 | + |
---|
| 5844 | + Menu cameraMenu; |
---|
| 5845 | + MenuItem editCameraItem; |
---|
| 5846 | + MenuItem restoreCameraItem; |
---|
5220 | 5847 | } |
---|