Normand Briere
2019-07-23 cf7cfa1c792eebba606a48aa648893f6e4873263
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,98 +606,231 @@
434606 oe.radioPanel.add(dummyButton);
435607 oe.buttonGroup.add(dummyButton);
436608 */
609
+ cGridBag copyOptionsPanel = new cGridBag();
610
+
611
+ copyOptionsPanel.preferredHeight = 1;
612
+
437613 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438614
439
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
440
- liveCB.setToolTipText("Enabled animation");
441
- liveCB.addItemListener(this);
442
-
443
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
444
- trackCB.setToolTipText("Enable tracking");
445
- trackCB.addItemListener(this);
446
-
447
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
615
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ //minButton.setToolTipText("Minimize window");
617
+ //minButton.addActionListener(this);
618
+
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);
448631 screenfitButton.setToolTipText("Screen fit");
449632 screenfitButton.addActionListener(this);
450633
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
+
451683 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
452684 // screenfitpointButton.addActionListener(this);
453
-// oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
455
- snapobjectButton.addActionListener(this);
456
- snapobjectButton.setToolTipText("Snap Object");
457
- oe.aConstraints.gridx += 1;
458685
459
- //aConstraints.gridx = 0;
460
- //aConstraints.gridy += 1;
461
- oe.aConstraints.weighty = 0;
462
- oe.aConstraints.gridwidth = 1;
463
-
464
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
- flashSelectionButton.setToolTipText("Show selection");
466
- flashSelectionButton.addActionListener(this);
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
+
693
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
467694
468
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
-
470
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471
- twoButton.setToolTipText("Show center view only");
472
- twoButton.addActionListener(this);
473
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
695
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
474696 fourButton.addActionListener(this);
475697 fourButton.setToolTipText("Show left panel only");
476
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
477
- sixButton.setToolTipText("2-column layout left");
698
+
699
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ twoButton.setToolTipText("Show right view only");
701
+ twoButton.addActionListener(this);
702
+ this.fullscreenLayout = twoButton;
703
+
704
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ sixButton.setToolTipText("Show left and right");
478706 sixButton.addActionListener(this);
479
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
480
- threeButton.setToolTipText("2-column layout right");
481
- threeButton.addActionListener(this);
482
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
483
- sevenButton.setToolTipText("3-column layout");
484
- sevenButton.addActionListener(this);
707
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+// threeButton.setToolTipText("2-column layout right");
709
+// threeButton.addActionListener(this);
710
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+// sevenButton.setToolTipText("3-column layout");
712
+// sevenButton.addActionListener(this);
485713 //
486714
487
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
- 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");
489717 rootButton.addActionListener(this);
490
- oe.aConstraints.gridx += 1;
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
718
+
719
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492720 closeButton.setToolTipText("Close tab");
493721 closeButton.addActionListener(this);
494722 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
495723 //clearButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
-
498
- oe.aConstraints.gridx = 1; //
499
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
500
- editButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.aConstraints.weighty = 0;
503
- oe.aConstraints.gridwidth = 1;
504724
505
- 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");
506810 uneditButton.addActionListener(this);
507811
508
- oe.aConstraints.gridx += 1;
509
- oe.aConstraints.weighty = 0;
510
- oe.aConstraints.gridwidth = 1;
511
-
512
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
513
- clearPanelButton.addActionListener(this);
514
-
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518
-
519
- 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");
520814 allParamsButton.addActionListener(this);
521815
522
- oe.aConstraints.gridx += 1;
523
- oe.aConstraints.weighty = 0;
524
- oe.aConstraints.gridwidth = 1;
525
-
526
- 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");
527822 unselectButton.addActionListener(this);
528823
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
+
529834 // oe.aConstraints.gridx += 1;
530835 // oe.aConstraints.weighty = 0;
531836 // oe.aConstraints.gridwidth = 1;
....@@ -537,40 +842,25 @@
537842 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
538843 // gcButton.addActionListener(this);
539844
540
- oe.aConstraints.gridx = 0;
541
- oe.aConstraints.gridy += 1;
542
-
543
- //ctrlPanel.add(objList = new List(5, true));
544
- oe.aConstraints.gridwidth = 100;
545
- // oe.aConstraints.gridheight = 100;
546
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
547
- oe.aConstraints.gridheight = 1;
548
- oe.aConstraints.weighty = 0.5;
549
- oe.aConstraints.gridx = 0;
550
- JScrollPane jSP;
845
+ cGridBag jSPPanel = new cGridBag();
846
+
847
+ JScrollPane jSP;
551848 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
552
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
849
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
553850 ResetModel();
554
- oe.aConstraints.weighty = 0.5;
555
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
556
- oe.aConstraints.gridy += 1;
557
- oe.aConstraints.gridwidth = 1;
558
-
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 2;
561
-
562
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
563
- colorCB.addItemListener(this);
564
- oe.aConstraints.gridx += 2;
565
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
566
- materialCB.addItemListener(this);
567
- oe.aConstraints.gridx += 2;
568
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
569
- textureCB.addItemListener(this);
570
-
571
- oe.aConstraints.gridx = 0;
572
- oe.aConstraints.gridy += 1;
573851
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
+
574864 //jList.addListSelectionListener(this);
575865 oe.jTree.addTreeSelectionListener(this);
576866 //jTree.setRootVisible(false);
....@@ -589,53 +879,67 @@
589879 dgr.addDragGestureListener(this);
590880 }catch(Exception e) {}
591881 */
592
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
593883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
594884 }
595885
596886 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
597887 {
598
- //constraints.gridx = 0;
599
- //constraints.gridy = 0;
600
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
601
- fastCB.setToolTipText("Fast mode");
602
- fastCB.addItemListener(this);
603
- //constraints.gridy += 1;
604
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
605
- supportCB.setToolTipText("Enabled rigging");
606
- 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);
607891
608
- // 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
+
609920 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
610921 // localCB.addItemListener(this);
611922
612
- //constraints.gridy += 1;
923
+ panel.Return();
924
+
613925 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
614926 crowdCB.setToolTipText("Used for crowds");
615927 crowdCB.addItemListener(this);
616928
617
- //constraints.gridy += 1;
618929 panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
619930 smoothCB.setToolTipText("Snapping delay");
620931 smoothCB.addItemListener(this);
621932
622
- //constraints.gridy += 1;
623933 panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
624934 slowCB.setToolTipText("Smooth interpolation");
625935 slowCB.addItemListener(this);
626
- //constraints.gridy += 1;
627
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
628
- boxCB.setToolTipText("Display bounding boxes");
629
- boxCB.addItemListener(this);
630
- //constraints.gridy += 1;
631
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
632
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
633
- zoomBoxCB.addItemListener(this);
634
-
936
+
635937 // constraints.gridy += 1;
636938 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
637939 // speakerMocapCB.addItemListener(this);
638940
941
+ panel.Return();
942
+
639943 if (false)
640944 {
641945 // handled in scripts
....@@ -650,36 +954,85 @@
650954 //constraints.gridy += 1;
651955 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
652956 smoothfocusCB.addItemListener(this);
957
+ panel.Return();
653958 }
654959
655960 //constraints.gridx += 1;
656961 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
657962 // debugCB.addItemListener(this);
658963
659
- //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
+
660968 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
969
+ oeilCB.setToolTipText("Move camera when tracking");
661970 oeilCB.addItemListener(this);
662971
663
- //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
+ {
664992 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
665993 lookAtCB.setToolTipText("Look-at target");
666994 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);
6671009
6681010 }
6691011
6701012 void EditObject(Object3D obj)
6711013 {
6721014 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
+
6731023 radioButton.SetObject(obj);
674
- radioButton.layout = sevenButton;
1024
+ radioButton.layout = sixButton; // sevenButton;
6751025 radioButton.SetCamera(cameraView.renderCamera, false);
6761026 radioButton.addActionListener(this);
6771027 radioPanel.add(radioButton);
6781028 buttonGroup.add(radioButton);
6791029 radioButton.doClick();
6801030 }
1031
+
6811032 void SetupViews(ObjEditor oe)
6821033 {
1034
+ theFrame = this;
1035
+
6831036 oe.SetupViews();
6841037
6851038 System.out.println("SetupViews");
....@@ -688,23 +1041,28 @@
6881041 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6891042 }
6901043
691
- JCheckBox liveCB;
692
- JCheckBox supportCB;
693
- JCheckBox localCB;
694
- JCheckBox crowdCB;
695
- JCheckBox smoothCB;
696
- JCheckBox fastCB;
697
- JCheckBox slowCB;
698
- JCheckBox boxCB;
699
- JCheckBox zoomBoxCB;
700
- JCheckBox trackCB;
701
- 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;
7021057 // JCheckBox speakerMocapCB;
703
- JCheckBox speakerCameraCB;
704
- JCheckBox speakerFocusCB;
705
- JCheckBox debugCB;
706
- JCheckBox oeilCB;
707
- JCheckBox lookAtCB;
1058
+ cCheckBox speakerCameraCB;
1059
+ cCheckBox speakerFocusCB;
1060
+ cCheckBox debugCB;
1061
+
1062
+ cCheckBox oeilCB;
1063
+ cCheckBox shadowCB;
1064
+ cCheckBox autokeepCB;
1065
+ cCheckBox lookAtCB;
7081066
7091067 // static int COLOR = 1;
7101068 // static int MATERIAL = 2;
....@@ -712,9 +1070,9 @@
7121070
7131071 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7141072
715
- JCheckBox colorCB;
716
- JCheckBox materialCB;
717
- JCheckBox textureCB;
1073
+ cCheckBox colorCB;
1074
+ cCheckBox materialCB;
1075
+ cCheckBox textureCB;
7181076
7191077 public void itemStateChanged(ItemEvent e)
7201078 {
....@@ -742,6 +1100,7 @@
7421100 } else if(e.getSource() == liveCB)
7431101 {
7441102 cameraView.ToggleLive();
1103
+ refreshContents(false);
7451104 }
7461105 else if(e.getSource() == supportCB)
7471106 {
....@@ -806,6 +1165,18 @@
8061165 {
8071166 cameraView.ToggleOeil();
8081167 }
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
+ }
8091180 else if(e.getSource() == lookAtCB)
8101181 {
8111182 cameraView.ToggleLookAt();
....@@ -822,7 +1193,8 @@
8221193
8231194 /**/
8241195 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
825
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1196
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1197
+ TreePath path = objEditor.jTree.getSelectionPath();
8261198 if ((path == null) || (path.getPathCount() <= 1)) {
8271199 // We can't move the root node or an empty selection
8281200 return;
....@@ -885,8 +1257,6 @@
8851257 }
8861258 }
8871259
888
- String string = (String) object;
889
-
8901260 System.out.println("Transfer = " + object + "; drop : " + target);
8911261 // if( object instanceof java.io.File[])
8921262 // {
....@@ -894,7 +1264,11 @@
8941264 // objEditor.DropFile((java.io.File[]) object, true);
8951265 // return;
8961266 // }
897
- 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) == ':')
8981272 {
8991273 // file(s)
9001274 String[] names = string.split("\n");
....@@ -921,7 +1295,7 @@
9211295
9221296 flashIt = false;
9231297 CameraPane pane = (CameraPane) target;
924
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1298
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9251299 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9261300
9271301 if (group.selection.size() == 1)
....@@ -937,23 +1311,33 @@
9371311
9381312 assert target == objEditor.jTree;
9391313 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1314
+ Object3D destinationLeaf;
9401315 try {
941
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1316
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9421317 } catch (Exception e) {
9431318 System.out.println("destinationPath : " + destinationPath);
9441319 return;
9451320 }
9461321
947
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1322
+ for (int i=group.selection.size(); --i>=0;)
9481323 {
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
+// {
9491333 loadClipboard(true);
9501334 objEditor.jTree.setSelectionPath(destinationPath);
951
- pasteInto(false);
952
- } else {
953
- loadClipboard(false);
954
- objEditor.jTree.setSelectionPath(destinationPath);
955
- pasteInto(false); // true); // ???
956
- }
1335
+ pasteInto(false, false);
1336
+// } else {
1337
+// loadClipboard(false);
1338
+// objEditor.jTree.setSelectionPath(destinationPath);
1339
+// pasteInto(false, false); // true); // ???
1340
+// }
9571341 }
9581342 public void dropActionChanged(DropTargetDragEvent dtde)
9591343 // Called if the user has modified the current drop gesture
....@@ -1058,85 +1442,107 @@
10581442 {
10591443 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10601444 //heightFieldItem.addActionListener(this);
1061
- gridItem = menu.add(new MenuItem("Grid"));
1062
- gridItem.addActionListener(this);
1063
- rectoidItem = menu.add(new MenuItem("Box"));
1064
- rectoidItem.addActionListener(this);
1065
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1066
- ellipsoidItem.addActionListener(this);
1067
- coneItem = menu.add(new MenuItem("Cone"));
1068
- coneItem.addActionListener(this);
1069
- torusItem = menu.add(new MenuItem("Torus"));
1070
- torusItem.addActionListener(this);
1071
- superItem = menu.add(new MenuItem("Superellipsoid"));
1072
- 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
+ {
10731463 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10741464 kleinItem.addActionListener(this);
1075
- particleItem = menu.add(new MenuItem("Particle system"));
1076
- particleItem.addActionListener(this);
1465
+ }
1466
+
1467
+// particleItem = menu.add(new MenuItem("Particle system"));
1468
+// particleItem.addActionListener(this);
1469
+ if (Globals.ADVANCED)
1470
+ {
10771471 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10781472 ragdollItem.addActionListener(this);
10791473 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10801474 ragdoll2Item.addActionListener(this);
1475
+ }
10811476 menu.add("-");
1082
- meshItem = menu.add(new MenuItem("Mesh"));
1477
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10831478 meshItem.addActionListener(this);
10841479 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10851480 // meshGroupItem.addActionListener(this);
1481
+ if (Globals.ADVANCED)
1482
+ {
10861483 springItem = menu.add(new MenuItem("Spring"));
10871484 springItem.addActionListener(this);
10881485 flagItem = menu.add(new MenuItem("Flag"));
10891486 flagItem.addActionListener(this);
1090
- bezierItem = menu.add(new MenuItem("Patch"));
1091
- bezierItem.addActionListener(this);
1092
- checkerItem = menu.add(new MenuItem("Checker"));
1093
- checkerItem.addActionListener(this);
10941487 blobItem = menu.add(new MenuItem("Blob"));
10951488 blobItem.addActionListener(this);
10961489 latheItem = menu.add(new MenuItem("Lathe"));
10971490 latheItem.addActionListener(this);
1098
- lightItem = menu.add(new MenuItem("Light"));
1099
- 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);
11001498 menu.add("-");
11011499 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11021500 //superLoopItem.addActionListener(this);
1103
- loopItem = menu.add(new MenuItem("Loop"));
1104
- loopItem.addActionListener(this);
1501
+// loopItem = menu.add(new MenuItem("Loop"));
1502
+// loopItem.addActionListener(this);
11051503 doubleItem = menu.add(new MenuItem("Fork"));
11061504 doubleItem.addActionListener(this);
1505
+ if (Globals.ADVANCED)
1506
+ {
11071507 tripleItem = menu.add(new MenuItem("Trident"));
11081508 tripleItem.addActionListener(this);
1509
+ }
11091510 }
11101511
11111512 void buildToolsMenu(Menu menu)
11121513 {
11131514 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11141515 animationItem.addItemListener(this);
1115
- animationItem.setState(CameraPane.ANIMATION);
1516
+ animationItem.setState(Globals.ANIMATION);
1517
+
1518
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1519
+ archiveItem.addActionListener(this);
11161520
11171521 menu.add("-");
11181522 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11191523 parseverticesItem.addActionListener(this);
11201524 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11211525 textureFieldItem.addActionListener(this);
1122
- alignItem = menu.add(new MenuItem("Align"));
1526
+ alignItem = menu.add(new MenuItem("Align Objects"));
11231527 alignItem.addActionListener(this);
1124
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1125
- mirrorItem.addActionListener(this);
11261528 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11271529 reduceMorphItem.addActionListener(this);
11281530 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11291531 reduce34MorphItem.addActionListener(this);
1130
-
1131
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1132
- computeAOItem.addActionListener(this);
11331532 menu.add("-");
1134
-
11351533 menu.add(memoryItem = new MenuItem("Memory Usage"));
11361534 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("-");
11371543 menu.add(analyzeItem = new MenuItem("Analyze"));
11381544 analyzeItem.addActionListener(this);
1139
- menu.add(dumpItem = new MenuItem("Dump"));
1545
+ menu.add(dumpItem = new MenuItem("Print"));
11401546 dumpItem.addActionListener(this);
11411547 // menu.add(pathItem = new MenuItem("From-to path"));
11421548 // pathItem.addActionListener(this);
....@@ -1154,6 +1560,7 @@
11541560 menu.add("-");
11551561 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11561562 editScriptItem.addActionListener(this);
1563
+ }
11571564 }
11581565
11591566 void ScreenFit()
....@@ -1276,9 +1683,34 @@
12761683 shadow.material = new cMaterial(obj.material);
12771684 shadow.material.diffuse = 0.0001f;
12781685 shadow.material.specular = 0.0001f;
1686
+ //shadow.projectedVertices[1].x = 300;
12791687
12801688 makeSomething(shadow);
12811689 }
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
+ }
12821714
12831715 /**
12841716 * applyExample
....@@ -1482,9 +1914,9 @@
14821914
14831915 void Overwrite(int mask)
14841916 {
1485
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14861918 {
1487
- Object3D content = GrafreeD.clipboard.get(0);
1919
+ Object3D content = Grafreed.clipboard.get(0);
14881920
14891921 if (content instanceof cGroup && ((cGroup)content).transientlink )
14901922 content = ((cGroup)content).get(0);
....@@ -1523,7 +1955,7 @@
15231955 {
15241956 ScreenFit();
15251957 } else
1526
- if (source == switchItem)
1958
+ if (source == switchViewItem)
15271959 {
15281960 cVector v1 = new cVector();
15291961 cVector v2 = new cVector();
....@@ -1532,11 +1964,11 @@
15321964 objEditor.cameraView.renderCamera.setAim(v2, v1);
15331965 objEditor.cameraView.repaint();
15341966 } else
1535
- if (source == rectoidItem)
1967
+ if (source == rectoidItem || source == boxButton)
15361968 {
15371969 makeSomething(new Box());
15381970 } else
1539
- if (source == particleItem)
1971
+ if (source == particleItem || source == particlesButton)
15401972 {
15411973 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15421974 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1615,27 +2047,27 @@
16152047
16162048 makeSomething(obj);
16172049 } else
1618
- if (source == gridItem)
2050
+ if (source == gridItem || source == gridButton)
16192051 {
16202052 makeSomething(new Grid());
16212053 } else
1622
- if (source == ellipsoidItem)
2054
+ if (source == ellipsoidItem || source == sphereButton)
16232055 {
16242056 makeSomething(new Sphere());
16252057 } else
1626
- if (source == coneItem)
2058
+ if (source == coneItem || source == coneButton)
16272059 {
16282060 makeSomething(new Cone());
16292061 } else
1630
- if (source == torusItem)
2062
+ if (source == torusItem || source == torusButton)
16312063 {
16322064 makeSomething(new Torus());
16332065 } else
1634
- if (source == superItem)
2066
+ if (source == superItem || source == superButton)
16352067 {
16362068 makeSomething(new Superellipsoid());
16372069 } else
1638
- if (source == kleinItem)
2070
+ if (source == kleinItem || source == kleinButton)
16392071 {
16402072 makeSomething(new Klein());
16412073 } else
....@@ -1655,7 +2087,7 @@
16552087 {
16562088 makeSomething(new BezierSurface());
16572089 } else
1658
- if (source == checkerItem)
2090
+ if (source == overlayItem || source == overlayButton)
16592091 {
16602092 /*
16612093 Object3D obj = new BezierSurface(5,8);
....@@ -1703,7 +2135,7 @@
17032135 s.setup();
17042136 makeSomething(s);
17052137 } else
1706
- if (source == lightItem)
2138
+ if (source == lightItem || source == lightButton)
17072139 {
17082140 makeSomething(new Light());
17092141 } else
....@@ -1753,30 +2185,30 @@
17532185
17542186 group(g);
17552187 } else
1756
- if (source == loopItem)
2188
+ if (source == loopItem || source == loopButton)
17572189 {
17582190 Composite csg = new GroupLeaf();
17592191 csg.count = 5;
17602192 group(csg);
1761
- Composite child = new cGroup();
2193
+ Composite child = new cGroup("Branch");
17622194 csg.addChild(child);
17632195 child.addChild(csg);
17642196 } else
17652197 if (source == doubleItem)
17662198 {
1767
- Composite csg = new GroupLeaf();
2199
+ Composite csg = new GroupLeaf("Fork");
17682200 csg.count = 5;
17692201 group(csg);
1770
- Composite child = new cGroup();
2202
+ Composite child = new cGroup("Branch A");
17712203 csg.addChild(child);
17722204 child.addChild(csg);
1773
- child = new cGroup();
2205
+ child = new cGroup("Branch B");
17742206 csg.addChild(child);
17752207 child.addChild(csg);
17762208 } else
17772209 if (source == tripleItem)
17782210 {
1779
- Composite csg = new GroupLeaf();
2211
+ Composite csg = new GroupLeaf("Trident");
17802212 csg.count = 4;
17812213 group(csg);
17822214 Composite child = new cGroup();
....@@ -1788,23 +2220,6 @@
17882220 child = new cGroup();
17892221 csg.addChild(child);
17902222 child.addChild(csg);
1791
- } else
1792
-
1793
- if (source == importGFDItem)
1794
- {
1795
- ImportGFD();
1796
- } else
1797
- if (source == importVRMLX3DItem)
1798
- {
1799
- ImportVRMLX3D();
1800
- } else
1801
- if (source == import3DSItem)
1802
- {
1803
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1804
- } else
1805
- if (source == importOBJItem)
1806
- {
1807
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18082223 } else
18092224 if (source == computeAOItem)
18102225 {
....@@ -1824,7 +2239,7 @@
18242239 if (source == invariantsItem)
18252240 {
18262241 System.out.println("Invariants:");
1827
- GrafreeD.grafreeD.universe.invariants();
2242
+ Grafreed.grafreeD.universe.invariants();
18282243 } else
18292244 if (source == memoryItem)
18302245 {
....@@ -1843,19 +2258,61 @@
18432258 {
18442259 DumpObject();
18452260 } 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
18462306 if (source == screenfitButton)
18472307 {
1848
- //Reload(lastConverter, lastFilename, true);
18492308 ScreenFit();
18502309 } else
18512310 if (source == screenfitpointButton)
18522311 {
1853
- //Reload(lastConverter, lastFilename, true);
18542312 ScreenFitPoint();
18552313 } else
18562314 if (source == snapobjectButton)
18572315 {
1858
- //Reload(lastConverter, lastFilename, true);
18592316 SnapObject();
18602317 } else
18612318 // if (event.getSource() == recompileButton)
....@@ -1892,12 +2349,20 @@
18922349 {
18932350 loadClipboard(true);
18942351 } else
2352
+ if (source == undoItem)
2353
+ {
2354
+ Undo();
2355
+ } else
2356
+ if (source == redoItem)
2357
+ {
2358
+ Redo();
2359
+ } else
18952360 if (source == duplicateItem)
18962361 {
1897
- Object3D keep = GrafreeD.clipboard;
2362
+ Object3D keep = Grafreed.clipboard;
18982363 loadClipboard(false);
18992364 paste(false);
1900
- GrafreeD.clipboard = keep;
2365
+ Grafreed.clipboard = keep;
19012366 } else
19022367 if (source == cloneItem)
19032368 {
....@@ -1915,13 +2380,17 @@
19152380 {
19162381 paste(false);
19172382 } else
2383
+ if (source == pasteIntoItem)
2384
+ {
2385
+ pasteInto(true, false);
2386
+ } else
19182387 if (source == pasteLinkItem)
19192388 {
1920
- pasteInto(false);
2389
+ pasteInto(false, false);
19212390 } else
19222391 if (source == pasteCloneItem)
19232392 {
1924
- pasteInto(true);
2393
+ pasteInto(true, true);
19252394 } else
19262395 if (source == pasteExpandItem)
19272396 {
....@@ -2113,9 +2582,9 @@
21132582 // group.selection.get(0).setMasterThis(content); // should be identity
21142583 // refreshContents();
21152584 // }
2116
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2585
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21172586 {
2118
- Object3D content = GrafreeD.clipboard.get(0);
2587
+ Object3D content = Grafreed.clipboard.get(0);
21192588
21202589 if (content instanceof cGroup && ((cGroup)content).transientlink )
21212590 content = ((cGroup)content).get(0);
....@@ -2123,11 +2592,11 @@
21232592 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21242593 for (int i=0; i<group.selection.size(); i++)
21252594 {
2126
- boolean random = CameraPane.RANDOM;
2127
- CameraPane.RANDOM = false; // parse all random nodes
2595
+ boolean random = CameraPane.SWITCH;
2596
+ CameraPane.SWITCH = false; // parse all random nodes
21282597 group.selection.get(i).linkVerticesThis(content);
21292598 // group.selection.get(i).setMasterThis(content); // should be identity
2130
- CameraPane.RANDOM = random;
2599
+ CameraPane.SWITCH = random;
21312600 }
21322601 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21332602 refreshContents();
....@@ -2137,20 +2606,20 @@
21372606 {
21382607 for (int i=0; i<group.selection.size(); i++)
21392608 {
2140
- boolean random = CameraPane.RANDOM;
2141
- CameraPane.RANDOM = false; // parse all random nodes
2609
+ boolean random = CameraPane.SWITCH;
2610
+ CameraPane.SWITCH = false; // parse all random nodes
21422611 group.selection.get(i).linkVerticesThis(null);
2143
- CameraPane.RANDOM = random;
2612
+ CameraPane.SWITCH = random;
21442613 }
21452614
21462615 refreshContents();
21472616 } else
21482617 if (source == relinkverticesItem)
21492618 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2619
+ boolean random = CameraPane.SWITCH;
2620
+ CameraPane.SWITCH = false; // parse all random nodes
21522621 group.selection.RelinkToSupport();
2153
- CameraPane.RANDOM = random;
2622
+ CameraPane.SWITCH = random;
21542623
21552624 refreshContents();
21562625 } else
....@@ -2165,9 +2634,9 @@
21652634 } else
21662635 if (source == setMasterItem)
21672636 {
2168
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2637
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21692638 {
2170
- Object3D content = GrafreeD.clipboard.get(0);
2639
+ Object3D content = Grafreed.clipboard.get(0);
21712640
21722641 if (content instanceof cGroup && ((cGroup)content).transientlink )
21732642 content = ((cGroup)content).get(0);
....@@ -2180,9 +2649,9 @@
21802649 {
21812650 if (group.selection.size() == 1)
21822651 {
2183
- if (GrafreeD.clipboard.size() == 1)
2652
+ if (Grafreed.clipboard.size() == 1)
21842653 {
2185
- Object3D content = GrafreeD.clipboard.get(0);
2654
+ Object3D content = Grafreed.clipboard.get(0);
21862655
21872656 if (content instanceof cGroup && ((cGroup)content).transientlink )
21882657 content = ((cGroup)content).get(0);
....@@ -2199,7 +2668,7 @@
21992668 {
22002669 RevertMeshes();
22012670 } else
2202
- if (source == resetMeshItem)
2671
+ if (source == resetAllItem)
22032672 {
22042673 ResetAll();
22052674 } else
....@@ -2207,7 +2676,7 @@
22072676 {
22082677 StepAll();
22092678 } else
2210
- if (source == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
22112680 {
22122681 //int indices[] = jList.getSelectedIndices();
22132682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2219,9 +2688,9 @@
22192688 {
22202689 ClearSelection(true);
22212690 } else
2222
- if (source == grabItem)
2691
+ if (source == grabItem || source == groupButton)
22232692 {
2224
- group(new cGroup(), true);
2693
+ group(new cGroup(), false); // true);
22252694 } else
22262695 if (source == hideItem)
22272696 {
....@@ -2239,16 +2708,16 @@
22392708 {
22402709 makeSomething(new Camera());
22412710 } else
2242
- if (source == compositeItem)
2711
+ if (source == compositeItem || source == compositeButton)
22432712 {
22442713 group(new Composite());
22452714 } else
2246
- if (source == randomItem)
2715
+ if (source == switchItem || source == switchButton)
22472716 {
22482717 RandomNode random = new RandomNode();
22492718 group(random);
22502719 if (random.size() > 0)
2251
- random.name = random.get(0).name + "Rnd";
2720
+ random.name = random.get(0).name + "Switch";
22522721 } else
22532722 if (source == physicsItem)
22542723 {
....@@ -2345,7 +2814,7 @@
23452814 {
23462815 group(new cLinker());
23472816 } else
2348
- if (source == textureItem)
2817
+ if (source == textureItem || source == textureButton)
23492818 {
23502819 group(new TextureNode());
23512820 } else
....@@ -2365,17 +2834,30 @@
23652834 {
23662835 CastShadow(2);
23672836 } else
2368
- if (source == ungroupItem)
2837
+ if (source == ungroupItem || source == ungroupButton)
23692838 {
2370
- //ungroup();
2839
+ boolean hasRoot = false;
2840
+
23712841 for (int i=0; i<group.selection.size(); i++)
23722842 {
2373
- Ungroup(group.selection.get(i));
2843
+ if (group.selection.get(i) == group)
2844
+ {
2845
+ hasRoot = true;
2846
+ break;
2847
+ }
23742848 }
23752849
2376
- ClearSelection(false);
2377
-
2378
- 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
+ }
23792861 } else
23802862 if (source == genUVItem)
23812863 {
....@@ -2387,7 +2869,7 @@
23872869 } else
23882870 if (source == genNormalsMESHItem)
23892871 {
2390
- GenNormals(true); // TODO
2872
+ GenNormalsMESH();
23912873 } else
23922874 if (source == genNormalsORGANItem)
23932875 {
....@@ -2452,6 +2934,22 @@
24522934 if (source == unmarkleavesItem)
24532935 {
24542936 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);
24552953 } else
24562954 if (source == flipVItem)
24572955 {
....@@ -2537,9 +3035,13 @@
25373035 {
25383036 SmoothMesh();
25393037 } else
2540
- if (source == transformgeometryItem)
3038
+ if (source == transformGeometryItem)
25413039 {
25423040 TransformGeometry();
3041
+ } else
3042
+ if (source == transformChildrenItem)
3043
+ {
3044
+ TransformChildren();
25433045 } else
25443046 if (source == resetTransformItem)
25453047 {
....@@ -2547,7 +3049,11 @@
25473049 } else
25483050 if (source == resetCentroidItem)
25493051 {
2550
- ResetCentroid();
3052
+ ResetCentroid(true);
3053
+ } else
3054
+ if (source == resetCentroidXZItem)
3055
+ {
3056
+ ResetCentroid(false);
25513057 } else
25523058 if (source == resetParentItem)
25533059 {
....@@ -2652,7 +3158,7 @@
26523158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26533159 {
26543160 obj = (Object3D)e.nextElement();
2655
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
26563162 }
26573163
26583164 refreshContents();
....@@ -2668,6 +3174,31 @@
26683174
26693175 refreshContents();
26703176 } 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
26713202 if (source == flashSelectionButton)
26723203 {
26733204 CameraPane.flash = true;
....@@ -2679,6 +3210,10 @@
26793210 if (source == twoButton)
26803211 {
26813212 radio.layout = twoButton;
3213
+
3214
+ if (CameraPane.FULLSCREEN)
3215
+ fullscreenLayout = radio.layout;
3216
+
26823217 // bug
26833218 //gridPanel.setDividerLocation(1.0);
26843219 //bigPanel.setDividerLocation(0.0);
....@@ -2711,10 +3246,31 @@
27113246 bigThree.ClearUI();
27123247 bigThree.add(centralPanel);
27133248 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
+
27143267 } else
27153268 if (source == threeButton)
27163269 {
27173270 radio.layout = threeButton;
3271
+
3272
+ if (CameraPane.FULLSCREEN)
3273
+ fullscreenLayout = radio.layout;
27183274
27193275 // bigThree.remove(scenePanel);
27203276 // bigThree.remove(centralPanel);
....@@ -2747,10 +3303,15 @@
27473303 bigThree.add(centralPanel);
27483304 bigThree.add(XYZPanel);
27493305 bigThree.FlushUI();
3306
+
3307
+ cameraView.requestFocusInWindow();
27503308 } else
27513309 if (source == fourButton)
27523310 {
27533311 radio.layout = fourButton;
3312
+
3313
+ if (CameraPane.FULLSCREEN)
3314
+ fullscreenLayout = radio.layout;
27543315
27553316 // bigThree.remove(scenePanel);
27563317 // bigThree.remove(centralPanel);
....@@ -2782,10 +3343,15 @@
27823343 bigThree.ClearUI();
27833344 bigThree.add(scenePanel);
27843345 bigThree.FlushUI();
3346
+
3347
+ cameraView.requestFocusInWindow();
27853348 } else
27863349 if (source == sixButton)
27873350 {
27883351 radio.layout = sixButton;
3352
+
3353
+ if (CameraPane.FULLSCREEN)
3354
+ fullscreenLayout = radio.layout;
27893355
27903356 // bigThree.remove(scenePanel);
27913357 // bigThree.remove(centralPanel);
....@@ -2818,10 +3384,15 @@
28183384 bigThree.add(scenePanel);
28193385 bigThree.add(centralPanel);
28203386 bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
28213389 } else
28223390 if (source == sevenButton)
28233391 {
28243392 radio.layout = sevenButton;
3393
+
3394
+ if (CameraPane.FULLSCREEN)
3395
+ fullscreenLayout = radio.layout;
28253396
28263397 // bigThree.remove(scenePanel);
28273398 // bigThree.remove(centralPanel);
....@@ -2855,6 +3426,8 @@
28553426 bigThree.add(centralPanel);
28563427 bigThree.add(XYZPanel);
28573428 bigThree.FlushUI();
3429
+
3430
+ cameraView.requestFocusInWindow();
28583431 } else
28593432 if (source == rootButton)
28603433 {
....@@ -2866,6 +3439,7 @@
28663439 EditObject(obj);
28673440 }
28683441
3442
+ cameraView.requestFocusInWindow();
28693443 refreshContents(true);
28703444 } else
28713445 if (source == closeButton)
....@@ -2875,22 +3449,37 @@
28753449 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28763450 {
28773451 ab = (cRadio)e.nextElement();
2878
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3452
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28793453 {
3454
+ // Patch to avoid bug with transparency.
3455
+ if (!ab.hadMaterial)
3456
+ {
3457
+ ab.object.material = null;
3458
+ }
3459
+
28803460 buttonGroup.remove(ab);
28813461 radioPanel.remove(ab);
28823462
2883
- ab.GetObject().editWindow = null;
3463
+ //ab.GetObject().editWindow = null;
3464
+ ab.GetObject().manipWindow = null;
28843465 // ab.GetObject().objectUI = null; // ?????????
28853466
28863467 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28873468 break;
28883469 }
28893470 }
3471
+
3472
+ cameraView.requestFocusInWindow();
28903473 refreshContents(true);
28913474 } else
28923475 if (source == editItem || source == editButton)
28933476 {
3477
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3478
+ {
3479
+ Object3D child = (Object3D)e.nextElement();
3480
+ child.pinned = true;
3481
+ }
3482
+
28943483 EditSelection(false);
28953484 } else
28963485 if (source == uneditButton)
....@@ -2900,12 +3489,13 @@
29003489 Object3D child = (Object3D)e.nextElement();
29013490 if(child.editWindow != null)
29023491 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3492
+ child.pinned = false;
29033493 child.CloseUI();
29043494 listUI.remove(child);
29053495
2906
- child.editWindow = null; // ???????????
3496
+ //child.editWindow = null; // ???????????
29073497 }
2908
- objEditor.ctrlPanel.validate();
3498
+ objEditor.ctrlPanel.FlushUI();
29093499 //objEditor.jTree.clearSelection();
29103500 //objEditor.ResetSliders();
29113501 refreshContents(true);
....@@ -2916,6 +3506,7 @@
29163506 //copy.ClearUI();
29173507 for (Object3D obj : listUI)
29183508 {
3509
+ obj.pinned = false;
29193510 obj.CloseUI();
29203511 }
29213512 listUI.clear();
....@@ -2925,7 +3516,7 @@
29253516 {
29263517 assert(copy == group);
29273518
2928
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3519
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29293520
29303521 for (Object3D obj : listUI)
29313522 {
....@@ -2974,6 +3565,9 @@
29743565 }
29753566
29763567 copy = group;
3568
+
3569
+ SetUndoStates();
3570
+
29773571 //Globals.theRenderer.object = group;
29783572 if(!useclient)
29793573 {
....@@ -2989,20 +3583,46 @@
29893583 frontView.object = group;
29903584 sideView.object = group;
29913585 }
2992
- group.editWindow = this;
3586
+
3587
+// fix "+" issue
3588
+ //group.editWindow = this;
3589
+ group.manipWindow = this;
3590
+
29933591 /*
29943592 currentLayout = radio.layout;
29953593 if (currentLayout == null)
29963594 currentLayout = sevenButton;
29973595 */
29983596 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);
29993604 keepparent = group.parent;
30003605 // PARENT = NULL or not???
30013606 //group.parent = null; // ROOT
30023607 //group.attributes = -1;
30033608 ResetModel();
3609
+
3610
+ cameraView.requestFocusInWindow();
30043611 refreshContents(true);
3005
- }
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
+ }
30063626 else
30073627 {
30083628 //return super.action(event, arg);
....@@ -3011,7 +3631,6 @@
30113631 }
30123632
30133633 boolean useclient = false;
3014
- cRadio radio;
30153634
30163635 void ToggleRoot()
30173636 {
....@@ -3063,6 +3682,28 @@
30633682 refreshContents();
30643683 }
30653684
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
+ }
30663707
30673708 void ResetTransform()
30683709 {
....@@ -3175,7 +3816,7 @@
31753816 refreshContents();
31763817 }
31773818
3178
- void ResetCentroid()
3819
+ void ResetCentroid(boolean full)
31793820 {
31803821 Object3D obj;
31813822 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3190,12 +3831,16 @@
31903831 LA.matIdentity(Object3D.mat);
31913832 obj.getBounds(minima, maxima, false);
31923833 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3193
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3834
+ if (full)
3835
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31943836 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31953837 obj.TransformMesh(Object3D.mat);
3838
+
31963839 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3197
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3840
+ if (full)
3841
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31983842 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3843
+
31993844 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32003845 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32013846 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3224,7 +3869,8 @@
32243869
32253870 int size = obj.MemorySize();
32263871
3227
- 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)");
32283874 }
32293875 }
32303876 catch (Exception e)
....@@ -3261,9 +3907,9 @@
32613907 obj = (Object3D)e.nextElement();
32623908
32633909 System.out.println("Object is: " + obj);
3264
- GrafreeD.AnalyzeObject(obj);
3910
+ Grafreed.AnalyzeObject(obj);
32653911 System.out.println("Boundary rep: " + obj.bRep);
3266
- GrafreeD.AnalyzeObject(obj.bRep);
3912
+ Grafreed.AnalyzeObject(obj.bRep);
32673913
32683914 // System.err.println((size/1024) + " KB is the size of " + obj);
32693915 }
....@@ -3305,6 +3951,13 @@
33053951 void GenNormals(boolean crease)
33063952 {
33073953 group.GenNormalsS(crease);
3954
+
3955
+ refreshContents();
3956
+ }
3957
+
3958
+ void GenNormalsMESH()
3959
+ {
3960
+ group.GenNormalsMeshS();
33083961
33093962 refreshContents();
33103963 }
....@@ -3477,8 +4130,8 @@
34774130
34784131 void ParseVertices()
34794132 {
3480
- boolean epsequal = GrafreeD.epsequal;
3481
- GrafreeD.epsequal = true;
4133
+ boolean epsequal = Grafreed.epsequal;
4134
+ Grafreed.epsequal = true;
34824135
34834136 for (int i=0; i<group.selection.size(); i++)
34844137 {
....@@ -3503,7 +4156,7 @@
35034156 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35044157 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35054158
3506
- g.add(GrafreeD.clipboard);
4159
+ g.add(Grafreed.clipboard);
35074160
35084161 buffer.add(g);
35094162 }
....@@ -3518,7 +4171,7 @@
35184171 makeSomething(buffer, i==group.selection.size()-1);
35194172 }
35204173
3521
- GrafreeD.epsequal = epsequal;
4174
+ Grafreed.epsequal = epsequal;
35224175
35234176 refreshContents();
35244177 }
....@@ -3536,7 +4189,16 @@
35364189 String pigment = Object3D.GetPigment(tex);
35374190 //String bump = Object3D.GetBump(tex);
35384191
3539
- 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
+ }
35404202
35414203 double s = v.s;
35424204
....@@ -3624,11 +4286,11 @@
36244286
36254287 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36264288
3627
- boolean random = CameraPane.RANDOM;
3628
- CameraPane.RANDOM = false; // parse all random nodes
4289
+ boolean random = CameraPane.SWITCH;
4290
+ CameraPane.SWITCH = false; // parse all random nodes
36294291 lowres.linkVerticesThis(null);
36304292 lowres.linkVerticesThis(sn);
3631
- CameraPane.RANDOM = random;
4293
+ CameraPane.SWITCH = random;
36324294
36334295 System.err.flush();
36344296
....@@ -3668,7 +4330,7 @@
36684330 return;
36694331
36704332 Object3D poses = group.selection.get(0);
3671
- Object3D ref = GrafreeD.clipboard.get(0);
4333
+ Object3D ref = Grafreed.clipboard.get(0);
36724334
36734335 Object3D newgroup = new Object3D("Po:" + poses.name);
36744336
....@@ -3862,9 +4524,9 @@
38624524
38634525 void ClipMesh()
38644526 {
3865
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4527
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38664528 {
3867
- Object3D content = GrafreeD.clipboard.get(0);
4529
+ Object3D content = Grafreed.clipboard.get(0);
38684530
38694531 if (content instanceof cGroup && ((cGroup)content).transientlink )
38704532 content = ((cGroup)content).get(0);
....@@ -3873,7 +4535,7 @@
38734535 // {
38744536 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38754537 // }
3876
- group.selection.ClipMesh(GrafreeD.clipboard);
4538
+ group.selection.ClipMesh(Grafreed.clipboard);
38774539 }
38784540 // group.selection.ClipMesh(GrafreeD.clipboard);
38794541 System.out.println("DONE.");
....@@ -3920,6 +4582,18 @@
39204582 void MarkLeaves(boolean hide)
39214583 {
39224584 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);
39234597 refreshContents();
39244598 }
39254599
....@@ -3994,28 +4668,25 @@
39944668 // }
39954669 // }
39964670
3997
- static boolean allparams = true;
3998
-
3999
- static Vector<Object3D> listUI = new Vector<Object3D>();
4000
-
40014671 void EditSelection(boolean newWindow)
40024672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
40034679 // aConstraints.gridy = 0;
40044680 for (int i=0; i<group.selection.size(); i++)
40054681 {
40064682 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40074683 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4008
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4684
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40094685
40104686 Object3D elem = (Object3D)group.selection.elementAt(i);
4011
- if(elem != group)
4687
+ if(elem != group || !newWindow)
40124688 {
4013
- // if (!(elem instanceof Composite))
4014
- // newWindow = false;
4015
- listUI.add(elem);
4016
- elem.openEditWindow(this, newWindow); //, false);
4017
- System.out.println("edit : " + elem);
4018
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
40194690 }
40204691 }
40214692 }
....@@ -4090,7 +4761,8 @@
40904761 //new Exception().printStackTrace();
40914762
40924763 freezemodel = true;
4093
-
4764
+ ClearUnpinned();
4765
+
40944766 /**/
40954767 //switch (event.id)
40964768 {
....@@ -4098,7 +4770,6 @@
40984770 //case 702: // Event.LIST_DESELECT
40994771 group.deselectAll();
41004772 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4101
- objEditor.ClearInfo(); // .GetMaterial());
41024773 if (tps != null)
41034774 {
41044775 for (int i=0; i < tps.length; i++)
....@@ -4107,33 +4778,39 @@
41074778
41084779 //if (child.parent != null)
41094780 //child.parent.addSelectee(child);
4781
+ objEditor.SetMaterial(child);
41104782 group.addSelectee(child);
4111
- objEditor.SetMaterial(child); // .GetMaterial());
4112
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4113
- System.err.println("info : " + child.GetPath());
41144783 }
41154784 }
4116
- else
4117
- {
4118
- objEditor.SetMaterial(group); // .GetMaterial());
4119
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4120
- System.err.println("info : " + group.GetPath());
4121
- }
4785
+// else
4786
+// {
4787
+// objEditor.SetMaterial(group); // .GetMaterial());
4788
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4789
+// System.err.println("info : " + group.GetPath());
4790
+// }
41224791
4123
- objEditor.SetText(); // jan 2014
4124
-
4125
- 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))
41264793 CameraPane.flash = true;
41274794
4128
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4795
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41294796 // a camera
41304797 {
4131
- CameraPane.camerachangeframe = 0; // don't refuse it
4132
- 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
+ }
41334803 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41344804 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41354805 }
41364806
4807
+ if (tps != null && tps.length == 1)
4808
+ {
4809
+ EditSelection(false);
4810
+ }
4811
+
4812
+ SetPinStates(tps != null && tps.length > 0);
4813
+
41374814 refreshContents();
41384815 //return true;
41394816 }
....@@ -4142,6 +4819,35 @@
41424819
41434820 freezemodel = false;
41444821 }
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
+ }
41454851
41464852 void linkSomething(Object3D thing)
41474853 {
....@@ -4213,16 +4919,19 @@
42134919 {
42144920 if (group.selection.isEmpty())
42154921 return;
4216
- GrafreeD.clipboardIsTempGroup = false;
4922
+
4923
+ Grafreed.clipboardIsTempGroup = false;
42174924 Composite tGroup = null;
42184925 if (group.selection.size() > 0) // 1)
42194926 {
42204927 tGroup = new cGroup();
4221
- GrafreeD.clipboardIsTempGroup = true;
4928
+ Grafreed.clipboardIsTempGroup = true;
42224929 }
42234930
42244931 if (cut)
42254932 {
4933
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4934
+// Save();
42264935 //int indices[] = jList.getSelectedIndices();
42274936 //for (int i = indices.length - 1; i >= 0; i--)
42284937 //jList.remove(indices[i]);
....@@ -4258,16 +4967,16 @@
42584967 //System.out.println("cut " + child);
42594968 //System.out.println("parent = " + child.parent);
42604969 // tmp.addChild(child);
4261
- if (GrafreeD.clipboardIsTempGroup)
4970
+ if (Grafreed.clipboardIsTempGroup)
42624971 tGroup.add/*Child*/(tmp);
42634972 else
4264
- GrafreeD.clipboard = tmp;
4973
+ Grafreed.clipboard = tmp;
42654974 }
42664975 else
4267
- if (GrafreeD.clipboardIsTempGroup)
4976
+ if (Grafreed.clipboardIsTempGroup)
42684977 tGroup.add/*Child*/(child);
42694978 else
4270
- GrafreeD.clipboard = child;
4979
+ Grafreed.clipboard = child;
42714980 }
42724981
42734982 //ResetModel();
....@@ -4299,21 +5008,23 @@
42995008 //System.out.println("cut " + elem);
43005009 //System.out.println("parent = " + elem.parent);
43015010 // tmp.addChild(elem);
4302
- if (GrafreeD.clipboardIsTempGroup)
5011
+ if (Grafreed.clipboardIsTempGroup)
43035012 tGroup.add/*Child*/(tmp);
43045013 else
4305
- GrafreeD.clipboard = tmp;
5014
+ Grafreed.clipboard = tmp;
43065015 }
43075016 else
4308
- if (GrafreeD.clipboardIsTempGroup)
5017
+ if (Grafreed.clipboardIsTempGroup)
43095018 tGroup.add/*Child*/(child);
43105019 else
4311
- GrafreeD.clipboard = child;
5020
+ Grafreed.clipboard = child;
43125021 }
43135022
43145023 }
4315
- if (GrafreeD.clipboardIsTempGroup)
4316
- GrafreeD.clipboard = tGroup;
5024
+
5025
+ if (Grafreed.clipboardIsTempGroup)
5026
+ Grafreed.clipboard = tGroup;
5027
+
43175028 if (cut)
43185029 {
43195030 ResetModel();
....@@ -4323,11 +5034,15 @@
43235034
43245035 void paste(boolean expand)
43255036 {
5037
+ if (Globals.REPLACEONMAKE)
5038
+ Save();
5039
+ boolean keep = Globals.REPLACEONMAKE;
5040
+ Globals.REPLACEONMAKE = false;
43265041 // if (GrafreeD.clipboard == null)
43275042 // return;
43285043 boolean first = true;
43295044
4330
- if (GrafreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
43315046 {
43325047 Composite temp;
43335048
....@@ -4338,7 +5053,7 @@
43385053 temp = (Composite)Applet3D.clipboard.deepCopy();
43395054 */
43405055 Object3D elem;
4341
- 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))
43425057 {
43435058 Object3D child = (Object3D)e.nextElement();
43445059
....@@ -4372,21 +5087,22 @@
43725087 //Object3D cb = Applet3D.clipboard;
43735088 //temp.addChild(cb);
43745089 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4375
- assert(GrafreeD.clipboard.parent == null);
4376
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4377
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4378
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4379
- 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());
43805095 else
4381
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4382
- GrafreeD.clipboard.get(0).parent = keepparent;
5096
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5097
+ Grafreed.clipboard.get(0).parent = keepparent;
43835098 }
43845099
5100
+ Globals.REPLACEONMAKE = keep;
43855101 ResetModel();
43865102 refreshContents();
43875103 }
43885104
4389
- void pasteInto(boolean copyit)
5105
+ void pasteInto(boolean copyit, boolean clone)
43905106 {
43915107 // if (GrafreeD.clipboard == null)
43925108 // return;
....@@ -4415,15 +5131,22 @@
44155131 if (copyit)
44165132 {
44175133 // paste(false);
4418
- CloneClipboard(false); // sept 2014
5134
+ if (clone)
5135
+ {
5136
+ CloneClipboard(false); // sept 2014
5137
+ }
5138
+ else
5139
+ {
5140
+ paste(false);
5141
+ }
44195142 }
44205143 else
44215144 {
44225145 boolean first = true;
44235146
4424
- if (GrafreeD.clipboardIsTempGroup)
5147
+ if (Grafreed.clipboardIsTempGroup)
44255148 {
4426
- Composite temp = (Composite)GrafreeD.clipboard;
5149
+ Composite temp = (Composite)Grafreed.clipboard;
44275150 Object3D copy;
44285151 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44295152 {
....@@ -4433,7 +5156,7 @@
44335156 }
44345157 } else
44355158 {
4436
- linkSomething(GrafreeD.clipboard); //.get(0));
5159
+ linkSomething(Grafreed.clipboard); //.get(0));
44375160 }
44385161 }
44395162 }
....@@ -4510,6 +5233,10 @@
45105233
45115234 void group(Object3D csg, boolean grab)
45125235 {
5236
+ if (Globals.REPLACEONMAKE)
5237
+ Save();
5238
+ boolean keep = Globals.REPLACEONMAKE;
5239
+ Globals.REPLACEONMAKE = false;
45135240 if (//false) // why??
45145241 !group.selection.isEmpty())
45155242 {
....@@ -4623,10 +5350,15 @@
46235350 //node.add(csg);
46245351 //makeSomething(node);
46255352 makeSomething(csg);
5353
+ Globals.REPLACEONMAKE = keep;
46265354 }
46275355
46285356 void Ungroup(Object3D g)
46295357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
46305362 if (g instanceof HiddenObject)
46315363 {
46325364 HiddenObject h = (HiddenObject) g;
....@@ -4643,6 +5375,7 @@
46435375 objEditor.makeSomething(g.get(i), false);
46445376 }
46455377 }
5378
+ Globals.REPLACEONMAKE = keep;
46465379 }
46475380
46485381 void ungroup()
....@@ -4838,21 +5571,6 @@
48385571 }
48395572 */
48405573
4841
- void ImportGFD()
4842
- {
4843
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4844
- browser.show();
4845
- String filename = browser.getFile();
4846
- if (filename != null && filename.length() > 0)
4847
- {
4848
- String fullname = browser.getDirectory() + filename;
4849
-
4850
- //Object3D readobj =
4851
- objEditor.ReadGFD(fullname, objEditor);
4852
- //makeSomething(readobj);
4853
- }
4854
- }
4855
-
48565574 /*
48575575 public void Callback(Object obj)
48585576 {
....@@ -4876,26 +5594,9 @@
48765594 }
48775595 */
48785596
4879
- void ImportVRMLX3D()
4880
- {
4881
- if (GrafreeD.standAlone)
4882
- {
4883
- /**/
4884
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4885
- browser.show();
4886
- String filename = browser.getFile();
4887
- if (filename != null && filename.length() > 0)
4888
- {
4889
- String fullname = browser.getDirectory() + filename;
4890
- LoadVRMLX3D(fullname);
4891
- }
4892
- /**/
4893
- }
4894
- }
4895
-
48965597 String GetFile(String dialogName)
48975598 {
4898
- if (GrafreeD.standAlone)
5599
+ if (Grafreed.standAlone)
48995600 {
49005601 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49015602 browser.show();
....@@ -4959,10 +5660,33 @@
49595660 cButton flashSelectionButton;
49605661 cButton editButton;
49615662 cButton uneditButton;
5663
+ JCheckBox allParamsButton;
49625664 cButton clearpanelButton;
4963
- cButton allParamsButton;
49645665 cButton unselectButton;
49655666
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
+
49665690 cButton screenfitButton;
49675691 cButton screenfitpointButton;
49685692 cButton snapobjectButton;
....@@ -4974,14 +5698,6 @@
49745698
49755699 cButton setsupportButton;
49765700
4977
- cButton twoButton;
4978
- cButton sixButton;
4979
- cButton threeButton;
4980
- cButton sevenButton;
4981
- cButton fourButton; // full panel
4982
- cButton oneButton; // full XYZ
4983
- //cButton currentLayout;
4984
-
49855701 //
49865702 //Composite
49875703 Object3D // to do !!
....@@ -4991,9 +5707,11 @@
49915707 //JTree jTree;
49925708 private MenuItem lookAtItem;
49935709 private MenuItem lookFromItem;
4994
- private MenuItem switchItem;
5710
+ private MenuItem switchViewItem;
49955711 private MenuItem cutItem;
4996
- private MenuItem duplicateItem;
5712
+ private MenuItem undoItem;
5713
+ private MenuItem redoItem;
5714
+ private JMenuItem duplicateItem;
49975715 private MenuItem cloneItem;
49985716 private MenuItem cloneSupportItem;
49995717 private MenuItem overwriteGeoItem;
....@@ -5006,7 +5724,7 @@
50065724 private MenuItem linkverticesItem;
50075725 private MenuItem relinkverticesItem;
50085726 private MenuItem setMasterItem;
5009
- private MenuItem resetMeshItem;
5727
+ private MenuItem resetAllItem;
50105728 private MenuItem stepAllItem;
50115729 private MenuItem revertMeshItem;
50125730 private MenuItem poseMeshItem;
....@@ -5017,10 +5735,11 @@
50175735 private MenuItem mergeGeometriesItem;
50185736 private MenuItem copyItem;
50195737 private MenuItem pasteItem;
5738
+ private MenuItem pasteIntoItem;
50205739 private MenuItem pasteLinkItem;
50215740 private MenuItem pasteCloneItem;
50225741 private MenuItem pasteExpandItem;
5023
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
50245743 private MenuItem clearAllItem;
50255744 private MenuItem genUVItem;
50265745 private MenuItem genNormalsMESHItem;
....@@ -5055,6 +5774,10 @@
50555774 private MenuItem showleavesItem;
50565775 private MenuItem markleavesItem;
50575776 private MenuItem unmarkleavesItem;
5777
+ private MenuItem rewindleavesItem;
5778
+ private MenuItem unrewindleavesItem;
5779
+ private MenuItem randomleavesItem;
5780
+ private MenuItem unrandomleavesItem;
50585781
50595782 private MenuItem flipVItem;
50605783 private MenuItem unflipVItem;
....@@ -5066,15 +5789,17 @@
50665789 private MenuItem panoTexturesItem;
50675790
50685791 private MenuItem resetCentroidItem;
5069
- private MenuItem transformgeometryItem;
5792
+ private MenuItem resetCentroidXZItem;
50705793 private MenuItem resetTransformItem;
5794
+ private MenuItem transformGeometryItem;
5795
+ private MenuItem transformChildrenItem;
50715796 private MenuItem hideItem;
50725797 private MenuItem grabItem;
50735798 private MenuItem backItem;
50745799 private MenuItem frontItem;
50755800 private MenuItem cameraItem;
50765801 private MenuItem compositeItem;
5077
- private MenuItem randomItem;
5802
+ private MenuItem switchItem;
50785803 private MenuItem physicsItem;
50795804 private MenuItem frameselectorItem;
50805805 private MenuItem scriptNodeItem;
....@@ -5098,6 +5823,8 @@
50985823 private MenuItem attachBumpItem;
50995824 private MenuItem detachBumpItem;
51005825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
51015828
51025829 private MenuItem particleItem;
51035830 private MenuItem ragdollItem;
....@@ -5114,7 +5841,7 @@
51145841 private MenuItem blobItem;
51155842 private MenuItem latheItem;
51165843 private MenuItem bezierItem;
5117
- private MenuItem checkerItem;
5844
+ private MenuItem overlayItem;
51185845 private MenuItem meshItem;
51195846 // private MenuItem meshGroupItem;
51205847 private MenuItem springItem;
....@@ -5136,11 +5863,6 @@
51365863 private MenuItem doubleItem;
51375864 private MenuItem tripleItem;
51385865
5139
- private MenuItem importGFDItem;
5140
- private MenuItem importVRMLX3DItem;
5141
- private MenuItem import3DSItem;
5142
- private MenuItem importOBJItem;
5143
-
51445866 private MenuItem computeAOItem;
51455867 private MenuItem recompileItem;
51465868 private MenuItem editScriptItem;
....@@ -5150,4 +5872,8 @@
51505872 private MenuItem analyzeItem;
51515873 private MenuItem dumpItem;
51525874 //boolean freezemodel = false;
5875
+
5876
+ Menu cameraMenu;
5877
+ MenuItem editCameraItem;
5878
+ MenuItem restoreCameraItem;
51535879 }