Normand Briere
2019-07-27 1af7d3700724834e40ad8636bc9a56cdc3b19b15
GroupEditor.java
....@@ -60,6 +60,12 @@
6060 this.copy = this.group = group;
6161 //selectees = this.group.selectees;
6262
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6369 if(ui)
6470 SetupUI(objEditor);
6571 }
....@@ -74,16 +80,28 @@
7480 this.copy = this.group = copy;
7581 //selectees = this.group.selectees;
7682
77
- SetupMenu2(objEditor);
83
+ SetupMenu2(this); //objEditor);
7884 SetupUI2(objEditor);
7985 objEditor.SetupUI(true);
8086 SetupViews(objEditor);
8187
8288 ((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
+ }
8397 }
8498
8599 void CloneSelection(boolean supports)
86100 {
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
87105 // Object3D keep = GrafreeD.clipboard;
88106 //Object3D obj;
89107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +112,19 @@
94112
95113 makeSomething(clone, i==group.selection.size()-1);
96114 }
115
+ Globals.REPLACEONMAKE = keep;
97116 }
98117
99118 void CloneClipboard(boolean supports)
100119 {
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));
106125 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;
109128 }
110129
111130 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +138,7 @@
119138 // obj.support = null;
120139 if (!supports)
121140 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
141
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123142 obj.parent = parent;
124143 // obj.support = support;
125144 // clone.support = support; // aout 2013
....@@ -148,30 +167,29 @@
148167
149168 //JTextField nameField;
150169
151
- void SetupMenu2(ObjEditor oe)
170
+ void SetupMenu2(GroupEditor oe)
152171 {
153
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
156
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
157
- oe.cameraMenu.add("-");
158
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
159
- openWindowItem.addActionListener(this);
160
- editLeafItem.addActionListener(this);
161
- lookAtItem.addActionListener(this);
162
- //lookFromItem.addActinoListener(this);
163
- //switchItem.addActionListener(this);
172
+ oe.jTree = new cTree();
173
+
164174 Menu menu;
165175 oe.menuBar.add(menu = new Menu("Edit"));
166176 //editItem = menu.add(new MenuItem("Edit"));
167177 //editItem.addActionListener(this);
168
- 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"));
169185 duplicateItem.addActionListener(this);
170
- menu.add("-");
171186 cloneItem = menu.add(new MenuItem("Clone"));
172187 cloneItem.addActionListener(this);
188
+ if (Globals.ADVANCED)
189
+ {
173190 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174191 cloneSupportItem.addActionListener(this);
192
+ }
175193 menu.add("-");
176194 cutItem = menu.add(new MenuItem("Cut"));
177195 cutItem.addActionListener(this);
....@@ -179,27 +197,123 @@
179197 copyItem.addActionListener(this);
180198 pasteItem = menu.add(new MenuItem("Paste"));
181199 pasteItem.addActionListener(this);
200
+
201
+ menu.add("-");
202
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
203
+ pasteIntoItem.addActionListener(this);
182204 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183205 pasteLinkItem.addActionListener(this);
184206 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185207 pasteCloneItem.addActionListener(this);
186208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187209 // pasteExpandItem.addActionListener(this);
188
- clearItem = menu.add(new MenuItem("Clear"));
189
- clearItem.addActionListener(this);
210
+ menu.add("-");
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
213
+
214
+ if (Globals.ADVANCED)
215
+ {
216
+ // Deletes the cameras...
190217 clearAllItem = menu.add(new MenuItem("Clear All"));
191218 clearAllItem.addActionListener(this);
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());
192256
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
+
193308 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
309
+ if (Globals.ADVANCED)
310
+ {
198311 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199312 revertMeshItem.addActionListener(this);
200313 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201314 resetreferencesItem.addActionListener(this);
202315 menu.add("-");
316
+ }
203317 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204318 overwriteGeoItem.addActionListener(this);
205319 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,79 +325,104 @@
211325 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212326 overwriteUVItem.addActionListener(this);
213327 menu.add("-");
328
+ if (Globals.ADVANCED)
329
+ {
214330 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215331 generateMeshItem.addActionListener(this);
216332 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217333 poseMeshItem.addActionListener(this);
218334 menu.add("-");
335
+ }
219336 resetsupportItem = menu.add(new MenuItem("Reset support"));
220337 resetsupportItem.addActionListener(this);
221338 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222339 linkverticesItem.addActionListener(this);
223340 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224341 relinkverticesItem.addActionListener(this);
342
+
343
+ if (Globals.ADVANCED)
344
+ {
225345 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226346 setMasterItem.addActionListener(this);
347
+ }
227348
228349 oe.menuBar.add(menu = new Menu("Group"));
229
- grabItem = menu.add(new MenuItem("Grab"));
230
- grabItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
231352 backItem = menu.add(new MenuItem("Back"));
232353 backItem.addActionListener(this);
233354 frontItem = menu.add(new MenuItem("Front"));
234355 frontItem.addActionListener(this);
235
- compositeItem = menu.add(new MenuItem("Composite"));
236
- compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
356
+// compositeItem = menu.add(new MenuItem("Composite"));
357
+// compositeItem.addActionListener(this);
358
+
359
+ if (Globals.ADVANCED)
360
+ {
361
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238362 hideItem.addActionListener(this);
363
+ }
239364 ungroupItem = menu.add(new MenuItem("Ungroup"));
240365 ungroupItem.addActionListener(this);
241
- menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
243
- randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
248373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249374 switchGeoItem.addActionListener(this);
250375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251376 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
377
+ morphItem = menu.add(new MenuItem("Morph Group"));
253378 morphItem.addActionListener(this);
379
+
380
+ menu.add("-");
381
+ physicsItem = menu.add(new MenuItem("Physics"));
382
+ physicsItem.addActionListener(this);
383
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
384
+ frameselectorItem.addActionListener(this);
254385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255386 scriptNodeItem.addActionListener(this);
256
- cameraItem = menu.add(new MenuItem("Camera"));
257
- cameraItem.addActionListener(this);
387
+ }
258388
259389 oe.menuBar.add(menu = new Menu("Object"));
260
- textureItem = menu.add(new MenuItem("Texture"));
261
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
262392 billboardItem = menu.add(new MenuItem("Billboard"));
263393 billboardItem.addActionListener(this);
264394 csgItem = menu.add(new MenuItem("CSG"));
265395 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267397 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269399 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
405
+ if (Globals.ADVANCED)
406
+ {
407
+ menu.add("-");
272408 linkerItem = menu.add(new MenuItem("Linker"));
273409 linkerItem.addActionListener(this);
274410 templateItem = menu.add(new MenuItem("Template"));
275411 templateItem.addActionListener(this);
276
- attributeItem = menu.add(new MenuItem("Attribute"));
277
- attributeItem.addActionListener(this);
278412 pointflowItem = menu.add(new MenuItem("Point Flow"));
279413 pointflowItem.addActionListener(this);
414
+ }
280415 menu.add("-");
281416 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282417 resetTransformItem.addActionListener(this);
283418 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284419 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- 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);
287426
288427 oe.menuBar.add(menu = new Menu("Geometry"));
289428 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +433,11 @@
294433 genNormalsCADItem.addActionListener(this);
295434 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296435 genNormalsMESHItem.addActionListener(this);
297
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
298439 genNormalsMINEItem.addActionListener(this);
440
+ }
299441 stripifyItem = menu.add(new MenuItem("Stripify"));
300442 stripifyItem.addActionListener(this);
301443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +459,34 @@
317459 reduce34MeshItem.addActionListener(this);
318460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319461 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
324470
325471 oe.menuBar.add(menu = new Menu("Attributes"));
326472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327473 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);
328478 menu.add("-");
329479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330480 liveleavesItem.addActionListener(this);
331481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
333485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334486 supportleavesItem.addActionListener(this);
335487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336488 unsupportleavesItem.addActionListener(this);
489
+ }
337490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338491 hideleavesItem.addActionListener(this);
339492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +495,14 @@
342495 markleavesItem.addActionListener(this);
343496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344497 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);
345506 menu.add("-");
346507 flipVItem = menu.add(new MenuItem("Flip V"));
347508 flipVItem.addActionListener(this);
....@@ -367,45 +528,56 @@
367528 attachBumpItem.addActionListener(this);
368529 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
369530 pigmentBumpItem.addActionListener(this);
531
+ //embedTexturesItem
370532 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
371533 detachPigmentItem.addActionListener(this);
372534 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
373535 detachBumpItem.addActionListener(this);
536
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
537
+ embedTexturesItem.addActionListener(this);
538
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
539
+ deEmbedTexturesItem.addActionListener(this);
374540 menu.add("-");
375541 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
376542 sortbysizeItem.addActionListener(this);
377543 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378544 sortbynameItem.addActionListener(this);
379545 menu.add("-");
546
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
547
+ shareGeometriesItem.addActionListener(this);
548
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
549
+ mergeGeometriesItem.addActionListener(this);
550
+ if (Globals.ADVANCED)
551
+ {
552
+ // Pretty much the same as duplicate and clone.
380553 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381554 extractGeometriesItem.addActionListener(this);
382555 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383556 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
557
+ }
388558
389559 oe.menuBar.add(menu = new Menu("Insert"));
390560 buildCreateMenu(menu);
391561
392
-
393
- oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
399
- importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
401
- import3DSItem.addActionListener(this);
402
-
403562 oe.menuBar.add(menu = new Menu("Tools"));
404563 buildToolsMenu(menu);
405564 }
406565
566
+
407567 void SetupUI2(ObjEditor oe)
408568 {
569
+ // June 2019
570
+ if (oe == null)
571
+ {
572
+ //super.SetupUI2(this);
573
+ //return;
574
+ }
575
+
576
+ if (copy != group)
577
+ {
578
+ //super.SetupUI2(this);
579
+ }
580
+
409581 //new Exception().printStackTrace();
410582
411583 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -434,110 +606,231 @@
434606 oe.radioPanel.add(dummyButton);
435607 oe.buttonGroup.add(dummyButton);
436608 */
437
- aConstraints.gridy += 1;
609
+ cGridBag copyOptionsPanel = new cGridBag();
610
+
611
+ copyOptionsPanel.preferredHeight = 1;
438612
439613 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
440614
441
- oe.aConstraints.gridwidth = 1;
442
- oe.aConstraints.gridx = 0;
615
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ //minButton.setToolTipText("Minimize window");
617
+ //minButton.addActionListener(this);
443618
444
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
445
- liveCB.setToolTipText("Enabled animation");
446
- liveCB.addItemListener(this);
447
-
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
450
- trackCB.setToolTipText("Enable tracking");
451
- trackCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ if (Globals.ADVANCED)
620
+ {
621
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ maxButton.setToolTipText("Maximize window");
623
+ maxButton.addActionListener(this);
624
+ }
625
+
626
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
627
+ fullButton.setToolTipText("Full-screen window");
628
+ fullButton.addActionListener(this);
629
+
630
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
455631 screenfitButton.setToolTipText("Screen fit");
456632 screenfitButton.addActionListener(this);
457
- oe.aConstraints.gridx += 1;
633
+
634
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ restoreCameraButton.setToolTipText("Restore viewpoint");
636
+ restoreCameraButton.addActionListener(this);
637
+
638
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ saveButton.setToolTipText("New version");
640
+ saveButton.addActionListener(this);
641
+
642
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643
+ undoButton.setToolTipText("Previous version");
644
+ undoButton.addActionListener(this);
645
+ undoButton.setEnabled(false);
646
+
647
+ cGridBag updown = new cGridBag().setVertical(true);
648
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ restoreButton.setToolTipText("Restore current");
650
+ restoreButton.addActionListener(this);
651
+ restoreButton.setEnabled(false);
652
+
653
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ replaceButton.setToolTipText("Replace current");
655
+ replaceButton.addActionListener(this);
656
+ replaceButton.setEnabled(false);
657
+
658
+ copyOptionsPanel.add(updown);
659
+
660
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ redoButton.setToolTipText("Next version");
662
+ redoButton.addActionListener(this);
663
+ redoButton.setEnabled(false);
664
+
665
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
666
+ liveCB.setToolTipText("Enable animation");
667
+ liveCB.addItemListener(this);
668
+
669
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ oneStepButton.setToolTipText("Animate one step forward");
671
+ oneStepButton.addActionListener(this);
672
+
673
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
674
+ fastCB.setToolTipText("Fast mode");
675
+ fastCB.addItemListener(this);
676
+
677
+ //oe.toolboxPanel.Return();
678
+
679
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
680
+// trackCB.setToolTipText("Enable tracking");
681
+// trackCB.addItemListener(this);
682
+
458683 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
459684 // screenfitpointButton.addActionListener(this);
460
-// oe.aConstraints.gridx += 1;
461
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
462
- snapobjectButton.addActionListener(this);
463
- snapobjectButton.setToolTipText("Snap Object");
464
- oe.aConstraints.gridx += 1;
465685
466
- //aConstraints.gridx = 0;
467
- //aConstraints.gridy += 1;
468
- oe.aConstraints.weighty = 0;
469
- oe.aConstraints.gridwidth = 1;
470
-
471
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
472
- flashSelectionButton.setToolTipText("Show selection");
473
- flashSelectionButton.addActionListener(this);
474
-
475
- oe.toolbarPanel.add(new cButton(" ", false));
476
-
477
- oe.aConstraints.gridx += 1;
478
- oe.aConstraints.weighty = 0;
479
- oe.aConstraints.gridwidth = 1;
480
-
481
- //
482
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
483
- twoButton.setToolTipText("Show center view only");
484
- twoButton.addActionListener(this);
485
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
686
+ if (Globals.ADVANCED)
687
+ {
688
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
+ snapobjectButton.addActionListener(this);
690
+ snapobjectButton.setToolTipText("Snap Object");
691
+
692
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
486693 fourButton.addActionListener(this);
487
- fourButton.setToolTipText("Show left panel only");
488
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
489
- sixButton.setToolTipText("2-column layout left");
490
- sixButton.addActionListener(this);
491
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
492
- threeButton.setToolTipText("2-column layout right");
694
+ fourButton.setToolTipText("Show control panel only");
695
+ }
696
+
697
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
698
+
699
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ twoButton.setToolTipText("Show 3D view only");
701
+ twoButton.addActionListener(this);
702
+ this.fullscreenLayout = twoButton;
703
+
704
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ threeButton.setToolTipText("Show controls and 3D view");
493706 threeButton.addActionListener(this);
494
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
495
- sevenButton.setToolTipText("3-column layout");
496
- sevenButton.addActionListener(this);
707
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ sixButton.setToolTipText("Show 3D view and controls");
709
+ sixButton.addActionListener(this);
710
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+// sevenButton.setToolTipText("3-column layout");
712
+// sevenButton.addActionListener(this);
497713 //
498714
499
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
500
- rootButton.setToolTipText("Edit object in new tab");
715
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
716
+ rootButton.setToolTipText("Open selection in new tab");
501717 rootButton.addActionListener(this);
502
- oe.aConstraints.gridx += 1;
503
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
718
+
719
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504720 closeButton.setToolTipText("Close tab");
505721 closeButton.addActionListener(this);
506722 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
507723 //clearButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509
-
510
- oe.aConstraints.gridx = 1; //
511
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
512
- editButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516724
517
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
725
+ // INSERT
726
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ gridButton.setToolTipText("Create grid");
728
+ gridButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ boxButton.setToolTipText("Create box");
732
+ boxButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ sphereButton.setToolTipText("Create sphere");
736
+ sphereButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ coneButton.setToolTipText("Create cone");
740
+ coneButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ torusButton.setToolTipText("Create torus");
744
+ torusButton.addActionListener(this);
745
+
746
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
747
+ superButton.setToolTipText("Create superellipsoid");
748
+ superButton.addActionListener(this);
749
+
750
+ if (Globals.ADVANCED)
751
+ {
752
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
753
+ kleinButton.setToolTipText("Create Klein bottle");
754
+ kleinButton.addActionListener(this);
755
+ }
756
+
757
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
758
+ particlesButton.setToolTipText("Create particle system");
759
+ particlesButton.addActionListener(this);
760
+
761
+ oe.toolboxPanel.Return();
762
+
763
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ groupButton.setToolTipText("Create group");
765
+ groupButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ compositeButton.setToolTipText("Create composite");
769
+ compositeButton.addActionListener(this);
770
+
771
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
772
+ switchButton.setToolTipText("Create item switcher");
773
+ switchButton.addActionListener(this);
774
+
775
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
776
+ loopButton.setToolTipText("Create loop");
777
+ loopButton.addActionListener(this);
778
+
779
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ textureButton.setToolTipText("Create texture");
781
+ textureButton.addActionListener(this);
782
+
783
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
784
+ overlayButton.setToolTipText("Create overlay");
785
+ overlayButton.addActionListener(this);
786
+
787
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
788
+ lightButton.setToolTipText("Create light");
789
+ lightButton.addActionListener(this);
790
+
791
+ for (int i=6; --i>=0;)
792
+ {
793
+ oe.toolboxPanel.Return();
794
+ oe.toolboxPanel.add(new cGridBag());
795
+ oe.toolboxPanel.add(new cGridBag());
796
+ oe.toolboxPanel.add(new cGridBag());
797
+ oe.toolboxPanel.add(new cGridBag());
798
+ oe.toolboxPanel.add(new cGridBag());
799
+ oe.toolboxPanel.add(new cGridBag());
800
+ oe.toolboxPanel.add(new cGridBag());
801
+ }
802
+
803
+ // EDIT panel
804
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ editButton.setToolTipText("Pin selection controls");
806
+ editButton.addActionListener(this);
807
+
808
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ uneditButton.setToolTipText("Remove selection controls");
518810 uneditButton.addActionListener(this);
519811
520
- oe.aConstraints.gridx += 1;
521
- oe.aConstraints.weighty = 0;
522
- oe.aConstraints.gridwidth = 1;
523
-
524
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
525
- clearPanelButton.addActionListener(this);
526
-
527
- oe.aConstraints.gridx += 1;
528
- oe.aConstraints.weighty = 0;
529
- oe.aConstraints.gridwidth = 1;
530
-
531
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
812
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
813
+ allParamsButton.setToolTipText("Show all controle");
532814 allParamsButton.addActionListener(this);
533815
534
- oe.aConstraints.gridx += 1;
535
- oe.aConstraints.weighty = 0;
536
- oe.aConstraints.gridwidth = 1;
537
-
538
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
816
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
817
+ clearPanelButton.setToolTipText("Clear edit panel");
818
+ clearPanelButton.addActionListener(this);
819
+
820
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
821
+ unselectButton.setToolTipText("Unselect");
539822 unselectButton.addActionListener(this);
540823
824
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
825
+ flashSelectionButton.setToolTipText("Highlight selection");
826
+ flashSelectionButton.addActionListener(this);
827
+
828
+ editCommandsPanel.preferredHeight = 1;
829
+
830
+ SetPinStates(false);
831
+// oe.treePanel.add(commandsPanel);
832
+// oe.treePanel.Return();
833
+
541834 // oe.aConstraints.gridx += 1;
542835 // oe.aConstraints.weighty = 0;
543836 // oe.aConstraints.gridwidth = 1;
....@@ -549,40 +842,25 @@
549842 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
550843 // gcButton.addActionListener(this);
551844
552
- oe.aConstraints.gridx = 0;
553
- oe.aConstraints.gridy += 1;
554
-
555
- //ctrlPanel.add(objList = new List(5, true));
556
- oe.aConstraints.gridwidth = 100;
557
- // oe.aConstraints.gridheight = 100;
558
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
559
- oe.aConstraints.gridheight = 1;
560
- oe.aConstraints.weighty = 0.5;
561
- oe.aConstraints.gridx = 0;
562
- JScrollPane jSP;
845
+ cGridBag jSPPanel = new cGridBag();
846
+
847
+ JScrollPane jSP;
563848 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
564
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
849
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
565850 ResetModel();
566
- oe.aConstraints.weighty = 0.5;
567
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
568
- oe.aConstraints.gridy += 1;
569
- oe.aConstraints.gridwidth = 1;
570
-
571
- oe.aConstraints.weighty = 0;
572
- oe.aConstraints.gridwidth = 2;
573
-
574
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
575
- colorCB.addItemListener(this);
576
- oe.aConstraints.gridx += 2;
577
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
578
- materialCB.addItemListener(this);
579
- oe.aConstraints.gridx += 2;
580
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
581
- textureCB.addItemListener(this);
582
-
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585851
852
+ oe.treePanel.add(jSPPanel);
853
+ oe.treePanel.Return();
854
+
855
+ oe.treePanel.add(copyOptionsPanel);
856
+ oe.treePanel.Return();
857
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
858
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
859
+ sliderPane.preferredHeight = 1;
860
+
861
+// mainPanel.setDividerLocation(0.5); //1.0);
862
+// mainPanel.setResizeWeight(0.5);
863
+
586864 //jList.addListSelectionListener(this);
587865 oe.jTree.addTreeSelectionListener(this);
588866 //jTree.setRootVisible(false);
....@@ -601,53 +879,67 @@
601879 dgr.addDragGestureListener(this);
602880 }catch(Exception e) {}
603881 */
604
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
605883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
606884 }
607885
608886 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
609887 {
610
- //constraints.gridx = 0;
611
- //constraints.gridy = 0;
612
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
- fastCB.setToolTipText("Fast mode");
614
- fastCB.addItemListener(this);
615
- //constraints.gridy += 1;
616
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
617
- supportCB.setToolTipText("Enabled rigging");
618
- supportCB.addItemListener(this);
888
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
889
+ colorCB.setToolTipText("Copy color when dropped");
890
+ colorCB.addItemListener(this);
619891
620
- // constraints.gridy += 1;
892
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
893
+ materialCB.setToolTipText("Copy material when dropped");
894
+ materialCB.addItemListener(this);
895
+
896
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
897
+ textureCB.setToolTipText("Copy texture when dropped");
898
+ textureCB.addItemListener(this);
899
+
900
+ panel.Return();
901
+
902
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
903
+ boxCB.setToolTipText("Display bounding boxes");
904
+ boxCB.addItemListener(this);
905
+
906
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
907
+ zoomBoxCB.setToolTipText("Display only for wheel");
908
+ zoomBoxCB.addItemListener(this);
909
+
910
+ if (true) // Globals.ADVANCED)
911
+ {
912
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
913
+// supportCB.setToolTipText("Enable rigging");
914
+// supportCB.addItemListener(this);
915
+
916
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
917
+ freezeCB.setToolTipText("Fast moving camera");
918
+ freezeCB.addItemListener(this);
919
+
621920 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
622921 // localCB.addItemListener(this);
623922
624
- //constraints.gridy += 1;
923
+ panel.Return();
924
+
625925 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
626926 crowdCB.setToolTipText("Used for crowds");
627927 crowdCB.addItemListener(this);
628928
629
- //constraints.gridy += 1;
630929 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
631930 smoothCB.setToolTipText("Snapping delay");
632931 smoothCB.addItemListener(this);
633932
634
- //constraints.gridy += 1;
635933 panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
636934 slowCB.setToolTipText("Smooth interpolation");
637935 slowCB.addItemListener(this);
638
- //constraints.gridy += 1;
639
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
640
- boxCB.setToolTipText("Display bounding boxes");
641
- boxCB.addItemListener(this);
642
- //constraints.gridy += 1;
643
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
644
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
645
- zoomBoxCB.addItemListener(this);
646
-
936
+
647937 // constraints.gridy += 1;
648938 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
649939 // speakerMocapCB.addItemListener(this);
650940
941
+ panel.Return();
942
+
651943 if (false)
652944 {
653945 // handled in scripts
....@@ -662,36 +954,85 @@
662954 //constraints.gridy += 1;
663955 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
664956 smoothfocusCB.addItemListener(this);
957
+ panel.Return();
665958 }
666959
667960 //constraints.gridx += 1;
668961 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
669962 // debugCB.addItemListener(this);
670963
671
- //constraints.gridy += 1;
964
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
965
+ trackCB.setToolTipText("Enable tracking target");
966
+ trackCB.addItemListener(this);
967
+
672968 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
969
+ oeilCB.setToolTipText("Move camera when tracking");
673970 oeilCB.addItemListener(this);
674971
675
- //constraints.gridy += 1;
972
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
973
+ shadowCB.setToolTipText("When live compute shadows");
974
+ shadowCB.addItemListener(this);
975
+
976
+ panel.Return();
977
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
978
+ toggleTextureCB.setToolTipText("Load textures");
979
+ toggleTextureCB.addItemListener(this);
980
+
981
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
982
+ toggleSwitchCB.setToolTipText("Choose a single item");
983
+ toggleSwitchCB.addItemListener(this);
984
+
985
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
986
+ autokeepCB.setToolTipText("On structure change");
987
+ autokeepCB.addItemListener(this);
988
+
989
+ panel.Return();
990
+ if (Globals.ADVANCED)
991
+ {
676992 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
677993 lookAtCB.setToolTipText("Look-at target");
678994 lookAtCB.addItemListener(this);
995
+ }
996
+
997
+ }
998
+
999
+ cGridBag fill = new cGridBag();
1000
+ fill.preferredHeight = 200;
1001
+ cGridBag fill2 = new cGridBag();
1002
+ fill2.preferredHeight = 200;
1003
+ cGridBag fill3 = new cGridBag();
1004
+ fill3.preferredHeight = 200;
1005
+
1006
+ panel.add(fill);
1007
+ panel.add(fill2);
1008
+ panel.add(fill3);
6791009
6801010 }
6811011
6821012 void EditObject(Object3D obj)
6831013 {
6841014 cRadio radioButton = new cRadio(obj.name);
1015
+
1016
+ // June 2019. Patch to avoid bug with transparency.
1017
+ radioButton.hadMaterial = obj.material != null;
1018
+ if (!radioButton.hadMaterial)
1019
+ {
1020
+ obj.material = new cMaterial();
1021
+ }
1022
+
6851023 radioButton.SetObject(obj);
686
- radioButton.layout = sevenButton;
1024
+ radioButton.layout = sixButton; // sevenButton;
6871025 radioButton.SetCamera(cameraView.renderCamera, false);
6881026 radioButton.addActionListener(this);
6891027 radioPanel.add(radioButton);
6901028 buttonGroup.add(radioButton);
6911029 radioButton.doClick();
6921030 }
1031
+
6931032 void SetupViews(ObjEditor oe)
6941033 {
1034
+ theFrame = this;
1035
+
6951036 oe.SetupViews();
6961037
6971038 System.out.println("SetupViews");
....@@ -700,23 +1041,28 @@
7001041 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7011042 }
7021043
703
- JCheckBox liveCB;
704
- JCheckBox supportCB;
705
- JCheckBox localCB;
706
- JCheckBox crowdCB;
707
- JCheckBox smoothCB;
708
- JCheckBox fastCB;
709
- JCheckBox slowCB;
710
- JCheckBox boxCB;
711
- JCheckBox zoomBoxCB;
712
- JCheckBox trackCB;
713
- JCheckBox smoothfocusCB;
1044
+ cToggleButton liveCB;
1045
+ cCheckBox supportCB;
1046
+ cCheckBox localCB;
1047
+ cCheckBox crowdCB;
1048
+ cCheckBox smoothCB;
1049
+ cToggleButton fastCB;
1050
+ cCheckBox slowCB;
1051
+ cCheckBox boxCB;
1052
+ cCheckBox zoomBoxCB;
1053
+ cCheckBox freezeCB;
1054
+ //cToggleButton trackCB;
1055
+ cCheckBox trackCB;
1056
+ cCheckBox smoothfocusCB;
7141057 // JCheckBox speakerMocapCB;
715
- JCheckBox speakerCameraCB;
716
- JCheckBox speakerFocusCB;
717
- JCheckBox debugCB;
718
- JCheckBox oeilCB;
719
- JCheckBox lookAtCB;
1058
+ cCheckBox speakerCameraCB;
1059
+ cCheckBox speakerFocusCB;
1060
+ cCheckBox debugCB;
1061
+
1062
+ cCheckBox oeilCB;
1063
+ cCheckBox shadowCB;
1064
+ cCheckBox autokeepCB;
1065
+ cCheckBox lookAtCB;
7201066
7211067 // static int COLOR = 1;
7221068 // static int MATERIAL = 2;
....@@ -724,9 +1070,9 @@
7241070
7251071 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7261072
727
- JCheckBox colorCB;
728
- JCheckBox materialCB;
729
- JCheckBox textureCB;
1073
+ cCheckBox colorCB;
1074
+ cCheckBox materialCB;
1075
+ cCheckBox textureCB;
7301076
7311077 public void itemStateChanged(ItemEvent e)
7321078 {
....@@ -754,6 +1100,7 @@
7541100 } else if(e.getSource() == liveCB)
7551101 {
7561102 cameraView.ToggleLive();
1103
+ refreshContents(false);
7571104 }
7581105 else if(e.getSource() == supportCB)
7591106 {
....@@ -818,6 +1165,18 @@
8181165 {
8191166 cameraView.ToggleOeil();
8201167 }
1168
+ else if(e.getSource() == shadowCB)
1169
+ {
1170
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1171
+ }
1172
+ else if(e.getSource() == freezeCB)
1173
+ {
1174
+ Globals.FREEZEONMOVE ^= true;
1175
+ }
1176
+ else if(e.getSource() == autokeepCB)
1177
+ {
1178
+ Globals.REPLACEONMAKE ^= true;
1179
+ }
8211180 else if(e.getSource() == lookAtCB)
8221181 {
8231182 cameraView.ToggleLookAt();
....@@ -834,7 +1193,8 @@
8341193
8351194 /**/
8361195 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
837
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1196
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1197
+ TreePath path = objEditor.jTree.getSelectionPath();
8381198 if ((path == null) || (path.getPathCount() <= 1)) {
8391199 // We can't move the root node or an empty selection
8401200 return;
....@@ -897,8 +1257,6 @@
8971257 }
8981258 }
8991259
900
- String string = (String) object;
901
-
9021260 System.out.println("Transfer = " + object + "; drop : " + target);
9031261 // if( object instanceof java.io.File[])
9041262 // {
....@@ -906,7 +1264,11 @@
9061264 // objEditor.DropFile((java.io.File[]) object, true);
9071265 // return;
9081266 // }
909
- if (string.charAt(0) == '/')
1267
+
1268
+ String string = object.toString();
1269
+
1270
+ // File path for Mac and Windows
1271
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9101272 {
9111273 // file(s)
9121274 String[] names = string.split("\n");
....@@ -933,7 +1295,7 @@
9331295
9341296 flashIt = false;
9351297 CameraPane pane = (CameraPane) target;
936
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1298
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9371299 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9381300
9391301 if (group.selection.size() == 1)
....@@ -949,23 +1311,33 @@
9491311
9501312 assert target == objEditor.jTree;
9511313 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1314
+ Object3D destinationLeaf;
9521315 try {
953
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1316
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9541317 } catch (Exception e) {
9551318 System.out.println("destinationPath : " + destinationPath);
9561319 return;
9571320 }
9581321
959
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1322
+ for (int i=group.selection.size(); --i>=0;)
9601323 {
1324
+ Object3D child = (Object3D)group.selection.elementAt(i);
1325
+
1326
+ // Cannot move into itself
1327
+ if (child == destinationLeaf)
1328
+ return;
1329
+ }
1330
+
1331
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1332
+// {
9611333 loadClipboard(true);
9621334 objEditor.jTree.setSelectionPath(destinationPath);
963
- pasteInto(false);
964
- } else {
965
- loadClipboard(false);
966
- objEditor.jTree.setSelectionPath(destinationPath);
967
- pasteInto(false); // true); // ???
968
- }
1335
+ pasteInto(false, false);
1336
+// } else {
1337
+// loadClipboard(false);
1338
+// objEditor.jTree.setSelectionPath(destinationPath);
1339
+// pasteInto(false, false); // true); // ???
1340
+// }
9691341 }
9701342 public void dropActionChanged(DropTargetDragEvent dtde)
9711343 // Called if the user has modified the current drop gesture
....@@ -1070,85 +1442,107 @@
10701442 {
10711443 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10721444 //heightFieldItem.addActionListener(this);
1073
- gridItem = menu.add(new MenuItem("Grid"));
1074
- gridItem.addActionListener(this);
1075
- rectoidItem = menu.add(new MenuItem("Box"));
1076
- rectoidItem.addActionListener(this);
1077
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1078
- ellipsoidItem.addActionListener(this);
1079
- coneItem = menu.add(new MenuItem("Cone"));
1080
- coneItem.addActionListener(this);
1081
- torusItem = menu.add(new MenuItem("Torus"));
1082
- torusItem.addActionListener(this);
1083
- superItem = menu.add(new MenuItem("Superellipsoid"));
1084
- superItem.addActionListener(this);
1445
+// gridItem = menu.add(new MenuItem("Grid"));
1446
+// gridItem.addActionListener(this);
1447
+// rectoidItem = menu.add(new MenuItem("Box"));
1448
+// rectoidItem.addActionListener(this);
1449
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1450
+// ellipsoidItem.addActionListener(this);
1451
+// coneItem = menu.add(new MenuItem("Cone"));
1452
+// coneItem.addActionListener(this);
1453
+// torusItem = menu.add(new MenuItem("Torus"));
1454
+// torusItem.addActionListener(this);
1455
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1456
+// superItem.addActionListener(this);
1457
+
1458
+ cameraItem = menu.add(new MenuItem("Camera"));
1459
+ cameraItem.addActionListener(this);
1460
+
1461
+ if (!Globals.ADVANCED)
1462
+ {
10851463 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10861464 kleinItem.addActionListener(this);
1087
- particleItem = menu.add(new MenuItem("Particle system"));
1088
- particleItem.addActionListener(this);
1465
+ }
1466
+
1467
+// particleItem = menu.add(new MenuItem("Particle system"));
1468
+// particleItem.addActionListener(this);
1469
+ if (Globals.ADVANCED)
1470
+ {
10891471 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10901472 ragdollItem.addActionListener(this);
10911473 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10921474 ragdoll2Item.addActionListener(this);
1475
+ }
10931476 menu.add("-");
1094
- meshItem = menu.add(new MenuItem("Mesh"));
1477
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10951478 meshItem.addActionListener(this);
10961479 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10971480 // meshGroupItem.addActionListener(this);
1481
+ if (Globals.ADVANCED)
1482
+ {
10981483 springItem = menu.add(new MenuItem("Spring"));
10991484 springItem.addActionListener(this);
11001485 flagItem = menu.add(new MenuItem("Flag"));
11011486 flagItem.addActionListener(this);
1102
- bezierItem = menu.add(new MenuItem("Patch"));
1103
- bezierItem.addActionListener(this);
1104
- checkerItem = menu.add(new MenuItem("Checker"));
1105
- checkerItem.addActionListener(this);
11061487 blobItem = menu.add(new MenuItem("Blob"));
11071488 blobItem.addActionListener(this);
11081489 latheItem = menu.add(new MenuItem("Lathe"));
11091490 latheItem.addActionListener(this);
1110
- lightItem = menu.add(new MenuItem("Light"));
1111
- lightItem.addActionListener(this);
1491
+ }
1492
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1493
+ bezierItem.addActionListener(this);
1494
+// overlayItem = menu.add(new MenuItem("Overlay"));
1495
+// overlayItem.addActionListener(this);
1496
+// lightItem = menu.add(new MenuItem("Light"));
1497
+// lightItem.addActionListener(this);
11121498 menu.add("-");
11131499 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11141500 //superLoopItem.addActionListener(this);
1115
- loopItem = menu.add(new MenuItem("Loop"));
1116
- loopItem.addActionListener(this);
1501
+// loopItem = menu.add(new MenuItem("Loop"));
1502
+// loopItem.addActionListener(this);
11171503 doubleItem = menu.add(new MenuItem("Fork"));
11181504 doubleItem.addActionListener(this);
1505
+ if (Globals.ADVANCED)
1506
+ {
11191507 tripleItem = menu.add(new MenuItem("Trident"));
11201508 tripleItem.addActionListener(this);
1509
+ }
11211510 }
11221511
11231512 void buildToolsMenu(Menu menu)
11241513 {
11251514 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11261515 animationItem.addItemListener(this);
1127
- animationItem.setState(CameraPane.ANIMATION);
1516
+ animationItem.setState(Globals.ANIMATION);
1517
+
1518
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1519
+ archiveItem.addActionListener(this);
11281520
11291521 menu.add("-");
11301522 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11311523 parseverticesItem.addActionListener(this);
11321524 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11331525 textureFieldItem.addActionListener(this);
1134
- alignItem = menu.add(new MenuItem("Align"));
1526
+ alignItem = menu.add(new MenuItem("Align Objects"));
11351527 alignItem.addActionListener(this);
1136
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1137
- mirrorItem.addActionListener(this);
11381528 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11391529 reduceMorphItem.addActionListener(this);
11401530 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11411531 reduce34MorphItem.addActionListener(this);
1142
-
1143
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1144
- computeAOItem.addActionListener(this);
11451532 menu.add("-");
1146
-
11471533 menu.add(memoryItem = new MenuItem("Memory Usage"));
11481534 memoryItem.addActionListener(this);
1535
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1536
+ computeAOItem.addActionListener(this);
1537
+
1538
+ if (Globals.ADVANCED)
1539
+ {
1540
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1541
+ mirrorItem.addActionListener(this);
1542
+ menu.add("-");
11491543 menu.add(analyzeItem = new MenuItem("Analyze"));
11501544 analyzeItem.addActionListener(this);
1151
- menu.add(dumpItem = new MenuItem("Dump"));
1545
+ menu.add(dumpItem = new MenuItem("Print"));
11521546 dumpItem.addActionListener(this);
11531547 // menu.add(pathItem = new MenuItem("From-to path"));
11541548 // pathItem.addActionListener(this);
....@@ -1166,6 +1560,7 @@
11661560 menu.add("-");
11671561 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11681562 editScriptItem.addActionListener(this);
1563
+ }
11691564 }
11701565
11711566 void ScreenFit()
....@@ -1288,9 +1683,34 @@
12881683 shadow.material = new cMaterial(obj.material);
12891684 shadow.material.diffuse = 0.0001f;
12901685 shadow.material.specular = 0.0001f;
1686
+ //shadow.projectedVertices[1].x = 300;
12911687
12921688 makeSomething(shadow);
12931689 }
1690
+
1691
+ private void ClearUnpinned()
1692
+ {
1693
+ //for (Object3D obj : listUI)
1694
+ for (int i=listUI.size(); --i>=0;)
1695
+ {
1696
+ Object3D obj = listUI.elementAt(i);
1697
+ if (!obj.pinned)
1698
+ {
1699
+ obj.CloseUI();
1700
+ listUI.remove(i);
1701
+ }
1702
+ }
1703
+ }
1704
+
1705
+ private void EditElement(Object3D elem, boolean newWindow)
1706
+ {
1707
+ // if (!(elem instanceof Composite))
1708
+ // newWindow = false;
1709
+ listUI.add(elem);
1710
+ elem.openEditWindow(this, newWindow); //, false);
1711
+ System.out.println("edit : " + elem);
1712
+ elem.editWindow.refreshContents(true); // ? new
1713
+ }
12941714
12951715 /**
12961716 * applyExample
....@@ -1494,9 +1914,9 @@
14941914
14951915 void Overwrite(int mask)
14961916 {
1497
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14981918 {
1499
- Object3D content = GrafreeD.clipboard.get(0);
1919
+ Object3D content = Grafreed.clipboard.get(0);
15001920
15011921 if (content instanceof cGroup && ((cGroup)content).transientlink )
15021922 content = ((cGroup)content).get(0);
....@@ -1535,7 +1955,7 @@
15351955 {
15361956 ScreenFit();
15371957 } else
1538
- if (source == switchItem)
1958
+ if (source == switchViewItem)
15391959 {
15401960 cVector v1 = new cVector();
15411961 cVector v2 = new cVector();
....@@ -1544,11 +1964,11 @@
15441964 objEditor.cameraView.renderCamera.setAim(v2, v1);
15451965 objEditor.cameraView.repaint();
15461966 } else
1547
- if (source == rectoidItem)
1967
+ if (source == rectoidItem || source == boxButton)
15481968 {
15491969 makeSomething(new Box());
15501970 } else
1551
- if (source == particleItem)
1971
+ if (source == particleItem || source == particlesButton)
15521972 {
15531973 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15541974 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1627,27 +2047,27 @@
16272047
16282048 makeSomething(obj);
16292049 } else
1630
- if (source == gridItem)
2050
+ if (source == gridItem || source == gridButton)
16312051 {
16322052 makeSomething(new Grid());
16332053 } else
1634
- if (source == ellipsoidItem)
2054
+ if (source == ellipsoidItem || source == sphereButton)
16352055 {
16362056 makeSomething(new Sphere());
16372057 } else
1638
- if (source == coneItem)
2058
+ if (source == coneItem || source == coneButton)
16392059 {
16402060 makeSomething(new Cone());
16412061 } else
1642
- if (source == torusItem)
2062
+ if (source == torusItem || source == torusButton)
16432063 {
16442064 makeSomething(new Torus());
16452065 } else
1646
- if (source == superItem)
2066
+ if (source == superItem || source == superButton)
16472067 {
16482068 makeSomething(new Superellipsoid());
16492069 } else
1650
- if (source == kleinItem)
2070
+ if (source == kleinItem || source == kleinButton)
16512071 {
16522072 makeSomething(new Klein());
16532073 } else
....@@ -1667,7 +2087,7 @@
16672087 {
16682088 makeSomething(new BezierSurface());
16692089 } else
1670
- if (source == checkerItem)
2090
+ if (source == overlayItem || source == overlayButton)
16712091 {
16722092 /*
16732093 Object3D obj = new BezierSurface(5,8);
....@@ -1715,7 +2135,7 @@
17152135 s.setup();
17162136 makeSomething(s);
17172137 } else
1718
- if (source == lightItem)
2138
+ if (source == lightItem || source == lightButton)
17192139 {
17202140 makeSomething(new Light());
17212141 } else
....@@ -1765,30 +2185,30 @@
17652185
17662186 group(g);
17672187 } else
1768
- if (source == loopItem)
2188
+ if (source == loopItem || source == loopButton)
17692189 {
17702190 Composite csg = new GroupLeaf();
17712191 csg.count = 5;
17722192 group(csg);
1773
- Composite child = new cGroup();
2193
+ Composite child = new cGroup("Branch");
17742194 csg.addChild(child);
17752195 child.addChild(csg);
17762196 } else
17772197 if (source == doubleItem)
17782198 {
1779
- Composite csg = new GroupLeaf();
2199
+ Composite csg = new GroupLeaf("Fork");
17802200 csg.count = 5;
17812201 group(csg);
1782
- Composite child = new cGroup();
2202
+ Composite child = new cGroup("Branch A");
17832203 csg.addChild(child);
17842204 child.addChild(csg);
1785
- child = new cGroup();
2205
+ child = new cGroup("Branch B");
17862206 csg.addChild(child);
17872207 child.addChild(csg);
17882208 } else
17892209 if (source == tripleItem)
17902210 {
1791
- Composite csg = new GroupLeaf();
2211
+ Composite csg = new GroupLeaf("Trident");
17922212 csg.count = 4;
17932213 group(csg);
17942214 Composite child = new cGroup();
....@@ -1800,23 +2220,6 @@
18002220 child = new cGroup();
18012221 csg.addChild(child);
18022222 child.addChild(csg);
1803
- } else
1804
-
1805
- if (source == importGFDItem)
1806
- {
1807
- ImportGFD();
1808
- } else
1809
- if (source == importVRMLX3DItem)
1810
- {
1811
- ImportVRMLX3D();
1812
- } else
1813
- if (source == import3DSItem)
1814
- {
1815
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1816
- } else
1817
- if (source == importOBJItem)
1818
- {
1819
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18202223 } else
18212224 if (source == computeAOItem)
18222225 {
....@@ -1836,7 +2239,7 @@
18362239 if (source == invariantsItem)
18372240 {
18382241 System.out.println("Invariants:");
1839
- GrafreeD.grafreeD.universe.invariants();
2242
+ Grafreed.grafreeD.universe.invariants();
18402243 } else
18412244 if (source == memoryItem)
18422245 {
....@@ -1855,19 +2258,61 @@
18552258 {
18562259 DumpObject();
18572260 } else
2261
+ if (source == minButton)
2262
+ {
2263
+ Minimize();
2264
+ } else
2265
+ if (source == maxButton)
2266
+ {
2267
+ Maximize();
2268
+ } else
2269
+ if (source == fullButton)
2270
+ {
2271
+ ToggleFullScreen();
2272
+ } else
2273
+ if (source == undoButton)
2274
+ {
2275
+ // Go to previous version
2276
+ //if (!Undo())
2277
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2278
+ Undo();
2279
+ } else
2280
+ if (source == restoreButton)
2281
+ {
2282
+ // Restore current version
2283
+ Restore();
2284
+ } else
2285
+ if (source == replaceButton)
2286
+ {
2287
+ // Overwrite current version
2288
+ Replace();
2289
+ } else
2290
+ if (source == redoButton)
2291
+ {
2292
+ // Go to next version
2293
+ Redo();
2294
+ } else
2295
+ if (source == saveButton)
2296
+ {
2297
+ // Save a new version
2298
+ if (!Save(true))
2299
+ java.awt.Toolkit.getDefaultToolkit().beep();
2300
+ } else
2301
+ if (source == oneStepButton)
2302
+ {
2303
+ Globals.ONESTEP = true;
2304
+ cameraView.repaint();
2305
+ } else
18582306 if (source == screenfitButton)
18592307 {
1860
- //Reload(lastConverter, lastFilename, true);
18612308 ScreenFit();
18622309 } else
18632310 if (source == screenfitpointButton)
18642311 {
1865
- //Reload(lastConverter, lastFilename, true);
18662312 ScreenFitPoint();
18672313 } else
18682314 if (source == snapobjectButton)
18692315 {
1870
- //Reload(lastConverter, lastFilename, true);
18712316 SnapObject();
18722317 } else
18732318 // if (event.getSource() == recompileButton)
....@@ -1904,12 +2349,20 @@
19042349 {
19052350 loadClipboard(true);
19062351 } else
2352
+ if (source == undoItem)
2353
+ {
2354
+ Undo();
2355
+ } else
2356
+ if (source == redoItem)
2357
+ {
2358
+ Redo();
2359
+ } else
19072360 if (source == duplicateItem)
19082361 {
1909
- Object3D keep = GrafreeD.clipboard;
2362
+ Object3D keep = Grafreed.clipboard;
19102363 loadClipboard(false);
19112364 paste(false);
1912
- GrafreeD.clipboard = keep;
2365
+ Grafreed.clipboard = keep;
19132366 } else
19142367 if (source == cloneItem)
19152368 {
....@@ -1927,13 +2380,17 @@
19272380 {
19282381 paste(false);
19292382 } else
2383
+ if (source == pasteIntoItem)
2384
+ {
2385
+ pasteInto(true, false);
2386
+ } else
19302387 if (source == pasteLinkItem)
19312388 {
1932
- pasteInto(false);
2389
+ pasteInto(false, false);
19332390 } else
19342391 if (source == pasteCloneItem)
19352392 {
1936
- pasteInto(true);
2393
+ pasteInto(true, true);
19372394 } else
19382395 if (source == pasteExpandItem)
19392396 {
....@@ -2125,9 +2582,9 @@
21252582 // group.selection.get(0).setMasterThis(content); // should be identity
21262583 // refreshContents();
21272584 // }
2128
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2585
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21292586 {
2130
- Object3D content = GrafreeD.clipboard.get(0);
2587
+ Object3D content = Grafreed.clipboard.get(0);
21312588
21322589 if (content instanceof cGroup && ((cGroup)content).transientlink )
21332590 content = ((cGroup)content).get(0);
....@@ -2135,11 +2592,11 @@
21352592 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21362593 for (int i=0; i<group.selection.size(); i++)
21372594 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2595
+ boolean random = CameraPane.SWITCH;
2596
+ CameraPane.SWITCH = false; // parse all random nodes
21402597 group.selection.get(i).linkVerticesThis(content);
21412598 // group.selection.get(i).setMasterThis(content); // should be identity
2142
- CameraPane.RANDOM = random;
2599
+ CameraPane.SWITCH = random;
21432600 }
21442601 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21452602 refreshContents();
....@@ -2149,20 +2606,20 @@
21492606 {
21502607 for (int i=0; i<group.selection.size(); i++)
21512608 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2609
+ boolean random = CameraPane.SWITCH;
2610
+ CameraPane.SWITCH = false; // parse all random nodes
21542611 group.selection.get(i).linkVerticesThis(null);
2155
- CameraPane.RANDOM = random;
2612
+ CameraPane.SWITCH = random;
21562613 }
21572614
21582615 refreshContents();
21592616 } else
21602617 if (source == relinkverticesItem)
21612618 {
2162
- boolean random = CameraPane.RANDOM;
2163
- CameraPane.RANDOM = false; // parse all random nodes
2619
+ boolean random = CameraPane.SWITCH;
2620
+ CameraPane.SWITCH = false; // parse all random nodes
21642621 group.selection.RelinkToSupport();
2165
- CameraPane.RANDOM = random;
2622
+ CameraPane.SWITCH = random;
21662623
21672624 refreshContents();
21682625 } else
....@@ -2177,9 +2634,9 @@
21772634 } else
21782635 if (source == setMasterItem)
21792636 {
2180
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2637
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21812638 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2639
+ Object3D content = Grafreed.clipboard.get(0);
21832640
21842641 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852642 content = ((cGroup)content).get(0);
....@@ -2192,9 +2649,9 @@
21922649 {
21932650 if (group.selection.size() == 1)
21942651 {
2195
- if (GrafreeD.clipboard.size() == 1)
2652
+ if (Grafreed.clipboard.size() == 1)
21962653 {
2197
- Object3D content = GrafreeD.clipboard.get(0);
2654
+ Object3D content = Grafreed.clipboard.get(0);
21982655
21992656 if (content instanceof cGroup && ((cGroup)content).transientlink )
22002657 content = ((cGroup)content).get(0);
....@@ -2211,7 +2668,7 @@
22112668 {
22122669 RevertMeshes();
22132670 } else
2214
- if (source == resetMeshItem)
2671
+ if (source == resetAllItem)
22152672 {
22162673 ResetAll();
22172674 } else
....@@ -2219,7 +2676,7 @@
22192676 {
22202677 StepAll();
22212678 } else
2222
- if (source == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
22232680 {
22242681 //int indices[] = jList.getSelectedIndices();
22252682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2231,9 +2688,9 @@
22312688 {
22322689 ClearSelection(true);
22332690 } else
2234
- if (source == grabItem)
2691
+ if (source == grabItem || source == groupButton)
22352692 {
2236
- group(new cGroup(), true);
2693
+ group(new cGroup(), false); // true);
22372694 } else
22382695 if (source == hideItem)
22392696 {
....@@ -2251,16 +2708,16 @@
22512708 {
22522709 makeSomething(new Camera());
22532710 } else
2254
- if (source == compositeItem)
2711
+ if (source == compositeItem || source == compositeButton)
22552712 {
22562713 group(new Composite());
22572714 } else
2258
- if (source == randomItem)
2715
+ if (source == switchItem || source == switchButton)
22592716 {
22602717 RandomNode random = new RandomNode();
22612718 group(random);
22622719 if (random.size() > 0)
2263
- random.name = random.get(0).name + "Rnd";
2720
+ random.name = random.get(0).name + "Switch";
22642721 } else
22652722 if (source == physicsItem)
22662723 {
....@@ -2357,7 +2814,7 @@
23572814 {
23582815 group(new cLinker());
23592816 } else
2360
- if (source == textureItem)
2817
+ if (source == textureItem || source == textureButton)
23612818 {
23622819 group(new TextureNode());
23632820 } else
....@@ -2377,17 +2834,30 @@
23772834 {
23782835 CastShadow(2);
23792836 } else
2380
- if (source == ungroupItem)
2837
+ if (source == ungroupItem || source == ungroupButton)
23812838 {
2382
- //ungroup();
2839
+ boolean hasRoot = false;
2840
+
23832841 for (int i=0; i<group.selection.size(); i++)
23842842 {
2385
- Ungroup(group.selection.get(i));
2843
+ if (group.selection.get(i) == group)
2844
+ {
2845
+ hasRoot = true;
2846
+ break;
2847
+ }
23862848 }
23872849
2388
- ClearSelection(false);
2389
-
2390
- refreshContents();
2850
+ if (!hasRoot)
2851
+ {
2852
+ for (int i=0; i<group.selection.size(); i++)
2853
+ {
2854
+ Ungroup(group.selection.get(i));
2855
+ }
2856
+
2857
+ ClearSelection(false);
2858
+
2859
+ refreshContents();
2860
+ }
23912861 } else
23922862 if (source == genUVItem)
23932863 {
....@@ -2399,7 +2869,7 @@
23992869 } else
24002870 if (source == genNormalsMESHItem)
24012871 {
2402
- GenNormals(true); // TODO
2872
+ GenNormalsMESH();
24032873 } else
24042874 if (source == genNormalsORGANItem)
24052875 {
....@@ -2464,6 +2934,22 @@
24642934 if (source == unmarkleavesItem)
24652935 {
24662936 MarkLeaves(false);
2937
+ } else
2938
+ if (source == rewindleavesItem)
2939
+ {
2940
+ RewindLeaves(true);
2941
+ } else
2942
+ if (source == unrewindleavesItem)
2943
+ {
2944
+ RewindLeaves(false);
2945
+ } else
2946
+ if (source == randomleavesItem)
2947
+ {
2948
+ RandomLeaves(true);
2949
+ } else
2950
+ if (source == unrandomleavesItem)
2951
+ {
2952
+ RandomLeaves(false);
24672953 } else
24682954 if (source == flipVItem)
24692955 {
....@@ -2549,9 +3035,13 @@
25493035 {
25503036 SmoothMesh();
25513037 } else
2552
- if (source == transformgeometryItem)
3038
+ if (source == transformGeometryItem)
25533039 {
25543040 TransformGeometry();
3041
+ } else
3042
+ if (source == transformChildrenItem)
3043
+ {
3044
+ TransformChildren();
25553045 } else
25563046 if (source == resetTransformItem)
25573047 {
....@@ -2559,7 +3049,11 @@
25593049 } else
25603050 if (source == resetCentroidItem)
25613051 {
2562
- ResetCentroid();
3052
+ ResetCentroid(true);
3053
+ } else
3054
+ if (source == resetCentroidXZItem)
3055
+ {
3056
+ ResetCentroid(false);
25633057 } else
25643058 if (source == resetParentItem)
25653059 {
....@@ -2664,7 +3158,7 @@
26643158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26653159 {
26663160 obj = (Object3D)e.nextElement();
2667
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
26683162 }
26693163
26703164 refreshContents();
....@@ -2680,6 +3174,31 @@
26803174
26813175 refreshContents();
26823176 } else
3177
+ if (source == embedTexturesItem)
3178
+ {
3179
+ Object3D obj;
3180
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3181
+ {
3182
+ obj = (Object3D)e.nextElement();
3183
+ obj.EmbedTextures(true);
3184
+ }
3185
+
3186
+ refreshContents();
3187
+ } else
3188
+ if (source == deEmbedTexturesItem)
3189
+ {
3190
+ Object3D obj;
3191
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3192
+ {
3193
+ obj = (Object3D)e.nextElement();
3194
+ obj.EmbedTextures(false);
3195
+ }
3196
+
3197
+ CameraPane.texturepigment.clear();
3198
+ CameraPane.texturebump.clear();
3199
+
3200
+ refreshContents();
3201
+ } else
26833202 if (source == flashSelectionButton)
26843203 {
26853204 CameraPane.flash = true;
....@@ -2691,6 +3210,10 @@
26913210 if (source == twoButton)
26923211 {
26933212 radio.layout = twoButton;
3213
+
3214
+ if (CameraPane.FULLSCREEN)
3215
+ fullscreenLayout = radio.layout;
3216
+
26943217 // bug
26953218 //gridPanel.setDividerLocation(1.0);
26963219 //bigPanel.setDividerLocation(0.0);
....@@ -2723,10 +3246,31 @@
27233246 bigThree.ClearUI();
27243247 bigThree.add(centralPanel);
27253248 bigThree.FlushUI();
3249
+
3250
+ cameraView.requestFocusInWindow();
3251
+
3252
+// refreshContents(true);
3253
+//
3254
+// try
3255
+// {
3256
+// java.awt.Robot bot = new java.awt.Robot();
3257
+// int mask = InputEvent.BUTTON1_MASK;
3258
+// bot.mouseMove(100, 100);
3259
+// bot.mousePress(mask);
3260
+// bot.mouseRelease(mask);
3261
+// }
3262
+// catch (Exception e)
3263
+// {
3264
+//
3265
+// }
3266
+
27263267 } else
27273268 if (source == threeButton)
27283269 {
27293270 radio.layout = threeButton;
3271
+
3272
+ if (CameraPane.FULLSCREEN)
3273
+ fullscreenLayout = radio.layout;
27303274
27313275 // bigThree.remove(scenePanel);
27323276 // bigThree.remove(centralPanel);
....@@ -2756,13 +3300,18 @@
27563300 // centralPanel.setVisible(true);
27573301 // XYZPanel.setVisible(true);
27583302 bigThree.ClearUI();
3303
+ bigThree.add(scenePanel);
27593304 bigThree.add(centralPanel);
2760
- bigThree.add(XYZPanel);
27613305 bigThree.FlushUI();
3306
+
3307
+ cameraView.requestFocusInWindow();
27623308 } else
27633309 if (source == fourButton)
27643310 {
27653311 radio.layout = fourButton;
3312
+
3313
+ if (CameraPane.FULLSCREEN)
3314
+ fullscreenLayout = radio.layout;
27663315
27673316 // bigThree.remove(scenePanel);
27683317 // bigThree.remove(centralPanel);
....@@ -2794,10 +3343,15 @@
27943343 bigThree.ClearUI();
27953344 bigThree.add(scenePanel);
27963345 bigThree.FlushUI();
3346
+
3347
+ cameraView.requestFocusInWindow();
27973348 } else
27983349 if (source == sixButton)
27993350 {
28003351 radio.layout = sixButton;
3352
+
3353
+ if (CameraPane.FULLSCREEN)
3354
+ fullscreenLayout = radio.layout;
28013355
28023356 // bigThree.remove(scenePanel);
28033357 // bigThree.remove(centralPanel);
....@@ -2827,13 +3381,18 @@
28273381 // centralPanel.setVisible(true);
28283382 // XYZPanel.setVisible(false);
28293383 bigThree.ClearUI();
2830
- bigThree.add(scenePanel);
28313384 bigThree.add(centralPanel);
3385
+ bigThree.add(scenePanel);
28323386 bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
28333389 } else
28343390 if (source == sevenButton)
28353391 {
28363392 radio.layout = sevenButton;
3393
+
3394
+ if (CameraPane.FULLSCREEN)
3395
+ fullscreenLayout = radio.layout;
28373396
28383397 // bigThree.remove(scenePanel);
28393398 // bigThree.remove(centralPanel);
....@@ -2867,6 +3426,8 @@
28673426 bigThree.add(centralPanel);
28683427 bigThree.add(XYZPanel);
28693428 bigThree.FlushUI();
3429
+
3430
+ cameraView.requestFocusInWindow();
28703431 } else
28713432 if (source == rootButton)
28723433 {
....@@ -2878,6 +3439,7 @@
28783439 EditObject(obj);
28793440 }
28803441
3442
+ cameraView.requestFocusInWindow();
28813443 refreshContents(true);
28823444 } else
28833445 if (source == closeButton)
....@@ -2887,22 +3449,37 @@
28873449 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28883450 {
28893451 ab = (cRadio)e.nextElement();
2890
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3452
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28913453 {
3454
+ // Patch to avoid bug with transparency.
3455
+ if (!ab.hadMaterial)
3456
+ {
3457
+ ab.object.material = null;
3458
+ }
3459
+
28923460 buttonGroup.remove(ab);
28933461 radioPanel.remove(ab);
28943462
2895
- ab.GetObject().editWindow = null;
3463
+ //ab.GetObject().editWindow = null;
3464
+ ab.GetObject().manipWindow = null;
28963465 // ab.GetObject().objectUI = null; // ?????????
28973466
28983467 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28993468 break;
29003469 }
29013470 }
3471
+
3472
+ cameraView.requestFocusInWindow();
29023473 refreshContents(true);
29033474 } else
29043475 if (source == editItem || source == editButton)
29053476 {
3477
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3478
+ {
3479
+ Object3D child = (Object3D)e.nextElement();
3480
+ child.pinned = true;
3481
+ }
3482
+
29063483 EditSelection(false);
29073484 } else
29083485 if (source == uneditButton)
....@@ -2912,12 +3489,13 @@
29123489 Object3D child = (Object3D)e.nextElement();
29133490 if(child.editWindow != null)
29143491 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3492
+ child.pinned = false;
29153493 child.CloseUI();
29163494 listUI.remove(child);
29173495
2918
- child.editWindow = null; // ???????????
3496
+ //child.editWindow = null; // ???????????
29193497 }
2920
- objEditor.ctrlPanel.validate();
3498
+ objEditor.ctrlPanel.FlushUI();
29213499 //objEditor.jTree.clearSelection();
29223500 //objEditor.ResetSliders();
29233501 refreshContents(true);
....@@ -2928,6 +3506,7 @@
29283506 //copy.ClearUI();
29293507 for (Object3D obj : listUI)
29303508 {
3509
+ obj.pinned = false;
29313510 obj.CloseUI();
29323511 }
29333512 listUI.clear();
....@@ -2937,7 +3516,7 @@
29373516 {
29383517 assert(copy == group);
29393518
2940
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3519
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29413520
29423521 for (Object3D obj : listUI)
29433522 {
....@@ -2986,6 +3565,9 @@
29863565 }
29873566
29883567 copy = group;
3568
+
3569
+ SetUndoStates();
3570
+
29893571 //Globals.theRenderer.object = group;
29903572 if(!useclient)
29913573 {
....@@ -3001,20 +3583,46 @@
30013583 frontView.object = group;
30023584 sideView.object = group;
30033585 }
3004
- group.editWindow = this;
3586
+
3587
+// fix "+" issue
3588
+ //group.editWindow = this;
3589
+ group.manipWindow = this;
3590
+
30053591 /*
30063592 currentLayout = radio.layout;
30073593 if (currentLayout == null)
30083594 currentLayout = sevenButton;
30093595 */
30103596 radio.layout.doClick();
3597
+
3598
+ ClearUnpinned();
3599
+ //Grafreed.Assert(group != null);
3600
+ //Grafreed.Assert(group.selection != null);
3601
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3602
+ if (group.selection == null || group.selection.size() == 1)
3603
+ EditSelection(false);
30113604 keepparent = group.parent;
30123605 // PARENT = NULL or not???
30133606 //group.parent = null; // ROOT
30143607 //group.attributes = -1;
30153608 ResetModel();
3609
+
3610
+ cameraView.requestFocusInWindow();
30163611 refreshContents(true);
3017
- }
3612
+ } else if (event.getSource() == editCameraItem)
3613
+ {
3614
+ cameraView.ProtectCamera();
3615
+ cameraView.repaint();
3616
+ return;
3617
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3618
+ {
3619
+ cameraView.RevertCamera();
3620
+ cameraView.repaint();
3621
+ return;
3622
+ // } else if (event.getSource() == textureButton)
3623
+ // {
3624
+ // return; // true;
3625
+ }
30183626 else
30193627 {
30203628 //return super.action(event, arg);
....@@ -3023,7 +3631,6 @@
30233631 }
30243632
30253633 boolean useclient = false;
3026
- cRadio radio;
30273634
30283635 void ToggleRoot()
30293636 {
....@@ -3075,6 +3682,28 @@
30753682 refreshContents();
30763683 }
30773684
3685
+ void TransformChildren()
3686
+ {
3687
+ Object3D obj;
3688
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3689
+ {
3690
+ obj = (Object3D)e.nextElement();
3691
+ obj.KeepTextureMatrices();
3692
+ obj.TransformChildren();
3693
+ obj.RestoreTextureMatrices();
3694
+
3695
+// if (obj.parent == null)
3696
+// {
3697
+// System.out.println("NULL PARENT!");
3698
+// new Exception().printStackTrace();
3699
+// }
3700
+// else
3701
+// TouchTransform(obj);
3702
+// //obj.parent.Touch();
3703
+ }
3704
+
3705
+ refreshContents();
3706
+ }
30783707
30793708 void ResetTransform()
30803709 {
....@@ -3187,7 +3816,7 @@
31873816 refreshContents();
31883817 }
31893818
3190
- void ResetCentroid()
3819
+ void ResetCentroid(boolean full)
31913820 {
31923821 Object3D obj;
31933822 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3202,12 +3831,16 @@
32023831 LA.matIdentity(Object3D.mat);
32033832 obj.getBounds(minima, maxima, false);
32043833 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3205
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3834
+ if (full)
3835
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32063836 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32073837 obj.TransformMesh(Object3D.mat);
3838
+
32083839 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3209
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3840
+ if (full)
3841
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32103842 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3843
+
32113844 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32123845 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32133846 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3236,7 +3869,8 @@
32363869
32373870 int size = obj.MemorySize();
32383871
3239
- System.err.println((size/1024) + " KB is the size of " + obj);
3872
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3873
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32403874 }
32413875 }
32423876 catch (Exception e)
....@@ -3273,9 +3907,9 @@
32733907 obj = (Object3D)e.nextElement();
32743908
32753909 System.out.println("Object is: " + obj);
3276
- GrafreeD.AnalyzeObject(obj);
3910
+ Grafreed.AnalyzeObject(obj);
32773911 System.out.println("Boundary rep: " + obj.bRep);
3278
- GrafreeD.AnalyzeObject(obj.bRep);
3912
+ Grafreed.AnalyzeObject(obj.bRep);
32793913
32803914 // System.err.println((size/1024) + " KB is the size of " + obj);
32813915 }
....@@ -3317,6 +3951,13 @@
33173951 void GenNormals(boolean crease)
33183952 {
33193953 group.GenNormalsS(crease);
3954
+
3955
+ refreshContents();
3956
+ }
3957
+
3958
+ void GenNormalsMESH()
3959
+ {
3960
+ group.GenNormalsMeshS();
33203961
33213962 refreshContents();
33223963 }
....@@ -3489,8 +4130,8 @@
34894130
34904131 void ParseVertices()
34914132 {
3492
- boolean epsequal = GrafreeD.epsequal;
3493
- GrafreeD.epsequal = true;
4133
+ boolean epsequal = Grafreed.epsequal;
4134
+ Grafreed.epsequal = true;
34944135
34954136 for (int i=0; i<group.selection.size(); i++)
34964137 {
....@@ -3515,7 +4156,7 @@
35154156 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35164157 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35174158
3518
- g.add(GrafreeD.clipboard);
4159
+ g.add(Grafreed.clipboard);
35194160
35204161 buffer.add(g);
35214162 }
....@@ -3530,7 +4171,7 @@
35304171 makeSomething(buffer, i==group.selection.size()-1);
35314172 }
35324173
3533
- GrafreeD.epsequal = epsequal;
4174
+ Grafreed.epsequal = epsequal;
35344175
35354176 refreshContents();
35364177 }
....@@ -3548,7 +4189,16 @@
35484189 String pigment = Object3D.GetPigment(tex);
35494190 //String bump = Object3D.GetBump(tex);
35504191
3551
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4192
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4193
+
4194
+ try
4195
+ {
4196
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4197
+ }
4198
+ catch (Exception e)
4199
+ {
4200
+ System.err.println("FAIL: " + node);
4201
+ }
35524202
35534203 double s = v.s;
35544204
....@@ -3636,11 +4286,11 @@
36364286
36374287 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36384288
3639
- boolean random = CameraPane.RANDOM;
3640
- CameraPane.RANDOM = false; // parse all random nodes
4289
+ boolean random = CameraPane.SWITCH;
4290
+ CameraPane.SWITCH = false; // parse all random nodes
36414291 lowres.linkVerticesThis(null);
36424292 lowres.linkVerticesThis(sn);
3643
- CameraPane.RANDOM = random;
4293
+ CameraPane.SWITCH = random;
36444294
36454295 System.err.flush();
36464296
....@@ -3680,7 +4330,7 @@
36804330 return;
36814331
36824332 Object3D poses = group.selection.get(0);
3683
- Object3D ref = GrafreeD.clipboard.get(0);
4333
+ Object3D ref = Grafreed.clipboard.get(0);
36844334
36854335 Object3D newgroup = new Object3D("Po:" + poses.name);
36864336
....@@ -3874,9 +4524,9 @@
38744524
38754525 void ClipMesh()
38764526 {
3877
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4527
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38784528 {
3879
- Object3D content = GrafreeD.clipboard.get(0);
4529
+ Object3D content = Grafreed.clipboard.get(0);
38804530
38814531 if (content instanceof cGroup && ((cGroup)content).transientlink )
38824532 content = ((cGroup)content).get(0);
....@@ -3885,7 +4535,7 @@
38854535 // {
38864536 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38874537 // }
3888
- group.selection.ClipMesh(GrafreeD.clipboard);
4538
+ group.selection.ClipMesh(Grafreed.clipboard);
38894539 }
38904540 // group.selection.ClipMesh(GrafreeD.clipboard);
38914541 System.out.println("DONE.");
....@@ -3932,6 +4582,18 @@
39324582 void MarkLeaves(boolean hide)
39334583 {
39344584 group.selection.MarkLeaves(hide);
4585
+ refreshContents();
4586
+ }
4587
+
4588
+ void RewindLeaves(boolean hide)
4589
+ {
4590
+ group.selection.RewindLeaves(hide);
4591
+ refreshContents();
4592
+ }
4593
+
4594
+ void RandomLeaves(boolean hide)
4595
+ {
4596
+ group.selection.RandomLeaves(hide);
39354597 refreshContents();
39364598 }
39374599
....@@ -4006,28 +4668,25 @@
40064668 // }
40074669 // }
40084670
4009
- static boolean allparams = true;
4010
-
4011
- static Vector<Object3D> listUI = new Vector<Object3D>();
4012
-
40134671 void EditSelection(boolean newWindow)
40144672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
40154679 // aConstraints.gridy = 0;
40164680 for (int i=0; i<group.selection.size(); i++)
40174681 {
40184682 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40194683 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4020
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4684
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40214685
40224686 Object3D elem = (Object3D)group.selection.elementAt(i);
4023
- if(elem != group)
4687
+ if(elem != group || !newWindow)
40244688 {
4025
- // if (!(elem instanceof Composite))
4026
- // newWindow = false;
4027
- listUI.add(elem);
4028
- elem.openEditWindow(this, newWindow); //, false);
4029
- System.out.println("edit : " + elem);
4030
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
40314690 }
40324691 }
40334692 }
....@@ -4102,7 +4761,8 @@
41024761 //new Exception().printStackTrace();
41034762
41044763 freezemodel = true;
4105
-
4764
+ ClearUnpinned();
4765
+
41064766 /**/
41074767 //switch (event.id)
41084768 {
....@@ -4110,7 +4770,6 @@
41104770 //case 702: // Event.LIST_DESELECT
41114771 group.deselectAll();
41124772 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4113
- objEditor.ClearInfo(); // .GetMaterial());
41144773 if (tps != null)
41154774 {
41164775 for (int i=0; i < tps.length; i++)
....@@ -4119,33 +4778,39 @@
41194778
41204779 //if (child.parent != null)
41214780 //child.parent.addSelectee(child);
4781
+ objEditor.SetMaterial(child);
41224782 group.addSelectee(child);
4123
- objEditor.SetMaterial(child); // .GetMaterial());
4124
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4125
- System.err.println("info : " + child.GetPath());
41264783 }
41274784 }
4128
- else
4129
- {
4130
- objEditor.SetMaterial(group); // .GetMaterial());
4131
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4132
- System.err.println("info : " + group.GetPath());
4133
- }
4785
+// else
4786
+// {
4787
+// objEditor.SetMaterial(group); // .GetMaterial());
4788
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4789
+// System.err.println("info : " + group.GetPath());
4790
+// }
41344791
4135
- objEditor.SetText(); // jan 2014
4136
-
4137
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4792
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41384793 CameraPane.flash = true;
41394794
4140
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4795
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41414796 // a camera
41424797 {
4143
- CameraPane.camerachangeframe = 0; // don't refuse it
4144
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4798
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4799
+ {
4800
+ CameraPane.camerachangeframe = 0; // don't refuse it
4801
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4802
+ }
41454803 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41464804 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41474805 }
41484806
4807
+ if (tps != null && tps.length == 1)
4808
+ {
4809
+ EditSelection(false);
4810
+ }
4811
+
4812
+ SetPinStates(tps != null && tps.length > 0);
4813
+
41494814 refreshContents();
41504815 //return true;
41514816 }
....@@ -4154,6 +4819,35 @@
41544819
41554820 freezemodel = false;
41564821 }
4822
+
4823
+ void SetPinStates(boolean enabled)
4824
+ {
4825
+ editButton.setEnabled(enabled);
4826
+ uneditButton.setEnabled(enabled);
4827
+ unselectButton.setEnabled(enabled);
4828
+ flashSelectionButton.setEnabled(enabled);
4829
+ }
4830
+
4831
+ void refreshContents(boolean cp)
4832
+ {
4833
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4834
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4835
+ {
4836
+ objEditor.ClearInfo(); // .GetMaterial());
4837
+
4838
+ for (int i=0; i < group.selection.Size(); i++)
4839
+ {
4840
+ Object3D child = (Object3D) group.selection.get(i);
4841
+
4842
+ objEditor.AddInfo(child, this, true);
4843
+ System.err.println("info : " + child.GetPath());
4844
+ }
4845
+
4846
+ objEditor.SetText(); // jan 2014
4847
+ }
4848
+
4849
+ super.refreshContents(cp);
4850
+ }
41574851
41584852 void linkSomething(Object3D thing)
41594853 {
....@@ -4225,16 +4919,19 @@
42254919 {
42264920 if (group.selection.isEmpty())
42274921 return;
4228
- GrafreeD.clipboardIsTempGroup = false;
4922
+
4923
+ Grafreed.clipboardIsTempGroup = false;
42294924 Composite tGroup = null;
42304925 if (group.selection.size() > 0) // 1)
42314926 {
42324927 tGroup = new cGroup();
4233
- GrafreeD.clipboardIsTempGroup = true;
4928
+ Grafreed.clipboardIsTempGroup = true;
42344929 }
42354930
42364931 if (cut)
42374932 {
4933
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4934
+// Save();
42384935 //int indices[] = jList.getSelectedIndices();
42394936 //for (int i = indices.length - 1; i >= 0; i--)
42404937 //jList.remove(indices[i]);
....@@ -4270,16 +4967,16 @@
42704967 //System.out.println("cut " + child);
42714968 //System.out.println("parent = " + child.parent);
42724969 // tmp.addChild(child);
4273
- if (GrafreeD.clipboardIsTempGroup)
4970
+ if (Grafreed.clipboardIsTempGroup)
42744971 tGroup.add/*Child*/(tmp);
42754972 else
4276
- GrafreeD.clipboard = tmp;
4973
+ Grafreed.clipboard = tmp;
42774974 }
42784975 else
4279
- if (GrafreeD.clipboardIsTempGroup)
4976
+ if (Grafreed.clipboardIsTempGroup)
42804977 tGroup.add/*Child*/(child);
42814978 else
4282
- GrafreeD.clipboard = child;
4979
+ Grafreed.clipboard = child;
42834980 }
42844981
42854982 //ResetModel();
....@@ -4311,21 +5008,23 @@
43115008 //System.out.println("cut " + elem);
43125009 //System.out.println("parent = " + elem.parent);
43135010 // tmp.addChild(elem);
4314
- if (GrafreeD.clipboardIsTempGroup)
5011
+ if (Grafreed.clipboardIsTempGroup)
43155012 tGroup.add/*Child*/(tmp);
43165013 else
4317
- GrafreeD.clipboard = tmp;
5014
+ Grafreed.clipboard = tmp;
43185015 }
43195016 else
4320
- if (GrafreeD.clipboardIsTempGroup)
5017
+ if (Grafreed.clipboardIsTempGroup)
43215018 tGroup.add/*Child*/(child);
43225019 else
4323
- GrafreeD.clipboard = child;
5020
+ Grafreed.clipboard = child;
43245021 }
43255022
43265023 }
4327
- if (GrafreeD.clipboardIsTempGroup)
4328
- GrafreeD.clipboard = tGroup;
5024
+
5025
+ if (Grafreed.clipboardIsTempGroup)
5026
+ Grafreed.clipboard = tGroup;
5027
+
43295028 if (cut)
43305029 {
43315030 ResetModel();
....@@ -4335,11 +5034,15 @@
43355034
43365035 void paste(boolean expand)
43375036 {
5037
+ if (Globals.REPLACEONMAKE)
5038
+ Save();
5039
+ boolean keep = Globals.REPLACEONMAKE;
5040
+ Globals.REPLACEONMAKE = false;
43385041 // if (GrafreeD.clipboard == null)
43395042 // return;
43405043 boolean first = true;
43415044
4342
- if (GrafreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
43435046 {
43445047 Composite temp;
43455048
....@@ -4350,7 +5053,7 @@
43505053 temp = (Composite)Applet3D.clipboard.deepCopy();
43515054 */
43525055 Object3D elem;
4353
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5056
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43545057 {
43555058 Object3D child = (Object3D)e.nextElement();
43565059
....@@ -4384,21 +5087,22 @@
43845087 //Object3D cb = Applet3D.clipboard;
43855088 //temp.addChild(cb);
43865089 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4387
- assert(GrafreeD.clipboard.parent == null);
4388
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4389
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4390
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4391
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5090
+ assert(Grafreed.clipboard.parent == null);
5091
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5092
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5093
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5094
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43925095 else
4393
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4394
- GrafreeD.clipboard.get(0).parent = keepparent;
5096
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5097
+ Grafreed.clipboard.get(0).parent = keepparent;
43955098 }
43965099
5100
+ Globals.REPLACEONMAKE = keep;
43975101 ResetModel();
43985102 refreshContents();
43995103 }
44005104
4401
- void pasteInto(boolean copyit)
5105
+ void pasteInto(boolean copyit, boolean clone)
44025106 {
44035107 // if (GrafreeD.clipboard == null)
44045108 // return;
....@@ -4427,15 +5131,22 @@
44275131 if (copyit)
44285132 {
44295133 // paste(false);
4430
- CloneClipboard(false); // sept 2014
5134
+ if (clone)
5135
+ {
5136
+ CloneClipboard(false); // sept 2014
5137
+ }
5138
+ else
5139
+ {
5140
+ paste(false);
5141
+ }
44315142 }
44325143 else
44335144 {
44345145 boolean first = true;
44355146
4436
- if (GrafreeD.clipboardIsTempGroup)
5147
+ if (Grafreed.clipboardIsTempGroup)
44375148 {
4438
- Composite temp = (Composite)GrafreeD.clipboard;
5149
+ Composite temp = (Composite)Grafreed.clipboard;
44395150 Object3D copy;
44405151 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44415152 {
....@@ -4445,7 +5156,7 @@
44455156 }
44465157 } else
44475158 {
4448
- linkSomething(GrafreeD.clipboard); //.get(0));
5159
+ linkSomething(Grafreed.clipboard); //.get(0));
44495160 }
44505161 }
44515162 }
....@@ -4522,6 +5233,10 @@
45225233
45235234 void group(Object3D csg, boolean grab)
45245235 {
5236
+ if (Globals.REPLACEONMAKE)
5237
+ Save();
5238
+ boolean keep = Globals.REPLACEONMAKE;
5239
+ Globals.REPLACEONMAKE = false;
45255240 if (//false) // why??
45265241 !group.selection.isEmpty())
45275242 {
....@@ -4635,10 +5350,15 @@
46355350 //node.add(csg);
46365351 //makeSomething(node);
46375352 makeSomething(csg);
5353
+ Globals.REPLACEONMAKE = keep;
46385354 }
46395355
46405356 void Ungroup(Object3D g)
46415357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
46425362 if (g instanceof HiddenObject)
46435363 {
46445364 HiddenObject h = (HiddenObject) g;
....@@ -4655,6 +5375,7 @@
46555375 objEditor.makeSomething(g.get(i), false);
46565376 }
46575377 }
5378
+ Globals.REPLACEONMAKE = keep;
46585379 }
46595380
46605381 void ungroup()
....@@ -4850,21 +5571,6 @@
48505571 }
48515572 */
48525573
4853
- void ImportGFD()
4854
- {
4855
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4856
- browser.show();
4857
- String filename = browser.getFile();
4858
- if (filename != null && filename.length() > 0)
4859
- {
4860
- String fullname = browser.getDirectory() + filename;
4861
-
4862
- //Object3D readobj =
4863
- objEditor.ReadGFD(fullname, objEditor);
4864
- //makeSomething(readobj);
4865
- }
4866
- }
4867
-
48685574 /*
48695575 public void Callback(Object obj)
48705576 {
....@@ -4888,26 +5594,9 @@
48885594 }
48895595 */
48905596
4891
- void ImportVRMLX3D()
4892
- {
4893
- if (GrafreeD.standAlone)
4894
- {
4895
- /**/
4896
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4897
- browser.show();
4898
- String filename = browser.getFile();
4899
- if (filename != null && filename.length() > 0)
4900
- {
4901
- String fullname = browser.getDirectory() + filename;
4902
- LoadVRMLX3D(fullname);
4903
- }
4904
- /**/
4905
- }
4906
- }
4907
-
49085597 String GetFile(String dialogName)
49095598 {
4910
- if (GrafreeD.standAlone)
5599
+ if (Grafreed.standAlone)
49115600 {
49125601 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49135602 browser.show();
....@@ -4971,10 +5660,33 @@
49715660 cButton flashSelectionButton;
49725661 cButton editButton;
49735662 cButton uneditButton;
5663
+ JCheckBox allParamsButton;
49745664 cButton clearpanelButton;
4975
- cButton allParamsButton;
49765665 cButton unselectButton;
49775666
5667
+ cButton restoreCameraButton;
5668
+
5669
+ cButton saveButton;
5670
+ cButton oneStepButton;
5671
+
5672
+ cButton groupButton;
5673
+ cButton ungroupButton;
5674
+ cButton compositeButton;
5675
+ cButton switchButton;
5676
+ cButton loopButton;
5677
+ cButton textureButton;
5678
+
5679
+ cButton gridButton;
5680
+ cButton boxButton;
5681
+ cButton sphereButton;
5682
+ cButton coneButton;
5683
+ cButton torusButton;
5684
+ cButton superButton;
5685
+ cButton kleinButton;
5686
+ cButton particlesButton;
5687
+ cButton overlayButton;
5688
+ cButton lightButton;
5689
+
49785690 cButton screenfitButton;
49795691 cButton screenfitpointButton;
49805692 cButton snapobjectButton;
....@@ -4986,14 +5698,6 @@
49865698
49875699 cButton setsupportButton;
49885700
4989
- cButton twoButton;
4990
- cButton sixButton;
4991
- cButton threeButton;
4992
- cButton sevenButton;
4993
- cButton fourButton; // full panel
4994
- cButton oneButton; // full XYZ
4995
- //cButton currentLayout;
4996
-
49975701 //
49985702 //Composite
49995703 Object3D // to do !!
....@@ -5003,9 +5707,11 @@
50035707 //JTree jTree;
50045708 private MenuItem lookAtItem;
50055709 private MenuItem lookFromItem;
5006
- private MenuItem switchItem;
5710
+ private MenuItem switchViewItem;
50075711 private MenuItem cutItem;
5008
- private MenuItem duplicateItem;
5712
+ private MenuItem undoItem;
5713
+ private MenuItem redoItem;
5714
+ private JMenuItem duplicateItem;
50095715 private MenuItem cloneItem;
50105716 private MenuItem cloneSupportItem;
50115717 private MenuItem overwriteGeoItem;
....@@ -5018,7 +5724,7 @@
50185724 private MenuItem linkverticesItem;
50195725 private MenuItem relinkverticesItem;
50205726 private MenuItem setMasterItem;
5021
- private MenuItem resetMeshItem;
5727
+ private MenuItem resetAllItem;
50225728 private MenuItem stepAllItem;
50235729 private MenuItem revertMeshItem;
50245730 private MenuItem poseMeshItem;
....@@ -5029,10 +5735,11 @@
50295735 private MenuItem mergeGeometriesItem;
50305736 private MenuItem copyItem;
50315737 private MenuItem pasteItem;
5738
+ private MenuItem pasteIntoItem;
50325739 private MenuItem pasteLinkItem;
50335740 private MenuItem pasteCloneItem;
50345741 private MenuItem pasteExpandItem;
5035
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
50365743 private MenuItem clearAllItem;
50375744 private MenuItem genUVItem;
50385745 private MenuItem genNormalsMESHItem;
....@@ -5067,6 +5774,10 @@
50675774 private MenuItem showleavesItem;
50685775 private MenuItem markleavesItem;
50695776 private MenuItem unmarkleavesItem;
5777
+ private MenuItem rewindleavesItem;
5778
+ private MenuItem unrewindleavesItem;
5779
+ private MenuItem randomleavesItem;
5780
+ private MenuItem unrandomleavesItem;
50705781
50715782 private MenuItem flipVItem;
50725783 private MenuItem unflipVItem;
....@@ -5078,15 +5789,17 @@
50785789 private MenuItem panoTexturesItem;
50795790
50805791 private MenuItem resetCentroidItem;
5081
- private MenuItem transformgeometryItem;
5792
+ private MenuItem resetCentroidXZItem;
50825793 private MenuItem resetTransformItem;
5794
+ private MenuItem transformGeometryItem;
5795
+ private MenuItem transformChildrenItem;
50835796 private MenuItem hideItem;
50845797 private MenuItem grabItem;
50855798 private MenuItem backItem;
50865799 private MenuItem frontItem;
50875800 private MenuItem cameraItem;
50885801 private MenuItem compositeItem;
5089
- private MenuItem randomItem;
5802
+ private MenuItem switchItem;
50905803 private MenuItem physicsItem;
50915804 private MenuItem frameselectorItem;
50925805 private MenuItem scriptNodeItem;
....@@ -5110,6 +5823,8 @@
51105823 private MenuItem attachBumpItem;
51115824 private MenuItem detachBumpItem;
51125825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
51135828
51145829 private MenuItem particleItem;
51155830 private MenuItem ragdollItem;
....@@ -5126,7 +5841,7 @@
51265841 private MenuItem blobItem;
51275842 private MenuItem latheItem;
51285843 private MenuItem bezierItem;
5129
- private MenuItem checkerItem;
5844
+ private MenuItem overlayItem;
51305845 private MenuItem meshItem;
51315846 // private MenuItem meshGroupItem;
51325847 private MenuItem springItem;
....@@ -5148,11 +5863,6 @@
51485863 private MenuItem doubleItem;
51495864 private MenuItem tripleItem;
51505865
5151
- private MenuItem importGFDItem;
5152
- private MenuItem importVRMLX3DItem;
5153
- private MenuItem import3DSItem;
5154
- private MenuItem importOBJItem;
5155
-
51565866 private MenuItem computeAOItem;
51575867 private MenuItem recompileItem;
51585868 private MenuItem editScriptItem;
....@@ -5162,4 +5872,8 @@
51625872 private MenuItem analyzeItem;
51635873 private MenuItem dumpItem;
51645874 //boolean freezemodel = false;
5875
+
5876
+ Menu cameraMenu;
5877
+ MenuItem editCameraItem;
5878
+ MenuItem restoreCameraItem;
51655879 }