Normand Briere
2019-06-25 26b24f5b623e709a88e91e9bce0864f9d5e8f084
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,199 @@
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
+
609
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
+ redoButton.setToolTipText("Redo changes");
611
+ redoButton.addActionListener(this);
612
+
613
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ saveButton.setToolTipText("Save changes");
615
+ saveButton.addActionListener(this);
616
+
617
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
618
+ liveCB.setToolTipText("Enable animation");
446619 liveCB.addItemListener(this);
447620
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);
621
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ oneStepButton.setToolTipText("Animate one step forward");
623
+ oneStepButton.addActionListener(this);
624
+
625
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626
+ fastCB.setToolTipText("Fast mode");
627
+ fastCB.addItemListener(this);
628
+
629
+ //oe.toolboxPanel.Return();
630
+
631
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
455632 screenfitButton.setToolTipText("Screen fit");
456633 screenfitButton.addActionListener(this);
457
- oe.aConstraints.gridx += 1;
634
+
635
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636
+// trackCB.setToolTipText("Enable tracking");
637
+// trackCB.addItemListener(this);
638
+
458639 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
459640 // 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;
465641
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);
642
+ if (Globals.ADVANCED)
643
+ {
644
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
645
+ snapobjectButton.addActionListener(this);
646
+ snapobjectButton.setToolTipText("Snap Object");
647
+ }
648
+
649
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
474650
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);
651
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
483652 twoButton.setToolTipText("Show center view only");
484653 twoButton.addActionListener(this);
485
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
654
+ this.fullscreenLayout = twoButton;
655
+
656
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
486657 fourButton.addActionListener(this);
487658 fourButton.setToolTipText("Show left panel only");
488
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
659
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
489660 sixButton.setToolTipText("2-column layout left");
490661 sixButton.addActionListener(this);
491
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492663 threeButton.setToolTipText("2-column layout right");
493664 threeButton.addActionListener(this);
494
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
665
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495666 sevenButton.setToolTipText("3-column layout");
496667 sevenButton.addActionListener(this);
497668 //
498669
499
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
500
- rootButton.setToolTipText("Edit object in new tab");
670
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ rootButton.setToolTipText("Edit selection in new tab");
501672 rootButton.addActionListener(this);
502
- oe.aConstraints.gridx += 1;
503
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
673
+
674
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504675 closeButton.setToolTipText("Close tab");
505676 closeButton.addActionListener(this);
506677 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
507678 //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;
516679
517
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
680
+ // INSERT
681
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ gridButton.setToolTipText("Create grid");
683
+ gridButton.addActionListener(this);
684
+
685
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ boxButton.setToolTipText("Create box");
687
+ boxButton.addActionListener(this);
688
+
689
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690
+ sphereButton.setToolTipText("Create sphere");
691
+ sphereButton.addActionListener(this);
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.Return();
717
+
718
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ groupButton.setToolTipText("Create group");
720
+ groupButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ compositeButton.setToolTipText("Create composite");
724
+ compositeButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ switchButton.setToolTipText("Create switch");
728
+ switchButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ loopButton.setToolTipText("Create loop");
732
+ loopButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ textureButton.setToolTipText("Create texture");
736
+ textureButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ overlayButton.setToolTipText("Create overlay");
740
+ overlayButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ lightButton.setToolTipText("Create light");
744
+ lightButton.addActionListener(this);
745
+
746
+ // EDIT panel
747
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ editButton.setToolTipText("Edit selection");
749
+ editButton.addActionListener(this);
750
+
751
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
+ uneditButton.setToolTipText("Unedit selection");
518753 uneditButton.addActionListener(this);
519754
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);
755
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
756
+ allParamsButton.setToolTipText("Edit all params");
532757 allParamsButton.addActionListener(this);
533758
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);
759
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ clearPanelButton.setToolTipText("Clear edit panel");
761
+ clearPanelButton.addActionListener(this);
762
+
763
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ unselectButton.setToolTipText("Unselect");
539765 unselectButton.addActionListener(this);
540766
767
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ flashSelectionButton.setToolTipText("Highlight selection");
769
+ flashSelectionButton.addActionListener(this);
770
+
771
+ editCommandsPanel.preferredHeight = 1;
772
+
773
+// oe.treePanel.add(commandsPanel);
774
+// oe.treePanel.Return();
775
+
541776 // oe.aConstraints.gridx += 1;
542777 // oe.aConstraints.weighty = 0;
543778 // oe.aConstraints.gridwidth = 1;
....@@ -549,40 +784,22 @@
549784 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
550785 // gcButton.addActionListener(this);
551786
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;
787
+ cGridBag jSPPanel = new cGridBag();
788
+
789
+ JScrollPane jSP;
563790 //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);
791
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
565792 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;
585793
794
+ oe.treePanel.add(jSPPanel);
795
+ oe.treePanel.Return();
796
+
797
+ oe.treePanel.add(copyOptionsPanel);
798
+ oe.treePanel.Return();
799
+
800
+// mainPanel.setDividerLocation(0.5); //1.0);
801
+// mainPanel.setResizeWeight(0.5);
802
+
586803 //jList.addListSelectionListener(this);
587804 oe.jTree.addTreeSelectionListener(this);
588805 //jTree.setRootVisible(false);
....@@ -607,47 +824,57 @@
607824
608825 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
609826 {
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);
827
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
828
+ colorCB.setToolTipText("Copy color when dropped");
829
+ colorCB.addItemListener(this);
619830
620
- // constraints.gridy += 1;
621
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
622
- // localCB.addItemListener(this);
831
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
832
+ materialCB.setToolTipText("Copy material when dropped");
833
+ materialCB.addItemListener(this);
623834
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;
835
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
836
+ textureCB.setToolTipText("Copy texture when dropped");
837
+ textureCB.addItemListener(this);
838
+
839
+ panel.Return();
840
+
639841 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
640842 boxCB.setToolTipText("Display bounding boxes");
641843 boxCB.addItemListener(this);
642
- //constraints.gridy += 1;
844
+
643845 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
644846 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
645847 zoomBoxCB.addItemListener(this);
646848
849
+ if (true) // Globals.ADVANCED)
850
+ {
851
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
852
+ supportCB.setToolTipText("Enable rigging");
853
+ supportCB.addItemListener(this);
854
+
855
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
856
+ // localCB.addItemListener(this);
857
+
858
+ panel.Return();
859
+
860
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
861
+ crowdCB.setToolTipText("Used for crowds");
862
+ crowdCB.addItemListener(this);
863
+
864
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
865
+ smoothCB.setToolTipText("Snapping delay");
866
+ smoothCB.addItemListener(this);
867
+
868
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
869
+ slowCB.setToolTipText("Smooth interpolation");
870
+ slowCB.addItemListener(this);
871
+
647872 // constraints.gridy += 1;
648873 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
649874 // speakerMocapCB.addItemListener(this);
650875
876
+ panel.Return();
877
+
651878 if (false)
652879 {
653880 // handled in scripts
....@@ -662,26 +889,72 @@
662889 //constraints.gridy += 1;
663890 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
664891 smoothfocusCB.addItemListener(this);
892
+ panel.Return();
665893 }
666894
667895 //constraints.gridx += 1;
668896 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
669897 // debugCB.addItemListener(this);
670898
671
- //constraints.gridy += 1;
899
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
900
+ trackCB.setToolTipText("Enable tracking target");
901
+ trackCB.addItemListener(this);
902
+
672903 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
904
+ oeilCB.setToolTipText("Move camera when tracking");
673905 oeilCB.addItemListener(this);
674906
675
- //constraints.gridy += 1;
907
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
+ shadowCB.setToolTipText("Compute shadows when live");
909
+ shadowCB.addItemListener(this);
910
+
911
+ panel.Return();
912
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
913
+ toggleTextureCB.setToolTipText("Load textures");
914
+ toggleTextureCB.addItemListener(this);
915
+
916
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
+ toggleSwitchCB.setToolTipText("Use switch");
918
+ toggleSwitchCB.addItemListener(this);
919
+
920
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
+ autosaveCB.setToolTipText("Auto-save on structure change");
922
+ autosaveCB.addItemListener(this);
923
+
924
+ panel.Return();
925
+ if (Globals.ADVANCED)
926
+ {
676927 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
677928 lookAtCB.setToolTipText("Look-at target");
678929 lookAtCB.addItemListener(this);
930
+ }
931
+
932
+ }
933
+
934
+ cGridBag fill = new cGridBag();
935
+ fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
940
+
941
+ panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
679944
680945 }
681946
682947 void EditObject(Object3D obj)
683948 {
684949 cRadio radioButton = new cRadio(obj.name);
950
+
951
+ // Patch to avoid bug with transparency.
952
+ radioButton.hadMaterial = obj.material != null;
953
+ if (!radioButton.hadMaterial)
954
+ {
955
+ obj.material = new cMaterial();
956
+ }
957
+
685958 radioButton.SetObject(obj);
686959 radioButton.layout = sevenButton;
687960 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -690,8 +963,11 @@
690963 buttonGroup.add(radioButton);
691964 radioButton.doClick();
692965 }
966
+
693967 void SetupViews(ObjEditor oe)
694968 {
969
+ theFrame = this;
970
+
695971 oe.SetupViews();
696972
697973 System.out.println("SetupViews");
....@@ -700,23 +976,27 @@
700976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
701977 }
702978
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;
979
+ cToggleButton liveCB;
980
+ cCheckBox supportCB;
981
+ cCheckBox localCB;
982
+ cCheckBox crowdCB;
983
+ cCheckBox smoothCB;
984
+ cToggleButton fastCB;
985
+ cCheckBox slowCB;
986
+ cCheckBox boxCB;
987
+ cCheckBox zoomBoxCB;
988
+ //cToggleButton trackCB;
989
+ cCheckBox trackCB;
990
+ cCheckBox smoothfocusCB;
714991 // JCheckBox speakerMocapCB;
715
- JCheckBox speakerCameraCB;
716
- JCheckBox speakerFocusCB;
717
- JCheckBox debugCB;
718
- JCheckBox oeilCB;
719
- JCheckBox lookAtCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
995
+
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
7201000
7211001 // static int COLOR = 1;
7221002 // static int MATERIAL = 2;
....@@ -724,9 +1004,9 @@
7241004
7251005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7261006
727
- JCheckBox colorCB;
728
- JCheckBox materialCB;
729
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
7301010
7311011 public void itemStateChanged(ItemEvent e)
7321012 {
....@@ -754,6 +1034,7 @@
7541034 } else if(e.getSource() == liveCB)
7551035 {
7561036 cameraView.ToggleLive();
1037
+ refreshContents(false);
7571038 }
7581039 else if(e.getSource() == supportCB)
7591040 {
....@@ -818,6 +1099,14 @@
8181099 {
8191100 cameraView.ToggleOeil();
8201101 }
1102
+ else if(e.getSource() == shadowCB)
1103
+ {
1104
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1105
+ }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
8211110 else if(e.getSource() == lookAtCB)
8221111 {
8231112 cameraView.ToggleLookAt();
....@@ -834,7 +1123,8 @@
8341123
8351124 /**/
8361125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
837
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
8381128 if ((path == null) || (path.getPathCount() <= 1)) {
8391129 // We can't move the root node or an empty selection
8401130 return;
....@@ -906,7 +1196,9 @@
9061196 // objEditor.DropFile((java.io.File[]) object, true);
9071197 // return;
9081198 // }
909
- if (string.charAt(0) == '/')
1199
+
1200
+ // File path for Mac and Windows
1201
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9101202 {
9111203 // file(s)
9121204 String[] names = string.split("\n");
....@@ -933,7 +1225,7 @@
9331225
9341226 flashIt = false;
9351227 CameraPane pane = (CameraPane) target;
936
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1228
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9371229 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9381230
9391231 if (group.selection.size() == 1)
....@@ -949,23 +1241,33 @@
9491241
9501242 assert target == objEditor.jTree;
9511243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
9521245 try {
953
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9541247 } catch (Exception e) {
9551248 System.out.println("destinationPath : " + destinationPath);
9561249 return;
9571250 }
9581251
959
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
9601253 {
1254
+ Object3D child = (Object3D)group.selection.elementAt(i);
1255
+
1256
+ // Cannot move into itself
1257
+ if (child == destinationLeaf)
1258
+ return;
1259
+ }
1260
+
1261
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1262
+// {
9611263 loadClipboard(true);
9621264 objEditor.jTree.setSelectionPath(destinationPath);
963
- pasteInto(false);
964
- } else {
965
- loadClipboard(false);
966
- objEditor.jTree.setSelectionPath(destinationPath);
967
- pasteInto(false); // true); // ???
968
- }
1265
+ pasteInto(false, false);
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
9691271 }
9701272 public void dropActionChanged(DropTargetDragEvent dtde)
9711273 // Called if the user has modified the current drop gesture
....@@ -1070,85 +1372,104 @@
10701372 {
10711373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10721374 //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);
1375
+// gridItem = menu.add(new MenuItem("Grid"));
1376
+// gridItem.addActionListener(this);
1377
+// rectoidItem = menu.add(new MenuItem("Box"));
1378
+// rectoidItem.addActionListener(this);
1379
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1380
+// ellipsoidItem.addActionListener(this);
1381
+// coneItem = menu.add(new MenuItem("Cone"));
1382
+// coneItem.addActionListener(this);
1383
+// torusItem = menu.add(new MenuItem("Torus"));
1384
+// torusItem.addActionListener(this);
1385
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1386
+// superItem.addActionListener(this);
1387
+
1388
+ cameraItem = menu.add(new MenuItem("Camera"));
1389
+ cameraItem.addActionListener(this);
1390
+
1391
+ if (!Globals.ADVANCED)
1392
+ {
10851393 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10861394 kleinItem.addActionListener(this);
1087
- particleItem = menu.add(new MenuItem("Particle system"));
1088
- particleItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
1399
+ if (Globals.ADVANCED)
1400
+ {
10891401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10901402 ragdollItem.addActionListener(this);
10911403 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10921404 ragdoll2Item.addActionListener(this);
1405
+ }
10931406 menu.add("-");
1094
- meshItem = menu.add(new MenuItem("Mesh"));
1407
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10951408 meshItem.addActionListener(this);
10961409 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10971410 // meshGroupItem.addActionListener(this);
1411
+ if (Globals.ADVANCED)
1412
+ {
10981413 springItem = menu.add(new MenuItem("Spring"));
10991414 springItem.addActionListener(this);
11001415 flagItem = menu.add(new MenuItem("Flag"));
11011416 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);
11061417 blobItem = menu.add(new MenuItem("Blob"));
11071418 blobItem.addActionListener(this);
11081419 latheItem = menu.add(new MenuItem("Lathe"));
11091420 latheItem.addActionListener(this);
1110
- lightItem = menu.add(new MenuItem("Light"));
1111
- lightItem.addActionListener(this);
1421
+ }
1422
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1423
+ bezierItem.addActionListener(this);
1424
+// overlayItem = menu.add(new MenuItem("Overlay"));
1425
+// overlayItem.addActionListener(this);
1426
+// lightItem = menu.add(new MenuItem("Light"));
1427
+// lightItem.addActionListener(this);
11121428 menu.add("-");
11131429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11141430 //superLoopItem.addActionListener(this);
1115
- loopItem = menu.add(new MenuItem("Loop"));
1116
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
11171433 doubleItem = menu.add(new MenuItem("Fork"));
11181434 doubleItem.addActionListener(this);
1435
+ if (Globals.ADVANCED)
1436
+ {
11191437 tripleItem = menu.add(new MenuItem("Trident"));
11201438 tripleItem.addActionListener(this);
1439
+ }
11211440 }
11221441
11231442 void buildToolsMenu(Menu menu)
11241443 {
11251444 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11261445 animationItem.addItemListener(this);
1127
- animationItem.setState(CameraPane.ANIMATION);
1446
+ animationItem.setState(Globals.ANIMATION);
11281447
11291448 menu.add("-");
11301449 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11311450 parseverticesItem.addActionListener(this);
11321451 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11331452 textureFieldItem.addActionListener(this);
1134
- alignItem = menu.add(new MenuItem("Align"));
1453
+ alignItem = menu.add(new MenuItem("Align Objects"));
11351454 alignItem.addActionListener(this);
1136
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1137
- mirrorItem.addActionListener(this);
11381455 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11391456 reduceMorphItem.addActionListener(this);
11401457 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11411458 reduce34MorphItem.addActionListener(this);
1142
-
1459
+ menu.add("-");
11431460 menu.add(computeAOItem = new MenuItem("Compute AO"));
11441461 computeAOItem.addActionListener(this);
1145
- menu.add("-");
11461462
1463
+ if (Globals.ADVANCED)
1464
+ {
1465
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1466
+ mirrorItem.addActionListener(this);
1467
+ menu.add("-");
11471468 menu.add(memoryItem = new MenuItem("Memory Usage"));
11481469 memoryItem.addActionListener(this);
11491470 menu.add(analyzeItem = new MenuItem("Analyze"));
11501471 analyzeItem.addActionListener(this);
1151
- menu.add(dumpItem = new MenuItem("Dump"));
1472
+ menu.add(dumpItem = new MenuItem("Print"));
11521473 dumpItem.addActionListener(this);
11531474 // menu.add(pathItem = new MenuItem("From-to path"));
11541475 // pathItem.addActionListener(this);
....@@ -1166,6 +1487,7 @@
11661487 menu.add("-");
11671488 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11681489 editScriptItem.addActionListener(this);
1490
+ }
11691491 }
11701492
11711493 void ScreenFit()
....@@ -1288,6 +1610,7 @@
12881610 shadow.material = new cMaterial(obj.material);
12891611 shadow.material.diffuse = 0.0001f;
12901612 shadow.material.specular = 0.0001f;
1613
+ //shadow.projectedVertices[1].x = 300;
12911614
12921615 makeSomething(shadow);
12931616 }
....@@ -1494,9 +1817,9 @@
14941817
14951818 void Overwrite(int mask)
14961819 {
1497
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1820
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14981821 {
1499
- Object3D content = GrafreeD.clipboard.get(0);
1822
+ Object3D content = Grafreed.clipboard.get(0);
15001823
15011824 if (content instanceof cGroup && ((cGroup)content).transientlink )
15021825 content = ((cGroup)content).get(0);
....@@ -1535,7 +1858,7 @@
15351858 {
15361859 ScreenFit();
15371860 } else
1538
- if (source == switchItem)
1861
+ if (source == switchViewItem)
15391862 {
15401863 cVector v1 = new cVector();
15411864 cVector v2 = new cVector();
....@@ -1544,11 +1867,11 @@
15441867 objEditor.cameraView.renderCamera.setAim(v2, v1);
15451868 objEditor.cameraView.repaint();
15461869 } else
1547
- if (source == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
15481871 {
15491872 makeSomething(new Box());
15501873 } else
1551
- if (source == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
15521875 {
15531876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15541877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1627,27 +1950,27 @@
16271950
16281951 makeSomething(obj);
16291952 } else
1630
- if (source == gridItem)
1953
+ if (source == gridItem || source == gridButton)
16311954 {
16321955 makeSomething(new Grid());
16331956 } else
1634
- if (source == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
16351958 {
16361959 makeSomething(new Sphere());
16371960 } else
1638
- if (source == coneItem)
1961
+ if (source == coneItem || source == coneButton)
16391962 {
16401963 makeSomething(new Cone());
16411964 } else
1642
- if (source == torusItem)
1965
+ if (source == torusItem || source == torusButton)
16431966 {
16441967 makeSomething(new Torus());
16451968 } else
1646
- if (source == superItem)
1969
+ if (source == superItem || source == superButton)
16471970 {
16481971 makeSomething(new Superellipsoid());
16491972 } else
1650
- if (source == kleinItem)
1973
+ if (source == kleinItem || source == kleinButton)
16511974 {
16521975 makeSomething(new Klein());
16531976 } else
....@@ -1667,7 +1990,7 @@
16671990 {
16681991 makeSomething(new BezierSurface());
16691992 } else
1670
- if (source == checkerItem)
1993
+ if (source == overlayItem || source == overlayButton)
16711994 {
16721995 /*
16731996 Object3D obj = new BezierSurface(5,8);
....@@ -1715,7 +2038,7 @@
17152038 s.setup();
17162039 makeSomething(s);
17172040 } else
1718
- if (source == lightItem)
2041
+ if (source == lightItem || source == lightButton)
17192042 {
17202043 makeSomething(new Light());
17212044 } else
....@@ -1765,7 +2088,7 @@
17652088
17662089 group(g);
17672090 } else
1768
- if (source == loopItem)
2091
+ if (source == loopItem || source == loopButton)
17692092 {
17702093 Composite csg = new GroupLeaf();
17712094 csg.count = 5;
....@@ -1801,23 +2124,6 @@
18012124 csg.addChild(child);
18022125 child.addChild(csg);
18032126 } 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
18212127 if (source == computeAOItem)
18222128 {
18232129 Globals.drawMode = CameraPane.OCCLUSION;
....@@ -1836,7 +2142,7 @@
18362142 if (source == invariantsItem)
18372143 {
18382144 System.out.println("Invariants:");
1839
- GrafreeD.grafreeD.universe.invariants();
2145
+ Grafreed.grafreeD.universe.invariants();
18402146 } else
18412147 if (source == memoryItem)
18422148 {
....@@ -1854,6 +2160,35 @@
18542160 if (source == dumpItem)
18552161 {
18562162 DumpObject();
2163
+ } else
2164
+ if (source == minButton)
2165
+ {
2166
+ Minimize();
2167
+ } else
2168
+ if (source == maxButton)
2169
+ {
2170
+ Maximize();
2171
+ } else
2172
+ if (source == fullButton)
2173
+ {
2174
+ ToggleFullScreen();
2175
+ } else
2176
+ if (source == undoButton)
2177
+ {
2178
+ Undo();
2179
+ } else
2180
+ if (source == redoButton)
2181
+ {
2182
+ Redo();
2183
+ } else
2184
+ if (source == saveButton)
2185
+ {
2186
+ Save();
2187
+ } else
2188
+ if (source == oneStepButton)
2189
+ {
2190
+ Globals.ONESTEP = true;
2191
+ cameraView.repaint();
18572192 } else
18582193 if (source == screenfitButton)
18592194 {
....@@ -1904,12 +2239,20 @@
19042239 {
19052240 loadClipboard(true);
19062241 } else
2242
+ if (source == undoItem)
2243
+ {
2244
+ Undo();
2245
+ } else
2246
+ if (source == redoItem)
2247
+ {
2248
+ Redo();
2249
+ } else
19072250 if (source == duplicateItem)
19082251 {
1909
- Object3D keep = GrafreeD.clipboard;
2252
+ Object3D keep = Grafreed.clipboard;
19102253 loadClipboard(false);
19112254 paste(false);
1912
- GrafreeD.clipboard = keep;
2255
+ Grafreed.clipboard = keep;
19132256 } else
19142257 if (source == cloneItem)
19152258 {
....@@ -1927,13 +2270,17 @@
19272270 {
19282271 paste(false);
19292272 } else
2273
+ if (source == pasteIntoItem)
2274
+ {
2275
+ pasteInto(true, false);
2276
+ } else
19302277 if (source == pasteLinkItem)
19312278 {
1932
- pasteInto(false);
2279
+ pasteInto(false, false);
19332280 } else
19342281 if (source == pasteCloneItem)
19352282 {
1936
- pasteInto(true);
2283
+ pasteInto(true, true);
19372284 } else
19382285 if (source == pasteExpandItem)
19392286 {
....@@ -2125,9 +2472,9 @@
21252472 // group.selection.get(0).setMasterThis(content); // should be identity
21262473 // refreshContents();
21272474 // }
2128
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2475
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21292476 {
2130
- Object3D content = GrafreeD.clipboard.get(0);
2477
+ Object3D content = Grafreed.clipboard.get(0);
21312478
21322479 if (content instanceof cGroup && ((cGroup)content).transientlink )
21332480 content = ((cGroup)content).get(0);
....@@ -2135,11 +2482,11 @@
21352482 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21362483 for (int i=0; i<group.selection.size(); i++)
21372484 {
2138
- boolean random = CameraPane.RANDOM;
2139
- CameraPane.RANDOM = false; // parse all random nodes
2485
+ boolean random = CameraPane.SWITCH;
2486
+ CameraPane.SWITCH = false; // parse all random nodes
21402487 group.selection.get(i).linkVerticesThis(content);
21412488 // group.selection.get(i).setMasterThis(content); // should be identity
2142
- CameraPane.RANDOM = random;
2489
+ CameraPane.SWITCH = random;
21432490 }
21442491 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21452492 refreshContents();
....@@ -2149,20 +2496,20 @@
21492496 {
21502497 for (int i=0; i<group.selection.size(); i++)
21512498 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2499
+ boolean random = CameraPane.SWITCH;
2500
+ CameraPane.SWITCH = false; // parse all random nodes
21542501 group.selection.get(i).linkVerticesThis(null);
2155
- CameraPane.RANDOM = random;
2502
+ CameraPane.SWITCH = random;
21562503 }
21572504
21582505 refreshContents();
21592506 } else
21602507 if (source == relinkverticesItem)
21612508 {
2162
- boolean random = CameraPane.RANDOM;
2163
- CameraPane.RANDOM = false; // parse all random nodes
2509
+ boolean random = CameraPane.SWITCH;
2510
+ CameraPane.SWITCH = false; // parse all random nodes
21642511 group.selection.RelinkToSupport();
2165
- CameraPane.RANDOM = random;
2512
+ CameraPane.SWITCH = random;
21662513
21672514 refreshContents();
21682515 } else
....@@ -2177,9 +2524,9 @@
21772524 } else
21782525 if (source == setMasterItem)
21792526 {
2180
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2527
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21812528 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2529
+ Object3D content = Grafreed.clipboard.get(0);
21832530
21842531 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852532 content = ((cGroup)content).get(0);
....@@ -2192,9 +2539,9 @@
21922539 {
21932540 if (group.selection.size() == 1)
21942541 {
2195
- if (GrafreeD.clipboard.size() == 1)
2542
+ if (Grafreed.clipboard.size() == 1)
21962543 {
2197
- Object3D content = GrafreeD.clipboard.get(0);
2544
+ Object3D content = Grafreed.clipboard.get(0);
21982545
21992546 if (content instanceof cGroup && ((cGroup)content).transientlink )
22002547 content = ((cGroup)content).get(0);
....@@ -2211,7 +2558,7 @@
22112558 {
22122559 RevertMeshes();
22132560 } else
2214
- if (source == resetMeshItem)
2561
+ if (source == resetAllItem)
22152562 {
22162563 ResetAll();
22172564 } else
....@@ -2231,9 +2578,9 @@
22312578 {
22322579 ClearSelection(true);
22332580 } else
2234
- if (source == grabItem)
2581
+ if (source == grabItem || source == groupButton)
22352582 {
2236
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
22372584 } else
22382585 if (source == hideItem)
22392586 {
....@@ -2251,16 +2598,16 @@
22512598 {
22522599 makeSomething(new Camera());
22532600 } else
2254
- if (source == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
22552602 {
22562603 group(new Composite());
22572604 } else
2258
- if (source == randomItem)
2605
+ if (source == switchItem || source == switchButton)
22592606 {
22602607 RandomNode random = new RandomNode();
22612608 group(random);
22622609 if (random.size() > 0)
2263
- random.name = random.get(0).name + "Rnd";
2610
+ random.name = random.get(0).name + "Switch";
22642611 } else
22652612 if (source == physicsItem)
22662613 {
....@@ -2357,7 +2704,7 @@
23572704 {
23582705 group(new cLinker());
23592706 } else
2360
- if (source == textureItem)
2707
+ if (source == textureItem || source == textureButton)
23612708 {
23622709 group(new TextureNode());
23632710 } else
....@@ -2377,7 +2724,7 @@
23772724 {
23782725 CastShadow(2);
23792726 } else
2380
- if (source == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
23812728 {
23822729 //ungroup();
23832730 for (int i=0; i<group.selection.size(); i++)
....@@ -2399,7 +2746,7 @@
23992746 } else
24002747 if (source == genNormalsMESHItem)
24012748 {
2402
- GenNormals(true); // TODO
2749
+ GenNormalsMESH();
24032750 } else
24042751 if (source == genNormalsORGANItem)
24052752 {
....@@ -2464,6 +2811,22 @@
24642811 if (source == unmarkleavesItem)
24652812 {
24662813 MarkLeaves(false);
2814
+ } else
2815
+ if (source == rewindleavesItem)
2816
+ {
2817
+ RewindLeaves(true);
2818
+ } else
2819
+ if (source == unrewindleavesItem)
2820
+ {
2821
+ RewindLeaves(false);
2822
+ } else
2823
+ if (source == randomleavesItem)
2824
+ {
2825
+ RandomLeaves(true);
2826
+ } else
2827
+ if (source == unrandomleavesItem)
2828
+ {
2829
+ RandomLeaves(false);
24672830 } else
24682831 if (source == flipVItem)
24692832 {
....@@ -2549,9 +2912,13 @@
25492912 {
25502913 SmoothMesh();
25512914 } else
2552
- if (source == transformgeometryItem)
2915
+ if (source == transformGeometryItem)
25532916 {
25542917 TransformGeometry();
2918
+ } else
2919
+ if (source == transformChildrenItem)
2920
+ {
2921
+ TransformChildren();
25552922 } else
25562923 if (source == resetTransformItem)
25572924 {
....@@ -2559,7 +2926,11 @@
25592926 } else
25602927 if (source == resetCentroidItem)
25612928 {
2562
- ResetCentroid();
2929
+ ResetCentroid(true);
2930
+ } else
2931
+ if (source == resetCentroidXZItem)
2932
+ {
2933
+ ResetCentroid(false);
25632934 } else
25642935 if (source == resetParentItem)
25652936 {
....@@ -2691,6 +3062,10 @@
26913062 if (source == twoButton)
26923063 {
26933064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
26943069 // bug
26953070 //gridPanel.setDividerLocation(1.0);
26963071 //bigPanel.setDividerLocation(0.0);
....@@ -2723,10 +3098,31 @@
27233098 bigThree.ClearUI();
27243099 bigThree.add(centralPanel);
27253100 bigThree.FlushUI();
3101
+
3102
+ cameraView.requestFocusInWindow();
3103
+
3104
+// refreshContents(true);
3105
+//
3106
+// try
3107
+// {
3108
+// java.awt.Robot bot = new java.awt.Robot();
3109
+// int mask = InputEvent.BUTTON1_MASK;
3110
+// bot.mouseMove(100, 100);
3111
+// bot.mousePress(mask);
3112
+// bot.mouseRelease(mask);
3113
+// }
3114
+// catch (Exception e)
3115
+// {
3116
+//
3117
+// }
3118
+
27263119 } else
27273120 if (source == threeButton)
27283121 {
27293122 radio.layout = threeButton;
3123
+
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
27303126
27313127 // bigThree.remove(scenePanel);
27323128 // bigThree.remove(centralPanel);
....@@ -2759,10 +3155,15 @@
27593155 bigThree.add(centralPanel);
27603156 bigThree.add(XYZPanel);
27613157 bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
27623160 } else
27633161 if (source == fourButton)
27643162 {
27653163 radio.layout = fourButton;
3164
+
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
27663167
27673168 // bigThree.remove(scenePanel);
27683169 // bigThree.remove(centralPanel);
....@@ -2794,10 +3195,15 @@
27943195 bigThree.ClearUI();
27953196 bigThree.add(scenePanel);
27963197 bigThree.FlushUI();
3198
+
3199
+ cameraView.requestFocusInWindow();
27973200 } else
27983201 if (source == sixButton)
27993202 {
28003203 radio.layout = sixButton;
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
28013207
28023208 // bigThree.remove(scenePanel);
28033209 // bigThree.remove(centralPanel);
....@@ -2830,10 +3236,15 @@
28303236 bigThree.add(scenePanel);
28313237 bigThree.add(centralPanel);
28323238 bigThree.FlushUI();
3239
+
3240
+ cameraView.requestFocusInWindow();
28333241 } else
28343242 if (source == sevenButton)
28353243 {
28363244 radio.layout = sevenButton;
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
28373248
28383249 // bigThree.remove(scenePanel);
28393250 // bigThree.remove(centralPanel);
....@@ -2867,6 +3278,8 @@
28673278 bigThree.add(centralPanel);
28683279 bigThree.add(XYZPanel);
28693280 bigThree.FlushUI();
3281
+
3282
+ cameraView.requestFocusInWindow();
28703283 } else
28713284 if (source == rootButton)
28723285 {
....@@ -2878,6 +3291,7 @@
28783291 EditObject(obj);
28793292 }
28803293
3294
+ cameraView.requestFocusInWindow();
28813295 refreshContents(true);
28823296 } else
28833297 if (source == closeButton)
....@@ -2887,18 +3301,27 @@
28873301 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
28883302 {
28893303 ab = (cRadio)e.nextElement();
2890
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3304
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28913305 {
3306
+ // Patch to avoid bug with transparency.
3307
+ if (!ab.hadMaterial)
3308
+ {
3309
+ ab.object.material = null;
3310
+ }
3311
+
28923312 buttonGroup.remove(ab);
28933313 radioPanel.remove(ab);
28943314
2895
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
28963317 // ab.GetObject().objectUI = null; // ?????????
28973318
28983319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28993320 break;
29003321 }
29013322 }
3323
+
3324
+ cameraView.requestFocusInWindow();
29023325 refreshContents(true);
29033326 } else
29043327 if (source == editItem || source == editButton)
....@@ -2915,9 +3338,9 @@
29153338 child.CloseUI();
29163339 listUI.remove(child);
29173340
2918
- child.editWindow = null; // ???????????
3341
+ //child.editWindow = null; // ???????????
29193342 }
2920
- objEditor.ctrlPanel.validate();
3343
+ objEditor.ctrlPanel.FlushUI();
29213344 //objEditor.jTree.clearSelection();
29223345 //objEditor.ResetSliders();
29233346 refreshContents(true);
....@@ -3001,7 +3424,11 @@
30013424 frontView.object = group;
30023425 sideView.object = group;
30033426 }
3004
- group.editWindow = this;
3427
+
3428
+// fix "+" issue
3429
+ //group.editWindow = this;
3430
+ group.manipWindow = this;
3431
+
30053432 /*
30063433 currentLayout = radio.layout;
30073434 if (currentLayout == null)
....@@ -3013,8 +3440,23 @@
30133440 //group.parent = null; // ROOT
30143441 //group.attributes = -1;
30153442 ResetModel();
3443
+
3444
+ cameraView.requestFocusInWindow();
30163445 refreshContents(true);
3017
- }
3446
+ } else if (event.getSource() == editCameraItem)
3447
+ {
3448
+ cameraView.ProtectCamera();
3449
+ cameraView.repaint();
3450
+ return;
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3452
+ {
3453
+ cameraView.RevertCamera();
3454
+ cameraView.repaint();
3455
+ return;
3456
+ // } else if (event.getSource() == textureButton)
3457
+ // {
3458
+ // return; // true;
3459
+ }
30183460 else
30193461 {
30203462 //return super.action(event, arg);
....@@ -3023,7 +3465,6 @@
30233465 }
30243466
30253467 boolean useclient = false;
3026
- cRadio radio;
30273468
30283469 void ToggleRoot()
30293470 {
....@@ -3075,6 +3516,28 @@
30753516 refreshContents();
30763517 }
30773518
3519
+ void TransformChildren()
3520
+ {
3521
+ Object3D obj;
3522
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3523
+ {
3524
+ obj = (Object3D)e.nextElement();
3525
+ obj.KeepTextureMatrices();
3526
+ obj.TransformChildren();
3527
+ obj.RestoreTextureMatrices();
3528
+
3529
+// if (obj.parent == null)
3530
+// {
3531
+// System.out.println("NULL PARENT!");
3532
+// new Exception().printStackTrace();
3533
+// }
3534
+// else
3535
+// TouchTransform(obj);
3536
+// //obj.parent.Touch();
3537
+ }
3538
+
3539
+ refreshContents();
3540
+ }
30783541
30793542 void ResetTransform()
30803543 {
....@@ -3187,7 +3650,7 @@
31873650 refreshContents();
31883651 }
31893652
3190
- void ResetCentroid()
3653
+ void ResetCentroid(boolean full)
31913654 {
31923655 Object3D obj;
31933656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3202,12 +3665,16 @@
32023665 LA.matIdentity(Object3D.mat);
32033666 obj.getBounds(minima, maxima, false);
32043667 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3205
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3668
+ if (full)
3669
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32063670 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32073671 obj.TransformMesh(Object3D.mat);
3672
+
32083673 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3209
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3674
+ if (full)
3675
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32103676 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3677
+
32113678 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32123679 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32133680 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3236,7 +3703,8 @@
32363703
32373704 int size = obj.MemorySize();
32383705
3239
- System.err.println((size/1024) + " KB is the size of " + obj);
3706
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3707
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32403708 }
32413709 }
32423710 catch (Exception e)
....@@ -3273,9 +3741,9 @@
32733741 obj = (Object3D)e.nextElement();
32743742
32753743 System.out.println("Object is: " + obj);
3276
- GrafreeD.AnalyzeObject(obj);
3744
+ Grafreed.AnalyzeObject(obj);
32773745 System.out.println("Boundary rep: " + obj.bRep);
3278
- GrafreeD.AnalyzeObject(obj.bRep);
3746
+ Grafreed.AnalyzeObject(obj.bRep);
32793747
32803748 // System.err.println((size/1024) + " KB is the size of " + obj);
32813749 }
....@@ -3317,6 +3785,13 @@
33173785 void GenNormals(boolean crease)
33183786 {
33193787 group.GenNormalsS(crease);
3788
+
3789
+ refreshContents();
3790
+ }
3791
+
3792
+ void GenNormalsMESH()
3793
+ {
3794
+ group.GenNormalsMeshS();
33203795
33213796 refreshContents();
33223797 }
....@@ -3489,8 +3964,8 @@
34893964
34903965 void ParseVertices()
34913966 {
3492
- boolean epsequal = GrafreeD.epsequal;
3493
- GrafreeD.epsequal = true;
3967
+ boolean epsequal = Grafreed.epsequal;
3968
+ Grafreed.epsequal = true;
34943969
34953970 for (int i=0; i<group.selection.size(); i++)
34963971 {
....@@ -3515,7 +3990,7 @@
35153990 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35163991 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35173992
3518
- g.add(GrafreeD.clipboard);
3993
+ g.add(Grafreed.clipboard);
35193994
35203995 buffer.add(g);
35213996 }
....@@ -3530,7 +4005,7 @@
35304005 makeSomething(buffer, i==group.selection.size()-1);
35314006 }
35324007
3533
- GrafreeD.epsequal = epsequal;
4008
+ Grafreed.epsequal = epsequal;
35344009
35354010 refreshContents();
35364011 }
....@@ -3548,7 +4023,16 @@
35484023 String pigment = Object3D.GetPigment(tex);
35494024 //String bump = Object3D.GetBump(tex);
35504025
3551
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4026
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4027
+
4028
+ try
4029
+ {
4030
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4031
+ }
4032
+ catch (Exception e)
4033
+ {
4034
+ System.err.println("FAIL: " + node);
4035
+ }
35524036
35534037 double s = v.s;
35544038
....@@ -3636,11 +4120,11 @@
36364120
36374121 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
36384122
3639
- boolean random = CameraPane.RANDOM;
3640
- CameraPane.RANDOM = false; // parse all random nodes
4123
+ boolean random = CameraPane.SWITCH;
4124
+ CameraPane.SWITCH = false; // parse all random nodes
36414125 lowres.linkVerticesThis(null);
36424126 lowres.linkVerticesThis(sn);
3643
- CameraPane.RANDOM = random;
4127
+ CameraPane.SWITCH = random;
36444128
36454129 System.err.flush();
36464130
....@@ -3680,7 +4164,7 @@
36804164 return;
36814165
36824166 Object3D poses = group.selection.get(0);
3683
- Object3D ref = GrafreeD.clipboard.get(0);
4167
+ Object3D ref = Grafreed.clipboard.get(0);
36844168
36854169 Object3D newgroup = new Object3D("Po:" + poses.name);
36864170
....@@ -3874,9 +4358,9 @@
38744358
38754359 void ClipMesh()
38764360 {
3877
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4361
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38784362 {
3879
- Object3D content = GrafreeD.clipboard.get(0);
4363
+ Object3D content = Grafreed.clipboard.get(0);
38804364
38814365 if (content instanceof cGroup && ((cGroup)content).transientlink )
38824366 content = ((cGroup)content).get(0);
....@@ -3885,7 +4369,7 @@
38854369 // {
38864370 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38874371 // }
3888
- group.selection.ClipMesh(GrafreeD.clipboard);
4372
+ group.selection.ClipMesh(Grafreed.clipboard);
38894373 }
38904374 // group.selection.ClipMesh(GrafreeD.clipboard);
38914375 System.out.println("DONE.");
....@@ -3932,6 +4416,18 @@
39324416 void MarkLeaves(boolean hide)
39334417 {
39344418 group.selection.MarkLeaves(hide);
4419
+ refreshContents();
4420
+ }
4421
+
4422
+ void RewindLeaves(boolean hide)
4423
+ {
4424
+ group.selection.RewindLeaves(hide);
4425
+ refreshContents();
4426
+ }
4427
+
4428
+ void RandomLeaves(boolean hide)
4429
+ {
4430
+ group.selection.RandomLeaves(hide);
39354431 refreshContents();
39364432 }
39374433
....@@ -4017,10 +4513,10 @@
40174513 {
40184514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40194515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4020
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40214517
40224518 Object3D elem = (Object3D)group.selection.elementAt(i);
4023
- if(elem != group)
4519
+ if(elem != group || !newWindow)
40244520 {
40254521 // if (!(elem instanceof Composite))
40264522 // newWindow = false;
....@@ -4110,7 +4606,6 @@
41104606 //case 702: // Event.LIST_DESELECT
41114607 group.deselectAll();
41124608 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4113
- objEditor.ClearInfo(); // .GetMaterial());
41144609 if (tps != null)
41154610 {
41164611 for (int i=0; i < tps.length; i++)
....@@ -4119,29 +4614,28 @@
41194614
41204615 //if (child.parent != null)
41214616 //child.parent.addSelectee(child);
4617
+ objEditor.SetMaterial(child);
41224618 group.addSelectee(child);
4123
- objEditor.SetMaterial(child); // .GetMaterial());
4124
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4125
- System.err.println("info : " + child.GetPath());
41264619 }
41274620 }
4128
- else
4129
- {
4130
- objEditor.SetMaterial(group); // .GetMaterial());
4131
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4132
- System.err.println("info : " + group.GetPath());
4133
- }
4621
+// else
4622
+// {
4623
+// objEditor.SetMaterial(group); // .GetMaterial());
4624
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4625
+// System.err.println("info : " + group.GetPath());
4626
+// }
41344627
4135
- objEditor.SetText(); // jan 2014
4136
-
4137
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4628
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41384629 CameraPane.flash = true;
41394630
4140
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4631
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41414632 // a camera
41424633 {
4143
- CameraPane.camerachangeframe = 0; // don't refuse it
4144
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4634
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4635
+ {
4636
+ CameraPane.camerachangeframe = 0; // don't refuse it
4637
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4638
+ }
41454639 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41464640 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41474641 }
....@@ -4154,6 +4648,27 @@
41544648
41554649 freezemodel = false;
41564650 }
4651
+
4652
+ void refreshContents(boolean cp)
4653
+ {
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4656
+ {
4657
+ objEditor.ClearInfo(); // .GetMaterial());
4658
+
4659
+ for (int i=0; i < group.selection.Size(); i++)
4660
+ {
4661
+ Object3D child = (Object3D) group.selection.get(i);
4662
+
4663
+ objEditor.AddInfo(child, this, true);
4664
+ System.err.println("info : " + child.GetPath());
4665
+ }
4666
+
4667
+ objEditor.SetText(); // jan 2014
4668
+ }
4669
+
4670
+ super.refreshContents(cp);
4671
+ }
41574672
41584673 void linkSomething(Object3D thing)
41594674 {
....@@ -4225,16 +4740,19 @@
42254740 {
42264741 if (group.selection.isEmpty())
42274742 return;
4228
- GrafreeD.clipboardIsTempGroup = false;
4743
+
4744
+ Grafreed.clipboardIsTempGroup = false;
42294745 Composite tGroup = null;
42304746 if (group.selection.size() > 0) // 1)
42314747 {
42324748 tGroup = new cGroup();
4233
- GrafreeD.clipboardIsTempGroup = true;
4749
+ Grafreed.clipboardIsTempGroup = true;
42344750 }
42354751
42364752 if (cut)
42374753 {
4754
+ if (Globals.SAVEONMAKE)
4755
+ Save();
42384756 //int indices[] = jList.getSelectedIndices();
42394757 //for (int i = indices.length - 1; i >= 0; i--)
42404758 //jList.remove(indices[i]);
....@@ -4270,16 +4788,16 @@
42704788 //System.out.println("cut " + child);
42714789 //System.out.println("parent = " + child.parent);
42724790 // tmp.addChild(child);
4273
- if (GrafreeD.clipboardIsTempGroup)
4791
+ if (Grafreed.clipboardIsTempGroup)
42744792 tGroup.add/*Child*/(tmp);
42754793 else
4276
- GrafreeD.clipboard = tmp;
4794
+ Grafreed.clipboard = tmp;
42774795 }
42784796 else
4279
- if (GrafreeD.clipboardIsTempGroup)
4797
+ if (Grafreed.clipboardIsTempGroup)
42804798 tGroup.add/*Child*/(child);
42814799 else
4282
- GrafreeD.clipboard = child;
4800
+ Grafreed.clipboard = child;
42834801 }
42844802
42854803 //ResetModel();
....@@ -4311,21 +4829,23 @@
43114829 //System.out.println("cut " + elem);
43124830 //System.out.println("parent = " + elem.parent);
43134831 // tmp.addChild(elem);
4314
- if (GrafreeD.clipboardIsTempGroup)
4832
+ if (Grafreed.clipboardIsTempGroup)
43154833 tGroup.add/*Child*/(tmp);
43164834 else
4317
- GrafreeD.clipboard = tmp;
4835
+ Grafreed.clipboard = tmp;
43184836 }
43194837 else
4320
- if (GrafreeD.clipboardIsTempGroup)
4838
+ if (Grafreed.clipboardIsTempGroup)
43214839 tGroup.add/*Child*/(child);
43224840 else
4323
- GrafreeD.clipboard = child;
4841
+ Grafreed.clipboard = child;
43244842 }
43254843
43264844 }
4327
- if (GrafreeD.clipboardIsTempGroup)
4328
- GrafreeD.clipboard = tGroup;
4845
+
4846
+ if (Grafreed.clipboardIsTempGroup)
4847
+ Grafreed.clipboard = tGroup;
4848
+
43294849 if (cut)
43304850 {
43314851 ResetModel();
....@@ -4339,7 +4859,7 @@
43394859 // return;
43404860 boolean first = true;
43414861
4342
- if (GrafreeD.clipboardIsTempGroup)
4862
+ if (Grafreed.clipboardIsTempGroup)
43434863 {
43444864 Composite temp;
43454865
....@@ -4350,7 +4870,7 @@
43504870 temp = (Composite)Applet3D.clipboard.deepCopy();
43514871 */
43524872 Object3D elem;
4353
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4873
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43544874 {
43554875 Object3D child = (Object3D)e.nextElement();
43564876
....@@ -4384,21 +4904,21 @@
43844904 //Object3D cb = Applet3D.clipboard;
43854905 //temp.addChild(cb);
43864906 //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());
4907
+ assert(Grafreed.clipboard.parent == null);
4908
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4909
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4910
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4911
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43924912 else
4393
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4394
- GrafreeD.clipboard.get(0).parent = keepparent;
4913
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4914
+ Grafreed.clipboard.get(0).parent = keepparent;
43954915 }
43964916
43974917 ResetModel();
43984918 refreshContents();
43994919 }
44004920
4401
- void pasteInto(boolean copyit)
4921
+ void pasteInto(boolean copyit, boolean clone)
44024922 {
44034923 // if (GrafreeD.clipboard == null)
44044924 // return;
....@@ -4427,15 +4947,22 @@
44274947 if (copyit)
44284948 {
44294949 // paste(false);
4430
- CloneClipboard(false); // sept 2014
4950
+ if (clone)
4951
+ {
4952
+ CloneClipboard(false); // sept 2014
4953
+ }
4954
+ else
4955
+ {
4956
+ paste(false);
4957
+ }
44314958 }
44324959 else
44334960 {
44344961 boolean first = true;
44354962
4436
- if (GrafreeD.clipboardIsTempGroup)
4963
+ if (Grafreed.clipboardIsTempGroup)
44374964 {
4438
- Composite temp = (Composite)GrafreeD.clipboard;
4965
+ Composite temp = (Composite)Grafreed.clipboard;
44394966 Object3D copy;
44404967 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44414968 {
....@@ -4445,7 +4972,7 @@
44454972 }
44464973 } else
44474974 {
4448
- linkSomething(GrafreeD.clipboard); //.get(0));
4975
+ linkSomething(Grafreed.clipboard); //.get(0));
44494976 }
44504977 }
44514978 }
....@@ -4850,21 +5377,6 @@
48505377 }
48515378 */
48525379
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
-
48685380 /*
48695381 public void Callback(Object obj)
48705382 {
....@@ -4888,26 +5400,9 @@
48885400 }
48895401 */
48905402
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
-
49085403 String GetFile(String dialogName)
49095404 {
4910
- if (GrafreeD.standAlone)
5405
+ if (Grafreed.standAlone)
49115406 {
49125407 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49135408 browser.show();
....@@ -4971,10 +5466,38 @@
49715466 cButton flashSelectionButton;
49725467 cButton editButton;
49735468 cButton uneditButton;
5469
+ JCheckBox allParamsButton;
49745470 cButton clearpanelButton;
4975
- cButton allParamsButton;
49765471 cButton unselectButton;
49775472
5473
+ cButton restoreCameraButton;
5474
+
5475
+ cButton minButton;
5476
+ cButton maxButton;
5477
+ cButton fullButton;
5478
+ cButton undoButton;
5479
+ cButton redoButton;
5480
+ cButton saveButton;
5481
+ cButton oneStepButton;
5482
+
5483
+ cButton groupButton;
5484
+ cButton ungroupButton;
5485
+ cButton compositeButton;
5486
+ cButton switchButton;
5487
+ cButton loopButton;
5488
+ cButton textureButton;
5489
+
5490
+ cButton gridButton;
5491
+ cButton boxButton;
5492
+ cButton sphereButton;
5493
+ cButton coneButton;
5494
+ cButton torusButton;
5495
+ cButton superButton;
5496
+ cButton kleinButton;
5497
+ cButton particlesButton;
5498
+ cButton overlayButton;
5499
+ cButton lightButton;
5500
+
49785501 cButton screenfitButton;
49795502 cButton screenfitpointButton;
49805503 cButton snapobjectButton;
....@@ -4986,14 +5509,6 @@
49865509
49875510 cButton setsupportButton;
49885511
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
-
49975512 //
49985513 //Composite
49995514 Object3D // to do !!
....@@ -5003,9 +5518,11 @@
50035518 //JTree jTree;
50045519 private MenuItem lookAtItem;
50055520 private MenuItem lookFromItem;
5006
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
50075522 private MenuItem cutItem;
5008
- private MenuItem duplicateItem;
5523
+ private MenuItem undoItem;
5524
+ private MenuItem redoItem;
5525
+ private JMenuItem duplicateItem;
50095526 private MenuItem cloneItem;
50105527 private MenuItem cloneSupportItem;
50115528 private MenuItem overwriteGeoItem;
....@@ -5018,7 +5535,7 @@
50185535 private MenuItem linkverticesItem;
50195536 private MenuItem relinkverticesItem;
50205537 private MenuItem setMasterItem;
5021
- private MenuItem resetMeshItem;
5538
+ private MenuItem resetAllItem;
50225539 private MenuItem stepAllItem;
50235540 private MenuItem revertMeshItem;
50245541 private MenuItem poseMeshItem;
....@@ -5029,6 +5546,7 @@
50295546 private MenuItem mergeGeometriesItem;
50305547 private MenuItem copyItem;
50315548 private MenuItem pasteItem;
5549
+ private MenuItem pasteIntoItem;
50325550 private MenuItem pasteLinkItem;
50335551 private MenuItem pasteCloneItem;
50345552 private MenuItem pasteExpandItem;
....@@ -5067,6 +5585,10 @@
50675585 private MenuItem showleavesItem;
50685586 private MenuItem markleavesItem;
50695587 private MenuItem unmarkleavesItem;
5588
+ private MenuItem rewindleavesItem;
5589
+ private MenuItem unrewindleavesItem;
5590
+ private MenuItem randomleavesItem;
5591
+ private MenuItem unrandomleavesItem;
50705592
50715593 private MenuItem flipVItem;
50725594 private MenuItem unflipVItem;
....@@ -5078,15 +5600,17 @@
50785600 private MenuItem panoTexturesItem;
50795601
50805602 private MenuItem resetCentroidItem;
5081
- private MenuItem transformgeometryItem;
5603
+ private MenuItem resetCentroidXZItem;
50825604 private MenuItem resetTransformItem;
5605
+ private MenuItem transformGeometryItem;
5606
+ private MenuItem transformChildrenItem;
50835607 private MenuItem hideItem;
50845608 private MenuItem grabItem;
50855609 private MenuItem backItem;
50865610 private MenuItem frontItem;
50875611 private MenuItem cameraItem;
50885612 private MenuItem compositeItem;
5089
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
50905614 private MenuItem physicsItem;
50915615 private MenuItem frameselectorItem;
50925616 private MenuItem scriptNodeItem;
....@@ -5126,7 +5650,7 @@
51265650 private MenuItem blobItem;
51275651 private MenuItem latheItem;
51285652 private MenuItem bezierItem;
5129
- private MenuItem checkerItem;
5653
+ private MenuItem overlayItem;
51305654 private MenuItem meshItem;
51315655 // private MenuItem meshGroupItem;
51325656 private MenuItem springItem;
....@@ -5148,11 +5672,6 @@
51485672 private MenuItem doubleItem;
51495673 private MenuItem tripleItem;
51505674
5151
- private MenuItem importGFDItem;
5152
- private MenuItem importVRMLX3DItem;
5153
- private MenuItem import3DSItem;
5154
- private MenuItem importOBJItem;
5155
-
51565675 private MenuItem computeAOItem;
51575676 private MenuItem recompileItem;
51585677 private MenuItem editScriptItem;
....@@ -5162,4 +5681,8 @@
51625681 private MenuItem analyzeItem;
51635682 private MenuItem dumpItem;
51645683 //boolean freezemodel = false;
5684
+
5685
+ Menu cameraMenu;
5686
+ MenuItem editCameraItem;
5687
+ MenuItem restoreCameraItem;
51655688 }