Normand Briere
2019-07-23 cf7cfa1c792eebba606a48aa648893f6e4873263
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -59,6 +60,12 @@
5960 this.copy = this.group = group;
6061 //selectees = this.group.selectees;
6162
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6269 if(ui)
6370 SetupUI(objEditor);
6471 }
....@@ -73,16 +80,28 @@
7380 this.copy = this.group = copy;
7481 //selectees = this.group.selectees;
7582
76
- SetupMenu2(objEditor);
83
+ SetupMenu2(this); //objEditor);
7784 SetupUI2(objEditor);
7885 objEditor.SetupUI(true);
7986 SetupViews(objEditor);
8087
8188 ((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
+ }
8297 }
8398
8499 void CloneSelection(boolean supports)
85100 {
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
86105 // Object3D keep = GrafreeD.clipboard;
87106 //Object3D obj;
88107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +112,19 @@
93112
94113 makeSomething(clone, i==group.selection.size()-1);
95114 }
115
+ Globals.REPLACEONMAKE = keep;
96116 }
97117
98118 void CloneClipboard(boolean supports)
99119 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- 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));
105125 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
126
+ makeSomething(CloneObject(Grafreed.clipboard, false));
127
+ Grafreed.clipboard.get(0).parent = keepparent;
108128 }
109129
110130 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +138,7 @@
118138 // obj.support = null;
119139 if (!supports)
120140 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
141
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122142 obj.parent = parent;
123143 // obj.support = support;
124144 // clone.support = support; // aout 2013
....@@ -147,30 +167,29 @@
147167
148168 //JTextField nameField;
149169
150
- void SetupMenu2(ObjEditor oe)
170
+ void SetupMenu2(GroupEditor oe)
151171 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
172
+ oe.jTree = new cTree();
173
+
163174 Menu menu;
164175 oe.menuBar.add(menu = new Menu("Edit"));
165176 //editItem = menu.add(new MenuItem("Edit"));
166177 //editItem.addActionListener(this);
167
- 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"));
168185 duplicateItem.addActionListener(this);
169
- menu.add("-");
170186 cloneItem = menu.add(new MenuItem("Clone"));
171187 cloneItem.addActionListener(this);
188
+ if (Globals.ADVANCED)
189
+ {
172190 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173191 cloneSupportItem.addActionListener(this);
192
+ }
174193 menu.add("-");
175194 cutItem = menu.add(new MenuItem("Cut"));
176195 cutItem.addActionListener(this);
....@@ -178,27 +197,123 @@
178197 copyItem.addActionListener(this);
179198 pasteItem = menu.add(new MenuItem("Paste"));
180199 pasteItem.addActionListener(this);
200
+
201
+ menu.add("-");
202
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
203
+ pasteIntoItem.addActionListener(this);
181204 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182205 pasteLinkItem.addActionListener(this);
183206 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184207 pasteCloneItem.addActionListener(this);
185208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186209 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- 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...
189217 clearAllItem = menu.add(new MenuItem("Clear All"));
190218 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());
191256
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
+
192308 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
309
+ if (Globals.ADVANCED)
310
+ {
197311 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198312 revertMeshItem.addActionListener(this);
199313 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200314 resetreferencesItem.addActionListener(this);
201315 menu.add("-");
316
+ }
202317 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203318 overwriteGeoItem.addActionListener(this);
204319 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +325,104 @@
210325 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211326 overwriteUVItem.addActionListener(this);
212327 menu.add("-");
328
+ if (Globals.ADVANCED)
329
+ {
213330 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214331 generateMeshItem.addActionListener(this);
215332 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216333 poseMeshItem.addActionListener(this);
217334 menu.add("-");
335
+ }
218336 resetsupportItem = menu.add(new MenuItem("Reset support"));
219337 resetsupportItem.addActionListener(this);
220338 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221339 linkverticesItem.addActionListener(this);
340
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
341
+ relinkverticesItem.addActionListener(this);
342
+
343
+ if (Globals.ADVANCED)
344
+ {
222345 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223346 setMasterItem.addActionListener(this);
347
+ }
224348
225349 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
228352 backItem = menu.add(new MenuItem("Back"));
229353 backItem.addActionListener(this);
230354 frontItem = menu.add(new MenuItem("Front"));
231355 frontItem.addActionListener(this);
232
- compositeItem = menu.add(new MenuItem("Composite"));
233
- compositeItem.addActionListener(this);
234
- menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
236
- randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
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"));
362
+ hideItem.addActionListener(this);
363
+ }
364
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
365
+ ungroupItem.addActionListener(this);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
241373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242374 switchGeoItem.addActionListener(this);
243375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244376 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
377
+ morphItem = menu.add(new MenuItem("Morph Group"));
246378 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);
247385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248386 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
387
+ }
251388
252389 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
392
+ billboardItem = menu.add(new MenuItem("Billboard"));
393
+ billboardItem.addActionListener(this);
255394 csgItem = menu.add(new MenuItem("CSG"));
256395 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258397 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260399 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
405
+ if (Globals.ADVANCED)
406
+ {
407
+ menu.add("-");
263408 linkerItem = menu.add(new MenuItem("Linker"));
264409 linkerItem.addActionListener(this);
265410 templateItem = menu.add(new MenuItem("Template"));
266411 templateItem.addActionListener(this);
267
- attributeItem = menu.add(new MenuItem("Attribute"));
268
- attributeItem.addActionListener(this);
269412 pointflowItem = menu.add(new MenuItem("Point Flow"));
270413 pointflowItem.addActionListener(this);
414
+ }
271415 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274416 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275417 resetTransformItem.addActionListener(this);
276418 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277419 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.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);
280426
281427 oe.menuBar.add(menu = new Menu("Geometry"));
282428 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +433,11 @@
287433 genNormalsCADItem.addActionListener(this);
288434 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289435 genNormalsMESHItem.addActionListener(this);
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
439
+ genNormalsMINEItem.addActionListener(this);
440
+ }
290441 stripifyItem = menu.add(new MenuItem("Stripify"));
291442 stripifyItem.addActionListener(this);
292443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +459,34 @@
308459 reduce34MeshItem.addActionListener(this);
309460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310461 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
315470
316471 oe.menuBar.add(menu = new Menu("Attributes"));
317472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318473 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);
319478 menu.add("-");
320479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321480 liveleavesItem.addActionListener(this);
322481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
324485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325486 supportleavesItem.addActionListener(this);
326487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327488 unsupportleavesItem.addActionListener(this);
489
+ }
328490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329491 hideleavesItem.addActionListener(this);
330492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -333,6 +495,14 @@
333495 markleavesItem.addActionListener(this);
334496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
335497 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);
336506 menu.add("-");
337507 flipVItem = menu.add(new MenuItem("Flip V"));
338508 flipVItem.addActionListener(this);
....@@ -358,45 +528,56 @@
358528 attachBumpItem.addActionListener(this);
359529 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
360530 pigmentBumpItem.addActionListener(this);
531
+ //embedTexturesItem
361532 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
362533 detachPigmentItem.addActionListener(this);
363534 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
364535 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);
365540 menu.add("-");
366541 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
367542 sortbysizeItem.addActionListener(this);
368543 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369544 sortbynameItem.addActionListener(this);
370545 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.
371553 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372554 extractGeometriesItem.addActionListener(this);
373555 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374556 cloneGeometriesItem.addActionListener(this);
375
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
376
- shareGeometriesItem.addActionListener(this);
377
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378
- mergeGeometriesItem.addActionListener(this);
557
+ }
379558
380559 oe.menuBar.add(menu = new Menu("Insert"));
381560 buildCreateMenu(menu);
382561
383
-
384
- oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
390
- importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
392
- import3DSItem.addActionListener(this);
393
-
394562 oe.menuBar.add(menu = new Menu("Tools"));
395563 buildToolsMenu(menu);
396564 }
397565
566
+
398567 void SetupUI2(ObjEditor oe)
399568 {
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
+
400581 //new Exception().printStackTrace();
401582
402583 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -425,150 +606,231 @@
425606 oe.radioPanel.add(dummyButton);
426607 oe.buttonGroup.add(dummyButton);
427608 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
609
+ cGridBag copyOptionsPanel = new cGridBag();
610
+
611
+ copyOptionsPanel.preferredHeight = 1;
431612
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
613
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
614
+
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);
631
+ screenfitButton.setToolTipText("Screen fit");
632
+ screenfitButton.addActionListener(this);
633
+
634
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ restoreCameraButton.setToolTipText("Restore viewpoint");
636
+ restoreCameraButton.addActionListener(this);
637
+
638
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ saveButton.setToolTipText("New version");
640
+ saveButton.addActionListener(this);
641
+
642
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643
+ undoButton.setToolTipText("Previous version");
644
+ undoButton.addActionListener(this);
645
+ undoButton.setEnabled(false);
646
+
647
+ cGridBag updown = new cGridBag().setVertical(true);
648
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ restoreButton.setToolTipText("Restore current");
650
+ restoreButton.addActionListener(this);
651
+ restoreButton.setEnabled(false);
652
+
653
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ replaceButton.setToolTipText("Replace current");
655
+ replaceButton.addActionListener(this);
656
+ replaceButton.setEnabled(false);
657
+
658
+ copyOptionsPanel.add(updown);
659
+
660
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ redoButton.setToolTipText("Next version");
662
+ redoButton.addActionListener(this);
663
+ redoButton.setEnabled(false);
664
+
665
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
666
+ liveCB.setToolTipText("Enable animation");
433667 liveCB.addItemListener(this);
434668
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
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");
453675 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.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);
460682
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
495
- trackCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
499
- screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
501683 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502684 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507685
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
514
- flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
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));
518694
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
521
- twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
695
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523696 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
697
+ fourButton.setToolTipText("Show left panel only");
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");
525706 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
527
- threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
529
- 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);
530713 //
531714
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
715
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
716
+ rootButton.setToolTipText("Open selection in new tab");
533717 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
718
+
719
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
720
+ closeButton.setToolTipText("Close tab");
536721 closeButton.addActionListener(this);
537722 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538723 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540
-
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
543
- editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547724
548
- 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");
549810 uneditButton.addActionListener(this);
550811
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- 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");
563814 allParamsButton.addActionListener(this);
564815
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- 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");
570822 unselectButton.addActionListener(this);
571823
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
+
572834 // oe.aConstraints.gridx += 1;
573835 // oe.aConstraints.weighty = 0;
574836 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +842,25 @@
580842 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581843 // gcButton.addActionListener(this);
582844
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
845
+ cGridBag jSPPanel = new cGridBag();
846
+
847
+ JScrollPane jSP;
594848 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
849
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
596850 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
601
-
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
- colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
609
- materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
612
- textureCB.addItemListener(this);
613
-
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
616851
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
+
617864 //jList.addListSelectionListener(this);
618865 oe.jTree.addTreeSelectionListener(this);
619866 //jTree.setRootVisible(false);
....@@ -632,23 +879,160 @@
632879 dgr.addDragGestureListener(this);
633880 }catch(Exception e) {}
634881 */
635
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
636883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637884 }
885
+
886
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
887
+ {
888
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
889
+ colorCB.setToolTipText("Copy color when dropped");
890
+ colorCB.addItemListener(this);
891
+
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
+
920
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
921
+ // localCB.addItemListener(this);
922
+
923
+ panel.Return();
924
+
925
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
926
+ crowdCB.setToolTipText("Used for crowds");
927
+ crowdCB.addItemListener(this);
928
+
929
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
930
+ smoothCB.setToolTipText("Snapping delay");
931
+ smoothCB.addItemListener(this);
932
+
933
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
934
+ slowCB.setToolTipText("Smooth interpolation");
935
+ slowCB.addItemListener(this);
936
+
937
+// constraints.gridy += 1;
938
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
939
+// speakerMocapCB.addItemListener(this);
940
+
941
+ panel.Return();
942
+
943
+ if (false)
944
+ {
945
+ // handled in scripts
946
+ //constraints.gridy += 1;
947
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
948
+ speakerCameraCB.addItemListener(this);
949
+
950
+ //constraints.gridy += 1;
951
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
952
+ speakerFocusCB.addItemListener(this);
953
+
954
+ //constraints.gridy += 1;
955
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
956
+ smoothfocusCB.addItemListener(this);
957
+ panel.Return();
958
+ }
959
+
960
+//constraints.gridx += 1;
961
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
962
+// debugCB.addItemListener(this);
963
+
964
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
965
+ trackCB.setToolTipText("Enable tracking target");
966
+ trackCB.addItemListener(this);
967
+
968
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
969
+ oeilCB.setToolTipText("Move camera when tracking");
970
+ oeilCB.addItemListener(this);
971
+
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
+ {
992
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
993
+ lookAtCB.setToolTipText("Look-at target");
994
+ 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);
1009
+
1010
+ }
6381011
6391012 void EditObject(Object3D obj)
6401013 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
1014
+ 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
+
1023
+ radioButton.SetObject(obj);
1024
+ radioButton.layout = sixButton; // sevenButton;
1025
+ radioButton.SetCamera(cameraView.renderCamera, false);
1026
+ radioButton.addActionListener(this);
1027
+ radioPanel.add(radioButton);
1028
+ buttonGroup.add(radioButton);
1029
+ radioButton.doClick();
6491030 }
1031
+
6501032 void SetupViews(ObjEditor oe)
6511033 {
1034
+ theFrame = this;
1035
+
6521036 oe.SetupViews();
6531037
6541038 System.out.println("SetupViews");
....@@ -657,22 +1041,28 @@
6571041 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6581042 }
6591043
660
- JCheckBox liveCB;
661
- JCheckBox supportCB;
662
- JCheckBox localCB;
663
- JCheckBox crowdCB;
664
- JCheckBox smoothCB;
665
- JCheckBox fastCB;
666
- JCheckBox slowCB;
667
- JCheckBox boxCB;
668
- JCheckBox trackCB;
669
- 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;
6701057 // JCheckBox speakerMocapCB;
671
- JCheckBox speakerCameraCB;
672
- JCheckBox speakerFocusCB;
673
- JCheckBox debugCB;
674
- JCheckBox oeilCB;
675
- JCheckBox lookAtCB;
1058
+ cCheckBox speakerCameraCB;
1059
+ cCheckBox speakerFocusCB;
1060
+ cCheckBox debugCB;
1061
+
1062
+ cCheckBox oeilCB;
1063
+ cCheckBox shadowCB;
1064
+ cCheckBox autokeepCB;
1065
+ cCheckBox lookAtCB;
6761066
6771067 // static int COLOR = 1;
6781068 // static int MATERIAL = 2;
....@@ -680,9 +1070,9 @@
6801070
6811071 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6821072
683
- JCheckBox colorCB;
684
- JCheckBox materialCB;
685
- JCheckBox textureCB;
1073
+ cCheckBox colorCB;
1074
+ cCheckBox materialCB;
1075
+ cCheckBox textureCB;
6861076
6871077 public void itemStateChanged(ItemEvent e)
6881078 {
....@@ -707,10 +1097,10 @@
7071097 dropAttributes |= Object3D.TEXTURE;
7081098 else
7091099 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
1100
+ } else if(e.getSource() == liveCB)
7121101 {
7131102 cameraView.ToggleLive();
1103
+ refreshContents(false);
7141104 }
7151105 else if(e.getSource() == supportCB)
7161106 {
....@@ -746,6 +1136,10 @@
7461136 cameraView.repaint();
7471137 // refreshContents();
7481138 }
1139
+ else if(e.getSource() == zoomBoxCB)
1140
+ {
1141
+ cameraView.ToggleZoomBoxMode();
1142
+ }
7491143 else if(e.getSource() == smoothfocusCB)
7501144 {
7511145 cameraView.ToggleSmoothFocus();
....@@ -771,6 +1165,18 @@
7711165 {
7721166 cameraView.ToggleOeil();
7731167 }
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
+ }
7741180 else if(e.getSource() == lookAtCB)
7751181 {
7761182 cameraView.ToggleLookAt();
....@@ -787,7 +1193,8 @@
7871193
7881194 /**/
7891195 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
790
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1196
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1197
+ TreePath path = objEditor.jTree.getSelectionPath();
7911198 if ((path == null) || (path.getPathCount() <= 1)) {
7921199 // We can't move the root node or an empty selection
7931200 return;
....@@ -850,8 +1257,6 @@
8501257 }
8511258 }
8521259
853
- String string = (String) object;
854
-
8551260 System.out.println("Transfer = " + object + "; drop : " + target);
8561261 // if( object instanceof java.io.File[])
8571262 // {
....@@ -859,7 +1264,11 @@
8591264 // objEditor.DropFile((java.io.File[]) object, true);
8601265 // return;
8611266 // }
862
- 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) == ':')
8631272 {
8641273 // file(s)
8651274 String[] names = string.split("\n");
....@@ -886,7 +1295,7 @@
8861295
8871296 flashIt = false;
8881297 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1298
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901299 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911300
8921301 if (group.selection.size() == 1)
....@@ -902,23 +1311,33 @@
9021311
9031312 assert target == objEditor.jTree;
9041313 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1314
+ Object3D destinationLeaf;
9051315 try {
906
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1316
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9071317 } catch (Exception e) {
9081318 System.out.println("destinationPath : " + destinationPath);
9091319 return;
9101320 }
9111321
912
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1322
+ for (int i=group.selection.size(); --i>=0;)
9131323 {
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
+// {
9141333 loadClipboard(true);
9151334 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
917
- } else {
918
- loadClipboard(false);
919
- objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
921
- }
1335
+ pasteInto(false, false);
1336
+// } else {
1337
+// loadClipboard(false);
1338
+// objEditor.jTree.setSelectionPath(destinationPath);
1339
+// pasteInto(false, false); // true); // ???
1340
+// }
9221341 }
9231342 public void dropActionChanged(DropTargetDragEvent dtde)
9241343 // Called if the user has modified the current drop gesture
....@@ -1023,83 +1442,107 @@
10231442 {
10241443 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10251444 //heightFieldItem.addActionListener(this);
1026
- gridItem = menu.add(new MenuItem("Grid"));
1027
- gridItem.addActionListener(this);
1028
- rectoidItem = menu.add(new MenuItem("Box"));
1029
- rectoidItem.addActionListener(this);
1030
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1031
- ellipsoidItem.addActionListener(this);
1032
- coneItem = menu.add(new MenuItem("Cone"));
1033
- coneItem.addActionListener(this);
1034
- torusItem = menu.add(new MenuItem("Torus"));
1035
- torusItem.addActionListener(this);
1036
- superItem = menu.add(new MenuItem("Superellipsoid"));
1037
- superItem.addActionListener(this);
1038
- particleItem = menu.add(new MenuItem("Particle system"));
1039
- particleItem.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
+ {
1463
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1464
+ kleinItem.addActionListener(this);
1465
+ }
1466
+
1467
+// particleItem = menu.add(new MenuItem("Particle system"));
1468
+// particleItem.addActionListener(this);
1469
+ if (Globals.ADVANCED)
1470
+ {
10401471 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411472 ragdollItem.addActionListener(this);
10421473 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431474 ragdoll2Item.addActionListener(this);
1475
+ }
10441476 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1477
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461478 meshItem.addActionListener(this);
10471479 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481480 // meshGroupItem.addActionListener(this);
1481
+ if (Globals.ADVANCED)
1482
+ {
10491483 springItem = menu.add(new MenuItem("Spring"));
10501484 springItem.addActionListener(this);
10511485 flagItem = menu.add(new MenuItem("Flag"));
10521486 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571487 blobItem = menu.add(new MenuItem("Blob"));
10581488 blobItem.addActionListener(this);
10591489 latheItem = menu.add(new MenuItem("Lathe"));
10601490 latheItem.addActionListener(this);
1061
- lightItem = menu.add(new MenuItem("Light"));
1062
- 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);
10631498 menu.add("-");
10641499 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10651500 //superLoopItem.addActionListener(this);
1066
- loopItem = menu.add(new MenuItem("Loop"));
1067
- loopItem.addActionListener(this);
1501
+// loopItem = menu.add(new MenuItem("Loop"));
1502
+// loopItem.addActionListener(this);
10681503 doubleItem = menu.add(new MenuItem("Fork"));
10691504 doubleItem.addActionListener(this);
1505
+ if (Globals.ADVANCED)
1506
+ {
10701507 tripleItem = menu.add(new MenuItem("Trident"));
10711508 tripleItem.addActionListener(this);
1509
+ }
10721510 }
10731511
10741512 void buildToolsMenu(Menu menu)
10751513 {
10761514 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771515 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1516
+ animationItem.setState(Globals.ANIMATION);
1517
+
1518
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1519
+ archiveItem.addActionListener(this);
10791520
10801521 menu.add("-");
10811522 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821523 parseverticesItem.addActionListener(this);
10831524 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841525 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1526
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861527 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891528 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901529 reduceMorphItem.addActionListener(this);
10911530 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921531 reduce34MorphItem.addActionListener(this);
1093
-
1094
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1095
- computeAOItem.addActionListener(this);
10961532 menu.add("-");
1097
-
10981533 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991534 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("-");
11001543 menu.add(analyzeItem = new MenuItem("Analyze"));
11011544 analyzeItem.addActionListener(this);
1102
- menu.add(dumpItem = new MenuItem("Dump"));
1545
+ menu.add(dumpItem = new MenuItem("Print"));
11031546 dumpItem.addActionListener(this);
11041547 // menu.add(pathItem = new MenuItem("From-to path"));
11051548 // pathItem.addActionListener(this);
....@@ -1108,6 +1551,8 @@
11081551 resetParentItem.addActionListener(this);
11091552 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101553 repairParentItem.addActionListener(this);
1554
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1555
+ repairShadowItem.addActionListener(this);
11111556 menu.add(invariantsItem = new MenuItem("Invariants"));
11121557 invariantsItem.addActionListener(this);
11131558 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1560,7 @@
11151560 menu.add("-");
11161561 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171562 editScriptItem.addActionListener(this);
1563
+ }
11181564 }
11191565
11201566 void ScreenFit()
....@@ -1237,9 +1683,34 @@
12371683 shadow.material = new cMaterial(obj.material);
12381684 shadow.material.diffuse = 0.0001f;
12391685 shadow.material.specular = 0.0001f;
1686
+ //shadow.projectedVertices[1].x = 300;
12401687
12411688 makeSomething(shadow);
12421689 }
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
+ }
12431714
12441715 /**
12451716 * applyExample
....@@ -1443,9 +1914,9 @@
14431914
14441915 void Overwrite(int mask)
14451916 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471918 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1919
+ Object3D content = Grafreed.clipboard.get(0);
14491920
14501921 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511922 content = ((cGroup)content).get(0);
....@@ -1468,6 +1939,7 @@
14681939 //
14691940 public void actionPerformed(ActionEvent event) // , Object arg)
14701941 {
1942
+ Object source = event.getSource();
14711943 /*
14721944 if (event.getSource() == nameField)
14731945 {
....@@ -1479,11 +1951,11 @@
14791951 }
14801952 else
14811953 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1954
+ if (source == lookAtItem || source == lookFromItem)
14831955 {
14841956 ScreenFit();
14851957 } else
1486
- if (event.getSource() == switchItem)
1958
+ if (source == switchViewItem)
14871959 {
14881960 cVector v1 = new cVector();
14891961 cVector v2 = new cVector();
....@@ -1492,11 +1964,11 @@
14921964 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931965 objEditor.cameraView.repaint();
14941966 } else
1495
- if (event.getSource() == rectoidItem)
1967
+ if (source == rectoidItem || source == boxButton)
14961968 {
14971969 makeSomething(new Box());
14981970 } else
1499
- if (event.getSource() == particleItem)
1971
+ if (source == particleItem || source == particlesButton)
15001972 {
15011973 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021974 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1989,9 @@
15171989 applyExample(particleGeom, "SMOKE");
15181990 makeSomething(particleGeom);
15191991 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1992
+ if (source == ragdollItem || source == ragdoll2Item)
15211993 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1994
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231995
15241996 ragdoll.toParent = LA.newMatrix();
15251997 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +2009,7 @@
15372009 } else
15382010 /*
15392011 */
1540
- if (event.getSource() == heightFieldItem)
2012
+ if (source == heightFieldItem)
15412013 {
15422014 Object3D obj = new Object3D();
15432015
....@@ -1575,27 +2047,31 @@
15752047
15762048 makeSomething(obj);
15772049 } else
1578
- if (event.getSource() == gridItem)
2050
+ if (source == gridItem || source == gridButton)
15792051 {
15802052 makeSomething(new Grid());
15812053 } else
1582
- if (event.getSource() == ellipsoidItem)
2054
+ if (source == ellipsoidItem || source == sphereButton)
15832055 {
15842056 makeSomething(new Sphere());
15852057 } else
1586
- if (event.getSource() == coneItem)
2058
+ if (source == coneItem || source == coneButton)
15872059 {
15882060 makeSomething(new Cone());
15892061 } else
1590
- if (event.getSource() == torusItem)
2062
+ if (source == torusItem || source == torusButton)
15912063 {
15922064 makeSomething(new Torus());
15932065 } else
1594
- if (event.getSource() == superItem)
2066
+ if (source == superItem || source == superButton)
15952067 {
15962068 makeSomething(new Superellipsoid());
15972069 } else
1598
- if (event.getSource() == blobItem)
2070
+ if (source == kleinItem || source == kleinButton)
2071
+ {
2072
+ makeSomething(new Klein());
2073
+ } else
2074
+ if (source == blobItem)
15992075 {
16002076 Blob blob = new Blob();
16012077 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +2079,15 @@
16032079 //blob.retile();
16042080 makeSomething(blob);
16052081 } else
1606
- if (event.getSource() == latheItem)
2082
+ if (source == latheItem)
16072083 {
16082084 makeSomething(new Lathe());
16092085 } else
1610
- if (event.getSource() == bezierItem)
2086
+ if (source == bezierItem)
16112087 {
16122088 makeSomething(new BezierSurface());
16132089 } else
1614
- if (event.getSource() == checkerItem)
2090
+ if (source == overlayItem || source == overlayButton)
16152091 {
16162092 /*
16172093 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +2102,7 @@
16262102 */
16272103 makeSomething(new Checker());
16282104 } else
1629
- if (event.getSource() == meshItem)
2105
+ if (source == meshItem)
16302106 {
16312107 Object3D itemtomake = new Object3D();
16322108 Object3D child;
....@@ -1647,35 +2123,35 @@
16472123 makeSomething(child);
16482124 }
16492125 } else
1650
- if (event.getSource() == springItem)
2126
+ if (source == springItem)
16512127 {
16522128 cSpring s = new cSpring();
16532129 s.setup();
16542130 makeSomething(s);
16552131 } else
1656
- if (event.getSource() == flagItem)
2132
+ if (source == flagItem)
16572133 {
16582134 cSpring s = new cFlag();
16592135 s.setup();
16602136 makeSomething(s);
16612137 } else
1662
- if (event.getSource() == lightItem)
2138
+ if (source == lightItem || source == lightButton)
16632139 {
16642140 makeSomething(new Light());
16652141 } else
1666
- if (event.getSource() == csgItem)
2142
+ if (source == csgItem)
16672143 {
16682144 group(new CSG());
16692145 } else
1670
- if (event.getSource() == templateItem)
2146
+ if (source == templateItem)
16712147 {
16722148 group(new cTemplate());
16732149 } else
1674
- if (event.getSource() == attributeItem)
2150
+ if (source == attributeItem)
16752151 {
16762152 makeSomething(new Attribute());
16772153 } else
1678
- if (event.getSource() == pointflowItem)
2154
+ if (source == pointflowItem)
16792155 {
16802156 makeSomething(new PointFlow());
16812157 } else
....@@ -1687,7 +2163,7 @@
16872163 } else
16882164 */
16892165
1690
- if (event.getSource() == superLoopItem)
2166
+ if (source == superLoopItem)
16912167 {
16922168 Composite g = new cGroup();
16932169 for (int i=0; i<15; i++)
....@@ -1709,30 +2185,30 @@
17092185
17102186 group(g);
17112187 } else
1712
- if (event.getSource() == loopItem)
2188
+ if (source == loopItem || source == loopButton)
17132189 {
17142190 Composite csg = new GroupLeaf();
17152191 csg.count = 5;
17162192 group(csg);
1717
- Composite child = new cGroup();
2193
+ Composite child = new cGroup("Branch");
17182194 csg.addChild(child);
17192195 child.addChild(csg);
17202196 } else
1721
- if (event.getSource() == doubleItem)
2197
+ if (source == doubleItem)
17222198 {
1723
- Composite csg = new GroupLeaf();
2199
+ Composite csg = new GroupLeaf("Fork");
17242200 csg.count = 5;
17252201 group(csg);
1726
- Composite child = new cGroup();
2202
+ Composite child = new cGroup("Branch A");
17272203 csg.addChild(child);
17282204 child.addChild(csg);
1729
- child = new cGroup();
2205
+ child = new cGroup("Branch B");
17302206 csg.addChild(child);
17312207 child.addChild(csg);
17322208 } else
1733
- if (event.getSource() == tripleItem)
2209
+ if (source == tripleItem)
17342210 {
1735
- Composite csg = new GroupLeaf();
2211
+ Composite csg = new GroupLeaf("Trident");
17362212 csg.count = 4;
17372213 group(csg);
17382214 Composite child = new cGroup();
....@@ -1745,73 +2221,98 @@
17452221 csg.addChild(child);
17462222 child.addChild(csg);
17472223 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
2224
+ if (source == computeAOItem)
17502225 {
1751
- ImportGFD();
2226
+ Globals.drawMode = CameraPane.OCCLUSION;
2227
+ Globals.theRenderer.repaint();
17522228 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1754
- {
1755
- ImportVRMLX3D();
1756
- } else
1757
- if (event.getSource() == import3DSItem)
1758
- {
1759
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1760
- } else
1761
- if (event.getSource() == importOBJItem)
1762
- {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1764
- } else
1765
- if (event.getSource() == computeAOItem)
1766
- {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1769
- } else
1770
- if (event.getSource() == recompileItem)
2229
+ if (source == recompileItem)
17712230 {
17722231 Recompile();
17732232 refreshContents();
17742233 } else
1775
- if (event.getSource() == editScriptItem)
2234
+ if (source == editScriptItem)
17762235 {
17772236 OpenDialog();
17782237 refreshContents();
17792238 } else
1780
- if (event.getSource() == invariantsItem)
2239
+ if (source == invariantsItem)
17812240 {
17822241 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
2242
+ Grafreed.grafreeD.universe.invariants();
17842243 } else
1785
- if (event.getSource() == memoryItem)
2244
+ if (source == memoryItem)
17862245 {
17872246 //System.out.println("Invariants:");
17882247 PrintMemory();
17892248 } else
1790
- if (event.getSource() == pathItem)
2249
+ if (source == pathItem)
17912250 {
17922251 PrintPath();
17932252 } else
1794
- if (event.getSource() == analyzeItem)
2253
+ if (source == analyzeItem)
17952254 {
17962255 AnalyzeObject();
17972256 } else
1798
- if (event.getSource() == dumpItem)
2257
+ if (source == dumpItem)
17992258 {
18002259 DumpObject();
18012260 } else
1802
- if (event.getSource() == screenfitButton)
2261
+ if (source == minButton)
18032262 {
1804
- //Reload(lastConverter, lastFilename, true);
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
2306
+ if (source == screenfitButton)
2307
+ {
18052308 ScreenFit();
18062309 } else
1807
- if (event.getSource() == screenfitpointButton)
2310
+ if (source == screenfitpointButton)
18082311 {
1809
- //Reload(lastConverter, lastFilename, true);
18102312 ScreenFitPoint();
18112313 } else
1812
- if (event.getSource() == snapobjectButton)
2314
+ if (source == snapobjectButton)
18132315 {
1814
- //Reload(lastConverter, lastFilename, true);
18152316 SnapObject();
18162317 } else
18172318 // if (event.getSource() == recompileButton)
....@@ -1820,13 +2321,13 @@
18202321 // Recompile();
18212322 // refreshContents();
18222323 // } else
1823
- if (event.getSource() == gcButton)
2324
+ if (source == gcButton)
18242325 {
18252326 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262327 System.gc();
18272328 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18282329 } else
1829
- if (event.getSource() == editLeafItem)
2330
+ if (source == editLeafItem)
18302331 {
18312332 Object3D obj;
18322333 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +2341,74 @@
18402341 }
18412342 refreshContents(true);
18422343 } else
1843
- if (event.getSource() == openWindowItem)
2344
+ if (source == openWindowItem)
18442345 {
18452346 EditSelection(true);
18462347 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2348
+ if (source == cutItem || source == clearButton)
18482349 {
18492350 loadClipboard(true);
18502351 } else
1851
- if (event.getSource() == duplicateItem)
2352
+ if (source == undoItem)
18522353 {
1853
- Object3D keep = GrafreeD.clipboard;
2354
+ Undo();
2355
+ } else
2356
+ if (source == redoItem)
2357
+ {
2358
+ Redo();
2359
+ } else
2360
+ if (source == duplicateItem)
2361
+ {
2362
+ Object3D keep = Grafreed.clipboard;
18542363 loadClipboard(false);
18552364 paste(false);
1856
- GrafreeD.clipboard = keep;
2365
+ Grafreed.clipboard = keep;
18572366 } else
1858
- if (event.getSource() == cloneItem)
2367
+ if (source == cloneItem)
18592368 {
18602369 CloneSelection(false);
18612370 } else
1862
- if (event.getSource() == cloneSupportItem)
2371
+ if (source == cloneSupportItem)
18632372 {
18642373 CloneSelection(true);
18652374 } else
1866
- if (event.getSource() == copyItem)
2375
+ if (source == copyItem)
18672376 {
18682377 loadClipboard(false);
18692378 } else
1870
- if (event.getSource() == pasteItem)
2379
+ if (source == pasteItem)
18712380 {
18722381 paste(false);
18732382 } else
1874
- if (event.getSource() == pasteLinkItem)
2383
+ if (source == pasteIntoItem)
18752384 {
1876
- pasteInto(false);
2385
+ pasteInto(true, false);
18772386 } else
1878
- if (event.getSource() == pasteCloneItem)
2387
+ if (source == pasteLinkItem)
18792388 {
1880
- pasteInto(true);
2389
+ pasteInto(false, false);
18812390 } else
1882
- if (event.getSource() == pasteExpandItem)
2391
+ if (source == pasteCloneItem)
2392
+ {
2393
+ pasteInto(true, true);
2394
+ } else
2395
+ if (source == pasteExpandItem)
18832396 {
18842397 paste(true);
18852398 } else
1886
- if (event.getSource() == synchronizeItem)
2399
+ if (source == synchronizeItem)
18872400 {
18882401 Overwrite(Object3D.TRANSFORM);
18892402 } else
1890
- if (event.getSource() == overwriteNameItem)
2403
+ if (source == overwriteNameItem)
18912404 {
18922405 Overwrite(Object3D.NAME);
18932406 } else
1894
- if (event.getSource() == overwriteUVItem)
2407
+ if (source == overwriteUVItem)
18952408 {
18962409 Overwrite(Object3D.UV);
18972410 } else
1898
- if (event.getSource() == overwriteMatItem)
2411
+ if (source == overwriteMatItem)
18992412 {
19002413 /* july 2015
19012414 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2428,7 @@
19152428
19162429 Overwrite(dropAttributes);
19172430 }
1918
- if (event.getSource() == overwriteGeoItem)
2431
+ if (source == overwriteGeoItem)
19192432 {
19202433 Overwrite(Object3D.GEOMETRY);
19212434 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2445,7 @@
19322445 // refreshContents();
19332446 // }
19342447 } else
1935
- if (event.getSource() == generateMeshItem)
2448
+ if (source == generateMeshItem)
19362449 {
19372450 //if (group.selection.size() == 1)
19382451 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2456,7 @@
19432456 ResetModel();
19442457 refreshContents();
19452458 } else
1946
- if (event.getSource() == extractGeometriesItem)
2459
+ if (source == extractGeometriesItem)
19472460 {
19482461 boolean one = false;
19492462
....@@ -1970,7 +2483,7 @@
19702483 ResetModel();
19712484 refreshContents();
19722485 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2486
+ if (source == cloneGeometriesItem)
19742487 {
19752488 boolean one = false;
19762489
....@@ -1996,32 +2509,37 @@
19962509 ResetModel();
19972510 refreshContents();
19982511 } else
1999
- if (event.getSource() == shareGeometriesItem)
2512
+ if (source == shareGeometriesItem)
20002513 {
20012514 boolean one = false;
20022515
20032516 if (group.selection.size() == 1)
20042517 one = true;
20052518
2519
+ Object3D merge = null;
2520
+
20062521 Object3D content = new cGroup();
20072522
20082523 for (int i=0; i<group.selection.size(); i++)
20092524 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2525
+ merge = new Merge(group.selection.get(i));
20112526
20122527 if (one)
2013
- makeSomething(sel, false);
2528
+ makeSomething(merge, false);
20142529 else
2015
- content.addChild(sel);
2530
+ content.addChild(merge);
20162531 }
20172532
20182533 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2534
+ makeSomething(content, true);
2535
+ else
2536
+ {
2537
+ ResetModel();
2538
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2539
+ refreshContents();
2540
+ }
20232541 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2542
+ if (source == mergeGeometriesItem)
20252543 {
20262544 boolean one = false;
20272545
....@@ -2051,7 +2569,7 @@
20512569 ResetModel();
20522570 refreshContents();
20532571 } else
2054
- if (event.getSource() == linkverticesItem)
2572
+ if (source == linkverticesItem)
20552573 {
20562574 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572575 // {
....@@ -2064,39 +2582,48 @@
20642582 // group.selection.get(0).setMasterThis(content); // should be identity
20652583 // refreshContents();
20662584 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2585
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682586 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2587
+ Object3D content = Grafreed.clipboard.get(0);
20702588
20712589 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722590 content = ((cGroup)content).get(0);
20732591
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2592
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752593 for (int i=0; i<group.selection.size(); i++)
20762594 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2595
+ boolean random = CameraPane.SWITCH;
2596
+ CameraPane.SWITCH = false; // parse all random nodes
20792597 group.selection.get(i).linkVerticesThis(content);
20802598 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2599
+ CameraPane.SWITCH = random;
20822600 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2601
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842602 refreshContents();
20852603 }
20862604 } else
2087
- if (event.getSource() == resetsupportItem)
2605
+ if (source == resetsupportItem)
20882606 {
20892607 for (int i=0; i<group.selection.size(); i++)
20902608 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2609
+ boolean random = CameraPane.SWITCH;
2610
+ CameraPane.SWITCH = false; // parse all random nodes
20932611 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2612
+ CameraPane.SWITCH = random;
20952613 }
20962614
20972615 refreshContents();
20982616 } else
2099
- if (event.getSource() == resetreferencesItem)
2617
+ if (source == relinkverticesItem)
2618
+ {
2619
+ boolean random = CameraPane.SWITCH;
2620
+ CameraPane.SWITCH = false; // parse all random nodes
2621
+ group.selection.RelinkToSupport();
2622
+ CameraPane.SWITCH = random;
2623
+
2624
+ refreshContents();
2625
+ } else
2626
+ if (source == resetreferencesItem)
21002627 {
21012628 for (int i=0; i<group.selection.size(); i++)
21022629 {
....@@ -2105,11 +2632,11 @@
21052632
21062633 refreshContents();
21072634 } else
2108
- if (event.getSource() == setMasterItem)
2635
+ if (source == setMasterItem)
21092636 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2637
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112638 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2639
+ Object3D content = Grafreed.clipboard.get(0);
21132640
21142641 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152642 content = ((cGroup)content).get(0);
....@@ -2118,13 +2645,13 @@
21182645 refreshContents();
21192646 }
21202647 } else
2121
- if (event.getSource() == poseMeshItem)
2648
+ if (source == poseMeshItem)
21222649 {
21232650 if (group.selection.size() == 1)
21242651 {
2125
- if (GrafreeD.clipboard.size() == 1)
2652
+ if (Grafreed.clipboard.size() == 1)
21262653 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2654
+ Object3D content = Grafreed.clipboard.get(0);
21282655
21292656 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302657 content = ((cGroup)content).get(0);
....@@ -2137,19 +2664,19 @@
21372664 }
21382665
21392666 } else
2140
- if (event.getSource() == revertMeshItem)
2667
+ if (source == revertMeshItem)
21412668 {
21422669 RevertMeshes();
21432670 } else
2144
- if (event.getSource() == resetMeshItem)
2671
+ if (source == resetAllItem)
21452672 {
21462673 ResetAll();
21472674 } else
2148
- if (event.getSource() == stepAllItem)
2675
+ if (source == stepAllItem)
21492676 {
21502677 StepAll();
21512678 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
21532680 {
21542681 //int indices[] = jList.getSelectedIndices();
21552682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2684,46 @@
21572684
21582685 ClearSelection(false);
21592686 } else
2160
- if (event.getSource() == clearAllItem)
2687
+ if (source == clearAllItem)
21612688 {
21622689 ClearSelection(true);
21632690 } else
2164
- if (event.getSource() == grabItem)
2691
+ if (source == grabItem || source == groupButton)
21652692 {
2166
- group(new cGroup(), true);
2693
+ group(new cGroup(), false); // true);
21672694 } else
2168
- if (event.getSource() == frontItem)
2695
+ if (source == hideItem)
2696
+ {
2697
+ group(new HiddenObject());
2698
+ } else
2699
+ if (source == frontItem)
21692700 {
21702701 front();
21712702 } else
2172
- if (event.getSource() == backItem)
2703
+ if (source == backItem)
21732704 {
21742705 back();
21752706 } else
2176
- if (event.getSource() == cameraItem)
2707
+ if (source == cameraItem)
21772708 {
21782709 makeSomething(new Camera());
21792710 } else
2180
- if (event.getSource() == compositeItem)
2711
+ if (source == compositeItem || source == compositeButton)
21812712 {
21822713 group(new Composite());
21832714 } else
2184
- if (event.getSource() == randomItem)
2715
+ if (source == switchItem || source == switchButton)
21852716 {
21862717 RandomNode random = new RandomNode();
21872718 group(random);
21882719 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2720
+ random.name = random.get(0).name + "Switch";
21902721 } else
2191
- if (event.getSource() == physicsItem)
2722
+ if (source == physicsItem)
21922723 {
21932724 group(new PhysicsNode());
21942725 } else
2195
- if (event.getSource() == frameselectorItem)
2726
+ if (source == frameselectorItem)
21962727 {
21972728 for (int i=0; i<group.selection.size(); i++)
21982729 {
....@@ -2204,7 +2735,7 @@
22042735 ResetModel();
22052736 refreshContents();
22062737 } else
2207
- if (event.getSource() == switchGeoItem)
2738
+ if (source == switchGeoItem)
22082739 {
22092740 for (int i=0; i<group.selection.size(); i++)
22102741 {
....@@ -2216,7 +2747,7 @@
22162747 ResetModel();
22172748 refreshContents();
22182749 } else
2219
- if (event.getSource() == switchTransfoItem)
2750
+ if (source == switchTransfoItem)
22202751 {
22212752 for (int i=0; i<group.selection.size(); i++)
22222753 {
....@@ -2228,7 +2759,7 @@
22282759 ResetModel();
22292760 refreshContents();
22302761 } else
2231
- if (event.getSource() == morphItem)
2762
+ if (source == morphItem)
22322763 {
22332764 for (int i=0; i<group.selection.size(); i++)
22342765 {
....@@ -2240,7 +2771,7 @@
22402771 ResetModel();
22412772 refreshContents();
22422773 } else
2243
- if (event.getSource() == scriptNodeItem)
2774
+ if (source == scriptNodeItem)
22442775 {
22452776 boolean atleastone = false;
22462777
....@@ -2279,199 +2810,252 @@
22792810 }
22802811 }
22812812 } else
2282
- if (event.getSource() == linkerItem)
2813
+ if (source == linkerItem)
22832814 {
22842815 group(new cLinker());
22852816 } else
2286
- if (event.getSource() == textureItem)
2817
+ if (source == textureItem || source == textureButton)
22872818 {
22882819 group(new TextureNode());
22892820 } else
2290
- if (event.getSource() == shadowXItem)
2821
+ if (source == billboardItem)
2822
+ {
2823
+ group(new BillboardNode());
2824
+ } else
2825
+ if (source == shadowXItem)
22912826 {
22922827 CastShadow(0);
22932828 } else
2294
- if (event.getSource() == shadowYItem)
2829
+ if (source == shadowYItem)
22952830 {
22962831 CastShadow(1);
22972832 } else
2298
- if (event.getSource() == shadowZItem)
2833
+ if (source == shadowZItem)
22992834 {
23002835 CastShadow(2);
23012836 } else
2302
- if (event.getSource() == ungroupItem)
2837
+ if (source == ungroupItem || source == ungroupButton)
23032838 {
2304
- ungroup();
2839
+ boolean hasRoot = false;
2840
+
2841
+ for (int i=0; i<group.selection.size(); i++)
2842
+ {
2843
+ if (group.selection.get(i) == group)
2844
+ {
2845
+ hasRoot = true;
2846
+ break;
2847
+ }
2848
+ }
2849
+
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
+ }
23052861 } else
2306
- if (event.getSource() == genUVItem)
2862
+ if (source == genUVItem)
23072863 {
23082864 GenUV();
23092865 } else
2310
- if (event.getSource() == genNormalsCADItem)
2866
+ if (source == genNormalsCADItem)
23112867 {
23122868 GenNormals(true);
23132869 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2870
+ if (source == genNormalsMESHItem)
23152871 {
2316
- GenNormals(true); // TODO
2872
+ GenNormalsMESH();
23172873 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2874
+ if (source == genNormalsORGANItem)
23192875 {
23202876 GenNormals(false);
23212877 } else
2322
- if (event.getSource() == stripifyItem)
2878
+ if (source == genNormalsMINEItem)
2879
+ {
2880
+ GenNormalsMINE();
2881
+ } else
2882
+ if (source == stripifyItem)
23232883 {
23242884 Stripify();
23252885 } else
2326
- if (event.getSource() == unstripifyItem)
2886
+ if (source == unstripifyItem)
23272887 {
23282888 Unstripify();
23292889 } else
2330
- if (event.getSource() == trimItem)
2890
+ if (source == trimItem)
23312891 {
23322892 Trim();
23332893 } else
2334
- if (event.getSource() == untrimItem)
2894
+ if (source == untrimItem)
23352895 {
23362896 Untrim();
23372897 } else
2338
- if (event.getSource() == clearColorsItem)
2898
+ if (source == clearColorsItem)
23392899 {
23402900 ClearColors();
23412901 } else
2342
- if (event.getSource() == clearMaterialsItem)
2902
+ if (source == clearMaterialsItem)
23432903 {
23442904 ClearMaterials();
23452905 } else
2346
- if (event.getSource() == liveleavesItem)
2906
+ if (source == liveleavesItem)
23472907 {
23482908 LiveLeaves(true);
23492909 } else
2350
- if (event.getSource() == unliveleavesItem)
2910
+ if (source == unliveleavesItem)
23512911 {
23522912 LiveLeaves(false);
23532913 } else
2354
- if (event.getSource() == supportleavesItem)
2914
+ if (source == supportleavesItem)
23552915 {
23562916 SupportLeaves(true);
23572917 } else
2358
- if (event.getSource() == unsupportleavesItem)
2918
+ if (source == unsupportleavesItem)
23592919 {
23602920 SupportLeaves(false);
23612921 } else
2362
- if (event.getSource() == hideleavesItem)
2922
+ if (source == hideleavesItem)
23632923 {
23642924 HideLeaves(true);
23652925 } else
2366
- if (event.getSource() == showleavesItem)
2926
+ if (source == showleavesItem)
23672927 {
23682928 HideLeaves(false);
23692929 } else
2370
- if (event.getSource() == markleavesItem)
2930
+ if (source == markleavesItem)
23712931 {
23722932 MarkLeaves(true);
23732933 } else
2374
- if (event.getSource() == unmarkleavesItem)
2934
+ if (source == unmarkleavesItem)
23752935 {
23762936 MarkLeaves(false);
23772937 } else
2378
- if (event.getSource() == flipVItem)
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);
2953
+ } else
2954
+ if (source == flipVItem)
23792955 {
23802956 FlipV(true);
23812957 } else
2382
- if (event.getSource() == unflipVItem)
2958
+ if (source == unflipVItem)
23832959 {
23842960 FlipV(false);
23852961 } else
2386
- if (event.getSource() == lowTexturesItem)
2962
+ if (source == lowTexturesItem)
23872963 {
23882964 SetTexRes(0);
23892965 } else
2390
- if (event.getSource() == normalTexturesItem)
2966
+ if (source == normalTexturesItem)
23912967 {
23922968 SetTexRes(1);
23932969 } else
2394
- if (event.getSource() == highTexturesItem)
2970
+ if (source == highTexturesItem)
23952971 {
23962972 SetTexRes(2);
23972973 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2974
+ if (source == veryhighTexturesItem)
23992975 {
24002976 SetTexRes(3);
24012977 } else
2402
- if (event.getSource() == maxTexturesItem)
2978
+ if (source == maxTexturesItem)
24032979 {
24042980 SetTexRes(4);
24052981 } else
2406
- if (event.getSource() == panoTexturesItem)
2982
+ if (source == panoTexturesItem)
24072983 {
24082984 SetTexRes(5);
24092985 } else
2410
- if (event.getSource() == reverseNormalsItem)
2986
+ if (source == reverseNormalsItem)
24112987 {
24122988 ReverseNormals();
24132989 } else
2414
- if (event.getSource() == parseverticesItem)
2990
+ if (source == parseverticesItem)
24152991 {
24162992 ParseVertices();
24172993 } else
2418
- if (event.getSource() == textureFieldItem)
2994
+ if (source == textureFieldItem)
24192995 {
24202996 TextureVertices();
24212997 } else
2422
- if (event.getSource() == alignItem)
2998
+ if (source == alignItem)
24232999 {
24243000 Align();
24253001 } else
2426
- if (event.getSource() == mirrorItem)
3002
+ if (source == mirrorItem)
24273003 {
24283004 MirrorPoses();
24293005 } else
2430
- if (event.getSource() == reduceMorphItem)
3006
+ if (source == reduceMorphItem)
24313007 {
24323008 MeshReduction(false);
24333009 } else
2434
- if (event.getSource() == reduce34MorphItem)
3010
+ if (source == reduce34MorphItem)
24353011 {
24363012 MeshReduction(true);
24373013 } else
2438
- if (event.getSource() == reverseTrianglesItem)
3014
+ if (source == reverseTrianglesItem)
24393015 {
24403016 ReverseTriangles();
24413017 } else
2442
- if (event.getSource() == reduceMeshItem)
3018
+ if (source == reduceMeshItem)
24433019 {
24443020 ReduceMesh(false);
24453021 } else
2446
- if (event.getSource() == reduce34MeshItem)
3022
+ if (source == reduce34MeshItem)
24473023 {
24483024 ReduceMesh(true);
24493025 } else
2450
- if (event.getSource() == increaseMeshItem)
3026
+ if (source == increaseMeshItem)
24513027 {
24523028 IncreaseMesh();
24533029 } else
2454
- if (event.getSource() == clipMeshItem)
3030
+ if (source == clipMeshItem)
24553031 {
24563032 ClipMesh();
24573033 } else
2458
- if (event.getSource() == smoothMeshItem)
3034
+ if (source == smoothMeshItem)
24593035 {
24603036 SmoothMesh();
24613037 } else
2462
- if (event.getSource() == transformgeometryItem)
3038
+ if (source == transformGeometryItem)
24633039 {
24643040 TransformGeometry();
24653041 } else
2466
- if (event.getSource() == resetTransformItem)
3042
+ if (source == transformChildrenItem)
3043
+ {
3044
+ TransformChildren();
3045
+ } else
3046
+ if (source == resetTransformItem)
24673047 {
24683048 ResetTransform();
24693049 } else
2470
- if (event.getSource() == resetCentroidItem)
3050
+ if (source == resetCentroidItem)
24713051 {
2472
- ResetCentroid();
3052
+ ResetCentroid(true);
24733053 } else
2474
- if (event.getSource() == resetParentItem)
3054
+ if (source == resetCentroidXZItem)
3055
+ {
3056
+ ResetCentroid(false);
3057
+ } else
3058
+ if (source == resetParentItem)
24753059 {
24763060 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773061 {
....@@ -2481,7 +3065,7 @@
24813065
24823066 refreshContents();
24833067 } else
2484
- if (event.getSource() == repairParentItem)
3068
+ if (source == repairParentItem)
24853069 {
24863070 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24873071 {
....@@ -2495,7 +3079,21 @@
24953079
24963080 refreshContents();
24973081 } else
2498
- if (event.getSource() == sortbysizeItem)
3082
+ if (source == repairShadowItem)
3083
+ {
3084
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3085
+ {
3086
+ Object3D obj = (Object3D)e.nextElement();
3087
+ obj.RepairShadow();
3088
+// for (int i=0; i<obj.size(); i++)
3089
+// {
3090
+// obj.get(i).parent = obj;
3091
+// }
3092
+ }
3093
+
3094
+ refreshContents();
3095
+ } else
3096
+ if (source == sortbysizeItem)
24993097 {
25003098 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25013099 {
....@@ -2507,7 +3105,7 @@
25073105 ResetModel();
25083106 refreshContents();
25093107 } else
2510
- if (event.getSource() == sortbynameItem)
3108
+ if (source == sortbynameItem)
25113109 {
25123110 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25133111 {
....@@ -2519,7 +3117,7 @@
25193117 ResetModel();
25203118 refreshContents();
25213119 } else
2522
- if (event.getSource() == attachPigmentItem)
3120
+ if (source == attachPigmentItem)
25233121 {
25243122 String texture = GetFile("Attach pigment");
25253123 Object3D obj;
....@@ -2531,7 +3129,7 @@
25313129
25323130 refreshContents();
25333131 } else
2534
- if (event.getSource() == detachPigmentItem)
3132
+ if (source == detachPigmentItem)
25353133 {
25363134 Object3D obj;
25373135 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +3140,7 @@
25423140
25433141 refreshContents();
25443142 } else
2545
- if (event.getSource() == attachBumpItem)
3143
+ if (source == attachBumpItem)
25463144 {
25473145 String texture = GetFile("Attach bump");
25483146 Object3D obj;
....@@ -2554,18 +3152,18 @@
25543152
25553153 refreshContents();
25563154 } else
2557
- if (event.getSource() == detachBumpItem)
3155
+ if (source == detachBumpItem)
25583156 {
25593157 Object3D obj;
25603158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25613159 {
25623160 obj = (Object3D)e.nextElement();
2563
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
25643162 }
25653163
25663164 refreshContents();
25673165 } else
2568
- if (event.getSource() == pigmentBumpItem)
3166
+ if (source == pigmentBumpItem)
25693167 {
25703168 Object3D obj;
25713169 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +3174,262 @@
25763174
25773175 refreshContents();
25783176 } else
2579
- if (event.getSource() == flashSelectionButton)
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
3202
+ if (source == flashSelectionButton)
25803203 {
25813204 CameraPane.flash = true;
25823205 refreshContents();
25833206 } else
2584
- if (event.getSource() == oneButton)
3207
+ if (source == oneButton)
25853208 {
25863209 } else
2587
- if (event.getSource() == twoButton)
3210
+ if (source == twoButton)
25883211 {
25893212 radio.layout = twoButton;
3213
+
3214
+ if (CameraPane.FULLSCREEN)
3215
+ fullscreenLayout = radio.layout;
3216
+
25903217 // bug
25913218 //gridPanel.setDividerLocation(1.0);
25923219 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
3220
+// bigThree.remove(scenePanel);
3221
+// bigThree.remove(centralPanel);
3222
+// bigThree.remove(XYZPanel);
3223
+// aWindowConstraints.gridx = 0;
3224
+// aWindowConstraints.gridy = 0;
3225
+// aWindowConstraints.gridwidth = 1;
3226
+// // aConstraints.gridheight = 3;
3227
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3228
+// aWindowConstraints.weightx = 0;
3229
+// aWindowConstraints.weighty = 1;
3230
+// //bigThree.add(jtp, aWindowConstraints);
3231
+// aWindowConstraints.weightx = 1;
3232
+// aWindowConstraints.gridwidth = 3;
3233
+// // aConstraints.gridheight = 3;
3234
+// aWindowConstraints.gridx = 1;
3235
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3236
+// bigThree.add(centralPanel, aWindowConstraints);
3237
+// aWindowConstraints.weightx = 0;
3238
+// aWindowConstraints.gridx = 4;
3239
+// aWindowConstraints.gridwidth = 1;
3240
+// // aConstraints.gridheight = 3;
3241
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3242
+// //bigThree.add(XYZPanel, aWindowConstraints);
3243
+// scenePanel.setVisible(false);
3244
+// centralPanel.setVisible(true);
3245
+// XYZPanel.setVisible(false);
3246
+ bigThree.ClearUI();
3247
+ bigThree.add(centralPanel);
3248
+ 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
+
26173267 } else
2618
- if (event.getSource() == threeButton)
3268
+ if (source == threeButton)
26193269 {
26203270 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
3271
+
3272
+ if (CameraPane.FULLSCREEN)
3273
+ fullscreenLayout = radio.layout;
3274
+
3275
+// bigThree.remove(scenePanel);
3276
+// bigThree.remove(centralPanel);
3277
+// bigThree.remove(XYZPanel);
3278
+// aWindowConstraints.gridx = 0;
3279
+// aWindowConstraints.gridy = 0;
3280
+// aWindowConstraints.gridwidth = 1;
3281
+// // aConstraints.gridheight = 3;
3282
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3283
+// aWindowConstraints.weightx = 0;
3284
+// aWindowConstraints.weighty = 1;
3285
+// //bigThree.add(jtp, aWindowConstraints);
3286
+// aWindowConstraints.weightx = 1;
3287
+// aWindowConstraints.gridwidth = 3;
3288
+// // aConstraints.gridheight = 3;
3289
+// aWindowConstraints.gridx = 1;
3290
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3291
+// bigThree.add(centralPanel, aWindowConstraints);
3292
+// aWindowConstraints.weightx = 0;
3293
+// aWindowConstraints.gridx = 4;
3294
+// aWindowConstraints.gridwidth = 1;
3295
+// // aConstraints.gridheight = 3;
3296
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3297
+// bigThree.add(XYZPanel, aWindowConstraints);
3298
+// bigThree.validate();
3299
+// scenePanel.setVisible(false);
3300
+// centralPanel.setVisible(true);
3301
+// XYZPanel.setVisible(true);
3302
+ bigThree.ClearUI();
3303
+ bigThree.add(centralPanel);
3304
+ bigThree.add(XYZPanel);
3305
+ bigThree.FlushUI();
3306
+
3307
+ cameraView.requestFocusInWindow();
26453308 } else
2646
- if (event.getSource() == fourButton)
3309
+ if (source == fourButton)
26473310 {
26483311 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
3312
+
3313
+ if (CameraPane.FULLSCREEN)
3314
+ fullscreenLayout = radio.layout;
3315
+
3316
+// bigThree.remove(scenePanel);
3317
+// bigThree.remove(centralPanel);
3318
+// bigThree.remove(XYZPanel);
3319
+// aWindowConstraints.gridx = 0;
3320
+// aWindowConstraints.gridy = 0;
3321
+// aWindowConstraints.gridwidth = 1;
3322
+// // aWindowConstraints.gridheight = 3;
3323
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3324
+// aWindowConstraints.weightx = 1;
3325
+// aWindowConstraints.weighty = 1;
3326
+// bigThree.add(scenePanel, aWindowConstraints);
3327
+// aWindowConstraints.weightx = 1;
3328
+// aWindowConstraints.gridwidth = 3;
3329
+// // aConstraints.gridheight = 3;
3330
+// aWindowConstraints.gridx = 1;
3331
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3332
+// //bigThree.add(cameraPanel, aWindowConstraints);
3333
+// aWindowConstraints.weightx = 0;
3334
+// aWindowConstraints.gridx = 4;
3335
+// aWindowConstraints.gridwidth = 1;
3336
+// // aWindowConstraints.gridheight = 3;
3337
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3338
+// //bigThree.add(XYZPanel, aWindowConstraints);
3339
+// bigThree.validate();
3340
+// scenePanel.setVisible(true);
3341
+// centralPanel.setVisible(false);
3342
+// XYZPanel.setVisible(false);
3343
+ bigThree.ClearUI();
3344
+ bigThree.add(scenePanel);
3345
+ bigThree.FlushUI();
3346
+
3347
+ cameraView.requestFocusInWindow();
26733348 } else
2674
- if (event.getSource() == sixButton)
3349
+ if (source == sixButton)
26753350 {
26763351 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
3352
+
3353
+ if (CameraPane.FULLSCREEN)
3354
+ fullscreenLayout = radio.layout;
3355
+
3356
+// bigThree.remove(scenePanel);
3357
+// bigThree.remove(centralPanel);
3358
+// bigThree.remove(XYZPanel);
3359
+// aWindowConstraints.gridx = 0;
3360
+// aWindowConstraints.gridy = 0;
3361
+// aWindowConstraints.gridwidth = 1;
3362
+// // aConstraints.gridheight = 3;
3363
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3364
+// aWindowConstraints.weightx = 0;
3365
+// aWindowConstraints.weighty = 1;
3366
+// bigThree.add(scenePanel, aWindowConstraints);
3367
+// aWindowConstraints.weightx = 1;
3368
+// aWindowConstraints.gridwidth = 3;
3369
+// // aWindowConstraints.gridheight = 3;
3370
+// aWindowConstraints.gridx = 1;
3371
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3372
+// bigThree.add(centralPanel, aWindowConstraints);
3373
+// aWindowConstraints.weightx = 0;
3374
+// aWindowConstraints.gridx = 4;
3375
+// aWindowConstraints.gridwidth = 1;
3376
+// // aWindowConstraints.gridheight = 3;
3377
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3378
+// //bigThree.add(XYZPanel, aConstraints);
3379
+// bigThree.validate();
3380
+// scenePanel.setVisible(true);
3381
+// centralPanel.setVisible(true);
3382
+// XYZPanel.setVisible(false);
3383
+ bigThree.ClearUI();
3384
+ bigThree.add(scenePanel);
3385
+ bigThree.add(centralPanel);
3386
+ bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
27013389 } else
2702
- if (event.getSource() == sevenButton)
3390
+ if (source == sevenButton)
27033391 {
27043392 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
3393
+
3394
+ if (CameraPane.FULLSCREEN)
3395
+ fullscreenLayout = radio.layout;
3396
+
3397
+// bigThree.remove(scenePanel);
3398
+// bigThree.remove(centralPanel);
3399
+// bigThree.remove(XYZPanel);
3400
+// aWindowConstraints.gridx = 0;
3401
+// aWindowConstraints.gridy = 0;
3402
+// aWindowConstraints.gridwidth = 1;
3403
+// // aWindowConstraints.gridheight = 3;
3404
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3405
+// aWindowConstraints.weightx = 0;
3406
+// aWindowConstraints.weighty = 1;
3407
+// bigThree.add(scenePanel, aWindowConstraints);
3408
+// aWindowConstraints.weightx = 1;
3409
+// aWindowConstraints.gridwidth = 3;
3410
+// // aWindowConstraints.gridheight = 3;
3411
+// aWindowConstraints.gridx = 1;
3412
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3413
+// bigThree.add(centralPanel, aWindowConstraints);
3414
+// aWindowConstraints.weightx = 0;
3415
+// aWindowConstraints.gridx = 4;
3416
+// aWindowConstraints.gridwidth = 1;
3417
+// // aConstraints.gridheight = 3;
3418
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3419
+// bigThree.add(XYZPanel, aWindowConstraints);
3420
+// bigThree.validate();
3421
+// scenePanel.setVisible(true);
3422
+// centralPanel.setVisible(true);
3423
+// XYZPanel.setVisible(true);
3424
+ bigThree.ClearUI();
3425
+ bigThree.add(scenePanel);
3426
+ bigThree.add(centralPanel);
3427
+ bigThree.add(XYZPanel);
3428
+ bigThree.FlushUI();
3429
+
3430
+ cameraView.requestFocusInWindow();
27293431 } else
2730
- if (event.getSource() == rootButton)
3432
+ if (source == rootButton)
27313433 {
27323434 Object3D obj;
27333435 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2737,66 +3439,84 @@
27373439 EditObject(obj);
27383440 }
27393441
3442
+ cameraView.requestFocusInWindow();
27403443 refreshContents(true);
27413444 } else
2742
- if (event.getSource() == closeButton)
3445
+ if (source == closeButton)
27433446 {
27443447 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27453448 cRadio ab;
27463449 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27473450 {
27483451 ab = (cRadio)e.nextElement();
2749
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3452
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27503453 {
3454
+ // Patch to avoid bug with transparency.
3455
+ if (!ab.hadMaterial)
3456
+ {
3457
+ ab.object.material = null;
3458
+ }
3459
+
27513460 buttonGroup.remove(ab);
27523461 radioPanel.remove(ab);
27533462
2754
- ab.GetObject().editWindow = null;
3463
+ //ab.GetObject().editWindow = null;
3464
+ ab.GetObject().manipWindow = null;
27553465 // ab.GetObject().objectUI = null; // ?????????
27563466
27573467 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27583468 break;
27593469 }
27603470 }
3471
+
3472
+ cameraView.requestFocusInWindow();
27613473 refreshContents(true);
27623474 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3475
+ if (source == editItem || source == editButton)
27643476 {
3477
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3478
+ {
3479
+ Object3D child = (Object3D)e.nextElement();
3480
+ child.pinned = true;
3481
+ }
3482
+
27653483 EditSelection(false);
27663484 } else
2767
- if (event.getSource() == uneditButton)
3485
+ if (source == uneditButton)
27683486 {
27693487 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703488 {
27713489 Object3D child = (Object3D)e.nextElement();
27723490 if(child.editWindow != null)
27733491 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3492
+ child.pinned = false;
27743493 child.CloseUI();
27753494 listUI.remove(child);
27763495
2777
- child.editWindow = null; // ???????????
3496
+ //child.editWindow = null; // ???????????
27783497 }
2779
- objEditor.ctrlPanel.revalidate();
3498
+ objEditor.ctrlPanel.FlushUI();
27803499 //objEditor.jTree.clearSelection();
27813500 //objEditor.ResetSliders();
27823501 refreshContents(true);
27833502 } else
2784
- if (event.getSource() == clearPanelButton)
3503
+ if (source == clearPanelButton)
27853504 {
27863505 assert(copy == group);
27873506 //copy.ClearUI();
27883507 for (Object3D obj : listUI)
27893508 {
3509
+ obj.pinned = false;
27903510 obj.CloseUI();
27913511 }
27923512 listUI.clear();
27933513 refreshContents(true);
27943514 } else
2795
- if (event.getSource() == allParamsButton)
3515
+ if (source == allParamsButton)
27963516 {
27973517 assert(copy == group);
27983518
2799
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3519
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28003520
28013521 for (Object3D obj : listUI)
28023522 {
....@@ -2813,19 +3533,19 @@
28133533
28143534 refreshContents(true);
28153535 } else
2816
- if (event.getSource() == unselectButton)
3536
+ if (source == unselectButton)
28173537 {
28183538 objEditor.jTree.clearSelection();
28193539 // ?? oct 2012 GrafreeD.clipboard.clear();
28203540 objEditor.ResetSliders();
28213541 refreshContents(true);
28223542 } else
2823
- if(event.getSource() instanceof cRadio)
3543
+ if(source instanceof cRadio)
28243544 {
28253545 group.parent = keepparent;
28263546 group.attributes = 0;
28273547 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3548
+ /*cRadio*/ radio = (cRadio)source;
28293549 Object3D obj = radio.GetObject();
28303550 System.out.println("Edit " + obj);
28313551 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3565,10 @@
28453565 }
28463566
28473567 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3568
+
3569
+ SetUndoStates();
3570
+
3571
+ //Globals.theRenderer.object = group;
28493572 if(!useclient)
28503573 {
28513574 cameraView.renderCamera = radio.camera;
....@@ -2854,25 +3577,52 @@
28543577 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553578 cameraView.targetLookAt.set(radio.camera.lookAt);
28563579 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3580
+ //cameraView.lighttouched = true;
3581
+ Globals.lighttouched = true;
28583582 topView.object = group;
28593583 frontView.object = group;
28603584 sideView.object = group;
28613585 }
2862
- group.editWindow = this;
3586
+
3587
+// fix "+" issue
3588
+ //group.editWindow = this;
3589
+ group.manipWindow = this;
3590
+
28633591 /*
28643592 currentLayout = radio.layout;
28653593 if (currentLayout == null)
28663594 currentLayout = sevenButton;
28673595 */
28683596 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);
28693604 keepparent = group.parent;
28703605 // PARENT = NULL or not???
28713606 //group.parent = null; // ROOT
28723607 //group.attributes = -1;
28733608 ResetModel();
3609
+
3610
+ cameraView.requestFocusInWindow();
28743611 refreshContents(true);
2875
- }
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
+ }
28763626 else
28773627 {
28783628 //return super.action(event, arg);
....@@ -2881,7 +3631,6 @@
28813631 }
28823632
28833633 boolean useclient = false;
2884
- cRadio radio;
28853634
28863635 void ToggleRoot()
28873636 {
....@@ -2890,7 +3639,7 @@
28903639 if (useclient)
28913640 {
28923641 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3642
+ Globals.lighttouched = true;
28943643 //topView.object = client;
28953644 //frontView.object = client;
28963645 //sideView.object = client;
....@@ -2898,7 +3647,7 @@
28983647 else
28993648 {
29003649 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3650
+ Globals.lighttouched = true;
29023651 //topView.object = group;
29033652 //frontView.object = group;
29043653 //sideView.object = group;
....@@ -2933,6 +3682,28 @@
29333682 refreshContents();
29343683 }
29353684
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
+ }
29363707
29373708 void ResetTransform()
29383709 {
....@@ -3045,7 +3816,7 @@
30453816 refreshContents();
30463817 }
30473818
3048
- void ResetCentroid()
3819
+ void ResetCentroid(boolean full)
30493820 {
30503821 Object3D obj;
30513822 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3831,16 @@
30603831 LA.matIdentity(Object3D.mat);
30613832 obj.getBounds(minima, maxima, false);
30623833 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3834
+ if (full)
3835
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643836 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653837 obj.TransformMesh(Object3D.mat);
3838
+
30663839 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3840
+ if (full)
3841
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683842 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3843
+
30693844 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703845 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713846 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3094,7 +3869,8 @@
30943869
30953870 int size = obj.MemorySize();
30963871
3097
- 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)");
30983874 }
30993875 }
31003876 catch (Exception e)
....@@ -3131,9 +3907,9 @@
31313907 obj = (Object3D)e.nextElement();
31323908
31333909 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3910
+ Grafreed.AnalyzeObject(obj);
31353911 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3912
+ Grafreed.AnalyzeObject(obj.bRep);
31373913
31383914 // System.err.println((size/1024) + " KB is the size of " + obj);
31393915 }
....@@ -3175,6 +3951,20 @@
31753951 void GenNormals(boolean crease)
31763952 {
31773953 group.GenNormalsS(crease);
3954
+
3955
+ refreshContents();
3956
+ }
3957
+
3958
+ void GenNormalsMESH()
3959
+ {
3960
+ group.GenNormalsMeshS();
3961
+
3962
+ refreshContents();
3963
+ }
3964
+
3965
+ void GenNormalsMINE()
3966
+ {
3967
+ group.selection.GenNormalsMINE();
31783968
31793969 refreshContents();
31803970 }
....@@ -3340,8 +4130,8 @@
33404130
33414131 void ParseVertices()
33424132 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
4133
+ boolean epsequal = Grafreed.epsequal;
4134
+ Grafreed.epsequal = true;
33454135
33464136 for (int i=0; i<group.selection.size(); i++)
33474137 {
....@@ -3366,7 +4156,7 @@
33664156 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33674157 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33684158
3369
- g.add(GrafreeD.clipboard);
4159
+ g.add(Grafreed.clipboard);
33704160
33714161 buffer.add(g);
33724162 }
....@@ -3381,7 +4171,7 @@
33814171 makeSomething(buffer, i==group.selection.size()-1);
33824172 }
33834173
3384
- GrafreeD.epsequal = epsequal;
4174
+ Grafreed.epsequal = epsequal;
33854175
33864176 refreshContents();
33874177 }
....@@ -3399,7 +4189,16 @@
33994189 String pigment = Object3D.GetPigment(tex);
34004190 //String bump = Object3D.GetBump(tex);
34014191
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.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
+ }
34034202
34044203 double s = v.s;
34054204
....@@ -3447,12 +4246,26 @@
34474246
34484247 void Align()
34494248 {
4249
+ if (group.selection.size() == 0)
4250
+ return;
4251
+
4252
+ cVector bbmin = new cVector();
4253
+ cVector bbmax = new cVector();
4254
+
4255
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4256
+
4257
+ double dx = bbmax.x - bbmin.x;
4258
+ double dy = bbmax.y - bbmin.y;
4259
+ double dz = bbmax.z - bbmin.z;
4260
+
4261
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4262
+
34504263 for (int i=0; i<group.selection.size(); i++)
34514264 {
34524265 Object3D obj = group.selection.get(i);
34534266
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4267
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4268
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34564269 }
34574270
34584271 refreshContents();
....@@ -3473,11 +4286,11 @@
34734286
34744287 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34754288
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
4289
+ boolean random = CameraPane.SWITCH;
4290
+ CameraPane.SWITCH = false; // parse all random nodes
34784291 lowres.linkVerticesThis(null);
34794292 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
4293
+ CameraPane.SWITCH = random;
34814294
34824295 System.err.flush();
34834296
....@@ -3517,7 +4330,7 @@
35174330 return;
35184331
35194332 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
4333
+ Object3D ref = Grafreed.clipboard.get(0);
35214334
35224335 Object3D newgroup = new Object3D("Po:" + poses.name);
35234336
....@@ -3686,7 +4499,7 @@
36864499 group.selection.RelinkToSupport(); // july 2014
36874500 System.out.println("DONE.");
36884501 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4502
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36904503 }
36914504
36924505 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4524,9 @@
37114524
37124525 void ClipMesh()
37134526 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4527
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154528 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4529
+ Object3D content = Grafreed.clipboard.get(0);
37174530
37184531 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194532 content = ((cGroup)content).get(0);
....@@ -3722,7 +4535,7 @@
37224535 // {
37234536 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244537 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4538
+ group.selection.ClipMesh(Grafreed.clipboard);
37264539 }
37274540 // group.selection.ClipMesh(GrafreeD.clipboard);
37284541 System.out.println("DONE.");
....@@ -3769,6 +4582,18 @@
37694582 void MarkLeaves(boolean hide)
37704583 {
37714584 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);
37724597 refreshContents();
37734598 }
37744599
....@@ -3843,28 +4668,25 @@
38434668 // }
38444669 // }
38454670
3846
- static boolean allparams = true;
3847
-
3848
- static Vector<Object3D> listUI = new Vector<Object3D>();
3849
-
38504671 void EditSelection(boolean newWindow)
38514672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
38524679 // aConstraints.gridy = 0;
38534680 for (int i=0; i<group.selection.size(); i++)
38544681 {
38554682 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38564683 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3857
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4684
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584685
38594686 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4687
+ if(elem != group || !newWindow)
38614688 {
3862
- // if (!(elem instanceof Composite))
3863
- // newWindow = false;
3864
- listUI.add(elem);
3865
- elem.openEditWindow(this, newWindow); //, false);
3866
- System.out.println("edit : " + elem);
3867
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
38684690 }
38694691 }
38704692 }
....@@ -3939,7 +4761,8 @@
39394761 //new Exception().printStackTrace();
39404762
39414763 freezemodel = true;
3942
-
4764
+ ClearUnpinned();
4765
+
39434766 /**/
39444767 //switch (event.id)
39454768 {
....@@ -3947,7 +4770,6 @@
39474770 //case 702: // Event.LIST_DESELECT
39484771 group.deselectAll();
39494772 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3950
- objEditor.ClearInfo(); // .GetMaterial());
39514773 if (tps != null)
39524774 {
39534775 for (int i=0; i < tps.length; i++)
....@@ -3956,33 +4778,39 @@
39564778
39574779 //if (child.parent != null)
39584780 //child.parent.addSelectee(child);
4781
+ objEditor.SetMaterial(child);
39594782 group.addSelectee(child);
3960
- objEditor.SetMaterial(child); // .GetMaterial());
3961
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3962
- System.err.println("info : " + child.GetPath());
39634783 }
39644784 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4785
+// else
4786
+// {
4787
+// objEditor.SetMaterial(group); // .GetMaterial());
4788
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4789
+// System.err.println("info : " + group.GetPath());
4790
+// }
39714791
3972
- objEditor.SetText(); // jan 2014
3973
-
3974
- if (flashIt && !CameraPane.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))
39754793 CameraPane.flash = true;
39764794
3977
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4795
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39784796 // a camera
39794797 {
3980
- CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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
+ }
4803
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4804
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844805 }
39854806
4807
+ if (tps != null && tps.length == 1)
4808
+ {
4809
+ EditSelection(false);
4810
+ }
4811
+
4812
+ SetPinStates(tps != null && tps.length > 0);
4813
+
39864814 refreshContents();
39874815 //return true;
39884816 }
....@@ -3991,6 +4819,35 @@
39914819
39924820 freezemodel = false;
39934821 }
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
+ }
39944851
39954852 void linkSomething(Object3D thing)
39964853 {
....@@ -4062,16 +4919,19 @@
40624919 {
40634920 if (group.selection.isEmpty())
40644921 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4922
+
4923
+ Grafreed.clipboardIsTempGroup = false;
40664924 Composite tGroup = null;
40674925 if (group.selection.size() > 0) // 1)
40684926 {
40694927 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4928
+ Grafreed.clipboardIsTempGroup = true;
40714929 }
40724930
40734931 if (cut)
40744932 {
4933
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4934
+// Save();
40754935 //int indices[] = jList.getSelectedIndices();
40764936 //for (int i = indices.length - 1; i >= 0; i--)
40774937 //jList.remove(indices[i]);
....@@ -4107,16 +4967,16 @@
41074967 //System.out.println("cut " + child);
41084968 //System.out.println("parent = " + child.parent);
41094969 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4970
+ if (Grafreed.clipboardIsTempGroup)
41114971 tGroup.add/*Child*/(tmp);
41124972 else
4113
- GrafreeD.clipboard = tmp;
4973
+ Grafreed.clipboard = tmp;
41144974 }
41154975 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4976
+ if (Grafreed.clipboardIsTempGroup)
41174977 tGroup.add/*Child*/(child);
41184978 else
4119
- GrafreeD.clipboard = child;
4979
+ Grafreed.clipboard = child;
41204980 }
41214981
41224982 //ResetModel();
....@@ -4148,21 +5008,23 @@
41485008 //System.out.println("cut " + elem);
41495009 //System.out.println("parent = " + elem.parent);
41505010 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
5011
+ if (Grafreed.clipboardIsTempGroup)
41525012 tGroup.add/*Child*/(tmp);
41535013 else
4154
- GrafreeD.clipboard = tmp;
5014
+ Grafreed.clipboard = tmp;
41555015 }
41565016 else
4157
- if (GrafreeD.clipboardIsTempGroup)
5017
+ if (Grafreed.clipboardIsTempGroup)
41585018 tGroup.add/*Child*/(child);
41595019 else
4160
- GrafreeD.clipboard = child;
5020
+ Grafreed.clipboard = child;
41615021 }
41625022
41635023 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
5024
+
5025
+ if (Grafreed.clipboardIsTempGroup)
5026
+ Grafreed.clipboard = tGroup;
5027
+
41665028 if (cut)
41675029 {
41685030 ResetModel();
....@@ -4172,11 +5034,15 @@
41725034
41735035 void paste(boolean expand)
41745036 {
5037
+ if (Globals.REPLACEONMAKE)
5038
+ Save();
5039
+ boolean keep = Globals.REPLACEONMAKE;
5040
+ Globals.REPLACEONMAKE = false;
41755041 // if (GrafreeD.clipboard == null)
41765042 // return;
41775043 boolean first = true;
41785044
4179
- if (GrafreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
41805046 {
41815047 Composite temp;
41825048
....@@ -4187,7 +5053,7 @@
41875053 temp = (Composite)Applet3D.clipboard.deepCopy();
41885054 */
41895055 Object3D elem;
4190
- 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))
41915057 {
41925058 Object3D child = (Object3D)e.nextElement();
41935059
....@@ -4221,21 +5087,22 @@
42215087 //Object3D cb = Applet3D.clipboard;
42225088 //temp.addChild(cb);
42235089 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4224
- assert(GrafreeD.clipboard.parent == null);
4225
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4226
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4227
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4228
- 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());
42295095 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
5096
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5097
+ Grafreed.clipboard.get(0).parent = keepparent;
42325098 }
42335099
5100
+ Globals.REPLACEONMAKE = keep;
42345101 ResetModel();
42355102 refreshContents();
42365103 }
42375104
4238
- void pasteInto(boolean copyit)
5105
+ void pasteInto(boolean copyit, boolean clone)
42395106 {
42405107 // if (GrafreeD.clipboard == null)
42415108 // return;
....@@ -4264,15 +5131,22 @@
42645131 if (copyit)
42655132 {
42665133 // paste(false);
4267
- CloneClipboard(false); // sept 2014
5134
+ if (clone)
5135
+ {
5136
+ CloneClipboard(false); // sept 2014
5137
+ }
5138
+ else
5139
+ {
5140
+ paste(false);
5141
+ }
42685142 }
42695143 else
42705144 {
42715145 boolean first = true;
42725146
4273
- if (GrafreeD.clipboardIsTempGroup)
5147
+ if (Grafreed.clipboardIsTempGroup)
42745148 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
5149
+ Composite temp = (Composite)Grafreed.clipboard;
42765150 Object3D copy;
42775151 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42785152 {
....@@ -4282,7 +5156,7 @@
42825156 }
42835157 } else
42845158 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
5159
+ linkSomething(Grafreed.clipboard); //.get(0));
42865160 }
42875161 }
42885162 }
....@@ -4359,6 +5233,10 @@
43595233
43605234 void group(Object3D csg, boolean grab)
43615235 {
5236
+ if (Globals.REPLACEONMAKE)
5237
+ Save();
5238
+ boolean keep = Globals.REPLACEONMAKE;
5239
+ Globals.REPLACEONMAKE = false;
43625240 if (//false) // why??
43635241 !group.selection.isEmpty())
43645242 {
....@@ -4472,8 +5350,34 @@
44725350 //node.add(csg);
44735351 //makeSomething(node);
44745352 makeSomething(csg);
5353
+ Globals.REPLACEONMAKE = keep;
44755354 }
44765355
5356
+ void Ungroup(Object3D g)
5357
+ {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
5362
+ if (g instanceof HiddenObject)
5363
+ {
5364
+ HiddenObject h = (HiddenObject) g;
5365
+
5366
+ for (int i=0; i<h.ActualSize(); i++)
5367
+ {
5368
+ objEditor.makeSomething(h.get(i), false);
5369
+ }
5370
+ }
5371
+ else
5372
+ {
5373
+ for (int i=0; i<g.Size(); i++)
5374
+ {
5375
+ objEditor.makeSomething(g.get(i), false);
5376
+ }
5377
+ }
5378
+ Globals.REPLACEONMAKE = keep;
5379
+ }
5380
+
44775381 void ungroup()
44785382 {
44795383 /*
....@@ -4667,21 +5571,6 @@
46675571 }
46685572 */
46695573
4670
- void ImportGFD()
4671
- {
4672
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4673
- browser.show();
4674
- String filename = browser.getFile();
4675
- if (filename != null && filename.length() > 0)
4676
- {
4677
- String fullname = browser.getDirectory() + filename;
4678
-
4679
- //Object3D readobj =
4680
- objEditor.ReadGFD(fullname, objEditor);
4681
- //makeSomething(readobj);
4682
- }
4683
- }
4684
-
46855574 /*
46865575 public void Callback(Object obj)
46875576 {
....@@ -4705,26 +5594,9 @@
47055594 }
47065595 */
47075596
4708
- void ImportVRMLX3D()
4709
- {
4710
- if (GrafreeD.standAlone)
4711
- {
4712
- /**/
4713
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4714
- browser.show();
4715
- String filename = browser.getFile();
4716
- if (filename != null && filename.length() > 0)
4717
- {
4718
- String fullname = browser.getDirectory() + filename;
4719
- LoadVRMLX3D(fullname);
4720
- }
4721
- /**/
4722
- }
4723
- }
4724
-
47255597 String GetFile(String dialogName)
47265598 {
4727
- if (GrafreeD.standAlone)
5599
+ if (Grafreed.standAlone)
47285600 {
47295601 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305602 browser.show();
....@@ -4788,10 +5660,33 @@
47885660 cButton flashSelectionButton;
47895661 cButton editButton;
47905662 cButton uneditButton;
5663
+ JCheckBox allParamsButton;
47915664 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935665 cButton unselectButton;
47945666
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
+
47955690 cButton screenfitButton;
47965691 cButton screenfitpointButton;
47975692 cButton snapobjectButton;
....@@ -4803,14 +5698,6 @@
48035698
48045699 cButton setsupportButton;
48055700
4806
- cButton twoButton;
4807
- cButton sixButton;
4808
- cButton threeButton;
4809
- cButton sevenButton;
4810
- cButton fourButton; // full panel
4811
- cButton oneButton; // full XYZ
4812
- //cButton currentLayout;
4813
-
48145701 //
48155702 //Composite
48165703 Object3D // to do !!
....@@ -4820,9 +5707,11 @@
48205707 //JTree jTree;
48215708 private MenuItem lookAtItem;
48225709 private MenuItem lookFromItem;
4823
- private MenuItem switchItem;
5710
+ private MenuItem switchViewItem;
48245711 private MenuItem cutItem;
4825
- private MenuItem duplicateItem;
5712
+ private MenuItem undoItem;
5713
+ private MenuItem redoItem;
5714
+ private JMenuItem duplicateItem;
48265715 private MenuItem cloneItem;
48275716 private MenuItem cloneSupportItem;
48285717 private MenuItem overwriteGeoItem;
....@@ -4833,8 +5722,9 @@
48335722 private MenuItem resetsupportItem;
48345723 private MenuItem resetreferencesItem;
48355724 private MenuItem linkverticesItem;
5725
+ private MenuItem relinkverticesItem;
48365726 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5727
+ private MenuItem resetAllItem;
48385728 private MenuItem stepAllItem;
48395729 private MenuItem revertMeshItem;
48405730 private MenuItem poseMeshItem;
....@@ -4845,15 +5735,17 @@
48455735 private MenuItem mergeGeometriesItem;
48465736 private MenuItem copyItem;
48475737 private MenuItem pasteItem;
5738
+ private MenuItem pasteIntoItem;
48485739 private MenuItem pasteLinkItem;
48495740 private MenuItem pasteCloneItem;
48505741 private MenuItem pasteExpandItem;
4851
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
48525743 private MenuItem clearAllItem;
48535744 private MenuItem genUVItem;
48545745 private MenuItem genNormalsMESHItem;
48555746 private MenuItem genNormalsCADItem;
48565747 private MenuItem genNormalsORGANItem;
5748
+ private MenuItem genNormalsMINEItem;
48575749 private MenuItem stripifyItem;
48585750 private MenuItem unstripifyItem;
48595751 private MenuItem trimItem;
....@@ -4882,6 +5774,10 @@
48825774 private MenuItem showleavesItem;
48835775 private MenuItem markleavesItem;
48845776 private MenuItem unmarkleavesItem;
5777
+ private MenuItem rewindleavesItem;
5778
+ private MenuItem unrewindleavesItem;
5779
+ private MenuItem randomleavesItem;
5780
+ private MenuItem unrandomleavesItem;
48855781
48865782 private MenuItem flipVItem;
48875783 private MenuItem unflipVItem;
....@@ -4893,14 +5789,17 @@
48935789 private MenuItem panoTexturesItem;
48945790
48955791 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5792
+ private MenuItem resetCentroidXZItem;
48975793 private MenuItem resetTransformItem;
5794
+ private MenuItem transformGeometryItem;
5795
+ private MenuItem transformChildrenItem;
5796
+ private MenuItem hideItem;
48985797 private MenuItem grabItem;
48995798 private MenuItem backItem;
49005799 private MenuItem frontItem;
49015800 private MenuItem cameraItem;
49025801 private MenuItem compositeItem;
4903
- private MenuItem randomItem;
5802
+ private MenuItem switchItem;
49045803 private MenuItem physicsItem;
49055804 private MenuItem frameselectorItem;
49065805 private MenuItem scriptNodeItem;
....@@ -4915,6 +5814,7 @@
49155814
49165815 private MenuItem resetParentItem;
49175816 private MenuItem repairParentItem;
5817
+ private MenuItem repairShadowItem;
49185818 private MenuItem sortbysizeItem;
49195819 private MenuItem sortbynameItem;
49205820
....@@ -4923,6 +5823,8 @@
49235823 private MenuItem attachBumpItem;
49245824 private MenuItem detachBumpItem;
49255825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
49265828
49275829 private MenuItem particleItem;
49285830 private MenuItem ragdollItem;
....@@ -4935,10 +5837,11 @@
49355837 private MenuItem coneItem;
49365838 private MenuItem torusItem;
49375839 private MenuItem superItem;
5840
+ private MenuItem kleinItem;
49385841 private MenuItem blobItem;
49395842 private MenuItem latheItem;
49405843 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5844
+ private MenuItem overlayItem;
49425845 private MenuItem meshItem;
49435846 // private MenuItem meshGroupItem;
49445847 private MenuItem springItem;
....@@ -4947,6 +5850,7 @@
49475850 private MenuItem csgItem;
49485851 private MenuItem templateItem;
49495852 private MenuItem textureItem;
5853
+ private MenuItem billboardItem;
49505854 private MenuItem shadowXItem;
49515855 private MenuItem shadowYItem;
49525856 private MenuItem shadowZItem;
....@@ -4959,11 +5863,6 @@
49595863 private MenuItem doubleItem;
49605864 private MenuItem tripleItem;
49615865
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675866 private MenuItem computeAOItem;
49685867 private MenuItem recompileItem;
49695868 private MenuItem editScriptItem;
....@@ -4973,4 +5872,8 @@
49735872 private MenuItem analyzeItem;
49745873 private MenuItem dumpItem;
49755874 //boolean freezemodel = false;
5875
+
5876
+ Menu cameraMenu;
5877
+ MenuItem editCameraItem;
5878
+ MenuItem restoreCameraItem;
49765879 }