Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
GroupEditor.java
....@@ -74,7 +74,7 @@
7474 this.copy = this.group = copy;
7575 //selectees = this.group.selectees;
7676
77
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7878 SetupUI2(objEditor);
7979 objEditor.SetupUI(true);
8080 SetupViews(objEditor);
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -148,30 +148,29 @@
148148
149149 //JTextField nameField;
150150
151
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
152152 {
153
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
154
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
155
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
156
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
157
- oe.cameraMenu.add("-");
158
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
159
- openWindowItem.addActionListener(this);
160
- editLeafItem.addActionListener(this);
161
- lookAtItem.addActionListener(this);
162
- //lookFromItem.addActinoListener(this);
163
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
164155 Menu menu;
165156 oe.menuBar.add(menu = new Menu("Edit"));
166157 //editItem = menu.add(new MenuItem("Edit"));
167158 //editItem.addActionListener(this);
168
- duplicateItem = menu.add(new MenuItem("Duplicate"));
159
+
160
+// undoItem = menu.add(new MenuItem("Undo"));
161
+// undoItem.addActionListener(this);
162
+// redoItem = menu.add(new MenuItem("Redo"));
163
+// redoItem.addActionListener(this);
164
+// menu.add("-");
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
169166 duplicateItem.addActionListener(this);
170
- menu.add("-");
171167 cloneItem = menu.add(new MenuItem("Clone"));
172168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
173171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
174172 cloneSupportItem.addActionListener(this);
173
+ }
175174 menu.add("-");
176175 cutItem = menu.add(new MenuItem("Cut"));
177176 cutItem.addActionListener(this);
....@@ -179,27 +178,123 @@
179178 copyItem.addActionListener(this);
180179 pasteItem = menu.add(new MenuItem("Paste"));
181180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
182185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
183186 pasteLinkItem.addActionListener(this);
184187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
185188 pasteCloneItem.addActionListener(this);
186189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
187190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
188192 clearItem = menu.add(new MenuItem("Clear"));
189193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
190198 clearAllItem = menu.add(new MenuItem("Clear All"));
191199 clearAllItem.addActionListener(this);
200
+ }
201
+
202
+ menuBar.add(cameraMenu = new Menu("View"));
203
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
204
+ //zBufferItem.addActionListener(this);
205
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206
+ //normalLensItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
209
+
210
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+// toggleFullScreenItem.addItemListener(this);
212
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+// cameraMenu.add("-");
214
+//
215
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+// toggleTextureItem.addItemListener(this);
217
+// toggleTextureItem.setState(CameraPane.textureon);
218
+//
219
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+// toggleSwitchItem.addItemListener(this);
221
+// toggleSwitchItem.setState(CameraPane.SWITCH);
222
+
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224
+ toggleHandleItem.addItemListener(this);
225
+ toggleHandleItem.setState(CameraPane.HANDLES);
226
+
227
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
228
+ togglePaintItem.addItemListener(this);
229
+ togglePaintItem.setState(CameraPane.PAINTMODE);
230
+
231
+ if (Globals.ADVANCED)
232
+ {
233
+ cameraMenu.add("-");
234
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
235
+ toggleLiveItem.addItemListener(this);
236
+ toggleLiveItem.setState(Globals.isLIVE());
192237
238
+ cameraMenu.add(stepItem = new MenuItem("Step"));
239
+ stepItem.addActionListener(this);
240
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
241
+ // toggleDLItem.addItemListener(this);
242
+ // toggleDLItem.setState(false);
243
+
244
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
245
+ toggleRenderItem.addItemListener(this);
246
+ toggleRenderItem.setState(!CameraPane.frozen);
247
+
248
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
249
+ toggleDebugItem.addItemListener(this);
250
+ toggleDebugItem.setState(Globals.DEBUG);
251
+
252
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
253
+ toggleFrustumItem.addItemListener(this);
254
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
255
+
256
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
257
+ toggleFootContactItem.addItemListener(this);
258
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
259
+
260
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
261
+ toggleTimelineItem.addItemListener(this);
262
+ }
263
+
264
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
265
+// toggleRootItem.addItemListener(this);
266
+// toggleRootItem.setState(false);
267
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
268
+// animationItem.addItemListener(this);
269
+// animationItem.setState(CameraPane.ANIMATION);
270
+ cameraMenu.add("-");
271
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
272
+ editCameraItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280
+ oe.cameraMenu.add("-");
281
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
282
+ openWindowItem.addActionListener(this);
283
+ editLeafItem.addActionListener(this);
284
+ lookAtItem.addActionListener(this);
285
+ //lookFromItem.addActinoListener(this);
286
+ //switchViewItem.addActionListener(this);
287
+ }
288
+
193289 oe.menuBar.add(menu = new Menu("Setting"));
194
- resetMeshItem = menu.add(new MenuItem("Reset All"));
195
- resetMeshItem.addActionListener(this);
196
- stepAllItem = menu.add(new MenuItem("Step All"));
197
- stepAllItem.addActionListener(this);
290
+ if (Globals.ADVANCED)
291
+ {
198292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
199293 revertMeshItem.addActionListener(this);
200294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
201295 resetreferencesItem.addActionListener(this);
202296 menu.add("-");
297
+ }
203298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
204299 overwriteGeoItem.addActionListener(this);
205300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -211,79 +306,103 @@
211306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
212307 overwriteUVItem.addActionListener(this);
213308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
214311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
215312 generateMeshItem.addActionListener(this);
216313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
217314 poseMeshItem.addActionListener(this);
218315 menu.add("-");
316
+ }
219317 resetsupportItem = menu.add(new MenuItem("Reset support"));
220318 resetsupportItem.addActionListener(this);
221319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
222320 linkverticesItem.addActionListener(this);
223321 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224322 relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
225326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
226327 setMasterItem.addActionListener(this);
328
+ }
227329
228330 oe.menuBar.add(menu = new Menu("Group"));
229
- grabItem = menu.add(new MenuItem("Grab"));
230
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
231333 backItem = menu.add(new MenuItem("Back"));
232334 backItem.addActionListener(this);
233335 frontItem = menu.add(new MenuItem("Front"));
234336 frontItem.addActionListener(this);
235
- compositeItem = menu.add(new MenuItem("Composite"));
236
- compositeItem.addActionListener(this);
237
- hideItem = menu.add(new MenuItem("Hide"));
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
342
+ hideItem = menu.add(new MenuItem("Hidden Group"));
238343 hideItem.addActionListener(this);
344
+ }
239345 ungroupItem = menu.add(new MenuItem("Ungroup"));
240346 ungroupItem.addActionListener(this);
241
- menu.add("-");
242
- randomItem = menu.add(new MenuItem("Random"));
243
- randomItem.addActionListener(this);
244
- physicsItem = menu.add(new MenuItem("Physics"));
245
- physicsItem.addActionListener(this);
246
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
247
- frameselectorItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
248354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
249355 switchGeoItem.addActionListener(this);
250356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
251357 switchTransfoItem.addActionListener(this);
252
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
253359 morphItem.addActionListener(this);
360
+
361
+ menu.add("-");
362
+ physicsItem = menu.add(new MenuItem("Physics"));
363
+ physicsItem.addActionListener(this);
364
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
365
+ frameselectorItem.addActionListener(this);
254366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
255367 scriptNodeItem.addActionListener(this);
256
- cameraItem = menu.add(new MenuItem("Camera"));
257
- cameraItem.addActionListener(this);
368
+ }
258369
259370 oe.menuBar.add(menu = new Menu("Object"));
260
- textureItem = menu.add(new MenuItem("Texture"));
261
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
262373 billboardItem = menu.add(new MenuItem("Billboard"));
263374 billboardItem.addActionListener(this);
264375 csgItem = menu.add(new MenuItem("CSG"));
265376 csgItem.addActionListener(this);
266
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
267378 shadowXItem.addActionListener(this);
268
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
269380 shadowYItem.addActionListener(this);
270
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
271382 shadowZItem.addActionListener(this);
383
+ if (Globals.ADVANCED)
384
+ {
385
+ menu.add("-");
272386 linkerItem = menu.add(new MenuItem("Linker"));
273387 linkerItem.addActionListener(this);
274
- templateItem = menu.add(new MenuItem("Template"));
275
- templateItem.addActionListener(this);
276388 attributeItem = menu.add(new MenuItem("Attribute"));
277389 attributeItem.addActionListener(this);
390
+ templateItem = menu.add(new MenuItem("Template"));
391
+ templateItem.addActionListener(this);
278392 pointflowItem = menu.add(new MenuItem("Point Flow"));
279393 pointflowItem.addActionListener(this);
394
+ }
280395 menu.add("-");
281396 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
282397 resetTransformItem.addActionListener(this);
283398 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
284399 resetCentroidItem.addActionListener(this);
285
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
- transformgeometryItem.addActionListener(this);
400
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
401
+ resetCentroidXZItem.addActionListener(this);
402
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
403
+ transformGeometryItem.addActionListener(this);
404
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
405
+ transformChildrenItem.addActionListener(this);
287406
288407 oe.menuBar.add(menu = new Menu("Geometry"));
289408 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -294,8 +413,11 @@
294413 genNormalsCADItem.addActionListener(this);
295414 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296415 genNormalsMESHItem.addActionListener(this);
416
+ if (Globals.ADVANCED)
417
+ {
297418 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298419 genNormalsMINEItem.addActionListener(this);
420
+ }
299421 stripifyItem = menu.add(new MenuItem("Stripify"));
300422 stripifyItem.addActionListener(this);
301423 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -317,23 +439,34 @@
317439 reduce34MeshItem.addActionListener(this);
318440 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
319441 increaseMeshItem.addActionListener(this);
320
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
321
- smoothMeshItem.addActionListener(this);
322442 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
323443 clipMeshItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
448
+ smoothMeshItem.addActionListener(this);
449
+ }
324450
325451 oe.menuBar.add(menu = new Menu("Attributes"));
326452 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327453 clearMaterialsItem.addActionListener(this);
454
+ resetAllItem = menu.add(new MenuItem("Reset All"));
455
+ resetAllItem.addActionListener(this);
456
+ stepAllItem = menu.add(new MenuItem("Step All"));
457
+ stepAllItem.addActionListener(this);
328458 menu.add("-");
329459 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
330460 liveleavesItem.addActionListener(this);
331461 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
332462 unliveleavesItem.addActionListener(this);
463
+ if (Globals.ADVANCED)
464
+ {
333465 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
334466 supportleavesItem.addActionListener(this);
335467 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
336468 unsupportleavesItem.addActionListener(this);
469
+ }
337470 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
338471 hideleavesItem.addActionListener(this);
339472 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -342,6 +475,14 @@
342475 markleavesItem.addActionListener(this);
343476 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
344477 unmarkleavesItem.addActionListener(this);
478
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
479
+ rewindleavesItem.addActionListener(this);
480
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
481
+ unrewindleavesItem.addActionListener(this);
482
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
483
+ randomleavesItem.addActionListener(this);
484
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
485
+ unrandomleavesItem.addActionListener(this);
345486 menu.add("-");
346487 flipVItem = menu.add(new MenuItem("Flip V"));
347488 flipVItem.addActionListener(this);
....@@ -377,35 +518,40 @@
377518 sortbynameItem = menu.add(new MenuItem("Sort by name"));
378519 sortbynameItem.addActionListener(this);
379520 menu.add("-");
521
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
522
+ shareGeometriesItem.addActionListener(this);
523
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
524
+ mergeGeometriesItem.addActionListener(this);
525
+ if (Globals.ADVANCED)
526
+ {
527
+ // Pretty much the same as duplicate and clone.
380528 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381529 extractGeometriesItem.addActionListener(this);
382530 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383531 cloneGeometriesItem.addActionListener(this);
384
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
- shareGeometriesItem.addActionListener(this);
386
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
- mergeGeometriesItem.addActionListener(this);
532
+ }
388533
389534 oe.menuBar.add(menu = new Menu("Insert"));
390535 buildCreateMenu(menu);
391536
392
-
393
- oe.menuBar.add(menu = new Menu("Include"));
394
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
- importGFDItem.addActionListener(this);
396
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
- importVRMLX3DItem.addActionListener(this);
398
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
399
- importOBJItem.addActionListener(this);
400
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
401
- import3DSItem.addActionListener(this);
402
-
403537 oe.menuBar.add(menu = new Menu("Tools"));
404538 buildToolsMenu(menu);
405539 }
406540
407541 void SetupUI2(ObjEditor oe)
408542 {
543
+ // June 2019
544
+ if (oe == null)
545
+ {
546
+ //super.SetupUI2(this);
547
+ //return;
548
+ }
549
+
550
+ if (copy != group)
551
+ {
552
+ //super.SetupUI2(this);
553
+ }
554
+
409555 //new Exception().printStackTrace();
410556
411557 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -434,110 +580,213 @@
434580 oe.radioPanel.add(dummyButton);
435581 oe.buttonGroup.add(dummyButton);
436582 */
437
- aConstraints.gridy += 1;
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
438586
439587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
440588
441
- oe.aConstraints.gridwidth = 1;
442
- oe.aConstraints.gridx = 0;
589
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
+ //minButton.setToolTipText("Minimize window");
591
+ //minButton.addActionListener(this);
443592
444
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
445
- liveCB.setToolTipText("Enabled animation");
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
+ maxButton.setToolTipText("Maximize window");
595
+ maxButton.addActionListener(this);
596
+
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598
+ fullButton.setToolTipText("Full-screen window");
599
+ fullButton.addActionListener(this);
600
+
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ undoButton.setToolTipText("Undo changes");
607
+ undoButton.addActionListener(this);
608
+ undoButton.setEnabled(false);
609
+
610
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ redoButton.setToolTipText("Redo changes");
612
+ redoButton.addActionListener(this);
613
+ redoButton.setEnabled(false);
614
+
615
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ saveButton.setToolTipText("Save changes");
617
+ saveButton.addActionListener(this);
618
+
619
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
620
+ liveCB.setToolTipText("Enable animation");
446621 liveCB.addItemListener(this);
447622
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
450
- trackCB.setToolTipText("Enable tracking");
451
- trackCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
623
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ oneStepButton.setToolTipText("Animate one step forward");
625
+ oneStepButton.addActionListener(this);
626
+
627
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
628
+ fastCB.setToolTipText("Fast mode");
629
+ fastCB.addItemListener(this);
630
+
631
+ //oe.toolboxPanel.Return();
632
+
633
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
455634 screenfitButton.setToolTipText("Screen fit");
456635 screenfitButton.addActionListener(this);
457
- oe.aConstraints.gridx += 1;
636
+
637
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638
+// trackCB.setToolTipText("Enable tracking");
639
+// trackCB.addItemListener(this);
640
+
458641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
459642 // screenfitpointButton.addActionListener(this);
460
-// oe.aConstraints.gridx += 1;
461
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
462
- snapobjectButton.addActionListener(this);
463
- snapobjectButton.setToolTipText("Snap Object");
464
- oe.aConstraints.gridx += 1;
465643
466
- //aConstraints.gridx = 0;
467
- //aConstraints.gridy += 1;
468
- oe.aConstraints.weighty = 0;
469
- oe.aConstraints.gridwidth = 1;
470
-
471
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
472
- flashSelectionButton.setToolTipText("Show selection");
473
- flashSelectionButton.addActionListener(this);
644
+ if (Globals.ADVANCED)
645
+ {
646
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ snapobjectButton.addActionListener(this);
648
+ snapobjectButton.setToolTipText("Snap Object");
649
+ }
650
+
651
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
474652
475
- oe.toolbarPanel.add(new cButton(" ", false));
476
-
477
- oe.aConstraints.gridx += 1;
478
- oe.aConstraints.weighty = 0;
479
- oe.aConstraints.gridwidth = 1;
480
-
481
- //
482
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
653
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483654 twoButton.setToolTipText("Show center view only");
484655 twoButton.addActionListener(this);
485
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
656
+ this.fullscreenLayout = twoButton;
657
+
658
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
486659 fourButton.addActionListener(this);
487660 fourButton.setToolTipText("Show left panel only");
488
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
661
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
489662 sixButton.setToolTipText("2-column layout left");
490663 sixButton.addActionListener(this);
491
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
664
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492665 threeButton.setToolTipText("2-column layout right");
493666 threeButton.addActionListener(this);
494
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
667
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495668 sevenButton.setToolTipText("3-column layout");
496669 sevenButton.addActionListener(this);
497670 //
498671
499
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
500
- rootButton.setToolTipText("Edit object in new tab");
672
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
+ rootButton.setToolTipText("Edit selection in new tab");
501674 rootButton.addActionListener(this);
502
- oe.aConstraints.gridx += 1;
503
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
675
+
676
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504677 closeButton.setToolTipText("Close tab");
505678 closeButton.addActionListener(this);
506679 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
507680 //clearButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509
-
510
- oe.aConstraints.gridx = 1; //
511
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
512
- editButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516681
517
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
682
+ // INSERT
683
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ gridButton.setToolTipText("Create grid");
685
+ gridButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ boxButton.setToolTipText("Create box");
689
+ boxButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
692
+ sphereButton.setToolTipText("Create sphere");
693
+ sphereButton.addActionListener(this);
694
+
695
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ coneButton.setToolTipText("Create cone");
697
+ coneButton.addActionListener(this);
698
+
699
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ torusButton.setToolTipText("Create torus");
701
+ torusButton.addActionListener(this);
702
+
703
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+ superButton.setToolTipText("Create superellipsoid");
705
+ superButton.addActionListener(this);
706
+
707
+ if (Globals.ADVANCED)
708
+ {
709
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
710
+ kleinButton.setToolTipText("Create Klein bottle");
711
+ kleinButton.addActionListener(this);
712
+ }
713
+
714
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ particlesButton.setToolTipText("Create particle system");
716
+ particlesButton.addActionListener(this);
717
+
718
+ oe.toolboxPanel.Return();
719
+
720
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ groupButton.setToolTipText("Create group");
722
+ groupButton.addActionListener(this);
723
+
724
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ compositeButton.setToolTipText("Create composite");
726
+ compositeButton.addActionListener(this);
727
+
728
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
+ switchButton.setToolTipText("Create switch");
730
+ switchButton.addActionListener(this);
731
+
732
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ loopButton.setToolTipText("Create loop");
734
+ loopButton.addActionListener(this);
735
+
736
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
737
+ textureButton.setToolTipText("Create texture");
738
+ textureButton.addActionListener(this);
739
+
740
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ overlayButton.setToolTipText("Create overlay");
742
+ overlayButton.addActionListener(this);
743
+
744
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ lightButton.setToolTipText("Create light");
746
+ lightButton.addActionListener(this);
747
+
748
+ for (int i=6; --i>=0;)
749
+ {
750
+ oe.toolboxPanel.Return();
751
+ oe.toolboxPanel.add(new cGridBag());
752
+ oe.toolboxPanel.add(new cGridBag());
753
+ oe.toolboxPanel.add(new cGridBag());
754
+ oe.toolboxPanel.add(new cGridBag());
755
+ oe.toolboxPanel.add(new cGridBag());
756
+ oe.toolboxPanel.add(new cGridBag());
757
+ oe.toolboxPanel.add(new cGridBag());
758
+ }
759
+
760
+ // EDIT panel
761
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ editButton.setToolTipText("Edit selection");
763
+ editButton.addActionListener(this);
764
+
765
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Unedit selection");
518767 uneditButton.addActionListener(this);
519768
520
- oe.aConstraints.gridx += 1;
521
- oe.aConstraints.weighty = 0;
522
- oe.aConstraints.gridwidth = 1;
523
-
524
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
525
- clearPanelButton.addActionListener(this);
526
-
527
- oe.aConstraints.gridx += 1;
528
- oe.aConstraints.weighty = 0;
529
- oe.aConstraints.gridwidth = 1;
530
-
531
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
769
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
+ allParamsButton.setToolTipText("Edit all params");
532771 allParamsButton.addActionListener(this);
533772
534
- oe.aConstraints.gridx += 1;
535
- oe.aConstraints.weighty = 0;
536
- oe.aConstraints.gridwidth = 1;
537
-
538
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
773
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
774
+ clearPanelButton.setToolTipText("Clear edit panel");
775
+ clearPanelButton.addActionListener(this);
776
+
777
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
778
+ unselectButton.setToolTipText("Unselect");
539779 unselectButton.addActionListener(this);
540780
781
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ flashSelectionButton.setToolTipText("Highlight selection");
783
+ flashSelectionButton.addActionListener(this);
784
+
785
+ editCommandsPanel.preferredHeight = 1;
786
+
787
+// oe.treePanel.add(commandsPanel);
788
+// oe.treePanel.Return();
789
+
541790 // oe.aConstraints.gridx += 1;
542791 // oe.aConstraints.weighty = 0;
543792 // oe.aConstraints.gridwidth = 1;
....@@ -549,40 +798,22 @@
549798 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
550799 // gcButton.addActionListener(this);
551800
552
- oe.aConstraints.gridx = 0;
553
- oe.aConstraints.gridy += 1;
554
-
555
- //ctrlPanel.add(objList = new List(5, true));
556
- oe.aConstraints.gridwidth = 100;
557
- // oe.aConstraints.gridheight = 100;
558
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
559
- oe.aConstraints.gridheight = 1;
560
- oe.aConstraints.weighty = 0.5;
561
- oe.aConstraints.gridx = 0;
562
- JScrollPane jSP;
801
+ cGridBag jSPPanel = new cGridBag();
802
+
803
+ JScrollPane jSP;
563804 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
564
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
805
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
565806 ResetModel();
566
- oe.aConstraints.weighty = 0.5;
567
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
568
- oe.aConstraints.gridy += 1;
569
- oe.aConstraints.gridwidth = 1;
570
-
571
- oe.aConstraints.weighty = 0;
572
- oe.aConstraints.gridwidth = 2;
573
-
574
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
575
- colorCB.addItemListener(this);
576
- oe.aConstraints.gridx += 2;
577
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
578
- materialCB.addItemListener(this);
579
- oe.aConstraints.gridx += 2;
580
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
581
- textureCB.addItemListener(this);
582
-
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585807
808
+ oe.treePanel.add(jSPPanel);
809
+ oe.treePanel.Return();
810
+
811
+ oe.treePanel.add(copyOptionsPanel);
812
+ oe.treePanel.Return();
813
+
814
+// mainPanel.setDividerLocation(0.5); //1.0);
815
+// mainPanel.setResizeWeight(0.5);
816
+
586817 //jList.addListSelectionListener(this);
587818 oe.jTree.addTreeSelectionListener(this);
588819 //jTree.setRootVisible(false);
....@@ -607,47 +838,57 @@
607838
608839 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
609840 {
610
- //constraints.gridx = 0;
611
- //constraints.gridy = 0;
612
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
- fastCB.setToolTipText("Fast mode");
614
- fastCB.addItemListener(this);
615
- //constraints.gridy += 1;
616
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
617
- supportCB.setToolTipText("Enabled rigging");
618
- supportCB.addItemListener(this);
841
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
842
+ colorCB.setToolTipText("Copy color when dropped");
843
+ colorCB.addItemListener(this);
619844
620
- // constraints.gridy += 1;
621
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
622
- // localCB.addItemListener(this);
845
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
846
+ materialCB.setToolTipText("Copy material when dropped");
847
+ materialCB.addItemListener(this);
623848
624
- //constraints.gridy += 1;
625
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
626
- crowdCB.setToolTipText("Used for crowds");
627
- crowdCB.addItemListener(this);
628
-
629
- //constraints.gridy += 1;
630
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
631
- smoothCB.setToolTipText("Snapping delay");
632
- smoothCB.addItemListener(this);
633
-
634
- //constraints.gridy += 1;
635
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
636
- slowCB.setToolTipText("Smooth interpolation");
637
- slowCB.addItemListener(this);
638
- //constraints.gridy += 1;
849
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
850
+ textureCB.setToolTipText("Copy texture when dropped");
851
+ textureCB.addItemListener(this);
852
+
853
+ panel.Return();
854
+
639855 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
640856 boxCB.setToolTipText("Display bounding boxes");
641857 boxCB.addItemListener(this);
642
- //constraints.gridy += 1;
858
+
643859 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
644860 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
645861 zoomBoxCB.addItemListener(this);
646862
863
+ if (true) // Globals.ADVANCED)
864
+ {
865
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
+ supportCB.setToolTipText("Enable rigging");
867
+ supportCB.addItemListener(this);
868
+
869
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
870
+ // localCB.addItemListener(this);
871
+
872
+ panel.Return();
873
+
874
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
875
+ crowdCB.setToolTipText("Used for crowds");
876
+ crowdCB.addItemListener(this);
877
+
878
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
879
+ smoothCB.setToolTipText("Snapping delay");
880
+ smoothCB.addItemListener(this);
881
+
882
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
883
+ slowCB.setToolTipText("Smooth interpolation");
884
+ slowCB.addItemListener(this);
885
+
647886 // constraints.gridy += 1;
648887 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
649888 // speakerMocapCB.addItemListener(this);
650889
890
+ panel.Return();
891
+
651892 if (false)
652893 {
653894 // handled in scripts
....@@ -662,26 +903,72 @@
662903 //constraints.gridy += 1;
663904 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
664905 smoothfocusCB.addItemListener(this);
906
+ panel.Return();
665907 }
666908
667909 //constraints.gridx += 1;
668910 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
669911 // debugCB.addItemListener(this);
670912
671
- //constraints.gridy += 1;
913
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
914
+ trackCB.setToolTipText("Enable tracking target");
915
+ trackCB.addItemListener(this);
916
+
672917 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
918
+ oeilCB.setToolTipText("Move camera when tracking");
673919 oeilCB.addItemListener(this);
674920
675
- //constraints.gridy += 1;
921
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
+ shadowCB.setToolTipText("Compute shadows when live");
923
+ shadowCB.addItemListener(this);
924
+
925
+ panel.Return();
926
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
927
+ toggleTextureCB.setToolTipText("Load textures");
928
+ toggleTextureCB.addItemListener(this);
929
+
930
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
+ toggleSwitchCB.setToolTipText("Use switch");
932
+ toggleSwitchCB.addItemListener(this);
933
+
934
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
+ autosaveCB.setToolTipText("Auto-save on structure change");
936
+ autosaveCB.addItemListener(this);
937
+
938
+ panel.Return();
939
+ if (Globals.ADVANCED)
940
+ {
676941 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
677942 lookAtCB.setToolTipText("Look-at target");
678943 lookAtCB.addItemListener(this);
944
+ }
945
+
946
+ }
947
+
948
+ cGridBag fill = new cGridBag();
949
+ fill.preferredHeight = 200;
950
+ cGridBag fill2 = new cGridBag();
951
+ fill2.preferredHeight = 200;
952
+ cGridBag fill3 = new cGridBag();
953
+ fill3.preferredHeight = 200;
954
+
955
+ panel.add(fill);
956
+ panel.add(fill2);
957
+ panel.add(fill3);
679958
680959 }
681960
682961 void EditObject(Object3D obj)
683962 {
684963 cRadio radioButton = new cRadio(obj.name);
964
+
965
+ // Patch to avoid bug with transparency.
966
+ radioButton.hadMaterial = obj.material != null;
967
+ if (!radioButton.hadMaterial)
968
+ {
969
+ obj.material = new cMaterial();
970
+ }
971
+
685972 radioButton.SetObject(obj);
686973 radioButton.layout = sevenButton;
687974 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -690,8 +977,11 @@
690977 buttonGroup.add(radioButton);
691978 radioButton.doClick();
692979 }
980
+
693981 void SetupViews(ObjEditor oe)
694982 {
983
+ theFrame = this;
984
+
695985 oe.SetupViews();
696986
697987 System.out.println("SetupViews");
....@@ -700,23 +990,27 @@
700990 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
701991 }
702992
703
- JCheckBox liveCB;
704
- JCheckBox supportCB;
705
- JCheckBox localCB;
706
- JCheckBox crowdCB;
707
- JCheckBox smoothCB;
708
- JCheckBox fastCB;
709
- JCheckBox slowCB;
710
- JCheckBox boxCB;
711
- JCheckBox zoomBoxCB;
712
- JCheckBox trackCB;
713
- JCheckBox smoothfocusCB;
993
+ cToggleButton liveCB;
994
+ cCheckBox supportCB;
995
+ cCheckBox localCB;
996
+ cCheckBox crowdCB;
997
+ cCheckBox smoothCB;
998
+ cToggleButton fastCB;
999
+ cCheckBox slowCB;
1000
+ cCheckBox boxCB;
1001
+ cCheckBox zoomBoxCB;
1002
+ //cToggleButton trackCB;
1003
+ cCheckBox trackCB;
1004
+ cCheckBox smoothfocusCB;
7141005 // JCheckBox speakerMocapCB;
715
- JCheckBox speakerCameraCB;
716
- JCheckBox speakerFocusCB;
717
- JCheckBox debugCB;
718
- JCheckBox oeilCB;
719
- JCheckBox lookAtCB;
1006
+ cCheckBox speakerCameraCB;
1007
+ cCheckBox speakerFocusCB;
1008
+ cCheckBox debugCB;
1009
+
1010
+ cCheckBox oeilCB;
1011
+ cCheckBox shadowCB;
1012
+ cCheckBox autosaveCB;
1013
+ cCheckBox lookAtCB;
7201014
7211015 // static int COLOR = 1;
7221016 // static int MATERIAL = 2;
....@@ -724,9 +1018,9 @@
7241018
7251019 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7261020
727
- JCheckBox colorCB;
728
- JCheckBox materialCB;
729
- JCheckBox textureCB;
1021
+ cCheckBox colorCB;
1022
+ cCheckBox materialCB;
1023
+ cCheckBox textureCB;
7301024
7311025 public void itemStateChanged(ItemEvent e)
7321026 {
....@@ -754,6 +1048,7 @@
7541048 } else if(e.getSource() == liveCB)
7551049 {
7561050 cameraView.ToggleLive();
1051
+ refreshContents(false);
7571052 }
7581053 else if(e.getSource() == supportCB)
7591054 {
....@@ -818,6 +1113,14 @@
8181113 {
8191114 cameraView.ToggleOeil();
8201115 }
1116
+ else if(e.getSource() == shadowCB)
1117
+ {
1118
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1119
+ }
1120
+ else if(e.getSource() == autosaveCB)
1121
+ {
1122
+ Globals.SAVEONMAKE ^= true;
1123
+ }
8211124 else if(e.getSource() == lookAtCB)
8221125 {
8231126 cameraView.ToggleLookAt();
....@@ -834,7 +1137,8 @@
8341137
8351138 /**/
8361139 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
837
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1140
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1141
+ TreePath path = objEditor.jTree.getSelectionPath();
8381142 if ((path == null) || (path.getPathCount() <= 1)) {
8391143 // We can't move the root node or an empty selection
8401144 return;
....@@ -906,7 +1210,9 @@
9061210 // objEditor.DropFile((java.io.File[]) object, true);
9071211 // return;
9081212 // }
909
- if (string.charAt(0) == '/')
1213
+
1214
+ // File path for Mac and Windows
1215
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9101216 {
9111217 // file(s)
9121218 String[] names = string.split("\n");
....@@ -933,7 +1239,7 @@
9331239
9341240 flashIt = false;
9351241 CameraPane pane = (CameraPane) target;
936
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1242
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9371243 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9381244
9391245 if (group.selection.size() == 1)
....@@ -949,23 +1255,33 @@
9491255
9501256 assert target == objEditor.jTree;
9511257 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1258
+ Object3D destinationLeaf;
9521259 try {
953
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1260
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9541261 } catch (Exception e) {
9551262 System.out.println("destinationPath : " + destinationPath);
9561263 return;
9571264 }
9581265
959
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1266
+ for (int i=group.selection.size(); --i>=0;)
9601267 {
1268
+ Object3D child = (Object3D)group.selection.elementAt(i);
1269
+
1270
+ // Cannot move into itself
1271
+ if (child == destinationLeaf)
1272
+ return;
1273
+ }
1274
+
1275
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1276
+// {
9611277 loadClipboard(true);
9621278 objEditor.jTree.setSelectionPath(destinationPath);
963
- pasteInto(false);
964
- } else {
965
- loadClipboard(false);
966
- objEditor.jTree.setSelectionPath(destinationPath);
967
- pasteInto(false); // true); // ???
968
- }
1279
+ pasteInto(false, false);
1280
+// } else {
1281
+// loadClipboard(false);
1282
+// objEditor.jTree.setSelectionPath(destinationPath);
1283
+// pasteInto(false, false); // true); // ???
1284
+// }
9691285 }
9701286 public void dropActionChanged(DropTargetDragEvent dtde)
9711287 // Called if the user has modified the current drop gesture
....@@ -1070,85 +1386,104 @@
10701386 {
10711387 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10721388 //heightFieldItem.addActionListener(this);
1073
- gridItem = menu.add(new MenuItem("Grid"));
1074
- gridItem.addActionListener(this);
1075
- rectoidItem = menu.add(new MenuItem("Box"));
1076
- rectoidItem.addActionListener(this);
1077
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1078
- ellipsoidItem.addActionListener(this);
1079
- coneItem = menu.add(new MenuItem("Cone"));
1080
- coneItem.addActionListener(this);
1081
- torusItem = menu.add(new MenuItem("Torus"));
1082
- torusItem.addActionListener(this);
1083
- superItem = menu.add(new MenuItem("Superellipsoid"));
1084
- superItem.addActionListener(this);
1389
+// gridItem = menu.add(new MenuItem("Grid"));
1390
+// gridItem.addActionListener(this);
1391
+// rectoidItem = menu.add(new MenuItem("Box"));
1392
+// rectoidItem.addActionListener(this);
1393
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1394
+// ellipsoidItem.addActionListener(this);
1395
+// coneItem = menu.add(new MenuItem("Cone"));
1396
+// coneItem.addActionListener(this);
1397
+// torusItem = menu.add(new MenuItem("Torus"));
1398
+// torusItem.addActionListener(this);
1399
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1400
+// superItem.addActionListener(this);
1401
+
1402
+ cameraItem = menu.add(new MenuItem("Camera"));
1403
+ cameraItem.addActionListener(this);
1404
+
1405
+ if (!Globals.ADVANCED)
1406
+ {
10851407 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10861408 kleinItem.addActionListener(this);
1087
- particleItem = menu.add(new MenuItem("Particle system"));
1088
- particleItem.addActionListener(this);
1409
+ }
1410
+
1411
+// particleItem = menu.add(new MenuItem("Particle system"));
1412
+// particleItem.addActionListener(this);
1413
+ if (Globals.ADVANCED)
1414
+ {
10891415 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10901416 ragdollItem.addActionListener(this);
10911417 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10921418 ragdoll2Item.addActionListener(this);
1419
+ }
10931420 menu.add("-");
1094
- meshItem = menu.add(new MenuItem("Mesh"));
1421
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10951422 meshItem.addActionListener(this);
10961423 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10971424 // meshGroupItem.addActionListener(this);
1425
+ if (Globals.ADVANCED)
1426
+ {
10981427 springItem = menu.add(new MenuItem("Spring"));
10991428 springItem.addActionListener(this);
11001429 flagItem = menu.add(new MenuItem("Flag"));
11011430 flagItem.addActionListener(this);
1102
- bezierItem = menu.add(new MenuItem("Patch"));
1103
- bezierItem.addActionListener(this);
1104
- checkerItem = menu.add(new MenuItem("Checker"));
1105
- checkerItem.addActionListener(this);
11061431 blobItem = menu.add(new MenuItem("Blob"));
11071432 blobItem.addActionListener(this);
11081433 latheItem = menu.add(new MenuItem("Lathe"));
11091434 latheItem.addActionListener(this);
1110
- lightItem = menu.add(new MenuItem("Light"));
1111
- lightItem.addActionListener(this);
1435
+ }
1436
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1437
+ bezierItem.addActionListener(this);
1438
+// overlayItem = menu.add(new MenuItem("Overlay"));
1439
+// overlayItem.addActionListener(this);
1440
+// lightItem = menu.add(new MenuItem("Light"));
1441
+// lightItem.addActionListener(this);
11121442 menu.add("-");
11131443 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11141444 //superLoopItem.addActionListener(this);
1115
- loopItem = menu.add(new MenuItem("Loop"));
1116
- loopItem.addActionListener(this);
1445
+// loopItem = menu.add(new MenuItem("Loop"));
1446
+// loopItem.addActionListener(this);
11171447 doubleItem = menu.add(new MenuItem("Fork"));
11181448 doubleItem.addActionListener(this);
1449
+ if (Globals.ADVANCED)
1450
+ {
11191451 tripleItem = menu.add(new MenuItem("Trident"));
11201452 tripleItem.addActionListener(this);
1453
+ }
11211454 }
11221455
11231456 void buildToolsMenu(Menu menu)
11241457 {
11251458 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11261459 animationItem.addItemListener(this);
1127
- animationItem.setState(CameraPane.ANIMATION);
1460
+ animationItem.setState(Globals.ANIMATION);
11281461
11291462 menu.add("-");
11301463 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11311464 parseverticesItem.addActionListener(this);
11321465 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11331466 textureFieldItem.addActionListener(this);
1134
- alignItem = menu.add(new MenuItem("Align"));
1467
+ alignItem = menu.add(new MenuItem("Align Objects"));
11351468 alignItem.addActionListener(this);
1136
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1137
- mirrorItem.addActionListener(this);
11381469 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11391470 reduceMorphItem.addActionListener(this);
11401471 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11411472 reduce34MorphItem.addActionListener(this);
1142
-
1473
+ menu.add("-");
11431474 menu.add(computeAOItem = new MenuItem("Compute AO"));
11441475 computeAOItem.addActionListener(this);
1145
- menu.add("-");
11461476
1477
+ if (Globals.ADVANCED)
1478
+ {
1479
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1480
+ mirrorItem.addActionListener(this);
1481
+ menu.add("-");
11471482 menu.add(memoryItem = new MenuItem("Memory Usage"));
11481483 memoryItem.addActionListener(this);
11491484 menu.add(analyzeItem = new MenuItem("Analyze"));
11501485 analyzeItem.addActionListener(this);
1151
- menu.add(dumpItem = new MenuItem("Dump"));
1486
+ menu.add(dumpItem = new MenuItem("Print"));
11521487 dumpItem.addActionListener(this);
11531488 // menu.add(pathItem = new MenuItem("From-to path"));
11541489 // pathItem.addActionListener(this);
....@@ -1166,6 +1501,7 @@
11661501 menu.add("-");
11671502 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11681503 editScriptItem.addActionListener(this);
1504
+ }
11691505 }
11701506
11711507 void ScreenFit()
....@@ -1288,6 +1624,7 @@
12881624 shadow.material = new cMaterial(obj.material);
12891625 shadow.material.diffuse = 0.0001f;
12901626 shadow.material.specular = 0.0001f;
1627
+ //shadow.projectedVertices[1].x = 300;
12911628
12921629 makeSomething(shadow);
12931630 }
....@@ -1494,9 +1831,9 @@
14941831
14951832 void Overwrite(int mask)
14961833 {
1497
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1834
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14981835 {
1499
- Object3D content = GrafreeD.clipboard.get(0);
1836
+ Object3D content = Grafreed.clipboard.get(0);
15001837
15011838 if (content instanceof cGroup && ((cGroup)content).transientlink )
15021839 content = ((cGroup)content).get(0);
....@@ -1535,7 +1872,7 @@
15351872 {
15361873 ScreenFit();
15371874 } else
1538
- if (source == switchItem)
1875
+ if (source == switchViewItem)
15391876 {
15401877 cVector v1 = new cVector();
15411878 cVector v2 = new cVector();
....@@ -1544,11 +1881,11 @@
15441881 objEditor.cameraView.renderCamera.setAim(v2, v1);
15451882 objEditor.cameraView.repaint();
15461883 } else
1547
- if (source == rectoidItem)
1884
+ if (source == rectoidItem || source == boxButton)
15481885 {
15491886 makeSomething(new Box());
15501887 } else
1551
- if (source == particleItem)
1888
+ if (source == particleItem || source == particlesButton)
15521889 {
15531890 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15541891 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1627,27 +1964,27 @@
16271964
16281965 makeSomething(obj);
16291966 } else
1630
- if (source == gridItem)
1967
+ if (source == gridItem || source == gridButton)
16311968 {
16321969 makeSomething(new Grid());
16331970 } else
1634
- if (source == ellipsoidItem)
1971
+ if (source == ellipsoidItem || source == sphereButton)
16351972 {
16361973 makeSomething(new Sphere());
16371974 } else
1638
- if (source == coneItem)
1975
+ if (source == coneItem || source == coneButton)
16391976 {
16401977 makeSomething(new Cone());
16411978 } else
1642
- if (source == torusItem)
1979
+ if (source == torusItem || source == torusButton)
16431980 {
16441981 makeSomething(new Torus());
16451982 } else
1646
- if (source == superItem)
1983
+ if (source == superItem || source == superButton)
16471984 {
16481985 makeSomething(new Superellipsoid());
16491986 } else
1650
- if (source == kleinItem)
1987
+ if (source == kleinItem || source == kleinButton)
16511988 {
16521989 makeSomething(new Klein());
16531990 } else
....@@ -1667,7 +2004,7 @@
16672004 {
16682005 makeSomething(new BezierSurface());
16692006 } else
1670
- if (source == checkerItem)
2007
+ if (source == overlayItem || source == overlayButton)
16712008 {
16722009 /*
16732010 Object3D obj = new BezierSurface(5,8);
....@@ -1715,7 +2052,7 @@
17152052 s.setup();
17162053 makeSomething(s);
17172054 } else
1718
- if (source == lightItem)
2055
+ if (source == lightItem || source == lightButton)
17192056 {
17202057 makeSomething(new Light());
17212058 } else
....@@ -1765,7 +2102,7 @@
17652102
17662103 group(g);
17672104 } else
1768
- if (source == loopItem)
2105
+ if (source == loopItem || source == loopButton)
17692106 {
17702107 Composite csg = new GroupLeaf();
17712108 csg.count = 5;
....@@ -1801,23 +2138,6 @@
18012138 csg.addChild(child);
18022139 child.addChild(csg);
18032140 } else
1804
-
1805
- if (source == importGFDItem)
1806
- {
1807
- ImportGFD();
1808
- } else
1809
- if (source == importVRMLX3DItem)
1810
- {
1811
- ImportVRMLX3D();
1812
- } else
1813
- if (source == import3DSItem)
1814
- {
1815
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1816
- } else
1817
- if (source == importOBJItem)
1818
- {
1819
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1820
- } else
18212141 if (source == computeAOItem)
18222142 {
18232143 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1836,7 +2156,7 @@
18362156 if (source == invariantsItem)
18372157 {
18382158 System.out.println("Invariants:");
1839
- GrafreeD.grafreeD.universe.invariants();
2159
+ Grafreed.grafreeD.universe.invariants();
18402160 } else
18412161 if (source == memoryItem)
18422162 {
....@@ -1854,6 +2174,35 @@
18542174 if (source == dumpItem)
18552175 {
18562176 DumpObject();
2177
+ } else
2178
+ if (source == minButton)
2179
+ {
2180
+ Minimize();
2181
+ } else
2182
+ if (source == maxButton)
2183
+ {
2184
+ Maximize();
2185
+ } else
2186
+ if (source == fullButton)
2187
+ {
2188
+ ToggleFullScreen();
2189
+ } else
2190
+ if (source == undoButton)
2191
+ {
2192
+ Undo();
2193
+ } else
2194
+ if (source == redoButton)
2195
+ {
2196
+ Redo();
2197
+ } else
2198
+ if (source == saveButton)
2199
+ {
2200
+ Save();
2201
+ } else
2202
+ if (source == oneStepButton)
2203
+ {
2204
+ Globals.ONESTEP = true;
2205
+ cameraView.repaint();
18572206 } else
18582207 if (source == screenfitButton)
18592208 {
....@@ -1904,12 +2253,20 @@
19042253 {
19052254 loadClipboard(true);
19062255 } else
2256
+ if (source == undoItem)
2257
+ {
2258
+ Undo();
2259
+ } else
2260
+ if (source == redoItem)
2261
+ {
2262
+ Redo();
2263
+ } else
19072264 if (source == duplicateItem)
19082265 {
1909
- Object3D keep = GrafreeD.clipboard;
2266
+ Object3D keep = Grafreed.clipboard;
19102267 loadClipboard(false);
19112268 paste(false);
1912
- GrafreeD.clipboard = keep;
2269
+ Grafreed.clipboard = keep;
19132270 } else
19142271 if (source == cloneItem)
19152272 {
....@@ -1927,13 +2284,17 @@
19272284 {
19282285 paste(false);
19292286 } else
2287
+ if (source == pasteIntoItem)
2288
+ {
2289
+ pasteInto(true, false);
2290
+ } else
19302291 if (source == pasteLinkItem)
19312292 {
1932
- pasteInto(false);
2293
+ pasteInto(false, false);
19332294 } else
19342295 if (source == pasteCloneItem)
19352296 {
1936
- pasteInto(true);
2297
+ pasteInto(true, true);
19372298 } else
19382299 if (source == pasteExpandItem)
19392300 {
....@@ -2125,9 +2486,9 @@
21252486 // group.selection.get(0).setMasterThis(content); // should be identity
21262487 // refreshContents();
21272488 // }
2128
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2489
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21292490 {
2130
- Object3D content = GrafreeD.clipboard.get(0);
2491
+ Object3D content = Grafreed.clipboard.get(0);
21312492
21322493 if (content instanceof cGroup && ((cGroup)content).transientlink )
21332494 content = ((cGroup)content).get(0);
....@@ -2135,11 +2496,11 @@
21352496 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21362497 for (int i=0; i<group.selection.size(); i++)
21372498 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21402501 group.selection.get(i).linkVerticesThis(content);
21412502 // group.selection.get(i).setMasterThis(content); // should be identity
2142
- CameraPane.RANDOM = random;
2503
+ CameraPane.SWITCH = random;
21432504 }
21442505 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21452506 refreshContents();
....@@ -2149,20 +2510,20 @@
21492510 {
21502511 for (int i=0; i<group.selection.size(); i++)
21512512 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2513
+ boolean random = CameraPane.SWITCH;
2514
+ CameraPane.SWITCH = false; // parse all random nodes
21542515 group.selection.get(i).linkVerticesThis(null);
2155
- CameraPane.RANDOM = random;
2516
+ CameraPane.SWITCH = random;
21562517 }
21572518
21582519 refreshContents();
21592520 } else
21602521 if (source == relinkverticesItem)
21612522 {
2162
- boolean random = CameraPane.RANDOM;
2163
- CameraPane.RANDOM = false; // parse all random nodes
2523
+ boolean random = CameraPane.SWITCH;
2524
+ CameraPane.SWITCH = false; // parse all random nodes
21642525 group.selection.RelinkToSupport();
2165
- CameraPane.RANDOM = random;
2526
+ CameraPane.SWITCH = random;
21662527
21672528 refreshContents();
21682529 } else
....@@ -2177,9 +2538,9 @@
21772538 } else
21782539 if (source == setMasterItem)
21792540 {
2180
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2541
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21812542 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2543
+ Object3D content = Grafreed.clipboard.get(0);
21832544
21842545 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852546 content = ((cGroup)content).get(0);
....@@ -2192,9 +2553,9 @@
21922553 {
21932554 if (group.selection.size() == 1)
21942555 {
2195
- if (GrafreeD.clipboard.size() == 1)
2556
+ if (Grafreed.clipboard.size() == 1)
21962557 {
2197
- Object3D content = GrafreeD.clipboard.get(0);
2558
+ Object3D content = Grafreed.clipboard.get(0);
21982559
21992560 if (content instanceof cGroup && ((cGroup)content).transientlink )
22002561 content = ((cGroup)content).get(0);
....@@ -2211,7 +2572,7 @@
22112572 {
22122573 RevertMeshes();
22132574 } else
2214
- if (source == resetMeshItem)
2575
+ if (source == resetAllItem)
22152576 {
22162577 ResetAll();
22172578 } else
....@@ -2231,9 +2592,9 @@
22312592 {
22322593 ClearSelection(true);
22332594 } else
2234
- if (source == grabItem)
2595
+ if (source == grabItem || source == groupButton)
22352596 {
2236
- group(new cGroup(), true);
2597
+ group(new cGroup(), false); // true);
22372598 } else
22382599 if (source == hideItem)
22392600 {
....@@ -2251,16 +2612,16 @@
22512612 {
22522613 makeSomething(new Camera());
22532614 } else
2254
- if (source == compositeItem)
2615
+ if (source == compositeItem || source == compositeButton)
22552616 {
22562617 group(new Composite());
22572618 } else
2258
- if (source == randomItem)
2619
+ if (source == switchItem || source == switchButton)
22592620 {
22602621 RandomNode random = new RandomNode();
22612622 group(random);
22622623 if (random.size() > 0)
2263
- random.name = random.get(0).name + "Rnd";
2624
+ random.name = random.get(0).name + "Switch";
22642625 } else
22652626 if (source == physicsItem)
22662627 {
....@@ -2357,7 +2718,7 @@
23572718 {
23582719 group(new cLinker());
23592720 } else
2360
- if (source == textureItem)
2721
+ if (source == textureItem || source == textureButton)
23612722 {
23622723 group(new TextureNode());
23632724 } else
....@@ -2377,7 +2738,7 @@
23772738 {
23782739 CastShadow(2);
23792740 } else
2380
- if (source == ungroupItem)
2741
+ if (source == ungroupItem || source == ungroupButton)
23812742 {
23822743 //ungroup();
23832744 for (int i=0; i<group.selection.size(); i++)
....@@ -2399,7 +2760,7 @@
23992760 } else
24002761 if (source == genNormalsMESHItem)
24012762 {
2402
- GenNormals(true); // TODO
2763
+ GenNormalsMESH();
24032764 } else
24042765 if (source == genNormalsORGANItem)
24052766 {
....@@ -2464,6 +2825,22 @@
24642825 if (source == unmarkleavesItem)
24652826 {
24662827 MarkLeaves(false);
2828
+ } else
2829
+ if (source == rewindleavesItem)
2830
+ {
2831
+ RewindLeaves(true);
2832
+ } else
2833
+ if (source == unrewindleavesItem)
2834
+ {
2835
+ RewindLeaves(false);
2836
+ } else
2837
+ if (source == randomleavesItem)
2838
+ {
2839
+ RandomLeaves(true);
2840
+ } else
2841
+ if (source == unrandomleavesItem)
2842
+ {
2843
+ RandomLeaves(false);
24672844 } else
24682845 if (source == flipVItem)
24692846 {
....@@ -2549,9 +2926,13 @@
25492926 {
25502927 SmoothMesh();
25512928 } else
2552
- if (source == transformgeometryItem)
2929
+ if (source == transformGeometryItem)
25532930 {
25542931 TransformGeometry();
2932
+ } else
2933
+ if (source == transformChildrenItem)
2934
+ {
2935
+ TransformChildren();
25552936 } else
25562937 if (source == resetTransformItem)
25572938 {
....@@ -2559,7 +2940,11 @@
25592940 } else
25602941 if (source == resetCentroidItem)
25612942 {
2562
- ResetCentroid();
2943
+ ResetCentroid(true);
2944
+ } else
2945
+ if (source == resetCentroidXZItem)
2946
+ {
2947
+ ResetCentroid(false);
25632948 } else
25642949 if (source == resetParentItem)
25652950 {
....@@ -2691,6 +3076,10 @@
26913076 if (source == twoButton)
26923077 {
26933078 radio.layout = twoButton;
3079
+
3080
+ if (CameraPane.FULLSCREEN)
3081
+ fullscreenLayout = radio.layout;
3082
+
26943083 // bug
26953084 //gridPanel.setDividerLocation(1.0);
26963085 //bigPanel.setDividerLocation(0.0);
....@@ -2723,10 +3112,31 @@
27233112 bigThree.ClearUI();
27243113 bigThree.add(centralPanel);
27253114 bigThree.FlushUI();
3115
+
3116
+ cameraView.requestFocusInWindow();
3117
+
3118
+// refreshContents(true);
3119
+//
3120
+// try
3121
+// {
3122
+// java.awt.Robot bot = new java.awt.Robot();
3123
+// int mask = InputEvent.BUTTON1_MASK;
3124
+// bot.mouseMove(100, 100);
3125
+// bot.mousePress(mask);
3126
+// bot.mouseRelease(mask);
3127
+// }
3128
+// catch (Exception e)
3129
+// {
3130
+//
3131
+// }
3132
+
27263133 } else
27273134 if (source == threeButton)
27283135 {
27293136 radio.layout = threeButton;
3137
+
3138
+ if (CameraPane.FULLSCREEN)
3139
+ fullscreenLayout = radio.layout;
27303140
27313141 // bigThree.remove(scenePanel);
27323142 // bigThree.remove(centralPanel);
....@@ -2759,10 +3169,15 @@
27593169 bigThree.add(centralPanel);
27603170 bigThree.add(XYZPanel);
27613171 bigThree.FlushUI();
3172
+
3173
+ cameraView.requestFocusInWindow();
27623174 } else
27633175 if (source == fourButton)
27643176 {
27653177 radio.layout = fourButton;
3178
+
3179
+ if (CameraPane.FULLSCREEN)
3180
+ fullscreenLayout = radio.layout;
27663181
27673182 // bigThree.remove(scenePanel);
27683183 // bigThree.remove(centralPanel);
....@@ -2794,10 +3209,15 @@
27943209 bigThree.ClearUI();
27953210 bigThree.add(scenePanel);
27963211 bigThree.FlushUI();
3212
+
3213
+ cameraView.requestFocusInWindow();
27973214 } else
27983215 if (source == sixButton)
27993216 {
28003217 radio.layout = sixButton;
3218
+
3219
+ if (CameraPane.FULLSCREEN)
3220
+ fullscreenLayout = radio.layout;
28013221
28023222 // bigThree.remove(scenePanel);
28033223 // bigThree.remove(centralPanel);
....@@ -2830,10 +3250,15 @@
28303250 bigThree.add(scenePanel);
28313251 bigThree.add(centralPanel);
28323252 bigThree.FlushUI();
3253
+
3254
+ cameraView.requestFocusInWindow();
28333255 } else
28343256 if (source == sevenButton)
28353257 {
28363258 radio.layout = sevenButton;
3259
+
3260
+ if (CameraPane.FULLSCREEN)
3261
+ fullscreenLayout = radio.layout;
28373262
28383263 // bigThree.remove(scenePanel);
28393264 // bigThree.remove(centralPanel);
....@@ -2867,6 +3292,8 @@
28673292 bigThree.add(centralPanel);
28683293 bigThree.add(XYZPanel);
28693294 bigThree.FlushUI();
3295
+
3296
+ cameraView.requestFocusInWindow();
28703297 } else
28713298 if (source == rootButton)
28723299 {
....@@ -2878,6 +3305,7 @@
28783305 EditObject(obj);
28793306 }
28803307
3308
+ cameraView.requestFocusInWindow();
28813309 refreshContents(true);
28823310 } else
28833311 if (source == closeButton)
....@@ -2887,22 +3315,37 @@
28873315 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28883316 {
28893317 ab = (cRadio)e.nextElement();
2890
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3318
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28913319 {
3320
+ // Patch to avoid bug with transparency.
3321
+ if (!ab.hadMaterial)
3322
+ {
3323
+ ab.object.material = null;
3324
+ }
3325
+
28923326 buttonGroup.remove(ab);
28933327 radioPanel.remove(ab);
28943328
2895
- ab.GetObject().editWindow = null;
3329
+ //ab.GetObject().editWindow = null;
3330
+ ab.GetObject().manipWindow = null;
28963331 // ab.GetObject().objectUI = null; // ?????????
28973332
28983333 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28993334 break;
29003335 }
29013336 }
3337
+
3338
+ cameraView.requestFocusInWindow();
29023339 refreshContents(true);
29033340 } else
29043341 if (source == editItem || source == editButton)
29053342 {
3343
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3344
+ {
3345
+ Object3D child = (Object3D)e.nextElement();
3346
+ child.pinned = true;
3347
+ }
3348
+
29063349 EditSelection(false);
29073350 } else
29083351 if (source == uneditButton)
....@@ -2912,12 +3355,13 @@
29123355 Object3D child = (Object3D)e.nextElement();
29133356 if(child.editWindow != null)
29143357 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3358
+ child.pinned = false;
29153359 child.CloseUI();
29163360 listUI.remove(child);
29173361
2918
- child.editWindow = null; // ???????????
3362
+ //child.editWindow = null; // ???????????
29193363 }
2920
- objEditor.ctrlPanel.validate();
3364
+ objEditor.ctrlPanel.FlushUI();
29213365 //objEditor.jTree.clearSelection();
29223366 //objEditor.ResetSliders();
29233367 refreshContents(true);
....@@ -2928,6 +3372,7 @@
29283372 //copy.ClearUI();
29293373 for (Object3D obj : listUI)
29303374 {
3375
+ obj.pinned = true;
29313376 obj.CloseUI();
29323377 }
29333378 listUI.clear();
....@@ -2937,7 +3382,7 @@
29373382 {
29383383 assert(copy == group);
29393384
2940
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3385
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29413386
29423387 for (Object3D obj : listUI)
29433388 {
....@@ -3001,7 +3446,11 @@
30013446 frontView.object = group;
30023447 sideView.object = group;
30033448 }
3004
- group.editWindow = this;
3449
+
3450
+// fix "+" issue
3451
+ //group.editWindow = this;
3452
+ group.manipWindow = this;
3453
+
30053454 /*
30063455 currentLayout = radio.layout;
30073456 if (currentLayout == null)
....@@ -3013,8 +3462,23 @@
30133462 //group.parent = null; // ROOT
30143463 //group.attributes = -1;
30153464 ResetModel();
3465
+
3466
+ cameraView.requestFocusInWindow();
30163467 refreshContents(true);
3017
- }
3468
+ } else if (event.getSource() == editCameraItem)
3469
+ {
3470
+ cameraView.ProtectCamera();
3471
+ cameraView.repaint();
3472
+ return;
3473
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3474
+ {
3475
+ cameraView.RevertCamera();
3476
+ cameraView.repaint();
3477
+ return;
3478
+ // } else if (event.getSource() == textureButton)
3479
+ // {
3480
+ // return; // true;
3481
+ }
30183482 else
30193483 {
30203484 //return super.action(event, arg);
....@@ -3023,7 +3487,6 @@
30233487 }
30243488
30253489 boolean useclient = false;
3026
- cRadio radio;
30273490
30283491 void ToggleRoot()
30293492 {
....@@ -3075,6 +3538,28 @@
30753538 refreshContents();
30763539 }
30773540
3541
+ void TransformChildren()
3542
+ {
3543
+ Object3D obj;
3544
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3545
+ {
3546
+ obj = (Object3D)e.nextElement();
3547
+ obj.KeepTextureMatrices();
3548
+ obj.TransformChildren();
3549
+ obj.RestoreTextureMatrices();
3550
+
3551
+// if (obj.parent == null)
3552
+// {
3553
+// System.out.println("NULL PARENT!");
3554
+// new Exception().printStackTrace();
3555
+// }
3556
+// else
3557
+// TouchTransform(obj);
3558
+// //obj.parent.Touch();
3559
+ }
3560
+
3561
+ refreshContents();
3562
+ }
30783563
30793564 void ResetTransform()
30803565 {
....@@ -3187,7 +3672,7 @@
31873672 refreshContents();
31883673 }
31893674
3190
- void ResetCentroid()
3675
+ void ResetCentroid(boolean full)
31913676 {
31923677 Object3D obj;
31933678 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3202,12 +3687,16 @@
32023687 LA.matIdentity(Object3D.mat);
32033688 obj.getBounds(minima, maxima, false);
32043689 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3205
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3690
+ if (full)
3691
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32063692 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32073693 obj.TransformMesh(Object3D.mat);
3694
+
32083695 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3209
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3696
+ if (full)
3697
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32103698 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3699
+
32113700 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32123701 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32133702 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3236,7 +3725,8 @@
32363725
32373726 int size = obj.MemorySize();
32383727
3239
- System.err.println((size/1024) + " KB is the size of " + obj);
3728
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3729
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32403730 }
32413731 }
32423732 catch (Exception e)
....@@ -3273,9 +3763,9 @@
32733763 obj = (Object3D)e.nextElement();
32743764
32753765 System.out.println("Object is: " + obj);
3276
- GrafreeD.AnalyzeObject(obj);
3766
+ Grafreed.AnalyzeObject(obj);
32773767 System.out.println("Boundary rep: " + obj.bRep);
3278
- GrafreeD.AnalyzeObject(obj.bRep);
3768
+ Grafreed.AnalyzeObject(obj.bRep);
32793769
32803770 // System.err.println((size/1024) + " KB is the size of " + obj);
32813771 }
....@@ -3317,6 +3807,13 @@
33173807 void GenNormals(boolean crease)
33183808 {
33193809 group.GenNormalsS(crease);
3810
+
3811
+ refreshContents();
3812
+ }
3813
+
3814
+ void GenNormalsMESH()
3815
+ {
3816
+ group.GenNormalsMeshS();
33203817
33213818 refreshContents();
33223819 }
....@@ -3489,8 +3986,8 @@
34893986
34903987 void ParseVertices()
34913988 {
3492
- boolean epsequal = GrafreeD.epsequal;
3493
- GrafreeD.epsequal = true;
3989
+ boolean epsequal = Grafreed.epsequal;
3990
+ Grafreed.epsequal = true;
34943991
34953992 for (int i=0; i<group.selection.size(); i++)
34963993 {
....@@ -3515,7 +4012,7 @@
35154012 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35164013 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35174014
3518
- g.add(GrafreeD.clipboard);
4015
+ g.add(Grafreed.clipboard);
35194016
35204017 buffer.add(g);
35214018 }
....@@ -3530,7 +4027,7 @@
35304027 makeSomething(buffer, i==group.selection.size()-1);
35314028 }
35324029
3533
- GrafreeD.epsequal = epsequal;
4030
+ Grafreed.epsequal = epsequal;
35344031
35354032 refreshContents();
35364033 }
....@@ -3548,7 +4045,16 @@
35484045 String pigment = Object3D.GetPigment(tex);
35494046 //String bump = Object3D.GetBump(tex);
35504047
3551
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4048
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4049
+
4050
+ try
4051
+ {
4052
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4053
+ }
4054
+ catch (Exception e)
4055
+ {
4056
+ System.err.println("FAIL: " + node);
4057
+ }
35524058
35534059 double s = v.s;
35544060
....@@ -3636,11 +4142,11 @@
36364142
36374143 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36384144
3639
- boolean random = CameraPane.RANDOM;
3640
- CameraPane.RANDOM = false; // parse all random nodes
4145
+ boolean random = CameraPane.SWITCH;
4146
+ CameraPane.SWITCH = false; // parse all random nodes
36414147 lowres.linkVerticesThis(null);
36424148 lowres.linkVerticesThis(sn);
3643
- CameraPane.RANDOM = random;
4149
+ CameraPane.SWITCH = random;
36444150
36454151 System.err.flush();
36464152
....@@ -3680,7 +4186,7 @@
36804186 return;
36814187
36824188 Object3D poses = group.selection.get(0);
3683
- Object3D ref = GrafreeD.clipboard.get(0);
4189
+ Object3D ref = Grafreed.clipboard.get(0);
36844190
36854191 Object3D newgroup = new Object3D("Po:" + poses.name);
36864192
....@@ -3874,9 +4380,9 @@
38744380
38754381 void ClipMesh()
38764382 {
3877
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4383
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38784384 {
3879
- Object3D content = GrafreeD.clipboard.get(0);
4385
+ Object3D content = Grafreed.clipboard.get(0);
38804386
38814387 if (content instanceof cGroup && ((cGroup)content).transientlink )
38824388 content = ((cGroup)content).get(0);
....@@ -3885,7 +4391,7 @@
38854391 // {
38864392 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38874393 // }
3888
- group.selection.ClipMesh(GrafreeD.clipboard);
4394
+ group.selection.ClipMesh(Grafreed.clipboard);
38894395 }
38904396 // group.selection.ClipMesh(GrafreeD.clipboard);
38914397 System.out.println("DONE.");
....@@ -3932,6 +4438,18 @@
39324438 void MarkLeaves(boolean hide)
39334439 {
39344440 group.selection.MarkLeaves(hide);
4441
+ refreshContents();
4442
+ }
4443
+
4444
+ void RewindLeaves(boolean hide)
4445
+ {
4446
+ group.selection.RewindLeaves(hide);
4447
+ refreshContents();
4448
+ }
4449
+
4450
+ void RandomLeaves(boolean hide)
4451
+ {
4452
+ group.selection.RandomLeaves(hide);
39354453 refreshContents();
39364454 }
39374455
....@@ -4006,10 +4524,6 @@
40064524 // }
40074525 // }
40084526
4009
- static boolean allparams = true;
4010
-
4011
- static Vector<Object3D> listUI = new Vector<Object3D>();
4012
-
40134527 void EditSelection(boolean newWindow)
40144528 {
40154529 // aConstraints.gridy = 0;
....@@ -4017,10 +4531,10 @@
40174531 {
40184532 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40194533 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4020
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4534
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40214535
40224536 Object3D elem = (Object3D)group.selection.elementAt(i);
4023
- if(elem != group)
4537
+ if(elem != group || !newWindow)
40244538 {
40254539 // if (!(elem instanceof Composite))
40264540 // newWindow = false;
....@@ -4103,6 +4617,17 @@
41034617
41044618 freezemodel = true;
41054619
4620
+ //for (Object3D obj : listUI)
4621
+ for (int i=listUI.size(); --i>=0;)
4622
+ {
4623
+ Object3D obj = listUI.elementAt(i);
4624
+ if (!obj.pinned)
4625
+ {
4626
+ obj.CloseUI();
4627
+ listUI.remove(i);
4628
+ }
4629
+ }
4630
+
41064631 /**/
41074632 //switch (event.id)
41084633 {
....@@ -4110,7 +4635,6 @@
41104635 //case 702: // Event.LIST_DESELECT
41114636 group.deselectAll();
41124637 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4113
- objEditor.ClearInfo(); // .GetMaterial());
41144638 if (tps != null)
41154639 {
41164640 for (int i=0; i < tps.length; i++)
....@@ -4119,33 +4643,39 @@
41194643
41204644 //if (child.parent != null)
41214645 //child.parent.addSelectee(child);
4646
+ objEditor.SetMaterial(child);
41224647 group.addSelectee(child);
4123
- objEditor.SetMaterial(child); // .GetMaterial());
4124
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4125
- System.err.println("info : " + child.GetPath());
41264648 }
41274649 }
4128
- else
4129
- {
4130
- objEditor.SetMaterial(group); // .GetMaterial());
4131
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4132
- System.err.println("info : " + group.GetPath());
4133
- }
4650
+// else
4651
+// {
4652
+// objEditor.SetMaterial(group); // .GetMaterial());
4653
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4654
+// System.err.println("info : " + group.GetPath());
4655
+// }
41344656
4135
- objEditor.SetText(); // jan 2014
4136
-
4137
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4657
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41384658 CameraPane.flash = true;
41394659
4140
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4660
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41414661 // a camera
41424662 {
4143
- CameraPane.camerachangeframe = 0; // don't refuse it
4144
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4663
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4664
+ {
4665
+ CameraPane.camerachangeframe = 0; // don't refuse it
4666
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4667
+ }
41454668 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41464669 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41474670 }
41484671
4672
+ if (tps != null && tps.length == 1)
4673
+ {
4674
+ EditSelection(false);
4675
+ }
4676
+
4677
+ SetPinStates(tps != null && tps.length > 0);
4678
+
41494679 refreshContents();
41504680 //return true;
41514681 }
....@@ -4154,6 +4684,33 @@
41544684
41554685 freezemodel = false;
41564686 }
4687
+
4688
+ void SetPinStates(boolean enabled)
4689
+ {
4690
+ editButton.setEnabled(enabled);
4691
+ uneditButton.setEnabled(enabled);
4692
+ }
4693
+
4694
+ void refreshContents(boolean cp)
4695
+ {
4696
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4697
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4698
+ {
4699
+ objEditor.ClearInfo(); // .GetMaterial());
4700
+
4701
+ for (int i=0; i < group.selection.Size(); i++)
4702
+ {
4703
+ Object3D child = (Object3D) group.selection.get(i);
4704
+
4705
+ objEditor.AddInfo(child, this, true);
4706
+ System.err.println("info : " + child.GetPath());
4707
+ }
4708
+
4709
+ objEditor.SetText(); // jan 2014
4710
+ }
4711
+
4712
+ super.refreshContents(cp);
4713
+ }
41574714
41584715 void linkSomething(Object3D thing)
41594716 {
....@@ -4225,16 +4782,19 @@
42254782 {
42264783 if (group.selection.isEmpty())
42274784 return;
4228
- GrafreeD.clipboardIsTempGroup = false;
4785
+
4786
+ Grafreed.clipboardIsTempGroup = false;
42294787 Composite tGroup = null;
42304788 if (group.selection.size() > 0) // 1)
42314789 {
42324790 tGroup = new cGroup();
4233
- GrafreeD.clipboardIsTempGroup = true;
4791
+ Grafreed.clipboardIsTempGroup = true;
42344792 }
42354793
42364794 if (cut)
42374795 {
4796
+ if (Globals.SAVEONMAKE)
4797
+ Save();
42384798 //int indices[] = jList.getSelectedIndices();
42394799 //for (int i = indices.length - 1; i >= 0; i--)
42404800 //jList.remove(indices[i]);
....@@ -4270,16 +4830,16 @@
42704830 //System.out.println("cut " + child);
42714831 //System.out.println("parent = " + child.parent);
42724832 // tmp.addChild(child);
4273
- if (GrafreeD.clipboardIsTempGroup)
4833
+ if (Grafreed.clipboardIsTempGroup)
42744834 tGroup.add/*Child*/(tmp);
42754835 else
4276
- GrafreeD.clipboard = tmp;
4836
+ Grafreed.clipboard = tmp;
42774837 }
42784838 else
4279
- if (GrafreeD.clipboardIsTempGroup)
4839
+ if (Grafreed.clipboardIsTempGroup)
42804840 tGroup.add/*Child*/(child);
42814841 else
4282
- GrafreeD.clipboard = child;
4842
+ Grafreed.clipboard = child;
42834843 }
42844844
42854845 //ResetModel();
....@@ -4311,21 +4871,23 @@
43114871 //System.out.println("cut " + elem);
43124872 //System.out.println("parent = " + elem.parent);
43134873 // tmp.addChild(elem);
4314
- if (GrafreeD.clipboardIsTempGroup)
4874
+ if (Grafreed.clipboardIsTempGroup)
43154875 tGroup.add/*Child*/(tmp);
43164876 else
4317
- GrafreeD.clipboard = tmp;
4877
+ Grafreed.clipboard = tmp;
43184878 }
43194879 else
4320
- if (GrafreeD.clipboardIsTempGroup)
4880
+ if (Grafreed.clipboardIsTempGroup)
43214881 tGroup.add/*Child*/(child);
43224882 else
4323
- GrafreeD.clipboard = child;
4883
+ Grafreed.clipboard = child;
43244884 }
43254885
43264886 }
4327
- if (GrafreeD.clipboardIsTempGroup)
4328
- GrafreeD.clipboard = tGroup;
4887
+
4888
+ if (Grafreed.clipboardIsTempGroup)
4889
+ Grafreed.clipboard = tGroup;
4890
+
43294891 if (cut)
43304892 {
43314893 ResetModel();
....@@ -4339,7 +4901,7 @@
43394901 // return;
43404902 boolean first = true;
43414903
4342
- if (GrafreeD.clipboardIsTempGroup)
4904
+ if (Grafreed.clipboardIsTempGroup)
43434905 {
43444906 Composite temp;
43454907
....@@ -4350,7 +4912,7 @@
43504912 temp = (Composite)Applet3D.clipboard.deepCopy();
43514913 */
43524914 Object3D elem;
4353
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4915
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43544916 {
43554917 Object3D child = (Object3D)e.nextElement();
43564918
....@@ -4384,21 +4946,21 @@
43844946 //Object3D cb = Applet3D.clipboard;
43854947 //temp.addChild(cb);
43864948 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4387
- assert(GrafreeD.clipboard.parent == null);
4388
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4389
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4390
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4391
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4949
+ assert(Grafreed.clipboard.parent == null);
4950
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4951
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4952
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4953
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43924954 else
4393
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4394
- GrafreeD.clipboard.get(0).parent = keepparent;
4955
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4956
+ Grafreed.clipboard.get(0).parent = keepparent;
43954957 }
43964958
43974959 ResetModel();
43984960 refreshContents();
43994961 }
44004962
4401
- void pasteInto(boolean copyit)
4963
+ void pasteInto(boolean copyit, boolean clone)
44024964 {
44034965 // if (GrafreeD.clipboard == null)
44044966 // return;
....@@ -4427,15 +4989,22 @@
44274989 if (copyit)
44284990 {
44294991 // paste(false);
4430
- CloneClipboard(false); // sept 2014
4992
+ if (clone)
4993
+ {
4994
+ CloneClipboard(false); // sept 2014
4995
+ }
4996
+ else
4997
+ {
4998
+ paste(false);
4999
+ }
44315000 }
44325001 else
44335002 {
44345003 boolean first = true;
44355004
4436
- if (GrafreeD.clipboardIsTempGroup)
5005
+ if (Grafreed.clipboardIsTempGroup)
44375006 {
4438
- Composite temp = (Composite)GrafreeD.clipboard;
5007
+ Composite temp = (Composite)Grafreed.clipboard;
44395008 Object3D copy;
44405009 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44415010 {
....@@ -4445,7 +5014,7 @@
44455014 }
44465015 } else
44475016 {
4448
- linkSomething(GrafreeD.clipboard); //.get(0));
5017
+ linkSomething(Grafreed.clipboard); //.get(0));
44495018 }
44505019 }
44515020 }
....@@ -4850,21 +5419,6 @@
48505419 }
48515420 */
48525421
4853
- void ImportGFD()
4854
- {
4855
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4856
- browser.show();
4857
- String filename = browser.getFile();
4858
- if (filename != null && filename.length() > 0)
4859
- {
4860
- String fullname = browser.getDirectory() + filename;
4861
-
4862
- //Object3D readobj =
4863
- objEditor.ReadGFD(fullname, objEditor);
4864
- //makeSomething(readobj);
4865
- }
4866
- }
4867
-
48685422 /*
48695423 public void Callback(Object obj)
48705424 {
....@@ -4888,26 +5442,9 @@
48885442 }
48895443 */
48905444
4891
- void ImportVRMLX3D()
4892
- {
4893
- if (GrafreeD.standAlone)
4894
- {
4895
- /**/
4896
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4897
- browser.show();
4898
- String filename = browser.getFile();
4899
- if (filename != null && filename.length() > 0)
4900
- {
4901
- String fullname = browser.getDirectory() + filename;
4902
- LoadVRMLX3D(fullname);
4903
- }
4904
- /**/
4905
- }
4906
- }
4907
-
49085445 String GetFile(String dialogName)
49095446 {
4910
- if (GrafreeD.standAlone)
5447
+ if (Grafreed.standAlone)
49115448 {
49125449 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49135450 browser.show();
....@@ -4971,10 +5508,36 @@
49715508 cButton flashSelectionButton;
49725509 cButton editButton;
49735510 cButton uneditButton;
5511
+ JCheckBox allParamsButton;
49745512 cButton clearpanelButton;
4975
- cButton allParamsButton;
49765513 cButton unselectButton;
49775514
5515
+ cButton restoreCameraButton;
5516
+
5517
+ cButton minButton;
5518
+ cButton maxButton;
5519
+ cButton fullButton;
5520
+ cButton saveButton;
5521
+ cButton oneStepButton;
5522
+
5523
+ cButton groupButton;
5524
+ cButton ungroupButton;
5525
+ cButton compositeButton;
5526
+ cButton switchButton;
5527
+ cButton loopButton;
5528
+ cButton textureButton;
5529
+
5530
+ cButton gridButton;
5531
+ cButton boxButton;
5532
+ cButton sphereButton;
5533
+ cButton coneButton;
5534
+ cButton torusButton;
5535
+ cButton superButton;
5536
+ cButton kleinButton;
5537
+ cButton particlesButton;
5538
+ cButton overlayButton;
5539
+ cButton lightButton;
5540
+
49785541 cButton screenfitButton;
49795542 cButton screenfitpointButton;
49805543 cButton snapobjectButton;
....@@ -4986,14 +5549,6 @@
49865549
49875550 cButton setsupportButton;
49885551
4989
- cButton twoButton;
4990
- cButton sixButton;
4991
- cButton threeButton;
4992
- cButton sevenButton;
4993
- cButton fourButton; // full panel
4994
- cButton oneButton; // full XYZ
4995
- //cButton currentLayout;
4996
-
49975552 //
49985553 //Composite
49995554 Object3D // to do !!
....@@ -5003,9 +5558,11 @@
50035558 //JTree jTree;
50045559 private MenuItem lookAtItem;
50055560 private MenuItem lookFromItem;
5006
- private MenuItem switchItem;
5561
+ private MenuItem switchViewItem;
50075562 private MenuItem cutItem;
5008
- private MenuItem duplicateItem;
5563
+ private MenuItem undoItem;
5564
+ private MenuItem redoItem;
5565
+ private JMenuItem duplicateItem;
50095566 private MenuItem cloneItem;
50105567 private MenuItem cloneSupportItem;
50115568 private MenuItem overwriteGeoItem;
....@@ -5018,7 +5575,7 @@
50185575 private MenuItem linkverticesItem;
50195576 private MenuItem relinkverticesItem;
50205577 private MenuItem setMasterItem;
5021
- private MenuItem resetMeshItem;
5578
+ private MenuItem resetAllItem;
50225579 private MenuItem stepAllItem;
50235580 private MenuItem revertMeshItem;
50245581 private MenuItem poseMeshItem;
....@@ -5029,6 +5586,7 @@
50295586 private MenuItem mergeGeometriesItem;
50305587 private MenuItem copyItem;
50315588 private MenuItem pasteItem;
5589
+ private MenuItem pasteIntoItem;
50325590 private MenuItem pasteLinkItem;
50335591 private MenuItem pasteCloneItem;
50345592 private MenuItem pasteExpandItem;
....@@ -5067,6 +5625,10 @@
50675625 private MenuItem showleavesItem;
50685626 private MenuItem markleavesItem;
50695627 private MenuItem unmarkleavesItem;
5628
+ private MenuItem rewindleavesItem;
5629
+ private MenuItem unrewindleavesItem;
5630
+ private MenuItem randomleavesItem;
5631
+ private MenuItem unrandomleavesItem;
50705632
50715633 private MenuItem flipVItem;
50725634 private MenuItem unflipVItem;
....@@ -5078,15 +5640,17 @@
50785640 private MenuItem panoTexturesItem;
50795641
50805642 private MenuItem resetCentroidItem;
5081
- private MenuItem transformgeometryItem;
5643
+ private MenuItem resetCentroidXZItem;
50825644 private MenuItem resetTransformItem;
5645
+ private MenuItem transformGeometryItem;
5646
+ private MenuItem transformChildrenItem;
50835647 private MenuItem hideItem;
50845648 private MenuItem grabItem;
50855649 private MenuItem backItem;
50865650 private MenuItem frontItem;
50875651 private MenuItem cameraItem;
50885652 private MenuItem compositeItem;
5089
- private MenuItem randomItem;
5653
+ private MenuItem switchItem;
50905654 private MenuItem physicsItem;
50915655 private MenuItem frameselectorItem;
50925656 private MenuItem scriptNodeItem;
....@@ -5126,7 +5690,7 @@
51265690 private MenuItem blobItem;
51275691 private MenuItem latheItem;
51285692 private MenuItem bezierItem;
5129
- private MenuItem checkerItem;
5693
+ private MenuItem overlayItem;
51305694 private MenuItem meshItem;
51315695 // private MenuItem meshGroupItem;
51325696 private MenuItem springItem;
....@@ -5148,11 +5712,6 @@
51485712 private MenuItem doubleItem;
51495713 private MenuItem tripleItem;
51505714
5151
- private MenuItem importGFDItem;
5152
- private MenuItem importVRMLX3DItem;
5153
- private MenuItem import3DSItem;
5154
- private MenuItem importOBJItem;
5155
-
51565715 private MenuItem computeAOItem;
51575716 private MenuItem recompileItem;
51585717 private MenuItem editScriptItem;
....@@ -5162,4 +5721,8 @@
51625721 private MenuItem analyzeItem;
51635722 private MenuItem dumpItem;
51645723 //boolean freezemodel = false;
5724
+
5725
+ Menu cameraMenu;
5726
+ MenuItem editCameraItem;
5727
+ MenuItem restoreCameraItem;
51655728 }