Normand Briere
2019-07-06 77633b188d01228383ced79c26b41ebb2989624c
GroupEditor.java
....@@ -12,9 +12,10 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
17
-class GroupEditor extends ObjEditor implements iParse, //iCallBack,
18
+class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
1819 ObjectUI,
1920 Runnable,
2021 ActionListener,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -83,7 +84,7 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
86
- // Object3D keep = GraphreeD.clipboard;
87
+ // Object3D keep = GrafreeD.clipboard;
8788 //Object3D obj;
8889 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8990 {
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.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));
105106 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,30 +148,29 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
153
+ oe.jTree = new cTree();
154
+
163155 Menu menu;
164156 oe.menuBar.add(menu = new Menu("Edit"));
165157 //editItem = menu.add(new MenuItem("Edit"));
166158 //editItem.addActionListener(this);
167
- 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"));
168166 duplicateItem.addActionListener(this);
169
- menu.add("-");
170167 cloneItem = menu.add(new MenuItem("Clone"));
171168 cloneItem.addActionListener(this);
169
+ if (Globals.ADVANCED)
170
+ {
172171 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173172 cloneSupportItem.addActionListener(this);
173
+ }
174174 menu.add("-");
175175 cutItem = menu.add(new MenuItem("Cut"));
176176 cutItem.addActionListener(this);
....@@ -178,26 +178,123 @@
178178 copyItem.addActionListener(this);
179179 pasteItem = menu.add(new MenuItem("Paste"));
180180 pasteItem.addActionListener(this);
181
+
182
+ menu.add("-");
183
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
184
+ pasteIntoItem.addActionListener(this);
181185 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182186 pasteLinkItem.addActionListener(this);
183187 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184188 pasteCloneItem.addActionListener(this);
185189 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186190 // pasteExpandItem.addActionListener(this);
191
+ menu.add("-");
187192 clearItem = menu.add(new MenuItem("Clear"));
188193 clearItem.addActionListener(this);
194
+
195
+ if (Globals.ADVANCED)
196
+ {
197
+ // Deletes the cameras...
189198 clearAllItem = menu.add(new MenuItem("Clear All"));
190199 clearAllItem.addActionListener(this);
191
- menu.add("-");
192
- resetMeshItem = menu.add(new MenuItem("Reset All"));
193
- resetMeshItem.addActionListener(this);
194
- stepAllItem = menu.add(new MenuItem("Step All"));
195
- stepAllItem.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("Show 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());
237
+
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
+
289
+ oe.menuBar.add(menu = new Menu("Setting"));
290
+ if (Globals.ADVANCED)
291
+ {
196292 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197293 revertMeshItem.addActionListener(this);
198294 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199295 resetreferencesItem.addActionListener(this);
200296 menu.add("-");
297
+ }
201298 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202299 overwriteGeoItem.addActionListener(this);
203300 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,72 +306,104 @@
209306 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210307 overwriteUVItem.addActionListener(this);
211308 menu.add("-");
309
+ if (Globals.ADVANCED)
310
+ {
212311 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213312 generateMeshItem.addActionListener(this);
214313 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215314 poseMeshItem.addActionListener(this);
216315 menu.add("-");
316
+ }
217317 resetsupportItem = menu.add(new MenuItem("Reset support"));
218318 resetsupportItem.addActionListener(this);
219319 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220320 linkverticesItem.addActionListener(this);
321
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
322
+ relinkverticesItem.addActionListener(this);
323
+
324
+ if (Globals.ADVANCED)
325
+ {
221326 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222327 setMasterItem.addActionListener(this);
328
+ }
223329
224
- oe.menuBar.add(menu = new Menu("Object"));
225
- grabItem = menu.add(new MenuItem("Grab"));
226
- grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
330
+ oe.menuBar.add(menu = new Menu("Group"));
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
229333 backItem = menu.add(new MenuItem("Back"));
230334 backItem.addActionListener(this);
231
- compositeItem = menu.add(new MenuItem("Composite"));
232
- compositeItem.addActionListener(this);
233
- menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
235
- randomItem.addActionListener(this);
236
- physicsItem = menu.add(new MenuItem("Physics"));
237
- physicsItem.addActionListener(this);
238
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
239
- frameselectorItem.addActionListener(this);
335
+ frontItem = menu.add(new MenuItem("Front"));
336
+ frontItem.addActionListener(this);
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"));
343
+ hideItem.addActionListener(this);
344
+ }
345
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
346
+ ungroupItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
240354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241355 switchGeoItem.addActionListener(this);
242356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243357 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
358
+ morphItem = menu.add(new MenuItem("Morph Group"));
245359 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);
246366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247367 scriptNodeItem.addActionListener(this);
248
- cameraItem = menu.add(new MenuItem("Camera"));
249
- cameraItem.addActionListener(this);
250
- menu.add("-");
251
- textureItem = menu.add(new MenuItem("Texture"));
252
- textureItem.addActionListener(this);
368
+ }
369
+
370
+ oe.menuBar.add(menu = new Menu("Object"));
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
373
+ billboardItem = menu.add(new MenuItem("Billboard"));
374
+ billboardItem.addActionListener(this);
253375 csgItem = menu.add(new MenuItem("CSG"));
254376 csgItem.addActionListener(this);
255
- shadowXItem = menu.add(new MenuItem("Shadow X"));
377
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
256378 shadowXItem.addActionListener(this);
257
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
379
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
258380 shadowYItem.addActionListener(this);
259
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
381
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
260382 shadowZItem.addActionListener(this);
383
+
384
+ if (Globals.ADVANCED)
385
+ {
386
+ menu.add("-");
261387 linkerItem = menu.add(new MenuItem("Linker"));
262388 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265389 attributeItem = menu.add(new MenuItem("Attribute"));
266390 attributeItem.addActionListener(this);
391
+ templateItem = menu.add(new MenuItem("Template"));
392
+ templateItem.addActionListener(this);
267393 pointflowItem = menu.add(new MenuItem("Point Flow"));
268394 pointflowItem.addActionListener(this);
395
+ }
269396 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272397 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273398 resetTransformItem.addActionListener(this);
274399 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275400 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
401
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
402
+ resetCentroidXZItem.addActionListener(this);
403
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
404
+ transformGeometryItem.addActionListener(this);
405
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
406
+ transformChildrenItem.addActionListener(this);
278407
279408 oe.menuBar.add(menu = new Menu("Geometry"));
280409 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +412,13 @@
283412 genNormalsORGANItem.addActionListener(this);
284413 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285414 genNormalsCADItem.addActionListener(this);
415
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
416
+ genNormalsMESHItem.addActionListener(this);
417
+ if (Globals.ADVANCED)
418
+ {
419
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
420
+ genNormalsMINEItem.addActionListener(this);
421
+ }
286422 stripifyItem = menu.add(new MenuItem("Stripify"));
287423 stripifyItem.addActionListener(this);
288424 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +428,6 @@
292428 untrimItem = menu.add(new MenuItem("Untrim"));
293429 untrimItem.addActionListener(this);
294430 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297431 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298432 clearColorsItem.addActionListener(this);
299433 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +440,34 @@
306440 reduce34MeshItem.addActionListener(this);
307441 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308442 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311443 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312444 clipMeshItem.addActionListener(this);
445
+
446
+ if (Globals.ADVANCED)
447
+ {
448
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
449
+ smoothMeshItem.addActionListener(this);
450
+ }
451
+
452
+ oe.menuBar.add(menu = new Menu("Attributes"));
453
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
454
+ clearMaterialsItem.addActionListener(this);
455
+ resetAllItem = menu.add(new MenuItem("Reset All"));
456
+ resetAllItem.addActionListener(this);
457
+ stepAllItem = menu.add(new MenuItem("Step All"));
458
+ stepAllItem.addActionListener(this);
313459 menu.add("-");
314460 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315461 liveleavesItem.addActionListener(this);
316462 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317463 unliveleavesItem.addActionListener(this);
464
+ if (Globals.ADVANCED)
465
+ {
318466 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319467 supportleavesItem.addActionListener(this);
320468 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321469 unsupportleavesItem.addActionListener(this);
470
+ }
322471 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323472 hideleavesItem.addActionListener(this);
324473 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +476,31 @@
327476 markleavesItem.addActionListener(this);
328477 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329478 unmarkleavesItem.addActionListener(this);
479
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
480
+ rewindleavesItem.addActionListener(this);
481
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
482
+ unrewindleavesItem.addActionListener(this);
483
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
484
+ randomleavesItem.addActionListener(this);
485
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
486
+ unrandomleavesItem.addActionListener(this);
330487 menu.add("-");
331488 flipVItem = menu.add(new MenuItem("Flip V"));
332489 flipVItem.addActionListener(this);
333490 unflipVItem = menu.add(new MenuItem("Unflip V"));
334491 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
492
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336493 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
494
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338495 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
496
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340497 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
498
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342499 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
500
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344501 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
502
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346503 panoTexturesItem.addActionListener(this);
347
- menu.add("-");
348
- extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
349
- extractGeometriesItem.addActionListener(this);
350
- cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
351
- cloneGeometriesItem.addActionListener(this);
352
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
353
- shareGeometriesItem.addActionListener(this);
354
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
355
- mergeGeometriesItem.addActionListener(this);
356504
357505 oe.menuBar.add(menu = new Menu("Selection"));
358506 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,14 +518,41 @@
370518 sortbysizeItem.addActionListener(this);
371519 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372520 sortbynameItem.addActionListener(this);
521
+ menu.add("-");
522
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
523
+ shareGeometriesItem.addActionListener(this);
524
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
525
+ mergeGeometriesItem.addActionListener(this);
526
+ if (Globals.ADVANCED)
527
+ {
528
+ // Pretty much the same as duplicate and clone.
529
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
530
+ extractGeometriesItem.addActionListener(this);
531
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
532
+ cloneGeometriesItem.addActionListener(this);
533
+ }
534
+
373535 oe.menuBar.add(menu = new Menu("Insert"));
374536 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
537
+
538
+ oe.menuBar.add(menu = new Menu("Tools"));
376539 buildToolsMenu(menu);
377540 }
378541
379542 void SetupUI2(ObjEditor oe)
380543 {
544
+ // June 2019
545
+ if (oe == null)
546
+ {
547
+ //super.SetupUI2(this);
548
+ //return;
549
+ }
550
+
551
+ if (copy != group)
552
+ {
553
+ //super.SetupUI2(this);
554
+ }
555
+
381556 //new Exception().printStackTrace();
382557
383558 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -406,150 +581,217 @@
406581 oe.radioPanel.add(dummyButton);
407582 oe.buttonGroup.add(dummyButton);
408583 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
584
+ cGridBag copyOptionsPanel = new cGridBag();
585
+
586
+ copyOptionsPanel.preferredHeight = 1;
412587
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
588
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
589
+
590
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591
+ //minButton.setToolTipText("Minimize window");
592
+ //minButton.addActionListener(this);
593
+
594
+ if (Globals.ADVANCED)
595
+ {
596
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ maxButton.setToolTipText("Maximize window");
598
+ maxButton.addActionListener(this);
599
+ }
600
+
601
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ fullButton.setToolTipText("Full-screen window");
603
+ fullButton.addActionListener(this);
604
+
605
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
+ screenfitButton.setToolTipText("Screen fit");
607
+ screenfitButton.addActionListener(this);
608
+
609
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
+ restoreCameraButton.setToolTipText("Restore viewpoint");
611
+ restoreCameraButton.addActionListener(this);
612
+
613
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
614
+ undoButton.setToolTipText("Undo changes");
615
+ undoButton.addActionListener(this);
616
+ undoButton.setEnabled(false);
617
+
618
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
619
+ redoButton.setToolTipText("Redo changes");
620
+ redoButton.addActionListener(this);
621
+ redoButton.setEnabled(false);
622
+
623
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ saveButton.setToolTipText("Save changes");
625
+ saveButton.addActionListener(this);
626
+
627
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
628
+ liveCB.setToolTipText("Enable animation");
414629 liveCB.addItemListener(this);
415630
416
- oe.aConstraints.gridx += 1;
417
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
418
- supportCB.addItemListener(this);
419
-
420
- // oe.aConstraints.gridx += 1;
421
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
422
- // localCB.addItemListener(this);
423
-
424
- oe.aConstraints.gridx += 1;
425
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
426
- crowdCB.addItemListener(this);
427
-
428
- oe.aConstraints.gridx += 1;
429
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
430
- smoothCB.addItemListener(this);
431
-
432
- oe.aConstraints.gridx += 1;
433
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
631
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ oneStepButton.setToolTipText("Animate one step forward");
633
+ oneStepButton.addActionListener(this);
634
+
635
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
636
+ fastCB.setToolTipText("Fast mode");
434637 fastCB.addItemListener(this);
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
437
- slowCB.addItemListener(this);
438
- oe.aConstraints.gridx += 1;
439
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
440
- boxCB.addItemListener(this);
638
+
639
+ //oe.toolboxPanel.Return();
640
+
641
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
642
+// trackCB.setToolTipText("Enable tracking");
643
+// trackCB.addItemListener(this);
441644
442
-// oe.aConstraints.gridx += 1;
443
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
444
-// speakerMocapCB.addItemListener(this);
445
-
446
- if (false)
447
- {
448
- // handled in scripts
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
451
- speakerCameraCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
455
- speakerFocusCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
459
- smoothfocusCB.addItemListener(this);
460
- }
461
-
462
-//oe.aConstraints.gridx += 1;
463
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
464
-// debugCB.addItemListener(this);
465
-
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
468
- oeilCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
472
- lookAtCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
476
- trackCB.addItemListener(this);
477
-
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
480
- screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
482645 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483646 // screenfitpointButton.addActionListener(this);
484
-// oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
486
- snapobjectButton.addActionListener(this);
487
- oe.aConstraints.gridx += 1;
488647
489
- //aConstraints.gridx = 0;
490
- //aConstraints.gridy += 1;
491
- oe.aConstraints.weighty = 0;
492
- oe.aConstraints.gridwidth = 1;
493
-
494
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
495
- flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
648
+ if (Globals.ADVANCED)
649
+ {
650
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ snapobjectButton.addActionListener(this);
652
+ snapobjectButton.setToolTipText("Snap Object");
653
+ }
654
+
655
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
499656
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ twoButton.setToolTipText("Show center view only");
502659 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
660
+ this.fullscreenLayout = twoButton;
661
+
662
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504663 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
664
+ fourButton.setToolTipText("Show left panel only");
665
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
666
+ sixButton.setToolTipText("2-column layout left");
506667 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
668
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
669
+ threeButton.setToolTipText("2-column layout right");
508670 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
671
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
672
+ sevenButton.setToolTipText("3-column layout");
510673 sevenButton.addActionListener(this);
511674 //
512675
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
677
+ rootButton.setToolTipText("Edit selection in new tab");
514678 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
679
+
680
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
681
+ closeButton.setToolTipText("Close tab");
517682 closeButton.addActionListener(this);
518683 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519684 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521
-
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
524
- editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528685
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
686
+ // INSERT
687
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ gridButton.setToolTipText("Create grid");
689
+ gridButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
692
+ boxButton.setToolTipText("Create box");
693
+ boxButton.addActionListener(this);
694
+
695
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ sphereButton.setToolTipText("Create sphere");
697
+ sphereButton.addActionListener(this);
698
+
699
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ coneButton.setToolTipText("Create cone");
701
+ coneButton.addActionListener(this);
702
+
703
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+ torusButton.setToolTipText("Create torus");
705
+ torusButton.addActionListener(this);
706
+
707
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ superButton.setToolTipText("Create superellipsoid");
709
+ superButton.addActionListener(this);
710
+
711
+ if (Globals.ADVANCED)
712
+ {
713
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
714
+ kleinButton.setToolTipText("Create Klein bottle");
715
+ kleinButton.addActionListener(this);
716
+ }
717
+
718
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ particlesButton.setToolTipText("Create particle system");
720
+ particlesButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.Return();
723
+
724
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ groupButton.setToolTipText("Create group");
726
+ groupButton.addActionListener(this);
727
+
728
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
+ compositeButton.setToolTipText("Create composite");
730
+ compositeButton.addActionListener(this);
731
+
732
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ switchButton.setToolTipText("Create item switcher");
734
+ switchButton.addActionListener(this);
735
+
736
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
737
+ loopButton.setToolTipText("Create loop");
738
+ loopButton.addActionListener(this);
739
+
740
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ textureButton.setToolTipText("Create texture");
742
+ textureButton.addActionListener(this);
743
+
744
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ overlayButton.setToolTipText("Create overlay");
746
+ overlayButton.addActionListener(this);
747
+
748
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
749
+ lightButton.setToolTipText("Create light");
750
+ lightButton.addActionListener(this);
751
+
752
+ for (int i=6; --i>=0;)
753
+ {
754
+ oe.toolboxPanel.Return();
755
+ oe.toolboxPanel.add(new cGridBag());
756
+ oe.toolboxPanel.add(new cGridBag());
757
+ oe.toolboxPanel.add(new cGridBag());
758
+ oe.toolboxPanel.add(new cGridBag());
759
+ oe.toolboxPanel.add(new cGridBag());
760
+ oe.toolboxPanel.add(new cGridBag());
761
+ oe.toolboxPanel.add(new cGridBag());
762
+ }
763
+
764
+ // EDIT panel
765
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ editButton.setToolTipText("Pin selection controls");
767
+ editButton.addActionListener(this);
768
+
769
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
770
+ uneditButton.setToolTipText("Remove selection controls");
530771 uneditButton.addActionListener(this);
531772
532
- oe.aConstraints.gridx += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
537
- clearPanelButton.addActionListener(this);
538
-
539
- oe.aConstraints.gridx += 1;
540
- oe.aConstraints.weighty = 0;
541
- oe.aConstraints.gridwidth = 1;
542
-
543
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
773
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
774
+ allParamsButton.setToolTipText("Show all controle");
544775 allParamsButton.addActionListener(this);
545776
546
- oe.aConstraints.gridx += 1;
547
- oe.aConstraints.weighty = 0;
548
- oe.aConstraints.gridwidth = 1;
549
-
550
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
777
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
778
+ clearPanelButton.setToolTipText("Clear edit panel");
779
+ clearPanelButton.addActionListener(this);
780
+
781
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ unselectButton.setToolTipText("Unselect");
551783 unselectButton.addActionListener(this);
552784
785
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
786
+ flashSelectionButton.setToolTipText("Highlight selection");
787
+ flashSelectionButton.addActionListener(this);
788
+
789
+ editCommandsPanel.preferredHeight = 1;
790
+
791
+ SetPinStates(false);
792
+// oe.treePanel.add(commandsPanel);
793
+// oe.treePanel.Return();
794
+
553795 // oe.aConstraints.gridx += 1;
554796 // oe.aConstraints.weighty = 0;
555797 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +803,22 @@
561803 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562804 // gcButton.addActionListener(this);
563805
564
- oe.aConstraints.gridx = 0;
565
- oe.aConstraints.gridy += 1;
566
-
567
- //ctrlPanel.add(objList = new List(5, true));
568
- oe.aConstraints.gridwidth = 100;
569
- // oe.aConstraints.gridheight = 100;
570
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
571
- oe.aConstraints.gridheight = 1;
572
- oe.aConstraints.weighty = 0.5;
573
- oe.aConstraints.gridx = 0;
574
- JScrollPane jSP;
806
+ cGridBag jSPPanel = new cGridBag();
807
+
808
+ JScrollPane jSP;
575809 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
576
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
810
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
577811 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
582
-
583
- oe.aConstraints.weighty = 0;
584
- oe.aConstraints.gridwidth = 2;
585
-
586
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
587
- colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
590
- materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
593
- textureCB.addItemListener(this);
594
-
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
597812
813
+ oe.treePanel.add(jSPPanel);
814
+ oe.treePanel.Return();
815
+
816
+ oe.treePanel.add(copyOptionsPanel);
817
+ oe.treePanel.Return();
818
+
819
+// mainPanel.setDividerLocation(0.5); //1.0);
820
+// mainPanel.setResizeWeight(0.5);
821
+
598822 //jList.addListSelectionListener(this);
599823 oe.jTree.addTreeSelectionListener(this);
600824 //jTree.setRootVisible(false);
....@@ -616,20 +840,157 @@
616840 radio.layout = sevenButton;
617841 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618842 }
843
+
844
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
845
+ {
846
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
847
+ colorCB.setToolTipText("Copy color when dropped");
848
+ colorCB.addItemListener(this);
849
+
850
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
851
+ materialCB.setToolTipText("Copy material when dropped");
852
+ materialCB.addItemListener(this);
853
+
854
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
855
+ textureCB.setToolTipText("Copy texture when dropped");
856
+ textureCB.addItemListener(this);
857
+
858
+ panel.Return();
859
+
860
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
861
+ boxCB.setToolTipText("Display bounding boxes");
862
+ boxCB.addItemListener(this);
863
+
864
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
865
+ zoomBoxCB.setToolTipText("Display only for wheel");
866
+ zoomBoxCB.addItemListener(this);
867
+
868
+ if (true) // Globals.ADVANCED)
869
+ {
870
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
871
+// supportCB.setToolTipText("Enable rigging");
872
+// supportCB.addItemListener(this);
873
+
874
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
875
+ freezeCB.setToolTipText("Fast moving camera");
876
+ freezeCB.addItemListener(this);
877
+
878
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
879
+ // localCB.addItemListener(this);
880
+
881
+ panel.Return();
882
+
883
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
884
+ crowdCB.setToolTipText("Used for crowds");
885
+ crowdCB.addItemListener(this);
886
+
887
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
888
+ smoothCB.setToolTipText("Snapping delay");
889
+ smoothCB.addItemListener(this);
890
+
891
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
892
+ slowCB.setToolTipText("Smooth interpolation");
893
+ slowCB.addItemListener(this);
894
+
895
+// constraints.gridy += 1;
896
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
897
+// speakerMocapCB.addItemListener(this);
898
+
899
+ panel.Return();
900
+
901
+ if (false)
902
+ {
903
+ // handled in scripts
904
+ //constraints.gridy += 1;
905
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
906
+ speakerCameraCB.addItemListener(this);
907
+
908
+ //constraints.gridy += 1;
909
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
910
+ speakerFocusCB.addItemListener(this);
911
+
912
+ //constraints.gridy += 1;
913
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
914
+ smoothfocusCB.addItemListener(this);
915
+ panel.Return();
916
+ }
917
+
918
+//constraints.gridx += 1;
919
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
920
+// debugCB.addItemListener(this);
921
+
922
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
923
+ trackCB.setToolTipText("Enable tracking target");
924
+ trackCB.addItemListener(this);
925
+
926
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
927
+ oeilCB.setToolTipText("Move camera when tracking");
928
+ oeilCB.addItemListener(this);
929
+
930
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
931
+ shadowCB.setToolTipText("When live compute shadows");
932
+ shadowCB.addItemListener(this);
933
+
934
+ panel.Return();
935
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
936
+ toggleTextureCB.setToolTipText("Load textures");
937
+ toggleTextureCB.addItemListener(this);
938
+
939
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
940
+ toggleSwitchCB.setToolTipText("Choose a single item");
941
+ toggleSwitchCB.addItemListener(this);
942
+
943
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
944
+ autosaveCB.setToolTipText("On structure change");
945
+ autosaveCB.addItemListener(this);
946
+
947
+ panel.Return();
948
+ if (Globals.ADVANCED)
949
+ {
950
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
951
+ lookAtCB.setToolTipText("Look-at target");
952
+ lookAtCB.addItemListener(this);
953
+ }
954
+
955
+ }
956
+
957
+ cGridBag fill = new cGridBag();
958
+ fill.preferredHeight = 200;
959
+ cGridBag fill2 = new cGridBag();
960
+ fill2.preferredHeight = 200;
961
+ cGridBag fill3 = new cGridBag();
962
+ fill3.preferredHeight = 200;
963
+
964
+ panel.add(fill);
965
+ panel.add(fill2);
966
+ panel.add(fill3);
967
+
968
+ }
619969
620970 void EditObject(Object3D obj)
621971 {
622
- cRadio dummyButton = new cRadio(obj.name);
623
- dummyButton.SetObject(obj);
624
- dummyButton.layout = sevenButton;
625
- dummyButton.SetCamera(cameraView.renderCamera, false);
626
- dummyButton.addActionListener(this);
627
- radioPanel.add(dummyButton);
628
- buttonGroup.add(dummyButton);
629
- dummyButton.doClick();
972
+ cRadio radioButton = new cRadio(obj.name);
973
+
974
+ // Patch to avoid bug with transparency.
975
+ radioButton.hadMaterial = obj.material != null;
976
+ if (!radioButton.hadMaterial)
977
+ {
978
+ obj.material = new cMaterial();
979
+ }
980
+
981
+ radioButton.SetObject(obj);
982
+ radioButton.layout = sevenButton;
983
+ radioButton.SetCamera(cameraView.renderCamera, false);
984
+ radioButton.addActionListener(this);
985
+ radioPanel.add(radioButton);
986
+ buttonGroup.add(radioButton);
987
+ radioButton.doClick();
630988 }
989
+
631990 void SetupViews(ObjEditor oe)
632991 {
992
+ theFrame = this;
993
+
633994 oe.SetupViews();
634995
635996 System.out.println("SetupViews");
....@@ -638,22 +999,28 @@
638999 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6391000 }
6401001
641
- JCheckBox liveCB;
642
- JCheckBox supportCB;
643
- JCheckBox localCB;
644
- JCheckBox crowdCB;
645
- JCheckBox smoothCB;
646
- JCheckBox fastCB;
647
- JCheckBox slowCB;
648
- JCheckBox boxCB;
649
- JCheckBox trackCB;
650
- JCheckBox smoothfocusCB;
1002
+ cToggleButton liveCB;
1003
+ cCheckBox supportCB;
1004
+ cCheckBox localCB;
1005
+ cCheckBox crowdCB;
1006
+ cCheckBox smoothCB;
1007
+ cToggleButton fastCB;
1008
+ cCheckBox slowCB;
1009
+ cCheckBox boxCB;
1010
+ cCheckBox zoomBoxCB;
1011
+ cCheckBox freezeCB;
1012
+ //cToggleButton trackCB;
1013
+ cCheckBox trackCB;
1014
+ cCheckBox smoothfocusCB;
6511015 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
1016
+ cCheckBox speakerCameraCB;
1017
+ cCheckBox speakerFocusCB;
1018
+ cCheckBox debugCB;
1019
+
1020
+ cCheckBox oeilCB;
1021
+ cCheckBox shadowCB;
1022
+ cCheckBox autosaveCB;
1023
+ cCheckBox lookAtCB;
6571024
6581025 // static int COLOR = 1;
6591026 // static int MATERIAL = 2;
....@@ -661,9 +1028,9 @@
6611028
6621029 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6631030
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
1031
+ cCheckBox colorCB;
1032
+ cCheckBox materialCB;
1033
+ cCheckBox textureCB;
6671034
6681035 public void itemStateChanged(ItemEvent e)
6691036 {
....@@ -688,10 +1055,10 @@
6881055 dropAttributes |= Object3D.TEXTURE;
6891056 else
6901057 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
1058
+ } else if(e.getSource() == liveCB)
6931059 {
6941060 cameraView.ToggleLive();
1061
+ refreshContents(false);
6951062 }
6961063 else if(e.getSource() == supportCB)
6971064 {
....@@ -727,6 +1094,10 @@
7271094 cameraView.repaint();
7281095 // refreshContents();
7291096 }
1097
+ else if(e.getSource() == zoomBoxCB)
1098
+ {
1099
+ cameraView.ToggleZoomBoxMode();
1100
+ }
7301101 else if(e.getSource() == smoothfocusCB)
7311102 {
7321103 cameraView.ToggleSmoothFocus();
....@@ -752,6 +1123,18 @@
7521123 {
7531124 cameraView.ToggleOeil();
7541125 }
1126
+ else if(e.getSource() == shadowCB)
1127
+ {
1128
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1129
+ }
1130
+ else if(e.getSource() == freezeCB)
1131
+ {
1132
+ Globals.FREEZEONMOVE ^= true;
1133
+ }
1134
+ else if(e.getSource() == autosaveCB)
1135
+ {
1136
+ Globals.SAVEONMAKE ^= true;
1137
+ }
7551138 else if(e.getSource() == lookAtCB)
7561139 {
7571140 cameraView.ToggleLookAt();
....@@ -768,7 +1151,8 @@
7681151
7691152 /**/
7701153 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1154
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1155
+ TreePath path = objEditor.jTree.getSelectionPath();
7721156 if ((path == null) || (path.getPathCount() <= 1)) {
7731157 // We can't move the root node or an empty selection
7741158 return;
....@@ -831,8 +1215,6 @@
8311215 }
8321216 }
8331217
834
- String string = (String) object;
835
-
8361218 System.out.println("Transfer = " + object + "; drop : " + target);
8371219 // if( object instanceof java.io.File[])
8381220 // {
....@@ -840,7 +1222,11 @@
8401222 // objEditor.DropFile((java.io.File[]) object, true);
8411223 // return;
8421224 // }
843
- if (string.charAt(0) == '/')
1225
+
1226
+ String string = (String) object;
1227
+
1228
+ // File path for Mac and Windows
1229
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441230 {
8451231 // file(s)
8461232 String[] names = string.split("\n");
....@@ -867,7 +1253,7 @@
8671253
8681254 flashIt = false;
8691255 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1256
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711257 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721258
8731259 if (group.selection.size() == 1)
....@@ -883,23 +1269,33 @@
8831269
8841270 assert target == objEditor.jTree;
8851271 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1272
+ Object3D destinationLeaf;
8861273 try {
887
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1274
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
8881275 } catch (Exception e) {
8891276 System.out.println("destinationPath : " + destinationPath);
8901277 return;
8911278 }
8921279
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1280
+ for (int i=group.selection.size(); --i>=0;)
8941281 {
1282
+ Object3D child = (Object3D)group.selection.elementAt(i);
1283
+
1284
+ // Cannot move into itself
1285
+ if (child == destinationLeaf)
1286
+ return;
1287
+ }
1288
+
1289
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1290
+// {
8951291 loadClipboard(true);
8961292 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1293
+ pasteInto(false, false);
1294
+// } else {
1295
+// loadClipboard(false);
1296
+// objEditor.jTree.setSelectionPath(destinationPath);
1297
+// pasteInto(false, false); // true); // ???
1298
+// }
9031299 }
9041300 public void dropActionChanged(DropTargetDragEvent dtde)
9051301 // Called if the user has modified the current drop gesture
....@@ -1002,90 +1398,109 @@
10021398
10031399 void buildCreateMenu(Menu menu)
10041400 {
1005
- gridItem = menu.add(new MenuItem("Grid"));
1006
- gridItem.addActionListener(this);
1007
- rectoidItem = menu.add(new MenuItem("Box"));
1008
- rectoidItem.addActionListener(this);
1009
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1010
- ellipsoidItem.addActionListener(this);
1011
- coneItem = menu.add(new MenuItem("Cone"));
1012
- coneItem.addActionListener(this);
1013
- torusItem = menu.add(new MenuItem("Torus"));
1014
- torusItem.addActionListener(this);
1015
- superItem = menu.add(new MenuItem("Superellipsoid"));
1016
- superItem.addActionListener(this);
1017
- particleItem = menu.add(new MenuItem("Particle system"));
1018
- particleItem.addActionListener(this);
1401
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1402
+ //heightFieldItem.addActionListener(this);
1403
+// gridItem = menu.add(new MenuItem("Grid"));
1404
+// gridItem.addActionListener(this);
1405
+// rectoidItem = menu.add(new MenuItem("Box"));
1406
+// rectoidItem.addActionListener(this);
1407
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1408
+// ellipsoidItem.addActionListener(this);
1409
+// coneItem = menu.add(new MenuItem("Cone"));
1410
+// coneItem.addActionListener(this);
1411
+// torusItem = menu.add(new MenuItem("Torus"));
1412
+// torusItem.addActionListener(this);
1413
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1414
+// superItem.addActionListener(this);
1415
+
1416
+ cameraItem = menu.add(new MenuItem("Camera"));
1417
+ cameraItem.addActionListener(this);
1418
+
1419
+ if (!Globals.ADVANCED)
1420
+ {
1421
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1422
+ kleinItem.addActionListener(this);
1423
+ }
1424
+
1425
+// particleItem = menu.add(new MenuItem("Particle system"));
1426
+// particleItem.addActionListener(this);
1427
+ if (Globals.ADVANCED)
1428
+ {
10191429 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201430 ragdollItem.addActionListener(this);
10211431 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221432 ragdoll2Item.addActionListener(this);
1433
+ }
10231434 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1435
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251436 meshItem.addActionListener(this);
10261437 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271438 // meshGroupItem.addActionListener(this);
1439
+ if (Globals.ADVANCED)
1440
+ {
10281441 springItem = menu.add(new MenuItem("Spring"));
10291442 springItem.addActionListener(this);
10301443 flagItem = menu.add(new MenuItem("Flag"));
10311444 flagItem.addActionListener(this);
1032
- bezierItem = menu.add(new MenuItem("Patch"));
1033
- bezierItem.addActionListener(this);
1034
- checkerItem = menu.add(new MenuItem("Checker"));
1035
- checkerItem.addActionListener(this);
10361445 blobItem = menu.add(new MenuItem("Blob"));
10371446 blobItem.addActionListener(this);
10381447 latheItem = menu.add(new MenuItem("Lathe"));
10391448 latheItem.addActionListener(this);
1040
- lightItem = menu.add(new MenuItem("Light"));
1041
- lightItem.addActionListener(this);
1449
+ }
1450
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1451
+ bezierItem.addActionListener(this);
1452
+// overlayItem = menu.add(new MenuItem("Overlay"));
1453
+// overlayItem.addActionListener(this);
1454
+// lightItem = menu.add(new MenuItem("Light"));
1455
+// lightItem.addActionListener(this);
10421456 menu.add("-");
10431457 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10441458 //superLoopItem.addActionListener(this);
1045
- loopItem = menu.add(new MenuItem("Loop"));
1046
- loopItem.addActionListener(this);
1459
+// loopItem = menu.add(new MenuItem("Loop"));
1460
+// loopItem.addActionListener(this);
10471461 doubleItem = menu.add(new MenuItem("Fork"));
10481462 doubleItem.addActionListener(this);
1463
+ if (Globals.ADVANCED)
1464
+ {
10491465 tripleItem = menu.add(new MenuItem("Trident"));
10501466 tripleItem.addActionListener(this);
1051
- menu.add("-");
1052
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
1053
- importGFDItem.addActionListener(this);
1054
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
1055
- importVRMLX3DItem.addActionListener(this);
1056
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
1057
- importOBJItem.addActionListener(this);
1058
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
1059
- import3DSItem.addActionListener(this);
1467
+ }
10601468 }
10611469
10621470 void buildToolsMenu(Menu menu)
10631471 {
10641472 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651473 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1474
+ animationItem.setState(Globals.ANIMATION);
1475
+
1476
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1477
+ archiveItem.addActionListener(this);
10671478
10681479 menu.add("-");
10691480 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701481 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1482
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1483
+ textureFieldItem.addActionListener(this);
1484
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721485 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751486 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761487 reduceMorphItem.addActionListener(this);
10771488 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781489 reduce34MorphItem.addActionListener(this);
1079
-
1490
+ menu.add("-");
10801491 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811492 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831493
1494
+ if (Globals.ADVANCED)
1495
+ {
1496
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1497
+ mirrorItem.addActionListener(this);
1498
+ menu.add("-");
10841499 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851500 memoryItem.addActionListener(this);
10861501 menu.add(analyzeItem = new MenuItem("Analyze"));
10871502 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1503
+ menu.add(dumpItem = new MenuItem("Print"));
10891504 dumpItem.addActionListener(this);
10901505 // menu.add(pathItem = new MenuItem("From-to path"));
10911506 // pathItem.addActionListener(this);
....@@ -1094,6 +1509,8 @@
10941509 resetParentItem.addActionListener(this);
10951510 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961511 repairParentItem.addActionListener(this);
1512
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1513
+ repairShadowItem.addActionListener(this);
10971514 menu.add(invariantsItem = new MenuItem("Invariants"));
10981515 invariantsItem.addActionListener(this);
10991516 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1518,7 @@
11011518 menu.add("-");
11021519 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031520 editScriptItem.addActionListener(this);
1521
+ }
11041522 }
11051523
11061524 void ScreenFit()
....@@ -1223,9 +1641,24 @@
12231641 shadow.material = new cMaterial(obj.material);
12241642 shadow.material.diffuse = 0.0001f;
12251643 shadow.material.specular = 0.0001f;
1644
+ //shadow.projectedVertices[1].x = 300;
12261645
12271646 makeSomething(shadow);
12281647 }
1648
+
1649
+ private void ClearUnpinned()
1650
+ {
1651
+ //for (Object3D obj : listUI)
1652
+ for (int i=listUI.size(); --i>=0;)
1653
+ {
1654
+ Object3D obj = listUI.elementAt(i);
1655
+ if (!obj.pinned)
1656
+ {
1657
+ obj.CloseUI();
1658
+ listUI.remove(i);
1659
+ }
1660
+ }
1661
+ }
12291662
12301663 /**
12311664 * applyExample
....@@ -1429,9 +1862,9 @@
14291862
14301863 void Overwrite(int mask)
14311864 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1865
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331866 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1867
+ Object3D content = Grafreed.clipboard.get(0);
14351868
14361869 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371870 content = ((cGroup)content).get(0);
....@@ -1454,6 +1887,7 @@
14541887 //
14551888 public void actionPerformed(ActionEvent event) // , Object arg)
14561889 {
1890
+ Object source = event.getSource();
14571891 /*
14581892 if (event.getSource() == nameField)
14591893 {
....@@ -1465,11 +1899,11 @@
14651899 }
14661900 else
14671901 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1902
+ if (source == lookAtItem || source == lookFromItem)
14691903 {
14701904 ScreenFit();
14711905 } else
1472
- if (event.getSource() == switchItem)
1906
+ if (source == switchViewItem)
14731907 {
14741908 cVector v1 = new cVector();
14751909 cVector v2 = new cVector();
....@@ -1478,11 +1912,11 @@
14781912 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791913 objEditor.cameraView.repaint();
14801914 } else
1481
- if (event.getSource() == rectoidItem)
1915
+ if (source == rectoidItem || source == boxButton)
14821916 {
14831917 makeSomething(new Box());
14841918 } else
1485
- if (event.getSource() == particleItem)
1919
+ if (source == particleItem || source == particlesButton)
14861920 {
14871921 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881922 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1937,9 @@
15031937 applyExample(particleGeom, "SMOKE");
15041938 makeSomething(particleGeom);
15051939 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1940
+ if (source == ragdollItem || source == ragdoll2Item)
15071941 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1942
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091943
15101944 ragdoll.toParent = LA.newMatrix();
15111945 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1955,71 @@
15211955 makeSomething(ragdoll);
15221956 //makeSomething(new VehicleDemo());
15231957 } else
1524
- if (event.getSource() == gridItem)
1958
+ /*
1959
+ */
1960
+ if (source == heightFieldItem)
1961
+ {
1962
+ Object3D obj = new Object3D();
1963
+
1964
+ obj.CreateMaterial();
1965
+ obj.bRep = new BoundaryRep();
1966
+
1967
+ obj.bRep.CreateMesh(new iHeightField()
1968
+ {
1969
+ public double f(double x, double y)
1970
+ {
1971
+ // The Mandelbrot set is represented by coloring
1972
+ // each point (x,y) according to the number of
1973
+ // iterations it takes before the while loop in
1974
+ // this method ends. For points that are actually
1975
+ // in the Mandelbrot set, or very close to it, the
1976
+ // count will reach the maximum value, 80. These
1977
+ // points will be colored purple. All other colors
1978
+ // represent points that are definitely NOT in the set.
1979
+ x -= 600;
1980
+ y -= 500;
1981
+ x /= 200;
1982
+ y /= 200;
1983
+ int count = 0;
1984
+ double zx = x;
1985
+ double zy = y;
1986
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1987
+ double new_zx = zx*zx - zy*zy + x;
1988
+ zy = 2*zx*zy + y;
1989
+ zx = new_zx;
1990
+ count++;
1991
+ }
1992
+ return count; // Math.sqrt(count);
1993
+ }
1994
+ }, 1000,1000);
1995
+
1996
+ makeSomething(obj);
1997
+ } else
1998
+ if (source == gridItem || source == gridButton)
15251999 {
15262000 makeSomething(new Grid());
15272001 } else
1528
- if (event.getSource() == ellipsoidItem)
2002
+ if (source == ellipsoidItem || source == sphereButton)
15292003 {
15302004 makeSomething(new Sphere());
15312005 } else
1532
- if (event.getSource() == coneItem)
2006
+ if (source == coneItem || source == coneButton)
15332007 {
15342008 makeSomething(new Cone());
15352009 } else
1536
- if (event.getSource() == torusItem)
2010
+ if (source == torusItem || source == torusButton)
15372011 {
15382012 makeSomething(new Torus());
15392013 } else
1540
- if (event.getSource() == superItem)
2014
+ if (source == superItem || source == superButton)
15412015 {
15422016 makeSomething(new Superellipsoid());
15432017 } else
1544
- if (event.getSource() == blobItem)
2018
+ if (source == kleinItem || source == kleinButton)
2019
+ {
2020
+ makeSomething(new Klein());
2021
+ } else
2022
+ if (source == blobItem)
15452023 {
15462024 Blob blob = new Blob();
15472025 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +2027,15 @@
15492027 //blob.retile();
15502028 makeSomething(blob);
15512029 } else
1552
- if (event.getSource() == latheItem)
2030
+ if (source == latheItem)
15532031 {
15542032 makeSomething(new Lathe());
15552033 } else
1556
- if (event.getSource() == bezierItem)
2034
+ if (source == bezierItem)
15572035 {
15582036 makeSomething(new BezierSurface());
15592037 } else
1560
- if (event.getSource() == checkerItem)
2038
+ if (source == overlayItem || source == overlayButton)
15612039 {
15622040 /*
15632041 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +2048,9 @@
15702048 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15712049 LA.matInvert(obj.toParent, obj.fromParent);
15722050 */
1573
- makeSomething(new CheckerIG());
2051
+ makeSomething(new Checker());
15742052 } else
1575
- if (event.getSource() == meshItem)
2053
+ if (source == meshItem)
15762054 {
15772055 Object3D itemtomake = new Object3D();
15782056 Object3D child;
....@@ -1593,35 +2071,35 @@
15932071 makeSomething(child);
15942072 }
15952073 } else
1596
- if (event.getSource() == springItem)
2074
+ if (source == springItem)
15972075 {
15982076 cSpring s = new cSpring();
15992077 s.setup();
16002078 makeSomething(s);
16012079 } else
1602
- if (event.getSource() == flagItem)
2080
+ if (source == flagItem)
16032081 {
16042082 cSpring s = new cFlag();
16052083 s.setup();
16062084 makeSomething(s);
16072085 } else
1608
- if (event.getSource() == lightItem)
2086
+ if (source == lightItem || source == lightButton)
16092087 {
16102088 makeSomething(new Light());
16112089 } else
1612
- if (event.getSource() == csgItem)
2090
+ if (source == csgItem)
16132091 {
16142092 group(new CSG());
16152093 } else
1616
- if (event.getSource() == templateItem)
2094
+ if (source == templateItem)
16172095 {
16182096 group(new cTemplate());
16192097 } else
1620
- if (event.getSource() == attributeItem)
2098
+ if (source == attributeItem)
16212099 {
16222100 makeSomething(new Attribute());
16232101 } else
1624
- if (event.getSource() == pointflowItem)
2102
+ if (source == pointflowItem)
16252103 {
16262104 makeSomething(new PointFlow());
16272105 } else
....@@ -1633,7 +2111,7 @@
16332111 } else
16342112 */
16352113
1636
- if (event.getSource() == superLoopItem)
2114
+ if (source == superLoopItem)
16372115 {
16382116 Composite g = new cGroup();
16392117 for (int i=0; i<15; i++)
....@@ -1655,30 +2133,30 @@
16552133
16562134 group(g);
16572135 } else
1658
- if (event.getSource() == loopItem)
2136
+ if (source == loopItem || source == loopButton)
16592137 {
16602138 Composite csg = new GroupLeaf();
16612139 csg.count = 5;
16622140 group(csg);
1663
- Composite child = new cGroup();
2141
+ Composite child = new cGroup("Branch");
16642142 csg.addChild(child);
16652143 child.addChild(csg);
16662144 } else
1667
- if (event.getSource() == doubleItem)
2145
+ if (source == doubleItem)
16682146 {
1669
- Composite csg = new GroupLeaf();
2147
+ Composite csg = new GroupLeaf("Fork");
16702148 csg.count = 5;
16712149 group(csg);
1672
- Composite child = new cGroup();
2150
+ Composite child = new cGroup("Branch A");
16732151 csg.addChild(child);
16742152 child.addChild(csg);
1675
- child = new cGroup();
2153
+ child = new cGroup("Branch B");
16762154 csg.addChild(child);
16772155 child.addChild(csg);
16782156 } else
1679
- if (event.getSource() == tripleItem)
2157
+ if (source == tripleItem)
16802158 {
1681
- Composite csg = new GroupLeaf();
2159
+ Composite csg = new GroupLeaf("Trident");
16822160 csg.count = 4;
16832161 group(csg);
16842162 Composite child = new cGroup();
....@@ -1691,73 +2169,84 @@
16912169 csg.addChild(child);
16922170 child.addChild(csg);
16932171 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2172
+ if (source == computeAOItem)
16962173 {
1697
- ImportGFD();
2174
+ Globals.drawMode = CameraPane.OCCLUSION;
2175
+ Globals.theRenderer.repaint();
16982176 } else
1699
- if (event.getSource() == importVRMLX3DItem)
1700
- {
1701
- ImportVRMLX3D();
1702
- } else
1703
- if (event.getSource() == import3DSItem)
1704
- {
1705
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1706
- } else
1707
- if (event.getSource() == importOBJItem)
1708
- {
1709
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1710
- } else
1711
- if (event.getSource() == computeAOItem)
1712
- {
1713
- CameraPane.drawMode = CameraPane.OCCLUSION;
1714
- CameraPane.theRenderer.repaint();
1715
- } else
1716
- if (event.getSource() == recompileItem)
2177
+ if (source == recompileItem)
17172178 {
17182179 Recompile();
17192180 refreshContents();
17202181 } else
1721
- if (event.getSource() == editScriptItem)
2182
+ if (source == editScriptItem)
17222183 {
17232184 OpenDialog();
17242185 refreshContents();
17252186 } else
1726
- if (event.getSource() == invariantsItem)
2187
+ if (source == invariantsItem)
17272188 {
17282189 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2190
+ Grafreed.grafreeD.universe.invariants();
17302191 } else
1731
- if (event.getSource() == memoryItem)
2192
+ if (source == memoryItem)
17322193 {
17332194 //System.out.println("Invariants:");
17342195 PrintMemory();
17352196 } else
1736
- if (event.getSource() == pathItem)
2197
+ if (source == pathItem)
17372198 {
17382199 PrintPath();
17392200 } else
1740
- if (event.getSource() == analyzeItem)
2201
+ if (source == analyzeItem)
17412202 {
17422203 AnalyzeObject();
17432204 } else
1744
- if (event.getSource() == dumpItem)
2205
+ if (source == dumpItem)
17452206 {
17462207 DumpObject();
17472208 } else
1748
- if (event.getSource() == screenfitButton)
2209
+ if (source == minButton)
17492210 {
1750
- //Reload(lastConverter, lastFilename, true);
2211
+ Minimize();
2212
+ } else
2213
+ if (source == maxButton)
2214
+ {
2215
+ Maximize();
2216
+ } else
2217
+ if (source == fullButton)
2218
+ {
2219
+ ToggleFullScreen();
2220
+ } else
2221
+ if (source == undoButton)
2222
+ {
2223
+ if (!Undo())
2224
+ java.awt.Toolkit.getDefaultToolkit().beep();
2225
+ } else
2226
+ if (source == redoButton)
2227
+ {
2228
+ Redo();
2229
+ } else
2230
+ if (source == saveButton)
2231
+ {
2232
+ if (!Save(true))
2233
+ java.awt.Toolkit.getDefaultToolkit().beep();
2234
+ } else
2235
+ if (source == oneStepButton)
2236
+ {
2237
+ Globals.ONESTEP = true;
2238
+ cameraView.repaint();
2239
+ } else
2240
+ if (source == screenfitButton)
2241
+ {
17512242 ScreenFit();
17522243 } else
1753
- if (event.getSource() == screenfitpointButton)
2244
+ if (source == screenfitpointButton)
17542245 {
1755
- //Reload(lastConverter, lastFilename, true);
17562246 ScreenFitPoint();
17572247 } else
1758
- if (event.getSource() == snapobjectButton)
2248
+ if (source == snapobjectButton)
17592249 {
1760
- //Reload(lastConverter, lastFilename, true);
17612250 SnapObject();
17622251 } else
17632252 // if (event.getSource() == recompileButton)
....@@ -1766,13 +2255,13 @@
17662255 // Recompile();
17672256 // refreshContents();
17682257 // } else
1769
- if (event.getSource() == gcButton)
2258
+ if (source == gcButton)
17702259 {
17712260 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722261 System.gc();
17732262 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742263 } else
1775
- if (event.getSource() == editLeafItem)
2264
+ if (source == editLeafItem)
17762265 {
17772266 Object3D obj;
17782267 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2275,78 @@
17862275 }
17872276 refreshContents(true);
17882277 } else
1789
- if (event.getSource() == openWindowItem)
2278
+ if (source == openWindowItem)
17902279 {
17912280 EditSelection(true);
17922281 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2282
+ if (source == cutItem || source == clearButton)
17942283 {
17952284 loadClipboard(true);
17962285 } else
1797
- if (event.getSource() == duplicateItem)
2286
+ if (source == undoItem)
17982287 {
1799
- Object3D keep = GraphreeD.clipboard;
2288
+ Undo();
2289
+ } else
2290
+ if (source == redoItem)
2291
+ {
2292
+ Redo();
2293
+ } else
2294
+ if (source == duplicateItem)
2295
+ {
2296
+ Object3D keep = Grafreed.clipboard;
18002297 loadClipboard(false);
18012298 paste(false);
1802
- GraphreeD.clipboard = keep;
2299
+ Grafreed.clipboard = keep;
18032300 } else
1804
- if (event.getSource() == cloneItem)
2301
+ if (source == cloneItem)
18052302 {
18062303 CloneSelection(false);
18072304 } else
1808
- if (event.getSource() == cloneSupportItem)
2305
+ if (source == cloneSupportItem)
18092306 {
18102307 CloneSelection(true);
18112308 } else
1812
- if (event.getSource() == copyItem)
2309
+ if (source == copyItem)
18132310 {
18142311 loadClipboard(false);
18152312 } else
1816
- if (event.getSource() == pasteItem)
2313
+ if (source == pasteItem)
18172314 {
18182315 paste(false);
18192316 } else
1820
- if (event.getSource() == pasteLinkItem)
2317
+ if (source == pasteIntoItem)
18212318 {
1822
- pasteInto(false);
2319
+ pasteInto(true, false);
18232320 } else
1824
- if (event.getSource() == pasteCloneItem)
2321
+ if (source == pasteLinkItem)
18252322 {
1826
- pasteInto(true);
2323
+ pasteInto(false, false);
18272324 } else
1828
- if (event.getSource() == pasteExpandItem)
2325
+ if (source == pasteCloneItem)
2326
+ {
2327
+ pasteInto(true, true);
2328
+ } else
2329
+ if (source == pasteExpandItem)
18292330 {
18302331 paste(true);
18312332 } else
1832
- if (event.getSource() == synchronizeItem)
2333
+ if (source == synchronizeItem)
18332334 {
18342335 Overwrite(Object3D.TRANSFORM);
18352336 } else
1836
- if (event.getSource() == overwriteNameItem)
2337
+ if (source == overwriteNameItem)
18372338 {
18382339 Overwrite(Object3D.NAME);
18392340 } else
1840
- if (event.getSource() == overwriteUVItem)
2341
+ if (source == overwriteUVItem)
18412342 {
18422343 Overwrite(Object3D.UV);
18432344 } else
1844
- if (event.getSource() == overwriteMatItem)
2345
+ if (source == overwriteMatItem)
18452346 {
2347
+ /* july 2015
18462348 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2349
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482350 else
18492351 {
18502352 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2358,16 @@
18562358 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572359 }
18582360 }
2361
+ */
2362
+
2363
+ Overwrite(dropAttributes);
18592364 }
1860
- if (event.getSource() == overwriteGeoItem)
2365
+ if (source == overwriteGeoItem)
18612366 {
18622367 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2368
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642369 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2370
+// Object3D content = GrafreeD.clipboard.get(0);
18662371 //
18672372 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682373 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2379,7 @@
18742379 // refreshContents();
18752380 // }
18762381 } else
1877
- if (event.getSource() == generateMeshItem)
2382
+ if (source == generateMeshItem)
18782383 {
18792384 //if (group.selection.size() == 1)
18802385 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2390,7 @@
18852390 ResetModel();
18862391 refreshContents();
18872392 } else
1888
- if (event.getSource() == extractGeometriesItem)
2393
+ if (source == extractGeometriesItem)
18892394 {
18902395 boolean one = false;
18912396
....@@ -1912,7 +2417,7 @@
19122417 ResetModel();
19132418 refreshContents();
19142419 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2420
+ if (source == cloneGeometriesItem)
19162421 {
19172422 boolean one = false;
19182423
....@@ -1938,32 +2443,37 @@
19382443 ResetModel();
19392444 refreshContents();
19402445 } else
1941
- if (event.getSource() == shareGeometriesItem)
2446
+ if (source == shareGeometriesItem)
19422447 {
19432448 boolean one = false;
19442449
19452450 if (group.selection.size() == 1)
19462451 one = true;
19472452
2453
+ Object3D merge = null;
2454
+
19482455 Object3D content = new cGroup();
19492456
19502457 for (int i=0; i<group.selection.size(); i++)
19512458 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2459
+ merge = new Merge(group.selection.get(i));
19532460
19542461 if (one)
1955
- makeSomething(sel, false);
2462
+ makeSomething(merge, false);
19562463 else
1957
- content.addChild(sel);
2464
+ content.addChild(merge);
19582465 }
19592466
19602467 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2468
+ makeSomething(content, true);
2469
+ else
2470
+ {
2471
+ ResetModel();
2472
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2473
+ refreshContents();
2474
+ }
19652475 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2476
+ if (source == mergeGeometriesItem)
19672477 {
19682478 boolean one = false;
19692479
....@@ -1993,11 +2503,11 @@
19932503 ResetModel();
19942504 refreshContents();
19952505 } else
1996
- if (event.getSource() == linkverticesItem)
2506
+ if (source == linkverticesItem)
19972507 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2508
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992509 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2510
+// Object3D content = GrafreeD.clipboard.get(0);
20012511 //
20022512 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032513 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2516,48 @@
20062516 // group.selection.get(0).setMasterThis(content); // should be identity
20072517 // refreshContents();
20082518 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2519
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102520 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2521
+ Object3D content = Grafreed.clipboard.get(0);
20122522
20132523 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142524 content = ((cGroup)content).get(0);
20152525
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2526
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172527 for (int i=0; i<group.selection.size(); i++)
20182528 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2529
+ boolean random = CameraPane.SWITCH;
2530
+ CameraPane.SWITCH = false; // parse all random nodes
20212531 group.selection.get(i).linkVerticesThis(content);
20222532 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2533
+ CameraPane.SWITCH = random;
20242534 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2535
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262536 refreshContents();
20272537 }
20282538 } else
2029
- if (event.getSource() == resetsupportItem)
2539
+ if (source == resetsupportItem)
20302540 {
20312541 for (int i=0; i<group.selection.size(); i++)
20322542 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2543
+ boolean random = CameraPane.SWITCH;
2544
+ CameraPane.SWITCH = false; // parse all random nodes
20352545 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2546
+ CameraPane.SWITCH = random;
20372547 }
20382548
20392549 refreshContents();
20402550 } else
2041
- if (event.getSource() == resetreferencesItem)
2551
+ if (source == relinkverticesItem)
2552
+ {
2553
+ boolean random = CameraPane.SWITCH;
2554
+ CameraPane.SWITCH = false; // parse all random nodes
2555
+ group.selection.RelinkToSupport();
2556
+ CameraPane.SWITCH = random;
2557
+
2558
+ refreshContents();
2559
+ } else
2560
+ if (source == resetreferencesItem)
20422561 {
20432562 for (int i=0; i<group.selection.size(); i++)
20442563 {
....@@ -2047,11 +2566,11 @@
20472566
20482567 refreshContents();
20492568 } else
2050
- if (event.getSource() == setMasterItem)
2569
+ if (source == setMasterItem)
20512570 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2571
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532572 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2573
+ Object3D content = Grafreed.clipboard.get(0);
20552574
20562575 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572576 content = ((cGroup)content).get(0);
....@@ -2060,13 +2579,13 @@
20602579 refreshContents();
20612580 }
20622581 } else
2063
- if (event.getSource() == poseMeshItem)
2582
+ if (source == poseMeshItem)
20642583 {
20652584 if (group.selection.size() == 1)
20662585 {
2067
- if (GraphreeD.clipboard.size() == 1)
2586
+ if (Grafreed.clipboard.size() == 1)
20682587 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2588
+ Object3D content = Grafreed.clipboard.get(0);
20702589
20712590 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722591 content = ((cGroup)content).get(0);
....@@ -2079,19 +2598,19 @@
20792598 }
20802599
20812600 } else
2082
- if (event.getSource() == revertMeshItem)
2601
+ if (source == revertMeshItem)
20832602 {
20842603 RevertMeshes();
20852604 } else
2086
- if (event.getSource() == resetMeshItem)
2605
+ if (source == resetAllItem)
20872606 {
20882607 ResetAll();
20892608 } else
2090
- if (event.getSource() == stepAllItem)
2609
+ if (source == stepAllItem)
20912610 {
20922611 StepAll();
20932612 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2613
+ if (source == clearItem) // || event.getSource() == clearButton)
20952614 {
20962615 //int indices[] = jList.getSelectedIndices();
20972616 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2618,46 @@
20992618
21002619 ClearSelection(false);
21012620 } else
2102
- if (event.getSource() == clearAllItem)
2621
+ if (source == clearAllItem)
21032622 {
21042623 ClearSelection(true);
21052624 } else
2106
- if (event.getSource() == grabItem)
2625
+ if (source == grabItem || source == groupButton)
21072626 {
2108
- group(new cGroup(), true);
2627
+ group(new cGroup(), false); // true);
21092628 } else
2110
- if (event.getSource() == frontItem)
2629
+ if (source == hideItem)
2630
+ {
2631
+ group(new HiddenObject());
2632
+ } else
2633
+ if (source == frontItem)
21112634 {
21122635 front();
21132636 } else
2114
- if (event.getSource() == backItem)
2637
+ if (source == backItem)
21152638 {
21162639 back();
21172640 } else
2118
- if (event.getSource() == cameraItem)
2641
+ if (source == cameraItem)
21192642 {
21202643 makeSomething(new Camera());
21212644 } else
2122
- if (event.getSource() == compositeItem)
2645
+ if (source == compositeItem || source == compositeButton)
21232646 {
21242647 group(new Composite());
21252648 } else
2126
- if (event.getSource() == randomItem)
2649
+ if (source == switchItem || source == switchButton)
21272650 {
21282651 RandomNode random = new RandomNode();
21292652 group(random);
21302653 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2654
+ random.name = random.get(0).name + "Switch";
21322655 } else
2133
- if (event.getSource() == physicsItem)
2656
+ if (source == physicsItem)
21342657 {
21352658 group(new PhysicsNode());
21362659 } else
2137
- if (event.getSource() == frameselectorItem)
2660
+ if (source == frameselectorItem)
21382661 {
21392662 for (int i=0; i<group.selection.size(); i++)
21402663 {
....@@ -2146,7 +2669,7 @@
21462669 ResetModel();
21472670 refreshContents();
21482671 } else
2149
- if (event.getSource() == switchGeoItem)
2672
+ if (source == switchGeoItem)
21502673 {
21512674 for (int i=0; i<group.selection.size(); i++)
21522675 {
....@@ -2158,7 +2681,7 @@
21582681 ResetModel();
21592682 refreshContents();
21602683 } else
2161
- if (event.getSource() == switchTransfoItem)
2684
+ if (source == switchTransfoItem)
21622685 {
21632686 for (int i=0; i<group.selection.size(); i++)
21642687 {
....@@ -2170,7 +2693,7 @@
21702693 ResetModel();
21712694 refreshContents();
21722695 } else
2173
- if (event.getSource() == morphItem)
2696
+ if (source == morphItem)
21742697 {
21752698 for (int i=0; i<group.selection.size(); i++)
21762699 {
....@@ -2182,7 +2705,7 @@
21822705 ResetModel();
21832706 refreshContents();
21842707 } else
2185
- if (event.getSource() == scriptNodeItem)
2708
+ if (source == scriptNodeItem)
21862709 {
21872710 boolean atleastone = false;
21882711
....@@ -2221,191 +2744,252 @@
22212744 }
22222745 }
22232746 } else
2224
- if (event.getSource() == linkerItem)
2747
+ if (source == linkerItem)
22252748 {
22262749 group(new cLinker());
22272750 } else
2228
- if (event.getSource() == textureItem)
2751
+ if (source == textureItem || source == textureButton)
22292752 {
22302753 group(new TextureNode());
22312754 } else
2232
- if (event.getSource() == shadowXItem)
2755
+ if (source == billboardItem)
2756
+ {
2757
+ group(new BillboardNode());
2758
+ } else
2759
+ if (source == shadowXItem)
22332760 {
22342761 CastShadow(0);
22352762 } else
2236
- if (event.getSource() == shadowYItem)
2763
+ if (source == shadowYItem)
22372764 {
22382765 CastShadow(1);
22392766 } else
2240
- if (event.getSource() == shadowZItem)
2767
+ if (source == shadowZItem)
22412768 {
22422769 CastShadow(2);
22432770 } else
2244
- if (event.getSource() == ungroupItem)
2771
+ if (source == ungroupItem || source == ungroupButton)
22452772 {
2246
- ungroup();
2773
+ boolean hasRoot = false;
2774
+
2775
+ for (int i=0; i<group.selection.size(); i++)
2776
+ {
2777
+ if (group.selection.get(i) == group)
2778
+ {
2779
+ hasRoot = true;
2780
+ break;
2781
+ }
2782
+ }
2783
+
2784
+ if (!hasRoot)
2785
+ {
2786
+ for (int i=0; i<group.selection.size(); i++)
2787
+ {
2788
+ Ungroup(group.selection.get(i));
2789
+ }
2790
+
2791
+ ClearSelection(false);
2792
+
2793
+ refreshContents();
2794
+ }
22472795 } else
2248
- if (event.getSource() == genUVItem)
2796
+ if (source == genUVItem)
22492797 {
22502798 GenUV();
22512799 } else
2252
- if (event.getSource() == genNormalsCADItem)
2800
+ if (source == genNormalsCADItem)
22532801 {
22542802 GenNormals(true);
22552803 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2804
+ if (source == genNormalsMESHItem)
2805
+ {
2806
+ GenNormalsMESH();
2807
+ } else
2808
+ if (source == genNormalsORGANItem)
22572809 {
22582810 GenNormals(false);
22592811 } else
2260
- if (event.getSource() == stripifyItem)
2812
+ if (source == genNormalsMINEItem)
2813
+ {
2814
+ GenNormalsMINE();
2815
+ } else
2816
+ if (source == stripifyItem)
22612817 {
22622818 Stripify();
22632819 } else
2264
- if (event.getSource() == unstripifyItem)
2820
+ if (source == unstripifyItem)
22652821 {
22662822 Unstripify();
22672823 } else
2268
- if (event.getSource() == trimItem)
2824
+ if (source == trimItem)
22692825 {
22702826 Trim();
22712827 } else
2272
- if (event.getSource() == untrimItem)
2828
+ if (source == untrimItem)
22732829 {
22742830 Untrim();
22752831 } else
2276
- if (event.getSource() == clearColorsItem)
2832
+ if (source == clearColorsItem)
22772833 {
22782834 ClearColors();
22792835 } else
2280
- if (event.getSource() == clearMaterialsItem)
2836
+ if (source == clearMaterialsItem)
22812837 {
22822838 ClearMaterials();
22832839 } else
2284
- if (event.getSource() == liveleavesItem)
2840
+ if (source == liveleavesItem)
22852841 {
22862842 LiveLeaves(true);
22872843 } else
2288
- if (event.getSource() == unliveleavesItem)
2844
+ if (source == unliveleavesItem)
22892845 {
22902846 LiveLeaves(false);
22912847 } else
2292
- if (event.getSource() == supportleavesItem)
2848
+ if (source == supportleavesItem)
22932849 {
22942850 SupportLeaves(true);
22952851 } else
2296
- if (event.getSource() == unsupportleavesItem)
2852
+ if (source == unsupportleavesItem)
22972853 {
22982854 SupportLeaves(false);
22992855 } else
2300
- if (event.getSource() == hideleavesItem)
2856
+ if (source == hideleavesItem)
23012857 {
23022858 HideLeaves(true);
23032859 } else
2304
- if (event.getSource() == showleavesItem)
2860
+ if (source == showleavesItem)
23052861 {
23062862 HideLeaves(false);
23072863 } else
2308
- if (event.getSource() == markleavesItem)
2864
+ if (source == markleavesItem)
23092865 {
23102866 MarkLeaves(true);
23112867 } else
2312
- if (event.getSource() == unmarkleavesItem)
2868
+ if (source == unmarkleavesItem)
23132869 {
23142870 MarkLeaves(false);
23152871 } else
2316
- if (event.getSource() == flipVItem)
2872
+ if (source == rewindleavesItem)
2873
+ {
2874
+ RewindLeaves(true);
2875
+ } else
2876
+ if (source == unrewindleavesItem)
2877
+ {
2878
+ RewindLeaves(false);
2879
+ } else
2880
+ if (source == randomleavesItem)
2881
+ {
2882
+ RandomLeaves(true);
2883
+ } else
2884
+ if (source == unrandomleavesItem)
2885
+ {
2886
+ RandomLeaves(false);
2887
+ } else
2888
+ if (source == flipVItem)
23172889 {
23182890 FlipV(true);
23192891 } else
2320
- if (event.getSource() == unflipVItem)
2892
+ if (source == unflipVItem)
23212893 {
23222894 FlipV(false);
23232895 } else
2324
- if (event.getSource() == lowTexturesItem)
2896
+ if (source == lowTexturesItem)
23252897 {
23262898 SetTexRes(0);
23272899 } else
2328
- if (event.getSource() == normalTexturesItem)
2900
+ if (source == normalTexturesItem)
23292901 {
23302902 SetTexRes(1);
23312903 } else
2332
- if (event.getSource() == highTexturesItem)
2904
+ if (source == highTexturesItem)
23332905 {
23342906 SetTexRes(2);
23352907 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2908
+ if (source == veryhighTexturesItem)
23372909 {
23382910 SetTexRes(3);
23392911 } else
2340
- if (event.getSource() == maxTexturesItem)
2912
+ if (source == maxTexturesItem)
23412913 {
23422914 SetTexRes(4);
23432915 } else
2344
- if (event.getSource() == panoTexturesItem)
2916
+ if (source == panoTexturesItem)
23452917 {
23462918 SetTexRes(5);
23472919 } else
2348
- if (event.getSource() == reverseNormalsItem)
2920
+ if (source == reverseNormalsItem)
23492921 {
23502922 ReverseNormals();
23512923 } else
2352
- if (event.getSource() == parseverticesItem)
2924
+ if (source == parseverticesItem)
23532925 {
23542926 ParseVertices();
23552927 } else
2356
- if (event.getSource() == alignItem)
2928
+ if (source == textureFieldItem)
2929
+ {
2930
+ TextureVertices();
2931
+ } else
2932
+ if (source == alignItem)
23572933 {
23582934 Align();
23592935 } else
2360
- if (event.getSource() == mirrorItem)
2936
+ if (source == mirrorItem)
23612937 {
23622938 MirrorPoses();
23632939 } else
2364
- if (event.getSource() == reduceMorphItem)
2940
+ if (source == reduceMorphItem)
23652941 {
23662942 MeshReduction(false);
23672943 } else
2368
- if (event.getSource() == reduce34MorphItem)
2944
+ if (source == reduce34MorphItem)
23692945 {
23702946 MeshReduction(true);
23712947 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2948
+ if (source == reverseTrianglesItem)
23732949 {
23742950 ReverseTriangles();
23752951 } else
2376
- if (event.getSource() == reduceMeshItem)
2952
+ if (source == reduceMeshItem)
23772953 {
23782954 ReduceMesh(false);
23792955 } else
2380
- if (event.getSource() == reduce34MeshItem)
2956
+ if (source == reduce34MeshItem)
23812957 {
23822958 ReduceMesh(true);
23832959 } else
2384
- if (event.getSource() == increaseMeshItem)
2960
+ if (source == increaseMeshItem)
23852961 {
23862962 IncreaseMesh();
23872963 } else
2388
- if (event.getSource() == clipMeshItem)
2964
+ if (source == clipMeshItem)
23892965 {
23902966 ClipMesh();
23912967 } else
2392
- if (event.getSource() == smoothMeshItem)
2968
+ if (source == smoothMeshItem)
23932969 {
23942970 SmoothMesh();
23952971 } else
2396
- if (event.getSource() == transformgeometryItem)
2972
+ if (source == transformGeometryItem)
23972973 {
23982974 TransformGeometry();
23992975 } else
2400
- if (event.getSource() == resetTransformItem)
2976
+ if (source == transformChildrenItem)
2977
+ {
2978
+ TransformChildren();
2979
+ } else
2980
+ if (source == resetTransformItem)
24012981 {
24022982 ResetTransform();
24032983 } else
2404
- if (event.getSource() == resetCentroidItem)
2984
+ if (source == resetCentroidItem)
24052985 {
2406
- ResetCentroid();
2986
+ ResetCentroid(true);
24072987 } else
2408
- if (event.getSource() == resetParentItem)
2988
+ if (source == resetCentroidXZItem)
2989
+ {
2990
+ ResetCentroid(false);
2991
+ } else
2992
+ if (source == resetParentItem)
24092993 {
24102994 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112995 {
....@@ -2415,7 +2999,7 @@
24152999
24163000 refreshContents();
24173001 } else
2418
- if (event.getSource() == repairParentItem)
3002
+ if (source == repairParentItem)
24193003 {
24203004 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24213005 {
....@@ -2429,7 +3013,21 @@
24293013
24303014 refreshContents();
24313015 } else
2432
- if (event.getSource() == sortbysizeItem)
3016
+ if (source == repairShadowItem)
3017
+ {
3018
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3019
+ {
3020
+ Object3D obj = (Object3D)e.nextElement();
3021
+ obj.RepairShadow();
3022
+// for (int i=0; i<obj.size(); i++)
3023
+// {
3024
+// obj.get(i).parent = obj;
3025
+// }
3026
+ }
3027
+
3028
+ refreshContents();
3029
+ } else
3030
+ if (source == sortbysizeItem)
24333031 {
24343032 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24353033 {
....@@ -2441,7 +3039,7 @@
24413039 ResetModel();
24423040 refreshContents();
24433041 } else
2444
- if (event.getSource() == sortbynameItem)
3042
+ if (source == sortbynameItem)
24453043 {
24463044 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24473045 {
....@@ -2453,7 +3051,7 @@
24533051 ResetModel();
24543052 refreshContents();
24553053 } else
2456
- if (event.getSource() == attachPigmentItem)
3054
+ if (source == attachPigmentItem)
24573055 {
24583056 String texture = GetFile("Attach pigment");
24593057 Object3D obj;
....@@ -2465,7 +3063,7 @@
24653063
24663064 refreshContents();
24673065 } else
2468
- if (event.getSource() == detachPigmentItem)
3066
+ if (source == detachPigmentItem)
24693067 {
24703068 Object3D obj;
24713069 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +3074,7 @@
24763074
24773075 refreshContents();
24783076 } else
2479
- if (event.getSource() == attachBumpItem)
3077
+ if (source == attachBumpItem)
24803078 {
24813079 String texture = GetFile("Attach bump");
24823080 Object3D obj;
....@@ -2488,7 +3086,7 @@
24883086
24893087 refreshContents();
24903088 } else
2491
- if (event.getSource() == detachBumpItem)
3089
+ if (source == detachBumpItem)
24923090 {
24933091 Object3D obj;
24943092 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +3097,7 @@
24993097
25003098 refreshContents();
25013099 } else
2502
- if (event.getSource() == pigmentBumpItem)
3100
+ if (source == pigmentBumpItem)
25033101 {
25043102 Object3D obj;
25053103 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +3108,237 @@
25103108
25113109 refreshContents();
25123110 } else
2513
- if (event.getSource() == flashSelectionButton)
3111
+ if (source == flashSelectionButton)
25143112 {
25153113 CameraPane.flash = true;
25163114 refreshContents();
25173115 } else
2518
- if (event.getSource() == oneButton)
3116
+ if (source == oneButton)
25193117 {
25203118 } else
2521
- if (event.getSource() == twoButton)
3119
+ if (source == twoButton)
25223120 {
25233121 radio.layout = twoButton;
3122
+
3123
+ if (CameraPane.FULLSCREEN)
3124
+ fullscreenLayout = radio.layout;
3125
+
25243126 // bug
25253127 //gridPanel.setDividerLocation(1.0);
25263128 //bigPanel.setDividerLocation(0.0);
2527
- bigThree.remove(jtp);
2528
- bigThree.remove(cameraPanel);
2529
- bigThree.remove(XYZPanel);
2530
- aWindowConstraints.gridx = 0;
2531
- aWindowConstraints.gridy = 0;
2532
- aWindowConstraints.gridwidth = 1;
2533
- // aConstraints.gridheight = 3;
2534
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2535
- aWindowConstraints.weightx = 0;
2536
- aWindowConstraints.weighty = 1;
2537
- //bigThree.add(jtp, aWindowConstraints);
2538
- aWindowConstraints.weightx = 1;
2539
- aWindowConstraints.gridwidth = 3;
2540
- // aConstraints.gridheight = 3;
2541
- aWindowConstraints.gridx = 1;
2542
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2543
- bigThree.add(cameraPanel, aWindowConstraints);
2544
- aWindowConstraints.weightx = 0;
2545
- aWindowConstraints.gridx = 4;
2546
- aWindowConstraints.gridwidth = 1;
2547
- // aConstraints.gridheight = 3;
2548
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2549
- //bigThree.add(XYZPanel, aWindowConstraints);
2550
- bigThree.revalidate();
3129
+// bigThree.remove(scenePanel);
3130
+// bigThree.remove(centralPanel);
3131
+// bigThree.remove(XYZPanel);
3132
+// aWindowConstraints.gridx = 0;
3133
+// aWindowConstraints.gridy = 0;
3134
+// aWindowConstraints.gridwidth = 1;
3135
+// // aConstraints.gridheight = 3;
3136
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3137
+// aWindowConstraints.weightx = 0;
3138
+// aWindowConstraints.weighty = 1;
3139
+// //bigThree.add(jtp, aWindowConstraints);
3140
+// aWindowConstraints.weightx = 1;
3141
+// aWindowConstraints.gridwidth = 3;
3142
+// // aConstraints.gridheight = 3;
3143
+// aWindowConstraints.gridx = 1;
3144
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3145
+// bigThree.add(centralPanel, aWindowConstraints);
3146
+// aWindowConstraints.weightx = 0;
3147
+// aWindowConstraints.gridx = 4;
3148
+// aWindowConstraints.gridwidth = 1;
3149
+// // aConstraints.gridheight = 3;
3150
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3151
+// //bigThree.add(XYZPanel, aWindowConstraints);
3152
+// scenePanel.setVisible(false);
3153
+// centralPanel.setVisible(true);
3154
+// XYZPanel.setVisible(false);
3155
+ bigThree.ClearUI();
3156
+ bigThree.add(centralPanel);
3157
+ bigThree.FlushUI();
3158
+
3159
+ cameraView.requestFocusInWindow();
3160
+
3161
+// refreshContents(true);
3162
+//
3163
+// try
3164
+// {
3165
+// java.awt.Robot bot = new java.awt.Robot();
3166
+// int mask = InputEvent.BUTTON1_MASK;
3167
+// bot.mouseMove(100, 100);
3168
+// bot.mousePress(mask);
3169
+// bot.mouseRelease(mask);
3170
+// }
3171
+// catch (Exception e)
3172
+// {
3173
+//
3174
+// }
3175
+
25513176 } else
2552
- if (event.getSource() == threeButton)
3177
+ if (source == threeButton)
25533178 {
25543179 radio.layout = threeButton;
2555
- bigThree.remove(jtp);
2556
- bigThree.remove(cameraPanel);
2557
- bigThree.remove(XYZPanel);
2558
- aWindowConstraints.gridx = 0;
2559
- aWindowConstraints.gridy = 0;
2560
- aWindowConstraints.gridwidth = 1;
2561
- // aConstraints.gridheight = 3;
2562
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2563
- aWindowConstraints.weightx = 0;
2564
- aWindowConstraints.weighty = 1;
2565
- //bigThree.add(jtp, aWindowConstraints);
2566
- aWindowConstraints.weightx = 1;
2567
- aWindowConstraints.gridwidth = 3;
2568
- // aConstraints.gridheight = 3;
2569
- aWindowConstraints.gridx = 1;
2570
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2571
- bigThree.add(cameraPanel, aWindowConstraints);
2572
- aWindowConstraints.weightx = 0;
2573
- aWindowConstraints.gridx = 4;
2574
- aWindowConstraints.gridwidth = 1;
2575
- // aConstraints.gridheight = 3;
2576
- aConstraints.fill = GridBagConstraints.VERTICAL;
2577
- bigThree.add(XYZPanel, aWindowConstraints);
2578
- bigThree.revalidate();
3180
+
3181
+ if (CameraPane.FULLSCREEN)
3182
+ fullscreenLayout = radio.layout;
3183
+
3184
+// bigThree.remove(scenePanel);
3185
+// bigThree.remove(centralPanel);
3186
+// bigThree.remove(XYZPanel);
3187
+// aWindowConstraints.gridx = 0;
3188
+// aWindowConstraints.gridy = 0;
3189
+// aWindowConstraints.gridwidth = 1;
3190
+// // aConstraints.gridheight = 3;
3191
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3192
+// aWindowConstraints.weightx = 0;
3193
+// aWindowConstraints.weighty = 1;
3194
+// //bigThree.add(jtp, aWindowConstraints);
3195
+// aWindowConstraints.weightx = 1;
3196
+// aWindowConstraints.gridwidth = 3;
3197
+// // aConstraints.gridheight = 3;
3198
+// aWindowConstraints.gridx = 1;
3199
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3200
+// bigThree.add(centralPanel, aWindowConstraints);
3201
+// aWindowConstraints.weightx = 0;
3202
+// aWindowConstraints.gridx = 4;
3203
+// aWindowConstraints.gridwidth = 1;
3204
+// // aConstraints.gridheight = 3;
3205
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3206
+// bigThree.add(XYZPanel, aWindowConstraints);
3207
+// bigThree.validate();
3208
+// scenePanel.setVisible(false);
3209
+// centralPanel.setVisible(true);
3210
+// XYZPanel.setVisible(true);
3211
+ bigThree.ClearUI();
3212
+ bigThree.add(centralPanel);
3213
+ bigThree.add(XYZPanel);
3214
+ bigThree.FlushUI();
3215
+
3216
+ cameraView.requestFocusInWindow();
25793217 } else
2580
- if (event.getSource() == fourButton)
3218
+ if (source == fourButton)
25813219 {
25823220 radio.layout = fourButton;
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aWindowConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2591
- aWindowConstraints.weightx = 1;
2592
- aWindowConstraints.weighty = 1;
2593
- bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- //bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aWindowConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
3221
+
3222
+ if (CameraPane.FULLSCREEN)
3223
+ fullscreenLayout = radio.layout;
3224
+
3225
+// bigThree.remove(scenePanel);
3226
+// bigThree.remove(centralPanel);
3227
+// bigThree.remove(XYZPanel);
3228
+// aWindowConstraints.gridx = 0;
3229
+// aWindowConstraints.gridy = 0;
3230
+// aWindowConstraints.gridwidth = 1;
3231
+// // aWindowConstraints.gridheight = 3;
3232
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3233
+// aWindowConstraints.weightx = 1;
3234
+// aWindowConstraints.weighty = 1;
3235
+// bigThree.add(scenePanel, aWindowConstraints);
3236
+// aWindowConstraints.weightx = 1;
3237
+// aWindowConstraints.gridwidth = 3;
3238
+// // aConstraints.gridheight = 3;
3239
+// aWindowConstraints.gridx = 1;
3240
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3241
+// //bigThree.add(cameraPanel, aWindowConstraints);
3242
+// aWindowConstraints.weightx = 0;
3243
+// aWindowConstraints.gridx = 4;
3244
+// aWindowConstraints.gridwidth = 1;
3245
+// // aWindowConstraints.gridheight = 3;
3246
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3247
+// //bigThree.add(XYZPanel, aWindowConstraints);
3248
+// bigThree.validate();
3249
+// scenePanel.setVisible(true);
3250
+// centralPanel.setVisible(false);
3251
+// XYZPanel.setVisible(false);
3252
+ bigThree.ClearUI();
3253
+ bigThree.add(scenePanel);
3254
+ bigThree.FlushUI();
3255
+
3256
+ cameraView.requestFocusInWindow();
26073257 } else
2608
- if (event.getSource() == sixButton)
3258
+ if (source == sixButton)
26093259 {
26103260 radio.layout = sixButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aWindowConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aWindowConstraints.gridheight = 3;
2632
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2633
- //bigThree.add(XYZPanel, aConstraints);
2634
- bigThree.revalidate();
3261
+
3262
+ if (CameraPane.FULLSCREEN)
3263
+ fullscreenLayout = radio.layout;
3264
+
3265
+// bigThree.remove(scenePanel);
3266
+// bigThree.remove(centralPanel);
3267
+// bigThree.remove(XYZPanel);
3268
+// aWindowConstraints.gridx = 0;
3269
+// aWindowConstraints.gridy = 0;
3270
+// aWindowConstraints.gridwidth = 1;
3271
+// // aConstraints.gridheight = 3;
3272
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3273
+// aWindowConstraints.weightx = 0;
3274
+// aWindowConstraints.weighty = 1;
3275
+// bigThree.add(scenePanel, aWindowConstraints);
3276
+// aWindowConstraints.weightx = 1;
3277
+// aWindowConstraints.gridwidth = 3;
3278
+// // aWindowConstraints.gridheight = 3;
3279
+// aWindowConstraints.gridx = 1;
3280
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3281
+// bigThree.add(centralPanel, aWindowConstraints);
3282
+// aWindowConstraints.weightx = 0;
3283
+// aWindowConstraints.gridx = 4;
3284
+// aWindowConstraints.gridwidth = 1;
3285
+// // aWindowConstraints.gridheight = 3;
3286
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3287
+// //bigThree.add(XYZPanel, aConstraints);
3288
+// bigThree.validate();
3289
+// scenePanel.setVisible(true);
3290
+// centralPanel.setVisible(true);
3291
+// XYZPanel.setVisible(false);
3292
+ bigThree.ClearUI();
3293
+ bigThree.add(scenePanel);
3294
+ bigThree.add(centralPanel);
3295
+ bigThree.FlushUI();
3296
+
3297
+ cameraView.requestFocusInWindow();
26353298 } else
2636
- if (event.getSource() == sevenButton)
3299
+ if (source == sevenButton)
26373300 {
26383301 radio.layout = sevenButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2647
- aWindowConstraints.weightx = 0;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aWindowConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3302
+
3303
+ if (CameraPane.FULLSCREEN)
3304
+ fullscreenLayout = radio.layout;
3305
+
3306
+// bigThree.remove(scenePanel);
3307
+// bigThree.remove(centralPanel);
3308
+// bigThree.remove(XYZPanel);
3309
+// aWindowConstraints.gridx = 0;
3310
+// aWindowConstraints.gridy = 0;
3311
+// aWindowConstraints.gridwidth = 1;
3312
+// // aWindowConstraints.gridheight = 3;
3313
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3314
+// aWindowConstraints.weightx = 0;
3315
+// aWindowConstraints.weighty = 1;
3316
+// bigThree.add(scenePanel, aWindowConstraints);
3317
+// aWindowConstraints.weightx = 1;
3318
+// aWindowConstraints.gridwidth = 3;
3319
+// // aWindowConstraints.gridheight = 3;
3320
+// aWindowConstraints.gridx = 1;
3321
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3322
+// bigThree.add(centralPanel, aWindowConstraints);
3323
+// aWindowConstraints.weightx = 0;
3324
+// aWindowConstraints.gridx = 4;
3325
+// aWindowConstraints.gridwidth = 1;
3326
+// // aConstraints.gridheight = 3;
3327
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3328
+// bigThree.add(XYZPanel, aWindowConstraints);
3329
+// bigThree.validate();
3330
+// scenePanel.setVisible(true);
3331
+// centralPanel.setVisible(true);
3332
+// XYZPanel.setVisible(true);
3333
+ bigThree.ClearUI();
3334
+ bigThree.add(scenePanel);
3335
+ bigThree.add(centralPanel);
3336
+ bigThree.add(XYZPanel);
3337
+ bigThree.FlushUI();
3338
+
3339
+ cameraView.requestFocusInWindow();
26633340 } else
2664
- if (event.getSource() == rootButton)
3341
+ if (source == rootButton)
26653342 {
26663343 Object3D obj;
26673344 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,66 +3348,84 @@
26713348 EditObject(obj);
26723349 }
26733350
3351
+ cameraView.requestFocusInWindow();
26743352 refreshContents(true);
26753353 } else
2676
- if (event.getSource() == closeButton)
3354
+ if (source == closeButton)
26773355 {
26783356 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793357 cRadio ab;
26803358 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813359 {
26823360 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3361
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843362 {
3363
+ // Patch to avoid bug with transparency.
3364
+ if (!ab.hadMaterial)
3365
+ {
3366
+ ab.object.material = null;
3367
+ }
3368
+
26853369 buttonGroup.remove(ab);
26863370 radioPanel.remove(ab);
26873371
2688
- ab.GetObject().editWindow = null;
3372
+ //ab.GetObject().editWindow = null;
3373
+ ab.GetObject().manipWindow = null;
26893374 // ab.GetObject().objectUI = null; // ?????????
26903375
26913376 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923377 break;
26933378 }
26943379 }
3380
+
3381
+ cameraView.requestFocusInWindow();
26953382 refreshContents(true);
26963383 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3384
+ if (source == editItem || source == editButton)
26983385 {
3386
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3387
+ {
3388
+ Object3D child = (Object3D)e.nextElement();
3389
+ child.pinned = true;
3390
+ }
3391
+
26993392 EditSelection(false);
27003393 } else
2701
- if (event.getSource() == uneditButton)
3394
+ if (source == uneditButton)
27023395 {
27033396 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043397 {
27053398 Object3D child = (Object3D)e.nextElement();
27063399 if(child.editWindow != null)
27073400 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3401
+ child.pinned = false;
27083402 child.CloseUI();
27093403 listUI.remove(child);
27103404
2711
- child.editWindow = null; // ???????????
3405
+ //child.editWindow = null; // ???????????
27123406 }
2713
- objEditor.ctrlPanel.revalidate();
3407
+ objEditor.ctrlPanel.FlushUI();
27143408 //objEditor.jTree.clearSelection();
27153409 //objEditor.ResetSliders();
27163410 refreshContents(true);
27173411 } else
2718
- if (event.getSource() == clearPanelButton)
3412
+ if (source == clearPanelButton)
27193413 {
27203414 assert(copy == group);
27213415 //copy.ClearUI();
27223416 for (Object3D obj : listUI)
27233417 {
3418
+ obj.pinned = false;
27243419 obj.CloseUI();
27253420 }
27263421 listUI.clear();
27273422 refreshContents(true);
27283423 } else
2729
- if (event.getSource() == allParamsButton)
3424
+ if (source == allParamsButton)
27303425 {
27313426 assert(copy == group);
27323427
2733
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3428
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27343429
27353430 for (Object3D obj : listUI)
27363431 {
....@@ -2747,19 +3442,19 @@
27473442
27483443 refreshContents(true);
27493444 } else
2750
- if (event.getSource() == unselectButton)
3445
+ if (source == unselectButton)
27513446 {
27523447 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3448
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543449 objEditor.ResetSliders();
27553450 refreshContents(true);
27563451 } else
2757
- if(event.getSource() instanceof cRadio)
3452
+ if(source instanceof cRadio)
27583453 {
27593454 group.parent = keepparent;
27603455 group.attributes = 0;
27613456 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3457
+ /*cRadio*/ radio = (cRadio)source;
27633458 Object3D obj = radio.GetObject();
27643459 System.out.println("Edit " + obj);
27653460 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3474,7 @@
27793474 }
27803475
27813476 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3477
+ //Globals.theRenderer.object = group;
27833478 if(!useclient)
27843479 {
27853480 cameraView.renderCamera = radio.camera;
....@@ -2788,25 +3483,50 @@
27883483 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893484 cameraView.targetLookAt.set(radio.camera.lookAt);
27903485 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3486
+ //cameraView.lighttouched = true;
3487
+ Globals.lighttouched = true;
27923488 topView.object = group;
27933489 frontView.object = group;
27943490 sideView.object = group;
27953491 }
2796
- group.editWindow = this;
3492
+
3493
+// fix "+" issue
3494
+ //group.editWindow = this;
3495
+ group.manipWindow = this;
3496
+
27973497 /*
27983498 currentLayout = radio.layout;
27993499 if (currentLayout == null)
28003500 currentLayout = sevenButton;
28013501 */
28023502 radio.layout.doClick();
3503
+
3504
+ ClearUnpinned();
3505
+ SetPinStates(group.selection.size() > 0);
3506
+ if (group.selection.size() == 1)
3507
+ EditSelection(false);
28033508 keepparent = group.parent;
28043509 // PARENT = NULL or not???
28053510 //group.parent = null; // ROOT
28063511 //group.attributes = -1;
28073512 ResetModel();
3513
+
3514
+ cameraView.requestFocusInWindow();
28083515 refreshContents(true);
2809
- }
3516
+ } else if (event.getSource() == editCameraItem)
3517
+ {
3518
+ cameraView.ProtectCamera();
3519
+ cameraView.repaint();
3520
+ return;
3521
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3522
+ {
3523
+ cameraView.RevertCamera();
3524
+ cameraView.repaint();
3525
+ return;
3526
+ // } else if (event.getSource() == textureButton)
3527
+ // {
3528
+ // return; // true;
3529
+ }
28103530 else
28113531 {
28123532 //return super.action(event, arg);
....@@ -2815,7 +3535,6 @@
28153535 }
28163536
28173537 boolean useclient = false;
2818
- cRadio radio;
28193538
28203539 void ToggleRoot()
28213540 {
....@@ -2824,7 +3543,7 @@
28243543 if (useclient)
28253544 {
28263545 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3546
+ Globals.lighttouched = true;
28283547 //topView.object = client;
28293548 //frontView.object = client;
28303549 //sideView.object = client;
....@@ -2832,7 +3551,7 @@
28323551 else
28333552 {
28343553 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3554
+ Globals.lighttouched = true;
28363555 //topView.object = group;
28373556 //frontView.object = group;
28383557 //sideView.object = group;
....@@ -2867,6 +3586,28 @@
28673586 refreshContents();
28683587 }
28693588
3589
+ void TransformChildren()
3590
+ {
3591
+ Object3D obj;
3592
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3593
+ {
3594
+ obj = (Object3D)e.nextElement();
3595
+ obj.KeepTextureMatrices();
3596
+ obj.TransformChildren();
3597
+ obj.RestoreTextureMatrices();
3598
+
3599
+// if (obj.parent == null)
3600
+// {
3601
+// System.out.println("NULL PARENT!");
3602
+// new Exception().printStackTrace();
3603
+// }
3604
+// else
3605
+// TouchTransform(obj);
3606
+// //obj.parent.Touch();
3607
+ }
3608
+
3609
+ refreshContents();
3610
+ }
28703611
28713612 void ResetTransform()
28723613 {
....@@ -2979,7 +3720,7 @@
29793720 refreshContents();
29803721 }
29813722
2982
- void ResetCentroid()
3723
+ void ResetCentroid(boolean full)
29833724 {
29843725 Object3D obj;
29853726 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3735,16 @@
29943735 LA.matIdentity(Object3D.mat);
29953736 obj.getBounds(minima, maxima, false);
29963737 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3738
+ if (full)
3739
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983740 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993741 obj.TransformMesh(Object3D.mat);
3742
+
30003743 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3744
+ if (full)
3745
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023746 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3747
+
30033748 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043749 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053750 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +3773,8 @@
30283773
30293774 int size = obj.MemorySize();
30303775
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
3776
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3777
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30323778 }
30333779 }
30343780 catch (Exception e)
....@@ -3065,9 +3811,9 @@
30653811 obj = (Object3D)e.nextElement();
30663812
30673813 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3814
+ Grafreed.AnalyzeObject(obj);
30693815 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3816
+ Grafreed.AnalyzeObject(obj.bRep);
30713817
30723818 // System.err.println((size/1024) + " KB is the size of " + obj);
30733819 }
....@@ -3109,6 +3855,20 @@
31093855 void GenNormals(boolean crease)
31103856 {
31113857 group.GenNormalsS(crease);
3858
+
3859
+ refreshContents();
3860
+ }
3861
+
3862
+ void GenNormalsMESH()
3863
+ {
3864
+ group.GenNormalsMeshS();
3865
+
3866
+ refreshContents();
3867
+ }
3868
+
3869
+ void GenNormalsMINE()
3870
+ {
3871
+ group.selection.GenNormalsMINE();
31123872
31133873 refreshContents();
31143874 }
....@@ -3157,104 +3917,259 @@
31573917
31583918 //Object3D buffer;
31593919 cVector temp = new cVector();
3160
- BoundaryRep temprep;
3161
- Object3D nodes;
3162
- Vector<Vertex> vertices;
3163
-
3164
- public void Vertex(Object3D node, Vertex v)
3165
- {
3166
- vertices.add(v);
3167
- nodes.addElement(node);
3168
-
3169
- if (temprep.GetCache(v) != null)
3170
- {
3171
- temprep.Remove(v);
3172
- }
3173
- else
3174
- {
3175
- temprep.Remember(v);
3176
- }
3177
- }
3178
-
3179
- public void Face(Object3D node, Face f)
3180
- {
3181
-
3182
- }
3183
-
3920
+// BoundaryRep temprep;
3921
+// Object3D nodes;
3922
+// Vector<Vertex> vertices;
3923
+//
3924
+// cGroup buffer;
3925
+//
3926
+// public void Vertex(Object3D node, Vertex v)
3927
+// {
3928
+//// vertices.add(v);
3929
+//// nodes.addElement(node);
3930
+////
3931
+//// if (temprep.GetCache(v) != null)
3932
+//// {
3933
+//// temprep.Remove(v);
3934
+//// } else
3935
+//// {
3936
+//// temprep.Remember(v);
3937
+//// }
3938
+//
3939
+// //Object3D node = nodes.get(index);
3940
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3941
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3942
+//
3943
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3944
+//
3945
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3946
+//
3947
+// cGroup g = new cGroup();
3948
+//
3949
+// if (g.toParent == null)
3950
+// {
3951
+// g.toParent = LA.newMatrix();
3952
+// g.fromParent = LA.newMatrix();
3953
+// }
3954
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3955
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3956
+//
3957
+// g.add(GrafreeD.clipboard);
3958
+//
3959
+// buffer.add(g);
3960
+// }
3961
+//
3962
+// public void Face(Object3D node, Face f)
3963
+// {
3964
+//
3965
+// }
3966
+//
3967
+// void ParseVerticesOld() // ??
3968
+// {
3969
+// //if (group.selection.size() != 1)
3970
+// // return;
3971
+//
3972
+// temprep = new BoundaryRep();
3973
+// nodes = new Object3D();
3974
+// vertices = new Vector<Vertex>();
3975
+//
3976
+// boolean epsequal = GrafreeD.epsequal;
3977
+// GrafreeD.epsequal = true;
3978
+//
3979
+// for (int i=0; i<group.selection.size(); i++)
3980
+// {
3981
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3982
+//
3983
+// group.selection.get(i).Parse(
3984
+//this );
3985
+//
3986
+// int repsize = temprep.VertexCount();
3987
+// int tablesize = temprep.vertextable.size();
3988
+// int nodesize = nodes.size();
3989
+//
3990
+// assert(vertices.size() == nodes.size());
3991
+//
3992
+// temprep.vertextable.elements();
3993
+//
3994
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3995
+//
3996
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3997
+// {
3998
+// cGroup g = new cGroup();
3999
+//
4000
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
4001
+//
4002
+// Object3D node = nodes.get(index);
4003
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
4004
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4005
+//
4006
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4007
+//
4008
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4009
+//
4010
+// if (g.toParent == null)
4011
+// {
4012
+// g.toParent = LA.newMatrix();
4013
+// g.fromParent = LA.newMatrix();
4014
+// }
4015
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4016
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4017
+//
4018
+// g.add(GrafreeD.clipboard);
4019
+//
4020
+// buffer.add(g);
4021
+// }
4022
+//
4023
+// makeSomething(buffer, i==group.selection.size()-1);
4024
+// }
4025
+//
4026
+// GrafreeD.epsequal = epsequal;
4027
+//
4028
+// //buffer = null;
4029
+// temprep = null;
4030
+// nodes = null;
4031
+//
4032
+// refreshContents();
4033
+// }
4034
+
31844035 void ParseVertices()
31854036 {
3186
- //if (group.selection.size() != 1)
3187
- // return;
3188
-
3189
- temprep = new BoundaryRep();
3190
- nodes = new Object3D();
3191
- vertices = new Vector<Vertex>();
3192
-
3193
- boolean epsequal = GraphreeD.epsequal;
3194
- GraphreeD.epsequal = true;
4037
+ boolean epsequal = Grafreed.epsequal;
4038
+ Grafreed.epsequal = true;
31954039
31964040 for (int i=0; i<group.selection.size(); i++)
31974041 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4042
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31994043
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
4044
+ group.selection.get(i).Parse(
4045
+
4046
+ new iParse()
4047
+ {
4048
+ public void Vertex(Object3D node, Vertex v)
4049
+ {
4050
+ temp.set(v);
4051
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32054052
3206
- assert(vertices.size() == nodes.size());
3207
-
3208
- temprep.vertextable.elements();
3209
-
3210
- java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
4053
+ cGroup g = new cGroup();
32114054
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
4055
+ if (g.toParent == null)
4056
+ {
4057
+ g.toParent = LA.newMatrix();
4058
+ g.fromParent = LA.newMatrix();
4059
+ }
4060
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4061
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32154062
3216
- int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3217
- Object3D node = nodes.get(index);
3218
- temp.set(vertices.get(index)); // temprep.GetVertex(k));
3219
- // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4063
+ g.add(Grafreed.clipboard);
32204064
3221
- LA.xformPos(temp, node.GlobalTransformInv(), temp);
3222
-
3223
- // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3224
-
3225
- if (g.toParent == null)
3226
- {
3227
- g.toParent = LA.newMatrix();
3228
- g.fromParent = LA.newMatrix();
3229
- }
3230
- LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3231
- LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4065
+ buffer.add(g);
4066
+ }
32324067
3233
- g.add(GraphreeD.clipboard);
4068
+ public void Face(Object3D node, Face f)
4069
+ {
32344070
3235
- buffer.add(g);
3236
- }
4071
+ }
4072
+ }
4073
+ );
32374074
32384075 makeSomething(buffer, i==group.selection.size()-1);
32394076 }
32404077
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
4078
+ Grafreed.epsequal = epsequal;
32464079
32474080 refreshContents();
32484081 }
3249
-
4082
+
4083
+ void TextureVertices()
4084
+ {
4085
+ for (int i=0; i<group.selection.size(); i++)
4086
+ {
4087
+ group.selection.get(i).Parse(
4088
+ new iParse()
4089
+ {
4090
+ public void Vertex(Object3D node, Vertex v)
4091
+ {
4092
+ cTexture tex = node.GetTextures();
4093
+ String pigment = Object3D.GetPigment(tex);
4094
+ //String bump = Object3D.GetBump(tex);
4095
+
4096
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4097
+
4098
+ try
4099
+ {
4100
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4101
+ }
4102
+ catch (Exception e)
4103
+ {
4104
+ System.err.println("FAIL: " + node);
4105
+ }
4106
+
4107
+ double s = v.s;
4108
+
4109
+ if (s == 1)
4110
+ s = 0;
4111
+
4112
+ double t = v.t;
4113
+
4114
+ if (t == 1)
4115
+ t = 0;
4116
+
4117
+ int indexs = (int) (texturedata.getWidth() * s);
4118
+ int indext = (int) (texturedata.getHeight() * t);
4119
+
4120
+ int index = indext * texturedata.getWidth() + indexs;
4121
+
4122
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
4123
+
4124
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
4125
+
4126
+ float scale = bytebuf.get(index*slide) & 0xFF;
4127
+ scale += bytebuf.get(index*slide+1) & 0xFF;
4128
+ scale += bytebuf.get(index*slide+2) & 0xFF;
4129
+ scale /= 3;
4130
+
4131
+ scale /= 0xFF;
4132
+ // c'est quoi ca? scale /= 4;
4133
+
4134
+ //v.AO = scale;
4135
+
4136
+ v.x += v.norm.x * scale;
4137
+ v.y += v.norm.y * scale;
4138
+ v.z += v.norm.z * scale;
4139
+ }
4140
+
4141
+ public void Face(Object3D node, Face f)
4142
+ {
4143
+ }
4144
+ }
4145
+ );
4146
+ }
4147
+
4148
+ refreshContents();
4149
+ }
4150
+
32504151 void Align()
32514152 {
4153
+ if (group.selection.size() == 0)
4154
+ return;
4155
+
4156
+ cVector bbmin = new cVector();
4157
+ cVector bbmax = new cVector();
4158
+
4159
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4160
+
4161
+ double dx = bbmax.x - bbmin.x;
4162
+ double dy = bbmax.y - bbmin.y;
4163
+ double dz = bbmax.z - bbmin.z;
4164
+
4165
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4166
+
32524167 for (int i=0; i<group.selection.size(); i++)
32534168 {
32544169 Object3D obj = group.selection.get(i);
32554170
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4171
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4172
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584173 }
32594174
32604175 refreshContents();
....@@ -3267,7 +4182,7 @@
32674182 // ref.SaveSupports();
32684183 // Object3D par = ref.parent;
32694184 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4185
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714186 // ref.parent = par;
32724187 // ref.RestoreSupports();
32734188
....@@ -3275,11 +4190,11 @@
32754190
32764191 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774192
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4193
+ boolean random = CameraPane.SWITCH;
4194
+ CameraPane.SWITCH = false; // parse all random nodes
32804195 lowres.linkVerticesThis(null);
32814196 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4197
+ CameraPane.SWITCH = random;
32834198
32844199 System.err.flush();
32854200
....@@ -3297,7 +4212,7 @@
32974212 // lowres.SaveSupports();
32984213 // par = lowres.parent;
32994214 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4215
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014216 Object3D newlow = CloneObject(lowres, false);
33024217 newlow.name = sn.switchobject.get(i).name;
33034218 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4234,7 @@
33194234 return;
33204235
33214236 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4237
+ Object3D ref = Grafreed.clipboard.get(0);
33234238
33244239 Object3D newgroup = new Object3D("Po:" + poses.name);
33254240
....@@ -3488,7 +4403,7 @@
34884403 group.selection.RelinkToSupport(); // july 2014
34894404 System.out.println("DONE.");
34904405 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4406
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924407 }
34934408
34944409 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4428,20 @@
35134428
35144429 void ClipMesh()
35154430 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4431
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174432 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4433
+ Object3D content = Grafreed.clipboard.get(0);
35194434
35204435 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214436 content = ((cGroup)content).get(0);
35224437
35234438 // for (int i=0; i<group.selection.size(); i++)
35244439 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4440
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264441 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4442
+ group.selection.ClipMesh(Grafreed.clipboard);
35284443 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4444
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304445 System.out.println("DONE.");
35314446 refreshContents();
35324447 }
....@@ -3571,6 +4486,18 @@
35714486 void MarkLeaves(boolean hide)
35724487 {
35734488 group.selection.MarkLeaves(hide);
4489
+ refreshContents();
4490
+ }
4491
+
4492
+ void RewindLeaves(boolean hide)
4493
+ {
4494
+ group.selection.RewindLeaves(hide);
4495
+ refreshContents();
4496
+ }
4497
+
4498
+ void RandomLeaves(boolean hide)
4499
+ {
4500
+ group.selection.RandomLeaves(hide);
35744501 refreshContents();
35754502 }
35764503
....@@ -3645,10 +4572,6 @@
36454572 // }
36464573 // }
36474574
3648
- static boolean allparams = true;
3649
-
3650
- static Vector<Object3D> listUI = new Vector<Object3D>();
3651
-
36524575 void EditSelection(boolean newWindow)
36534576 {
36544577 // aConstraints.gridy = 0;
....@@ -3656,10 +4579,10 @@
36564579 {
36574580 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36584581 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4582
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604583
36614584 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4585
+ if(elem != group || !newWindow)
36634586 {
36644587 // if (!(elem instanceof Composite))
36654588 // newWindow = false;
....@@ -3741,7 +4664,8 @@
37414664 //new Exception().printStackTrace();
37424665
37434666 freezemodel = true;
3744
-
4667
+ ClearUnpinned();
4668
+
37454669 /**/
37464670 //switch (event.id)
37474671 {
....@@ -3749,7 +4673,6 @@
37494673 //case 702: // Event.LIST_DESELECT
37504674 group.deselectAll();
37514675 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37534676 if (tps != null)
37544677 {
37554678 for (int i=0; i < tps.length; i++)
....@@ -3758,33 +4681,39 @@
37584681
37594682 //if (child.parent != null)
37604683 //child.parent.addSelectee(child);
4684
+ objEditor.SetMaterial(child);
37614685 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37654686 }
37664687 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4688
+// else
4689
+// {
4690
+// objEditor.SetMaterial(group); // .GetMaterial());
4691
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4692
+// System.err.println("info : " + group.GetPath());
4693
+// }
37734694
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4695
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774696 CameraPane.flash = true;
37784697
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4698
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804699 // a camera
37814700 {
3782
- CameraPane.camerachangeframe = 0; // don't refuse it
3783
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3784
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3785
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4701
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4702
+ {
4703
+ CameraPane.camerachangeframe = 0; // don't refuse it
4704
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4705
+ }
4706
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4707
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864708 }
37874709
4710
+ if (tps != null && tps.length == 1)
4711
+ {
4712
+ EditSelection(false);
4713
+ }
4714
+
4715
+ SetPinStates(tps != null && tps.length > 0);
4716
+
37884717 refreshContents();
37894718 //return true;
37904719 }
....@@ -3793,6 +4722,35 @@
37934722
37944723 freezemodel = false;
37954724 }
4725
+
4726
+ void SetPinStates(boolean enabled)
4727
+ {
4728
+ editButton.setEnabled(enabled);
4729
+ uneditButton.setEnabled(enabled);
4730
+ unselectButton.setEnabled(enabled);
4731
+ flashSelectionButton.setEnabled(enabled);
4732
+ }
4733
+
4734
+ void refreshContents(boolean cp)
4735
+ {
4736
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4737
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4738
+ {
4739
+ objEditor.ClearInfo(); // .GetMaterial());
4740
+
4741
+ for (int i=0; i < group.selection.Size(); i++)
4742
+ {
4743
+ Object3D child = (Object3D) group.selection.get(i);
4744
+
4745
+ objEditor.AddInfo(child, this, true);
4746
+ System.err.println("info : " + child.GetPath());
4747
+ }
4748
+
4749
+ objEditor.SetText(); // jan 2014
4750
+ }
4751
+
4752
+ super.refreshContents(cp);
4753
+ }
37964754
37974755 void linkSomething(Object3D thing)
37984756 {
....@@ -3864,16 +4822,19 @@
38644822 {
38654823 if (group.selection.isEmpty())
38664824 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4825
+
4826
+ Grafreed.clipboardIsTempGroup = false;
38684827 Composite tGroup = null;
38694828 if (group.selection.size() > 0) // 1)
38704829 {
38714830 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4831
+ Grafreed.clipboardIsTempGroup = true;
38734832 }
38744833
38754834 if (cut)
38764835 {
4836
+ if (Globals.SAVEONMAKE)
4837
+ Save();
38774838 //int indices[] = jList.getSelectedIndices();
38784839 //for (int i = indices.length - 1; i >= 0; i--)
38794840 //jList.remove(indices[i]);
....@@ -3909,16 +4870,16 @@
39094870 //System.out.println("cut " + child);
39104871 //System.out.println("parent = " + child.parent);
39114872 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4873
+ if (Grafreed.clipboardIsTempGroup)
39134874 tGroup.add/*Child*/(tmp);
39144875 else
3915
- GraphreeD.clipboard = tmp;
4876
+ Grafreed.clipboard = tmp;
39164877 }
39174878 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4879
+ if (Grafreed.clipboardIsTempGroup)
39194880 tGroup.add/*Child*/(child);
39204881 else
3921
- GraphreeD.clipboard = child;
4882
+ Grafreed.clipboard = child;
39224883 }
39234884
39244885 //ResetModel();
....@@ -3950,21 +4911,23 @@
39504911 //System.out.println("cut " + elem);
39514912 //System.out.println("parent = " + elem.parent);
39524913 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4914
+ if (Grafreed.clipboardIsTempGroup)
39544915 tGroup.add/*Child*/(tmp);
39554916 else
3956
- GraphreeD.clipboard = tmp;
4917
+ Grafreed.clipboard = tmp;
39574918 }
39584919 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4920
+ if (Grafreed.clipboardIsTempGroup)
39604921 tGroup.add/*Child*/(child);
39614922 else
3962
- GraphreeD.clipboard = child;
4923
+ Grafreed.clipboard = child;
39634924 }
39644925
39654926 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4927
+
4928
+ if (Grafreed.clipboardIsTempGroup)
4929
+ Grafreed.clipboard = tGroup;
4930
+
39684931 if (cut)
39694932 {
39704933 ResetModel();
....@@ -3974,11 +4937,11 @@
39744937
39754938 void paste(boolean expand)
39764939 {
3977
- // if (GraphreeD.clipboard == null)
4940
+ // if (GrafreeD.clipboard == null)
39784941 // return;
39794942 boolean first = true;
39804943
3981
- if (GraphreeD.clipboardIsTempGroup)
4944
+ if (Grafreed.clipboardIsTempGroup)
39824945 {
39834946 Composite temp;
39844947
....@@ -3989,7 +4952,7 @@
39894952 temp = (Composite)Applet3D.clipboard.deepCopy();
39904953 */
39914954 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4955
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934956 {
39944957 Object3D child = (Object3D)e.nextElement();
39954958
....@@ -4003,7 +4966,7 @@
40034966 else
40044967 elem = child.deepCopy(); // ?
40054968 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4969
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074970 // elem = elem.get(0);
40084971 makeSomething(elem, true); // ?? first);
40094972 //group.addChild(elem);
....@@ -4023,23 +4986,23 @@
40234986 //Object3D cb = Applet3D.clipboard;
40244987 //temp.addChild(cb);
40254988 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4026
- assert(GraphreeD.clipboard.parent == null);
4027
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4028
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4029
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4030
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4989
+ assert(Grafreed.clipboard.parent == null);
4990
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4991
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4992
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4993
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314994 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4995
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4996
+ Grafreed.clipboard.get(0).parent = keepparent;
40344997 }
40354998
40364999 ResetModel();
40375000 refreshContents();
40385001 }
40395002
4040
- void pasteInto(boolean copyit)
5003
+ void pasteInto(boolean copyit, boolean clone)
40415004 {
4042
-// if (GraphreeD.clipboard == null)
5005
+// if (GrafreeD.clipboard == null)
40435006 // return;
40445007
40455008 if (group.selection.size() != 1)
....@@ -4066,15 +5029,22 @@
40665029 if (copyit)
40675030 {
40685031 // paste(false);
4069
- CloneClipboard(false); // sept 2014
5032
+ if (clone)
5033
+ {
5034
+ CloneClipboard(false); // sept 2014
5035
+ }
5036
+ else
5037
+ {
5038
+ paste(false);
5039
+ }
40705040 }
40715041 else
40725042 {
40735043 boolean first = true;
40745044
4075
- if (GraphreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
40765046 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
5047
+ Composite temp = (Composite)Grafreed.clipboard;
40785048 Object3D copy;
40795049 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40805050 {
....@@ -4084,7 +5054,7 @@
40845054 }
40855055 } else
40865056 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
5057
+ linkSomething(Grafreed.clipboard); //.get(0));
40885058 }
40895059 }
40905060 }
....@@ -4276,6 +5246,26 @@
42765246 makeSomething(csg);
42775247 }
42785248
5249
+ void Ungroup(Object3D g)
5250
+ {
5251
+ if (g instanceof HiddenObject)
5252
+ {
5253
+ HiddenObject h = (HiddenObject) g;
5254
+
5255
+ for (int i=0; i<h.ActualSize(); i++)
5256
+ {
5257
+ objEditor.makeSomething(h.get(i), false);
5258
+ }
5259
+ }
5260
+ else
5261
+ {
5262
+ for (int i=0; i<g.Size(); i++)
5263
+ {
5264
+ objEditor.makeSomething(g.get(i), false);
5265
+ }
5266
+ }
5267
+ }
5268
+
42795269 void ungroup()
42805270 {
42815271 /*
....@@ -4469,21 +5459,6 @@
44695459 }
44705460 */
44715461
4472
- void ImportGFD()
4473
- {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4475
- browser.show();
4476
- String filename = browser.getFile();
4477
- if (filename != null && filename.length() > 0)
4478
- {
4479
- String fullname = browser.getDirectory() + filename;
4480
-
4481
- //Object3D readobj =
4482
- objEditor.ReadGFD(fullname, objEditor);
4483
- //makeSomething(readobj);
4484
- }
4485
- }
4486
-
44875462 /*
44885463 public void Callback(Object obj)
44895464 {
....@@ -4507,26 +5482,9 @@
45075482 }
45085483 */
45095484
4510
- void ImportVRMLX3D()
4511
- {
4512
- if (GraphreeD.standAlone)
4513
- {
4514
- /**/
4515
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4516
- browser.show();
4517
- String filename = browser.getFile();
4518
- if (filename != null && filename.length() > 0)
4519
- {
4520
- String fullname = browser.getDirectory() + filename;
4521
- LoadVRMLX3D(fullname);
4522
- }
4523
- /**/
4524
- }
4525
- }
4526
-
45275485 String GetFile(String dialogName)
45285486 {
4529
- if (GraphreeD.standAlone)
5487
+ if (Grafreed.standAlone)
45305488 {
45315489 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325490 browser.show();
....@@ -4590,10 +5548,33 @@
45905548 cButton flashSelectionButton;
45915549 cButton editButton;
45925550 cButton uneditButton;
5551
+ JCheckBox allParamsButton;
45935552 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955553 cButton unselectButton;
45965554
5555
+ cButton restoreCameraButton;
5556
+
5557
+ cButton saveButton;
5558
+ cButton oneStepButton;
5559
+
5560
+ cButton groupButton;
5561
+ cButton ungroupButton;
5562
+ cButton compositeButton;
5563
+ cButton switchButton;
5564
+ cButton loopButton;
5565
+ cButton textureButton;
5566
+
5567
+ cButton gridButton;
5568
+ cButton boxButton;
5569
+ cButton sphereButton;
5570
+ cButton coneButton;
5571
+ cButton torusButton;
5572
+ cButton superButton;
5573
+ cButton kleinButton;
5574
+ cButton particlesButton;
5575
+ cButton overlayButton;
5576
+ cButton lightButton;
5577
+
45975578 cButton screenfitButton;
45985579 cButton screenfitpointButton;
45995580 cButton snapobjectButton;
....@@ -4605,14 +5586,6 @@
46055586
46065587 cButton setsupportButton;
46075588
4608
- cButton twoButton;
4609
- cButton sixButton;
4610
- cButton threeButton;
4611
- cButton sevenButton;
4612
- cButton fourButton; // full panel
4613
- cButton oneButton; // full XYZ
4614
- //cButton currentLayout;
4615
-
46165589 //
46175590 //Composite
46185591 Object3D // to do !!
....@@ -4622,9 +5595,11 @@
46225595 //JTree jTree;
46235596 private MenuItem lookAtItem;
46245597 private MenuItem lookFromItem;
4625
- private MenuItem switchItem;
5598
+ private MenuItem switchViewItem;
46265599 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
5600
+ private MenuItem undoItem;
5601
+ private MenuItem redoItem;
5602
+ private JMenuItem duplicateItem;
46285603 private MenuItem cloneItem;
46295604 private MenuItem cloneSupportItem;
46305605 private MenuItem overwriteGeoItem;
....@@ -4635,8 +5610,9 @@
46355610 private MenuItem resetsupportItem;
46365611 private MenuItem resetreferencesItem;
46375612 private MenuItem linkverticesItem;
5613
+ private MenuItem relinkverticesItem;
46385614 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5615
+ private MenuItem resetAllItem;
46405616 private MenuItem stepAllItem;
46415617 private MenuItem revertMeshItem;
46425618 private MenuItem poseMeshItem;
....@@ -4647,14 +5623,17 @@
46475623 private MenuItem mergeGeometriesItem;
46485624 private MenuItem copyItem;
46495625 private MenuItem pasteItem;
5626
+ private MenuItem pasteIntoItem;
46505627 private MenuItem pasteLinkItem;
46515628 private MenuItem pasteCloneItem;
46525629 private MenuItem pasteExpandItem;
46535630 private MenuItem clearItem;
46545631 private MenuItem clearAllItem;
46555632 private MenuItem genUVItem;
5633
+ private MenuItem genNormalsMESHItem;
46565634 private MenuItem genNormalsCADItem;
46575635 private MenuItem genNormalsORGANItem;
5636
+ private MenuItem genNormalsMINEItem;
46585637 private MenuItem stripifyItem;
46595638 private MenuItem unstripifyItem;
46605639 private MenuItem trimItem;
....@@ -4683,6 +5662,10 @@
46835662 private MenuItem showleavesItem;
46845663 private MenuItem markleavesItem;
46855664 private MenuItem unmarkleavesItem;
5665
+ private MenuItem rewindleavesItem;
5666
+ private MenuItem unrewindleavesItem;
5667
+ private MenuItem randomleavesItem;
5668
+ private MenuItem unrandomleavesItem;
46865669
46875670 private MenuItem flipVItem;
46885671 private MenuItem unflipVItem;
....@@ -4694,14 +5677,17 @@
46945677 private MenuItem panoTexturesItem;
46955678
46965679 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5680
+ private MenuItem resetCentroidXZItem;
46985681 private MenuItem resetTransformItem;
5682
+ private MenuItem transformGeometryItem;
5683
+ private MenuItem transformChildrenItem;
5684
+ private MenuItem hideItem;
46995685 private MenuItem grabItem;
47005686 private MenuItem backItem;
47015687 private MenuItem frontItem;
47025688 private MenuItem cameraItem;
47035689 private MenuItem compositeItem;
4704
- private MenuItem randomItem;
5690
+ private MenuItem switchItem;
47055691 private MenuItem physicsItem;
47065692 private MenuItem frameselectorItem;
47075693 private MenuItem scriptNodeItem;
....@@ -4716,6 +5702,7 @@
47165702
47175703 private MenuItem resetParentItem;
47185704 private MenuItem repairParentItem;
5705
+ private MenuItem repairShadowItem;
47195706 private MenuItem sortbysizeItem;
47205707 private MenuItem sortbynameItem;
47215708
....@@ -4728,16 +5715,19 @@
47285715 private MenuItem particleItem;
47295716 private MenuItem ragdollItem;
47305717 private MenuItem ragdoll2Item;
5718
+ private MenuItem heightFieldItem;
5719
+ private MenuItem textureFieldItem;
47315720 private MenuItem gridItem;
47325721 private MenuItem rectoidItem;
47335722 private MenuItem ellipsoidItem;
47345723 private MenuItem coneItem;
47355724 private MenuItem torusItem;
47365725 private MenuItem superItem;
5726
+ private MenuItem kleinItem;
47375727 private MenuItem blobItem;
47385728 private MenuItem latheItem;
47395729 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5730
+ private MenuItem overlayItem;
47415731 private MenuItem meshItem;
47425732 // private MenuItem meshGroupItem;
47435733 private MenuItem springItem;
....@@ -4746,6 +5736,7 @@
47465736 private MenuItem csgItem;
47475737 private MenuItem templateItem;
47485738 private MenuItem textureItem;
5739
+ private MenuItem billboardItem;
47495740 private MenuItem shadowXItem;
47505741 private MenuItem shadowYItem;
47515742 private MenuItem shadowZItem;
....@@ -4758,11 +5749,6 @@
47585749 private MenuItem doubleItem;
47595750 private MenuItem tripleItem;
47605751
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665752 private MenuItem computeAOItem;
47675753 private MenuItem recompileItem;
47685754 private MenuItem editScriptItem;
....@@ -4772,4 +5758,8 @@
47725758 private MenuItem analyzeItem;
47735759 private MenuItem dumpItem;
47745760 //boolean freezemodel = false;
5761
+
5762
+ Menu cameraMenu;
5763
+ MenuItem editCameraItem;
5764
+ MenuItem restoreCameraItem;
47755765 }