Normand Briere
2019-06-23 f1382bc839a74ef1d1534c61ea94e53cf54716df
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,8 +148,129 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,44 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- 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);
285
+ }
286
+
287
+ oe.menuBar.add(menu = new Menu("Setting"));
288
+ if (Globals.ADVANCED)
289
+ {
196290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197291 revertMeshItem.addActionListener(this);
198292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199293 resetreferencesItem.addActionListener(this);
200294 menu.add("-");
295
+ }
201296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202297 overwriteGeoItem.addActionListener(this);
203298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,72 +304,99 @@
209304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210305 overwriteUVItem.addActionListener(this);
211306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
212309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213310 generateMeshItem.addActionListener(this);
214311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215312 poseMeshItem.addActionListener(this);
216313 menu.add("-");
314
+ }
217315 resetsupportItem = menu.add(new MenuItem("Reset support"));
218316 resetsupportItem.addActionListener(this);
219317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220318 linkverticesItem.addActionListener(this);
319
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
320
+ relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
221324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222325 setMasterItem.addActionListener(this);
326
+ }
223327
224
- oe.menuBar.add(menu = new Menu("Object"));
328
+ oe.menuBar.add(menu = new Menu("Group"));
225329 grabItem = menu.add(new MenuItem("Grab"));
226330 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229331 backItem = menu.add(new MenuItem("Back"));
230332 backItem.addActionListener(this);
333
+ frontItem = menu.add(new MenuItem("Front"));
334
+ frontItem.addActionListener(this);
231335 compositeItem = menu.add(new MenuItem("Composite"));
232336 compositeItem.addActionListener(this);
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
338
+ hideItem.addActionListener(this);
339
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
340
+ ungroupItem.addActionListener(this);
233341 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
235343 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);
240344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241345 switchGeoItem.addActionListener(this);
242346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243347 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
245349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
246358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247359 scriptNodeItem.addActionListener(this);
248360 cameraItem = menu.add(new MenuItem("Camera"));
249361 cameraItem.addActionListener(this);
250
- menu.add("-");
362
+ }
363
+
364
+ oe.menuBar.add(menu = new Menu("Object"));
251365 textureItem = menu.add(new MenuItem("Texture"));
252366 textureItem.addActionListener(this);
367
+ billboardItem = menu.add(new MenuItem("Billboard"));
368
+ billboardItem.addActionListener(this);
253369 csgItem = menu.add(new MenuItem("CSG"));
254370 csgItem.addActionListener(this);
255
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
256372 shadowXItem.addActionListener(this);
257
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
258374 shadowYItem.addActionListener(this);
259
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
260376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
261380 linkerItem = menu.add(new MenuItem("Linker"));
262381 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265382 attributeItem = menu.add(new MenuItem("Attribute"));
266383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
267386 pointflowItem = menu.add(new MenuItem("Point Flow"));
268387 pointflowItem.addActionListener(this);
388
+ }
269389 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273391 resetTransformItem.addActionListener(this);
274392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275393 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
278400
279401 oe.menuBar.add(menu = new Menu("Geometry"));
280402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +405,13 @@
283405 genNormalsORGANItem.addActionListener(this);
284406 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285407 genNormalsCADItem.addActionListener(this);
408
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
409
+ genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
412
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
413
+ genNormalsMINEItem.addActionListener(this);
414
+ }
286415 stripifyItem = menu.add(new MenuItem("Stripify"));
287416 stripifyItem.addActionListener(this);
288417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +421,6 @@
292421 untrimItem = menu.add(new MenuItem("Untrim"));
293422 untrimItem.addActionListener(this);
294423 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297424 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298425 clearColorsItem.addActionListener(this);
299426 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +433,34 @@
306433 reduce34MeshItem.addActionListener(this);
307434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308435 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
444
+
445
+ oe.menuBar.add(menu = new Menu("Attributes"));
446
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
447
+ clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
313452 menu.add("-");
314453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315454 liveleavesItem.addActionListener(this);
316455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
318459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319460 supportleavesItem.addActionListener(this);
320461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321462 unsupportleavesItem.addActionListener(this);
463
+ }
322464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323465 hideleavesItem.addActionListener(this);
324466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +469,31 @@
327469 markleavesItem.addActionListener(this);
328470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
330480 menu.add("-");
331481 flipVItem = menu.add(new MenuItem("Flip V"));
332482 flipVItem.addActionListener(this);
333483 unflipVItem = menu.add(new MenuItem("Unflip V"));
334484 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
485
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336486 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
487
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338488 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
489
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340490 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
491
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342492 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
493
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344494 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
495
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346496 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);
356497
357498 oe.menuBar.add(menu = new Menu("Selection"));
358499 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,14 +511,41 @@
370511 sortbysizeItem.addActionListener(this);
371512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372513 sortbynameItem.addActionListener(this);
514
+ menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
519
+ if (Globals.ADVANCED)
520
+ {
521
+ // Pretty much the same as duplicate and clone.
522
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
523
+ extractGeometriesItem.addActionListener(this);
524
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
525
+ cloneGeometriesItem.addActionListener(this);
526
+ }
527
+
373528 oe.menuBar.add(menu = new Menu("Insert"));
374529 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
530
+
531
+ oe.menuBar.add(menu = new Menu("Tools"));
376532 buildToolsMenu(menu);
377533 }
378534
379535 void SetupUI2(ObjEditor oe)
380536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
381549 //new Exception().printStackTrace();
382550
383551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -406,150 +574,120 @@
406574 oe.radioPanel.add(dummyButton);
407575 oe.buttonGroup.add(dummyButton);
408576 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412578
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
414605 liveCB.addItemListener(this);
415606
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);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612
+ fastCB.setToolTipText("Fast mode");
434613 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);
441
-
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);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
+ trackCB.setToolTipText("Enable tracking");
476617 trackCB.addItemListener(this);
477618
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ screenfitButton.setToolTipText("Screen fit");
480621 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
622
+
482623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483624 // 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;
488625
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);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Show selection");
495635 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499636
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638
+
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
+ twoButton.setToolTipText("Show center view only");
502641 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504643 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
644
+ fourButton.setToolTipText("Show left panel only");
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ sixButton.setToolTipText("2-column layout left");
506647 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ threeButton.setToolTipText("2-column layout right");
508650 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ sevenButton.setToolTipText("3-column layout");
510653 sevenButton.addActionListener(this);
511654 //
512655
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
514658 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ closeButton.setToolTipText("Close tab");
517662 closeButton.addActionListener(this);
518663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519664 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521665
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
524668 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528669
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
530672 uneditButton.addActionListener(this);
531673
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);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
544676 allParamsButton.addActionListener(this);
545677
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);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
551684 unselectButton.addActionListener(this);
552685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
553691 // oe.aConstraints.gridx += 1;
554692 // oe.aConstraints.weighty = 0;
555693 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +699,37 @@
561699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562700 // gcButton.addActionListener(this);
563701
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;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
575705 //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);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577707 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
582711
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);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
587716 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
590720 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
593724 textureCB.addItemListener(this);
594725
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
597729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
598733 //jList.addListSelectionListener(this);
599734 oe.jTree.addTreeSelectionListener(this);
600735 //jTree.setRootVisible(false);
....@@ -616,20 +751,95 @@
616751 radio.layout = sevenButton;
617752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618753 }
754
+
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756
+ {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
786
+// constraints.gridy += 1;
787
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788
+// speakerMocapCB.addItemListener(this);
789
+
790
+ if (false)
791
+ {
792
+ // handled in scripts
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
795
+ speakerCameraCB.addItemListener(this);
796
+
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
799
+ speakerFocusCB.addItemListener(this);
800
+
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803
+ smoothfocusCB.addItemListener(this);
804
+ }
805
+
806
+//constraints.gridx += 1;
807
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808
+// debugCB.addItemListener(this);
809
+
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.addItemListener(this);
812
+
813
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
814
+ lookAtCB.setToolTipText("Look-at target");
815
+ lookAtCB.addItemListener(this);
816
+
817
+ }
818
+
819
+ cGridBag fill = new cGridBag();
820
+
821
+ fill.preferredHeight = 200;
822
+
823
+ panel.add(fill);
824
+
825
+ }
619826
620827 void EditObject(Object3D obj)
621828 {
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();
829
+ cRadio radioButton = new cRadio(obj.name);
830
+ radioButton.SetObject(obj);
831
+ radioButton.layout = sevenButton;
832
+ radioButton.SetCamera(cameraView.renderCamera, false);
833
+ radioButton.addActionListener(this);
834
+ radioPanel.add(radioButton);
835
+ buttonGroup.add(radioButton);
836
+ radioButton.doClick();
630837 }
838
+
631839 void SetupViews(ObjEditor oe)
632840 {
841
+ theFrame = this;
842
+
633843 oe.SetupViews();
634844
635845 System.out.println("SetupViews");
....@@ -646,6 +856,7 @@
646856 JCheckBox fastCB;
647857 JCheckBox slowCB;
648858 JCheckBox boxCB;
859
+ JCheckBox zoomBoxCB;
649860 JCheckBox trackCB;
650861 JCheckBox smoothfocusCB;
651862 // JCheckBox speakerMocapCB;
....@@ -688,10 +899,10 @@
688899 dropAttributes |= Object3D.TEXTURE;
689900 else
690901 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
902
+ } else if(e.getSource() == liveCB)
693903 {
694904 cameraView.ToggleLive();
905
+ refreshContents(false);
695906 }
696907 else if(e.getSource() == supportCB)
697908 {
....@@ -726,6 +937,10 @@
726937 Recompile();
727938 cameraView.repaint();
728939 // refreshContents();
940
+ }
941
+ else if(e.getSource() == zoomBoxCB)
942
+ {
943
+ cameraView.ToggleZoomBoxMode();
729944 }
730945 else if(e.getSource() == smoothfocusCB)
731946 {
....@@ -840,7 +1055,9 @@
8401055 // objEditor.DropFile((java.io.File[]) object, true);
8411056 // return;
8421057 // }
843
- if (string.charAt(0) == '/')
1058
+
1059
+ // File path for Mac and Windows
1060
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441061 {
8451062 // file(s)
8461063 String[] names = string.split("\n");
....@@ -867,7 +1084,7 @@
8671084
8681085 flashIt = false;
8691086 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1087
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711088 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721089
8731090 if (group.selection.size() == 1)
....@@ -894,11 +1111,11 @@
8941111 {
8951112 loadClipboard(true);
8961113 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
1114
+ pasteInto(false, false);
8981115 } else {
8991116 loadClipboard(false);
9001117 objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
1118
+ pasteInto(false, false); // true); // ???
9021119 }
9031120 }
9041121 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1002,6 +1219,8 @@
10021219
10031220 void buildCreateMenu(Menu menu)
10041221 {
1222
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1223
+ //heightFieldItem.addActionListener(this);
10051224 gridItem = menu.add(new MenuItem("Grid"));
10061225 gridItem.addActionListener(this);
10071226 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1233,37 @@
10141233 torusItem.addActionListener(this);
10151234 superItem = menu.add(new MenuItem("Superellipsoid"));
10161235 superItem.addActionListener(this);
1236
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1237
+ kleinItem.addActionListener(this);
10171238 particleItem = menu.add(new MenuItem("Particle system"));
10181239 particleItem.addActionListener(this);
1240
+ if (Globals.ADVANCED)
1241
+ {
10191242 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201243 ragdollItem.addActionListener(this);
10211244 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221245 ragdoll2Item.addActionListener(this);
1246
+ }
10231247 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1248
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251249 meshItem.addActionListener(this);
10261250 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271251 // meshGroupItem.addActionListener(this);
1252
+ if (Globals.ADVANCED)
1253
+ {
10281254 springItem = menu.add(new MenuItem("Spring"));
10291255 springItem.addActionListener(this);
10301256 flagItem = menu.add(new MenuItem("Flag"));
10311257 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);
10361258 blobItem = menu.add(new MenuItem("Blob"));
10371259 blobItem.addActionListener(this);
10381260 latheItem = menu.add(new MenuItem("Lathe"));
10391261 latheItem.addActionListener(this);
1262
+ }
1263
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1264
+ bezierItem.addActionListener(this);
1265
+ overlayItem = menu.add(new MenuItem("Overlay"));
1266
+ overlayItem.addActionListener(this);
10401267 lightItem = menu.add(new MenuItem("Light"));
10411268 lightItem.addActionListener(this);
10421269 menu.add("-");
....@@ -1046,46 +1273,44 @@
10461273 loopItem.addActionListener(this);
10471274 doubleItem = menu.add(new MenuItem("Fork"));
10481275 doubleItem.addActionListener(this);
1276
+ if (Globals.ADVANCED)
1277
+ {
10491278 tripleItem = menu.add(new MenuItem("Trident"));
10501279 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);
1280
+ }
10601281 }
10611282
10621283 void buildToolsMenu(Menu menu)
10631284 {
10641285 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651286 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1287
+ animationItem.setState(Globals.ANIMATION);
10671288
10681289 menu.add("-");
10691290 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701291 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1292
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1293
+ textureFieldItem.addActionListener(this);
1294
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721295 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751296 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761297 reduceMorphItem.addActionListener(this);
10771298 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781299 reduce34MorphItem.addActionListener(this);
1079
-
1300
+ menu.add("-");
10801301 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811302 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831303
1304
+ if (Globals.ADVANCED)
1305
+ {
1306
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1307
+ mirrorItem.addActionListener(this);
1308
+ menu.add("-");
10841309 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851310 memoryItem.addActionListener(this);
10861311 menu.add(analyzeItem = new MenuItem("Analyze"));
10871312 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1313
+ menu.add(dumpItem = new MenuItem("Print"));
10891314 dumpItem.addActionListener(this);
10901315 // menu.add(pathItem = new MenuItem("From-to path"));
10911316 // pathItem.addActionListener(this);
....@@ -1094,6 +1319,8 @@
10941319 resetParentItem.addActionListener(this);
10951320 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961321 repairParentItem.addActionListener(this);
1322
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1323
+ repairShadowItem.addActionListener(this);
10971324 menu.add(invariantsItem = new MenuItem("Invariants"));
10981325 invariantsItem.addActionListener(this);
10991326 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1328,7 @@
11011328 menu.add("-");
11021329 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031330 editScriptItem.addActionListener(this);
1331
+ }
11041332 }
11051333
11061334 void ScreenFit()
....@@ -1223,6 +1451,7 @@
12231451 shadow.material = new cMaterial(obj.material);
12241452 shadow.material.diffuse = 0.0001f;
12251453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
12261455
12271456 makeSomething(shadow);
12281457 }
....@@ -1429,9 +1658,9 @@
14291658
14301659 void Overwrite(int mask)
14311660 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1661
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331662 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1663
+ Object3D content = Grafreed.clipboard.get(0);
14351664
14361665 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371666 content = ((cGroup)content).get(0);
....@@ -1454,6 +1683,7 @@
14541683 //
14551684 public void actionPerformed(ActionEvent event) // , Object arg)
14561685 {
1686
+ Object source = event.getSource();
14571687 /*
14581688 if (event.getSource() == nameField)
14591689 {
....@@ -1465,11 +1695,11 @@
14651695 }
14661696 else
14671697 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1698
+ if (source == lookAtItem || source == lookFromItem)
14691699 {
14701700 ScreenFit();
14711701 } else
1472
- if (event.getSource() == switchItem)
1702
+ if (source == switchItem)
14731703 {
14741704 cVector v1 = new cVector();
14751705 cVector v2 = new cVector();
....@@ -1478,11 +1708,11 @@
14781708 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791709 objEditor.cameraView.repaint();
14801710 } else
1481
- if (event.getSource() == rectoidItem)
1711
+ if (source == rectoidItem)
14821712 {
14831713 makeSomething(new Box());
14841714 } else
1485
- if (event.getSource() == particleItem)
1715
+ if (source == particleItem)
14861716 {
14871717 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881718 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1733,9 @@
15031733 applyExample(particleGeom, "SMOKE");
15041734 makeSomething(particleGeom);
15051735 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1736
+ if (source == ragdollItem || source == ragdoll2Item)
15071737 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1738
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091739
15101740 ragdoll.toParent = LA.newMatrix();
15111741 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1751,71 @@
15211751 makeSomething(ragdoll);
15221752 //makeSomething(new VehicleDemo());
15231753 } else
1524
- if (event.getSource() == gridItem)
1754
+ /*
1755
+ */
1756
+ if (source == heightFieldItem)
1757
+ {
1758
+ Object3D obj = new Object3D();
1759
+
1760
+ obj.CreateMaterial();
1761
+ obj.bRep = new BoundaryRep();
1762
+
1763
+ obj.bRep.CreateMesh(new iHeightField()
1764
+ {
1765
+ public double f(double x, double y)
1766
+ {
1767
+ // The Mandelbrot set is represented by coloring
1768
+ // each point (x,y) according to the number of
1769
+ // iterations it takes before the while loop in
1770
+ // this method ends. For points that are actually
1771
+ // in the Mandelbrot set, or very close to it, the
1772
+ // count will reach the maximum value, 80. These
1773
+ // points will be colored purple. All other colors
1774
+ // represent points that are definitely NOT in the set.
1775
+ x -= 600;
1776
+ y -= 500;
1777
+ x /= 200;
1778
+ y /= 200;
1779
+ int count = 0;
1780
+ double zx = x;
1781
+ double zy = y;
1782
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1783
+ double new_zx = zx*zx - zy*zy + x;
1784
+ zy = 2*zx*zy + y;
1785
+ zx = new_zx;
1786
+ count++;
1787
+ }
1788
+ return count; // Math.sqrt(count);
1789
+ }
1790
+ }, 1000,1000);
1791
+
1792
+ makeSomething(obj);
1793
+ } else
1794
+ if (source == gridItem)
15251795 {
15261796 makeSomething(new Grid());
15271797 } else
1528
- if (event.getSource() == ellipsoidItem)
1798
+ if (source == ellipsoidItem)
15291799 {
15301800 makeSomething(new Sphere());
15311801 } else
1532
- if (event.getSource() == coneItem)
1802
+ if (source == coneItem)
15331803 {
15341804 makeSomething(new Cone());
15351805 } else
1536
- if (event.getSource() == torusItem)
1806
+ if (source == torusItem)
15371807 {
15381808 makeSomething(new Torus());
15391809 } else
1540
- if (event.getSource() == superItem)
1810
+ if (source == superItem)
15411811 {
15421812 makeSomething(new Superellipsoid());
15431813 } else
1544
- if (event.getSource() == blobItem)
1814
+ if (source == kleinItem)
1815
+ {
1816
+ makeSomething(new Klein());
1817
+ } else
1818
+ if (source == blobItem)
15451819 {
15461820 Blob blob = new Blob();
15471821 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1823,15 @@
15491823 //blob.retile();
15501824 makeSomething(blob);
15511825 } else
1552
- if (event.getSource() == latheItem)
1826
+ if (source == latheItem)
15531827 {
15541828 makeSomething(new Lathe());
15551829 } else
1556
- if (event.getSource() == bezierItem)
1830
+ if (source == bezierItem)
15571831 {
15581832 makeSomething(new BezierSurface());
15591833 } else
1560
- if (event.getSource() == checkerItem)
1834
+ if (source == overlayItem)
15611835 {
15621836 /*
15631837 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1844,9 @@
15701844 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711845 LA.matInvert(obj.toParent, obj.fromParent);
15721846 */
1573
- makeSomething(new CheckerIG());
1847
+ makeSomething(new Checker());
15741848 } else
1575
- if (event.getSource() == meshItem)
1849
+ if (source == meshItem)
15761850 {
15771851 Object3D itemtomake = new Object3D();
15781852 Object3D child;
....@@ -1593,35 +1867,35 @@
15931867 makeSomething(child);
15941868 }
15951869 } else
1596
- if (event.getSource() == springItem)
1870
+ if (source == springItem)
15971871 {
15981872 cSpring s = new cSpring();
15991873 s.setup();
16001874 makeSomething(s);
16011875 } else
1602
- if (event.getSource() == flagItem)
1876
+ if (source == flagItem)
16031877 {
16041878 cSpring s = new cFlag();
16051879 s.setup();
16061880 makeSomething(s);
16071881 } else
1608
- if (event.getSource() == lightItem)
1882
+ if (source == lightItem)
16091883 {
16101884 makeSomething(new Light());
16111885 } else
1612
- if (event.getSource() == csgItem)
1886
+ if (source == csgItem)
16131887 {
16141888 group(new CSG());
16151889 } else
1616
- if (event.getSource() == templateItem)
1890
+ if (source == templateItem)
16171891 {
16181892 group(new cTemplate());
16191893 } else
1620
- if (event.getSource() == attributeItem)
1894
+ if (source == attributeItem)
16211895 {
16221896 makeSomething(new Attribute());
16231897 } else
1624
- if (event.getSource() == pointflowItem)
1898
+ if (source == pointflowItem)
16251899 {
16261900 makeSomething(new PointFlow());
16271901 } else
....@@ -1633,7 +1907,7 @@
16331907 } else
16341908 */
16351909
1636
- if (event.getSource() == superLoopItem)
1910
+ if (source == superLoopItem)
16371911 {
16381912 Composite g = new cGroup();
16391913 for (int i=0; i<15; i++)
....@@ -1655,7 +1929,7 @@
16551929
16561930 group(g);
16571931 } else
1658
- if (event.getSource() == loopItem)
1932
+ if (source == loopItem)
16591933 {
16601934 Composite csg = new GroupLeaf();
16611935 csg.count = 5;
....@@ -1664,7 +1938,7 @@
16641938 csg.addChild(child);
16651939 child.addChild(csg);
16661940 } else
1667
- if (event.getSource() == doubleItem)
1941
+ if (source == doubleItem)
16681942 {
16691943 Composite csg = new GroupLeaf();
16701944 csg.count = 5;
....@@ -1676,7 +1950,7 @@
16761950 csg.addChild(child);
16771951 child.addChild(csg);
16781952 } else
1679
- if (event.getSource() == tripleItem)
1953
+ if (source == tripleItem)
16801954 {
16811955 Composite csg = new GroupLeaf();
16821956 csg.count = 4;
....@@ -1691,71 +1965,83 @@
16911965 csg.addChild(child);
16921966 child.addChild(csg);
16931967 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
1968
+ if (source == computeAOItem)
16961969 {
1697
- ImportGFD();
1970
+ Globals.drawMode = CameraPane.OCCLUSION;
1971
+ Globals.theRenderer.repaint();
16981972 } 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)
1973
+ if (source == recompileItem)
17171974 {
17181975 Recompile();
17191976 refreshContents();
17201977 } else
1721
- if (event.getSource() == editScriptItem)
1978
+ if (source == editScriptItem)
17221979 {
17231980 OpenDialog();
17241981 refreshContents();
17251982 } else
1726
- if (event.getSource() == invariantsItem)
1983
+ if (source == invariantsItem)
17271984 {
17281985 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1986
+ Grafreed.grafreeD.universe.invariants();
17301987 } else
1731
- if (event.getSource() == memoryItem)
1988
+ if (source == memoryItem)
17321989 {
17331990 //System.out.println("Invariants:");
17341991 PrintMemory();
17351992 } else
1736
- if (event.getSource() == pathItem)
1993
+ if (source == pathItem)
17371994 {
17381995 PrintPath();
17391996 } else
1740
- if (event.getSource() == analyzeItem)
1997
+ if (source == analyzeItem)
17411998 {
17421999 AnalyzeObject();
17432000 } else
1744
- if (event.getSource() == dumpItem)
2001
+ if (source == dumpItem)
17452002 {
17462003 DumpObject();
17472004 } else
1748
- if (event.getSource() == screenfitButton)
2005
+ if (source == minButton)
2006
+ {
2007
+ Minimize();
2008
+ } else
2009
+ if (source == maxButton)
2010
+ {
2011
+ Maximize();
2012
+ } else
2013
+ if (source == fullButton)
2014
+ {
2015
+ ToggleFullScreen();
2016
+ } else
2017
+ if (source == undoButton)
2018
+ {
2019
+ Undo();
2020
+ } else
2021
+ if (source == redoButton)
2022
+ {
2023
+ Redo();
2024
+ } else
2025
+ if (source == saveButton)
2026
+ {
2027
+ Save();
2028
+ } else
2029
+ if (source == oneStepButton)
2030
+ {
2031
+ Globals.ONESTEP = true;
2032
+ cameraView.repaint();
2033
+ } else
2034
+ if (source == screenfitButton)
17492035 {
17502036 //Reload(lastConverter, lastFilename, true);
17512037 ScreenFit();
17522038 } else
1753
- if (event.getSource() == screenfitpointButton)
2039
+ if (source == screenfitpointButton)
17542040 {
17552041 //Reload(lastConverter, lastFilename, true);
17562042 ScreenFitPoint();
17572043 } else
1758
- if (event.getSource() == snapobjectButton)
2044
+ if (source == snapobjectButton)
17592045 {
17602046 //Reload(lastConverter, lastFilename, true);
17612047 SnapObject();
....@@ -1766,13 +2052,13 @@
17662052 // Recompile();
17672053 // refreshContents();
17682054 // } else
1769
- if (event.getSource() == gcButton)
2055
+ if (source == gcButton)
17702056 {
17712057 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722058 System.gc();
17732059 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742060 } else
1775
- if (event.getSource() == editLeafItem)
2061
+ if (source == editLeafItem)
17762062 {
17772063 Object3D obj;
17782064 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2072,78 @@
17862072 }
17872073 refreshContents(true);
17882074 } else
1789
- if (event.getSource() == openWindowItem)
2075
+ if (source == openWindowItem)
17902076 {
17912077 EditSelection(true);
17922078 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2079
+ if (source == cutItem || source == clearButton)
17942080 {
17952081 loadClipboard(true);
17962082 } else
1797
- if (event.getSource() == duplicateItem)
2083
+ if (source == undoItem)
17982084 {
1799
- Object3D keep = GraphreeD.clipboard;
2085
+ Undo();
2086
+ } else
2087
+ if (source == redoItem)
2088
+ {
2089
+ Redo();
2090
+ } else
2091
+ if (source == duplicateItem)
2092
+ {
2093
+ Object3D keep = Grafreed.clipboard;
18002094 loadClipboard(false);
18012095 paste(false);
1802
- GraphreeD.clipboard = keep;
2096
+ Grafreed.clipboard = keep;
18032097 } else
1804
- if (event.getSource() == cloneItem)
2098
+ if (source == cloneItem)
18052099 {
18062100 CloneSelection(false);
18072101 } else
1808
- if (event.getSource() == cloneSupportItem)
2102
+ if (source == cloneSupportItem)
18092103 {
18102104 CloneSelection(true);
18112105 } else
1812
- if (event.getSource() == copyItem)
2106
+ if (source == copyItem)
18132107 {
18142108 loadClipboard(false);
18152109 } else
1816
- if (event.getSource() == pasteItem)
2110
+ if (source == pasteItem)
18172111 {
18182112 paste(false);
18192113 } else
1820
- if (event.getSource() == pasteLinkItem)
2114
+ if (source == pasteIntoItem)
18212115 {
1822
- pasteInto(false);
2116
+ pasteInto(true, false);
18232117 } else
1824
- if (event.getSource() == pasteCloneItem)
2118
+ if (source == pasteLinkItem)
18252119 {
1826
- pasteInto(true);
2120
+ pasteInto(false, false);
18272121 } else
1828
- if (event.getSource() == pasteExpandItem)
2122
+ if (source == pasteCloneItem)
2123
+ {
2124
+ pasteInto(true, true);
2125
+ } else
2126
+ if (source == pasteExpandItem)
18292127 {
18302128 paste(true);
18312129 } else
1832
- if (event.getSource() == synchronizeItem)
2130
+ if (source == synchronizeItem)
18332131 {
18342132 Overwrite(Object3D.TRANSFORM);
18352133 } else
1836
- if (event.getSource() == overwriteNameItem)
2134
+ if (source == overwriteNameItem)
18372135 {
18382136 Overwrite(Object3D.NAME);
18392137 } else
1840
- if (event.getSource() == overwriteUVItem)
2138
+ if (source == overwriteUVItem)
18412139 {
18422140 Overwrite(Object3D.UV);
18432141 } else
1844
- if (event.getSource() == overwriteMatItem)
2142
+ if (source == overwriteMatItem)
18452143 {
2144
+ /* july 2015
18462145 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2146
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482147 else
18492148 {
18502149 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2155,16 @@
18562155 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572156 }
18582157 }
2158
+ */
2159
+
2160
+ Overwrite(dropAttributes);
18592161 }
1860
- if (event.getSource() == overwriteGeoItem)
2162
+ if (source == overwriteGeoItem)
18612163 {
18622164 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2165
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642166 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2167
+// Object3D content = GrafreeD.clipboard.get(0);
18662168 //
18672169 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682170 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2176,7 @@
18742176 // refreshContents();
18752177 // }
18762178 } else
1877
- if (event.getSource() == generateMeshItem)
2179
+ if (source == generateMeshItem)
18782180 {
18792181 //if (group.selection.size() == 1)
18802182 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2187,7 @@
18852187 ResetModel();
18862188 refreshContents();
18872189 } else
1888
- if (event.getSource() == extractGeometriesItem)
2190
+ if (source == extractGeometriesItem)
18892191 {
18902192 boolean one = false;
18912193
....@@ -1912,7 +2214,7 @@
19122214 ResetModel();
19132215 refreshContents();
19142216 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2217
+ if (source == cloneGeometriesItem)
19162218 {
19172219 boolean one = false;
19182220
....@@ -1938,32 +2240,37 @@
19382240 ResetModel();
19392241 refreshContents();
19402242 } else
1941
- if (event.getSource() == shareGeometriesItem)
2243
+ if (source == shareGeometriesItem)
19422244 {
19432245 boolean one = false;
19442246
19452247 if (group.selection.size() == 1)
19462248 one = true;
19472249
2250
+ Object3D merge = null;
2251
+
19482252 Object3D content = new cGroup();
19492253
19502254 for (int i=0; i<group.selection.size(); i++)
19512255 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2256
+ merge = new Merge(group.selection.get(i));
19532257
19542258 if (one)
1955
- makeSomething(sel, false);
2259
+ makeSomething(merge, false);
19562260 else
1957
- content.addChild(sel);
2261
+ content.addChild(merge);
19582262 }
19592263
19602264 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2265
+ makeSomething(content, true);
2266
+ else
2267
+ {
2268
+ ResetModel();
2269
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2270
+ refreshContents();
2271
+ }
19652272 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2273
+ if (source == mergeGeometriesItem)
19672274 {
19682275 boolean one = false;
19692276
....@@ -1993,11 +2300,11 @@
19932300 ResetModel();
19942301 refreshContents();
19952302 } else
1996
- if (event.getSource() == linkverticesItem)
2303
+ if (source == linkverticesItem)
19972304 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2305
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992306 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2307
+// Object3D content = GrafreeD.clipboard.get(0);
20012308 //
20022309 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032310 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2313,48 @@
20062313 // group.selection.get(0).setMasterThis(content); // should be identity
20072314 // refreshContents();
20082315 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2316
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102317 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2318
+ Object3D content = Grafreed.clipboard.get(0);
20122319
20132320 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142321 content = ((cGroup)content).get(0);
20152322
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2323
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172324 for (int i=0; i<group.selection.size(); i++)
20182325 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2326
+ boolean random = CameraPane.SWITCH;
2327
+ CameraPane.SWITCH = false; // parse all random nodes
20212328 group.selection.get(i).linkVerticesThis(content);
20222329 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2330
+ CameraPane.SWITCH = random;
20242331 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2332
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262333 refreshContents();
20272334 }
20282335 } else
2029
- if (event.getSource() == resetsupportItem)
2336
+ if (source == resetsupportItem)
20302337 {
20312338 for (int i=0; i<group.selection.size(); i++)
20322339 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2340
+ boolean random = CameraPane.SWITCH;
2341
+ CameraPane.SWITCH = false; // parse all random nodes
20352342 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2343
+ CameraPane.SWITCH = random;
20372344 }
20382345
20392346 refreshContents();
20402347 } else
2041
- if (event.getSource() == resetreferencesItem)
2348
+ if (source == relinkverticesItem)
2349
+ {
2350
+ boolean random = CameraPane.SWITCH;
2351
+ CameraPane.SWITCH = false; // parse all random nodes
2352
+ group.selection.RelinkToSupport();
2353
+ CameraPane.SWITCH = random;
2354
+
2355
+ refreshContents();
2356
+ } else
2357
+ if (source == resetreferencesItem)
20422358 {
20432359 for (int i=0; i<group.selection.size(); i++)
20442360 {
....@@ -2047,11 +2363,11 @@
20472363
20482364 refreshContents();
20492365 } else
2050
- if (event.getSource() == setMasterItem)
2366
+ if (source == setMasterItem)
20512367 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2368
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532369 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2370
+ Object3D content = Grafreed.clipboard.get(0);
20552371
20562372 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572373 content = ((cGroup)content).get(0);
....@@ -2060,13 +2376,13 @@
20602376 refreshContents();
20612377 }
20622378 } else
2063
- if (event.getSource() == poseMeshItem)
2379
+ if (source == poseMeshItem)
20642380 {
20652381 if (group.selection.size() == 1)
20662382 {
2067
- if (GraphreeD.clipboard.size() == 1)
2383
+ if (Grafreed.clipboard.size() == 1)
20682384 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2385
+ Object3D content = Grafreed.clipboard.get(0);
20702386
20712387 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722388 content = ((cGroup)content).get(0);
....@@ -2079,19 +2395,19 @@
20792395 }
20802396
20812397 } else
2082
- if (event.getSource() == revertMeshItem)
2398
+ if (source == revertMeshItem)
20832399 {
20842400 RevertMeshes();
20852401 } else
2086
- if (event.getSource() == resetMeshItem)
2402
+ if (source == resetAllItem)
20872403 {
20882404 ResetAll();
20892405 } else
2090
- if (event.getSource() == stepAllItem)
2406
+ if (source == stepAllItem)
20912407 {
20922408 StepAll();
20932409 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2410
+ if (source == clearItem) // || event.getSource() == clearButton)
20952411 {
20962412 //int indices[] = jList.getSelectedIndices();
20972413 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2415,46 @@
20992415
21002416 ClearSelection(false);
21012417 } else
2102
- if (event.getSource() == clearAllItem)
2418
+ if (source == clearAllItem)
21032419 {
21042420 ClearSelection(true);
21052421 } else
2106
- if (event.getSource() == grabItem)
2422
+ if (source == grabItem)
21072423 {
21082424 group(new cGroup(), true);
21092425 } else
2110
- if (event.getSource() == frontItem)
2426
+ if (source == hideItem)
2427
+ {
2428
+ group(new HiddenObject());
2429
+ } else
2430
+ if (source == frontItem)
21112431 {
21122432 front();
21132433 } else
2114
- if (event.getSource() == backItem)
2434
+ if (source == backItem)
21152435 {
21162436 back();
21172437 } else
2118
- if (event.getSource() == cameraItem)
2438
+ if (source == cameraItem)
21192439 {
21202440 makeSomething(new Camera());
21212441 } else
2122
- if (event.getSource() == compositeItem)
2442
+ if (source == compositeItem)
21232443 {
21242444 group(new Composite());
21252445 } else
2126
- if (event.getSource() == randomItem)
2446
+ if (source == randomItem)
21272447 {
21282448 RandomNode random = new RandomNode();
21292449 group(random);
21302450 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2451
+ random.name = random.get(0).name + "Switch";
21322452 } else
2133
- if (event.getSource() == physicsItem)
2453
+ if (source == physicsItem)
21342454 {
21352455 group(new PhysicsNode());
21362456 } else
2137
- if (event.getSource() == frameselectorItem)
2457
+ if (source == frameselectorItem)
21382458 {
21392459 for (int i=0; i<group.selection.size(); i++)
21402460 {
....@@ -2146,7 +2466,7 @@
21462466 ResetModel();
21472467 refreshContents();
21482468 } else
2149
- if (event.getSource() == switchGeoItem)
2469
+ if (source == switchGeoItem)
21502470 {
21512471 for (int i=0; i<group.selection.size(); i++)
21522472 {
....@@ -2158,7 +2478,7 @@
21582478 ResetModel();
21592479 refreshContents();
21602480 } else
2161
- if (event.getSource() == switchTransfoItem)
2481
+ if (source == switchTransfoItem)
21622482 {
21632483 for (int i=0; i<group.selection.size(); i++)
21642484 {
....@@ -2170,7 +2490,7 @@
21702490 ResetModel();
21712491 refreshContents();
21722492 } else
2173
- if (event.getSource() == morphItem)
2493
+ if (source == morphItem)
21742494 {
21752495 for (int i=0; i<group.selection.size(); i++)
21762496 {
....@@ -2182,7 +2502,7 @@
21822502 ResetModel();
21832503 refreshContents();
21842504 } else
2185
- if (event.getSource() == scriptNodeItem)
2505
+ if (source == scriptNodeItem)
21862506 {
21872507 boolean atleastone = false;
21882508
....@@ -2221,191 +2541,239 @@
22212541 }
22222542 }
22232543 } else
2224
- if (event.getSource() == linkerItem)
2544
+ if (source == linkerItem)
22252545 {
22262546 group(new cLinker());
22272547 } else
2228
- if (event.getSource() == textureItem)
2548
+ if (source == textureItem)
22292549 {
22302550 group(new TextureNode());
22312551 } else
2232
- if (event.getSource() == shadowXItem)
2552
+ if (source == billboardItem)
2553
+ {
2554
+ group(new BillboardNode());
2555
+ } else
2556
+ if (source == shadowXItem)
22332557 {
22342558 CastShadow(0);
22352559 } else
2236
- if (event.getSource() == shadowYItem)
2560
+ if (source == shadowYItem)
22372561 {
22382562 CastShadow(1);
22392563 } else
2240
- if (event.getSource() == shadowZItem)
2564
+ if (source == shadowZItem)
22412565 {
22422566 CastShadow(2);
22432567 } else
2244
- if (event.getSource() == ungroupItem)
2568
+ if (source == ungroupItem)
22452569 {
2246
- ungroup();
2570
+ //ungroup();
2571
+ for (int i=0; i<group.selection.size(); i++)
2572
+ {
2573
+ Ungroup(group.selection.get(i));
2574
+ }
2575
+
2576
+ ClearSelection(false);
2577
+
2578
+ refreshContents();
22472579 } else
2248
- if (event.getSource() == genUVItem)
2580
+ if (source == genUVItem)
22492581 {
22502582 GenUV();
22512583 } else
2252
- if (event.getSource() == genNormalsCADItem)
2584
+ if (source == genNormalsCADItem)
22532585 {
22542586 GenNormals(true);
22552587 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2588
+ if (source == genNormalsMESHItem)
2589
+ {
2590
+ GenNormalsMESH();
2591
+ } else
2592
+ if (source == genNormalsORGANItem)
22572593 {
22582594 GenNormals(false);
22592595 } else
2260
- if (event.getSource() == stripifyItem)
2596
+ if (source == genNormalsMINEItem)
2597
+ {
2598
+ GenNormalsMINE();
2599
+ } else
2600
+ if (source == stripifyItem)
22612601 {
22622602 Stripify();
22632603 } else
2264
- if (event.getSource() == unstripifyItem)
2604
+ if (source == unstripifyItem)
22652605 {
22662606 Unstripify();
22672607 } else
2268
- if (event.getSource() == trimItem)
2608
+ if (source == trimItem)
22692609 {
22702610 Trim();
22712611 } else
2272
- if (event.getSource() == untrimItem)
2612
+ if (source == untrimItem)
22732613 {
22742614 Untrim();
22752615 } else
2276
- if (event.getSource() == clearColorsItem)
2616
+ if (source == clearColorsItem)
22772617 {
22782618 ClearColors();
22792619 } else
2280
- if (event.getSource() == clearMaterialsItem)
2620
+ if (source == clearMaterialsItem)
22812621 {
22822622 ClearMaterials();
22832623 } else
2284
- if (event.getSource() == liveleavesItem)
2624
+ if (source == liveleavesItem)
22852625 {
22862626 LiveLeaves(true);
22872627 } else
2288
- if (event.getSource() == unliveleavesItem)
2628
+ if (source == unliveleavesItem)
22892629 {
22902630 LiveLeaves(false);
22912631 } else
2292
- if (event.getSource() == supportleavesItem)
2632
+ if (source == supportleavesItem)
22932633 {
22942634 SupportLeaves(true);
22952635 } else
2296
- if (event.getSource() == unsupportleavesItem)
2636
+ if (source == unsupportleavesItem)
22972637 {
22982638 SupportLeaves(false);
22992639 } else
2300
- if (event.getSource() == hideleavesItem)
2640
+ if (source == hideleavesItem)
23012641 {
23022642 HideLeaves(true);
23032643 } else
2304
- if (event.getSource() == showleavesItem)
2644
+ if (source == showleavesItem)
23052645 {
23062646 HideLeaves(false);
23072647 } else
2308
- if (event.getSource() == markleavesItem)
2648
+ if (source == markleavesItem)
23092649 {
23102650 MarkLeaves(true);
23112651 } else
2312
- if (event.getSource() == unmarkleavesItem)
2652
+ if (source == unmarkleavesItem)
23132653 {
23142654 MarkLeaves(false);
23152655 } else
2316
- if (event.getSource() == flipVItem)
2656
+ if (source == rewindleavesItem)
2657
+ {
2658
+ RewindLeaves(true);
2659
+ } else
2660
+ if (source == unrewindleavesItem)
2661
+ {
2662
+ RewindLeaves(false);
2663
+ } else
2664
+ if (source == randomleavesItem)
2665
+ {
2666
+ RandomLeaves(true);
2667
+ } else
2668
+ if (source == unrandomleavesItem)
2669
+ {
2670
+ RandomLeaves(false);
2671
+ } else
2672
+ if (source == flipVItem)
23172673 {
23182674 FlipV(true);
23192675 } else
2320
- if (event.getSource() == unflipVItem)
2676
+ if (source == unflipVItem)
23212677 {
23222678 FlipV(false);
23232679 } else
2324
- if (event.getSource() == lowTexturesItem)
2680
+ if (source == lowTexturesItem)
23252681 {
23262682 SetTexRes(0);
23272683 } else
2328
- if (event.getSource() == normalTexturesItem)
2684
+ if (source == normalTexturesItem)
23292685 {
23302686 SetTexRes(1);
23312687 } else
2332
- if (event.getSource() == highTexturesItem)
2688
+ if (source == highTexturesItem)
23332689 {
23342690 SetTexRes(2);
23352691 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2692
+ if (source == veryhighTexturesItem)
23372693 {
23382694 SetTexRes(3);
23392695 } else
2340
- if (event.getSource() == maxTexturesItem)
2696
+ if (source == maxTexturesItem)
23412697 {
23422698 SetTexRes(4);
23432699 } else
2344
- if (event.getSource() == panoTexturesItem)
2700
+ if (source == panoTexturesItem)
23452701 {
23462702 SetTexRes(5);
23472703 } else
2348
- if (event.getSource() == reverseNormalsItem)
2704
+ if (source == reverseNormalsItem)
23492705 {
23502706 ReverseNormals();
23512707 } else
2352
- if (event.getSource() == parseverticesItem)
2708
+ if (source == parseverticesItem)
23532709 {
23542710 ParseVertices();
23552711 } else
2356
- if (event.getSource() == alignItem)
2712
+ if (source == textureFieldItem)
2713
+ {
2714
+ TextureVertices();
2715
+ } else
2716
+ if (source == alignItem)
23572717 {
23582718 Align();
23592719 } else
2360
- if (event.getSource() == mirrorItem)
2720
+ if (source == mirrorItem)
23612721 {
23622722 MirrorPoses();
23632723 } else
2364
- if (event.getSource() == reduceMorphItem)
2724
+ if (source == reduceMorphItem)
23652725 {
23662726 MeshReduction(false);
23672727 } else
2368
- if (event.getSource() == reduce34MorphItem)
2728
+ if (source == reduce34MorphItem)
23692729 {
23702730 MeshReduction(true);
23712731 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2732
+ if (source == reverseTrianglesItem)
23732733 {
23742734 ReverseTriangles();
23752735 } else
2376
- if (event.getSource() == reduceMeshItem)
2736
+ if (source == reduceMeshItem)
23772737 {
23782738 ReduceMesh(false);
23792739 } else
2380
- if (event.getSource() == reduce34MeshItem)
2740
+ if (source == reduce34MeshItem)
23812741 {
23822742 ReduceMesh(true);
23832743 } else
2384
- if (event.getSource() == increaseMeshItem)
2744
+ if (source == increaseMeshItem)
23852745 {
23862746 IncreaseMesh();
23872747 } else
2388
- if (event.getSource() == clipMeshItem)
2748
+ if (source == clipMeshItem)
23892749 {
23902750 ClipMesh();
23912751 } else
2392
- if (event.getSource() == smoothMeshItem)
2752
+ if (source == smoothMeshItem)
23932753 {
23942754 SmoothMesh();
23952755 } else
2396
- if (event.getSource() == transformgeometryItem)
2756
+ if (source == transformGeometryItem)
23972757 {
23982758 TransformGeometry();
23992759 } else
2400
- if (event.getSource() == resetTransformItem)
2760
+ if (source == transformChildrenItem)
2761
+ {
2762
+ TransformChildren();
2763
+ } else
2764
+ if (source == resetTransformItem)
24012765 {
24022766 ResetTransform();
24032767 } else
2404
- if (event.getSource() == resetCentroidItem)
2768
+ if (source == resetCentroidItem)
24052769 {
2406
- ResetCentroid();
2770
+ ResetCentroid(true);
24072771 } else
2408
- if (event.getSource() == resetParentItem)
2772
+ if (source == resetCentroidXZItem)
2773
+ {
2774
+ ResetCentroid(false);
2775
+ } else
2776
+ if (source == resetParentItem)
24092777 {
24102778 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112779 {
....@@ -2415,7 +2783,7 @@
24152783
24162784 refreshContents();
24172785 } else
2418
- if (event.getSource() == repairParentItem)
2786
+ if (source == repairParentItem)
24192787 {
24202788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212789 {
....@@ -2429,7 +2797,21 @@
24292797
24302798 refreshContents();
24312799 } else
2432
- if (event.getSource() == sortbysizeItem)
2800
+ if (source == repairShadowItem)
2801
+ {
2802
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2803
+ {
2804
+ Object3D obj = (Object3D)e.nextElement();
2805
+ obj.RepairShadow();
2806
+// for (int i=0; i<obj.size(); i++)
2807
+// {
2808
+// obj.get(i).parent = obj;
2809
+// }
2810
+ }
2811
+
2812
+ refreshContents();
2813
+ } else
2814
+ if (source == sortbysizeItem)
24332815 {
24342816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352817 {
....@@ -2441,7 +2823,7 @@
24412823 ResetModel();
24422824 refreshContents();
24432825 } else
2444
- if (event.getSource() == sortbynameItem)
2826
+ if (source == sortbynameItem)
24452827 {
24462828 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472829 {
....@@ -2453,7 +2835,7 @@
24532835 ResetModel();
24542836 refreshContents();
24552837 } else
2456
- if (event.getSource() == attachPigmentItem)
2838
+ if (source == attachPigmentItem)
24572839 {
24582840 String texture = GetFile("Attach pigment");
24592841 Object3D obj;
....@@ -2465,7 +2847,7 @@
24652847
24662848 refreshContents();
24672849 } else
2468
- if (event.getSource() == detachPigmentItem)
2850
+ if (source == detachPigmentItem)
24692851 {
24702852 Object3D obj;
24712853 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2858,7 @@
24762858
24772859 refreshContents();
24782860 } else
2479
- if (event.getSource() == attachBumpItem)
2861
+ if (source == attachBumpItem)
24802862 {
24812863 String texture = GetFile("Attach bump");
24822864 Object3D obj;
....@@ -2488,7 +2870,7 @@
24882870
24892871 refreshContents();
24902872 } else
2491
- if (event.getSource() == detachBumpItem)
2873
+ if (source == detachBumpItem)
24922874 {
24932875 Object3D obj;
24942876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2881,7 @@
24992881
25002882 refreshContents();
25012883 } else
2502
- if (event.getSource() == pigmentBumpItem)
2884
+ if (source == pigmentBumpItem)
25032885 {
25042886 Object3D obj;
25052887 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2892,221 @@
25102892
25112893 refreshContents();
25122894 } else
2513
- if (event.getSource() == flashSelectionButton)
2895
+ if (source == flashSelectionButton)
25142896 {
25152897 CameraPane.flash = true;
25162898 refreshContents();
25172899 } else
2518
- if (event.getSource() == oneButton)
2900
+ if (source == oneButton)
25192901 {
25202902 } else
2521
- if (event.getSource() == twoButton)
2903
+ if (source == twoButton)
25222904 {
25232905 radio.layout = twoButton;
25242906 // bug
25252907 //gridPanel.setDividerLocation(1.0);
25262908 //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();
2909
+// bigThree.remove(scenePanel);
2910
+// bigThree.remove(centralPanel);
2911
+// bigThree.remove(XYZPanel);
2912
+// aWindowConstraints.gridx = 0;
2913
+// aWindowConstraints.gridy = 0;
2914
+// aWindowConstraints.gridwidth = 1;
2915
+// // aConstraints.gridheight = 3;
2916
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2917
+// aWindowConstraints.weightx = 0;
2918
+// aWindowConstraints.weighty = 1;
2919
+// //bigThree.add(jtp, aWindowConstraints);
2920
+// aWindowConstraints.weightx = 1;
2921
+// aWindowConstraints.gridwidth = 3;
2922
+// // aConstraints.gridheight = 3;
2923
+// aWindowConstraints.gridx = 1;
2924
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2925
+// bigThree.add(centralPanel, aWindowConstraints);
2926
+// aWindowConstraints.weightx = 0;
2927
+// aWindowConstraints.gridx = 4;
2928
+// aWindowConstraints.gridwidth = 1;
2929
+// // aConstraints.gridheight = 3;
2930
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2931
+// //bigThree.add(XYZPanel, aWindowConstraints);
2932
+// scenePanel.setVisible(false);
2933
+// centralPanel.setVisible(true);
2934
+// XYZPanel.setVisible(false);
2935
+ bigThree.ClearUI();
2936
+ bigThree.add(centralPanel);
2937
+ bigThree.FlushUI();
2938
+
2939
+ cameraView.requestFocusInWindow();
2940
+
2941
+// refreshContents(true);
2942
+//
2943
+// try
2944
+// {
2945
+// java.awt.Robot bot = new java.awt.Robot();
2946
+// int mask = InputEvent.BUTTON1_MASK;
2947
+// bot.mouseMove(100, 100);
2948
+// bot.mousePress(mask);
2949
+// bot.mouseRelease(mask);
2950
+// }
2951
+// catch (Exception e)
2952
+// {
2953
+//
2954
+// }
2955
+
25512956 } else
2552
- if (event.getSource() == threeButton)
2957
+ if (source == threeButton)
25532958 {
25542959 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();
2960
+
2961
+// bigThree.remove(scenePanel);
2962
+// bigThree.remove(centralPanel);
2963
+// bigThree.remove(XYZPanel);
2964
+// aWindowConstraints.gridx = 0;
2965
+// aWindowConstraints.gridy = 0;
2966
+// aWindowConstraints.gridwidth = 1;
2967
+// // aConstraints.gridheight = 3;
2968
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2969
+// aWindowConstraints.weightx = 0;
2970
+// aWindowConstraints.weighty = 1;
2971
+// //bigThree.add(jtp, aWindowConstraints);
2972
+// aWindowConstraints.weightx = 1;
2973
+// aWindowConstraints.gridwidth = 3;
2974
+// // aConstraints.gridheight = 3;
2975
+// aWindowConstraints.gridx = 1;
2976
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2977
+// bigThree.add(centralPanel, aWindowConstraints);
2978
+// aWindowConstraints.weightx = 0;
2979
+// aWindowConstraints.gridx = 4;
2980
+// aWindowConstraints.gridwidth = 1;
2981
+// // aConstraints.gridheight = 3;
2982
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2983
+// bigThree.add(XYZPanel, aWindowConstraints);
2984
+// bigThree.validate();
2985
+// scenePanel.setVisible(false);
2986
+// centralPanel.setVisible(true);
2987
+// XYZPanel.setVisible(true);
2988
+ bigThree.ClearUI();
2989
+ bigThree.add(centralPanel);
2990
+ bigThree.add(XYZPanel);
2991
+ bigThree.FlushUI();
2992
+
2993
+ cameraView.requestFocusInWindow();
25792994 } else
2580
- if (event.getSource() == fourButton)
2995
+ if (source == fourButton)
25812996 {
25822997 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();
2998
+
2999
+// bigThree.remove(scenePanel);
3000
+// bigThree.remove(centralPanel);
3001
+// bigThree.remove(XYZPanel);
3002
+// aWindowConstraints.gridx = 0;
3003
+// aWindowConstraints.gridy = 0;
3004
+// aWindowConstraints.gridwidth = 1;
3005
+// // aWindowConstraints.gridheight = 3;
3006
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3007
+// aWindowConstraints.weightx = 1;
3008
+// aWindowConstraints.weighty = 1;
3009
+// bigThree.add(scenePanel, aWindowConstraints);
3010
+// aWindowConstraints.weightx = 1;
3011
+// aWindowConstraints.gridwidth = 3;
3012
+// // aConstraints.gridheight = 3;
3013
+// aWindowConstraints.gridx = 1;
3014
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3015
+// //bigThree.add(cameraPanel, aWindowConstraints);
3016
+// aWindowConstraints.weightx = 0;
3017
+// aWindowConstraints.gridx = 4;
3018
+// aWindowConstraints.gridwidth = 1;
3019
+// // aWindowConstraints.gridheight = 3;
3020
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3021
+// //bigThree.add(XYZPanel, aWindowConstraints);
3022
+// bigThree.validate();
3023
+// scenePanel.setVisible(true);
3024
+// centralPanel.setVisible(false);
3025
+// XYZPanel.setVisible(false);
3026
+ bigThree.ClearUI();
3027
+ bigThree.add(scenePanel);
3028
+ bigThree.FlushUI();
3029
+
3030
+ cameraView.requestFocusInWindow();
26073031 } else
2608
- if (event.getSource() == sixButton)
3032
+ if (source == sixButton)
26093033 {
26103034 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();
3035
+
3036
+// bigThree.remove(scenePanel);
3037
+// bigThree.remove(centralPanel);
3038
+// bigThree.remove(XYZPanel);
3039
+// aWindowConstraints.gridx = 0;
3040
+// aWindowConstraints.gridy = 0;
3041
+// aWindowConstraints.gridwidth = 1;
3042
+// // aConstraints.gridheight = 3;
3043
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3044
+// aWindowConstraints.weightx = 0;
3045
+// aWindowConstraints.weighty = 1;
3046
+// bigThree.add(scenePanel, aWindowConstraints);
3047
+// aWindowConstraints.weightx = 1;
3048
+// aWindowConstraints.gridwidth = 3;
3049
+// // aWindowConstraints.gridheight = 3;
3050
+// aWindowConstraints.gridx = 1;
3051
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3052
+// bigThree.add(centralPanel, aWindowConstraints);
3053
+// aWindowConstraints.weightx = 0;
3054
+// aWindowConstraints.gridx = 4;
3055
+// aWindowConstraints.gridwidth = 1;
3056
+// // aWindowConstraints.gridheight = 3;
3057
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3058
+// //bigThree.add(XYZPanel, aConstraints);
3059
+// bigThree.validate();
3060
+// scenePanel.setVisible(true);
3061
+// centralPanel.setVisible(true);
3062
+// XYZPanel.setVisible(false);
3063
+ bigThree.ClearUI();
3064
+ bigThree.add(scenePanel);
3065
+ bigThree.add(centralPanel);
3066
+ bigThree.FlushUI();
3067
+
3068
+ cameraView.requestFocusInWindow();
26353069 } else
2636
- if (event.getSource() == sevenButton)
3070
+ if (source == sevenButton)
26373071 {
26383072 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();
3073
+
3074
+// bigThree.remove(scenePanel);
3075
+// bigThree.remove(centralPanel);
3076
+// bigThree.remove(XYZPanel);
3077
+// aWindowConstraints.gridx = 0;
3078
+// aWindowConstraints.gridy = 0;
3079
+// aWindowConstraints.gridwidth = 1;
3080
+// // aWindowConstraints.gridheight = 3;
3081
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3082
+// aWindowConstraints.weightx = 0;
3083
+// aWindowConstraints.weighty = 1;
3084
+// bigThree.add(scenePanel, aWindowConstraints);
3085
+// aWindowConstraints.weightx = 1;
3086
+// aWindowConstraints.gridwidth = 3;
3087
+// // aWindowConstraints.gridheight = 3;
3088
+// aWindowConstraints.gridx = 1;
3089
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3090
+// bigThree.add(centralPanel, aWindowConstraints);
3091
+// aWindowConstraints.weightx = 0;
3092
+// aWindowConstraints.gridx = 4;
3093
+// aWindowConstraints.gridwidth = 1;
3094
+// // aConstraints.gridheight = 3;
3095
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3096
+// bigThree.add(XYZPanel, aWindowConstraints);
3097
+// bigThree.validate();
3098
+// scenePanel.setVisible(true);
3099
+// centralPanel.setVisible(true);
3100
+// XYZPanel.setVisible(true);
3101
+ bigThree.ClearUI();
3102
+ bigThree.add(scenePanel);
3103
+ bigThree.add(centralPanel);
3104
+ bigThree.add(XYZPanel);
3105
+ bigThree.FlushUI();
3106
+
3107
+ cameraView.requestFocusInWindow();
26633108 } else
2664
- if (event.getSource() == rootButton)
3109
+ if (source == rootButton)
26653110 {
26663111 Object3D obj;
26673112 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,9 +3116,10 @@
26713116 EditObject(obj);
26723117 }
26733118
3119
+ cameraView.requestFocusInWindow();
26743120 refreshContents(true);
26753121 } else
2676
- if (event.getSource() == closeButton)
3122
+ if (source == closeButton)
26773123 {
26783124 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793125 cRadio ab;
....@@ -2692,13 +3138,15 @@
26923138 break;
26933139 }
26943140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
26953143 refreshContents(true);
26963144 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3145
+ if (source == editItem || source == editButton)
26983146 {
26993147 EditSelection(false);
27003148 } else
2701
- if (event.getSource() == uneditButton)
3149
+ if (source == uneditButton)
27023150 {
27033151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043152 {
....@@ -2708,14 +3156,14 @@
27083156 child.CloseUI();
27093157 listUI.remove(child);
27103158
2711
- child.editWindow = null; // ???????????
3159
+ //child.editWindow = null; // ???????????
27123160 }
2713
- objEditor.ctrlPanel.revalidate();
3161
+ objEditor.ctrlPanel.FlushUI();
27143162 //objEditor.jTree.clearSelection();
27153163 //objEditor.ResetSliders();
27163164 refreshContents(true);
27173165 } else
2718
- if (event.getSource() == clearPanelButton)
3166
+ if (source == clearPanelButton)
27193167 {
27203168 assert(copy == group);
27213169 //copy.ClearUI();
....@@ -2726,7 +3174,7 @@
27263174 listUI.clear();
27273175 refreshContents(true);
27283176 } else
2729
- if (event.getSource() == allParamsButton)
3177
+ if (source == allParamsButton)
27303178 {
27313179 assert(copy == group);
27323180
....@@ -2747,19 +3195,19 @@
27473195
27483196 refreshContents(true);
27493197 } else
2750
- if (event.getSource() == unselectButton)
3198
+ if (source == unselectButton)
27513199 {
27523200 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3201
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543202 objEditor.ResetSliders();
27553203 refreshContents(true);
27563204 } else
2757
- if(event.getSource() instanceof cRadio)
3205
+ if(source instanceof cRadio)
27583206 {
27593207 group.parent = keepparent;
27603208 group.attributes = 0;
27613209 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3210
+ /*cRadio*/ radio = (cRadio)source;
27633211 Object3D obj = radio.GetObject();
27643212 System.out.println("Edit " + obj);
27653213 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3227,7 @@
27793227 }
27803228
27813229 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3230
+ //Globals.theRenderer.object = group;
27833231 if(!useclient)
27843232 {
27853233 cameraView.renderCamera = radio.camera;
....@@ -2788,12 +3236,16 @@
27883236 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893237 cameraView.targetLookAt.set(radio.camera.lookAt);
27903238 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3239
+ //cameraView.lighttouched = true;
3240
+ Globals.lighttouched = true;
27923241 topView.object = group;
27933242 frontView.object = group;
27943243 sideView.object = group;
27953244 }
2796
- group.editWindow = this;
3245
+
3246
+// fix "+" issue
3247
+ //group.editWindow = this;
3248
+
27973249 /*
27983250 currentLayout = radio.layout;
27993251 if (currentLayout == null)
....@@ -2805,8 +3257,23 @@
28053257 //group.parent = null; // ROOT
28063258 //group.attributes = -1;
28073259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
28083262 refreshContents(true);
2809
- }
3263
+ } else if (event.getSource() == editCameraItem)
3264
+ {
3265
+ cameraView.ProtectCamera();
3266
+ cameraView.repaint();
3267
+ return;
3268
+ } else if (event.getSource() == revertCameraItem)
3269
+ {
3270
+ cameraView.RevertCamera();
3271
+ cameraView.repaint();
3272
+ return;
3273
+ // } else if (event.getSource() == textureButton)
3274
+ // {
3275
+ // return; // true;
3276
+ }
28103277 else
28113278 {
28123279 //return super.action(event, arg);
....@@ -2815,7 +3282,6 @@
28153282 }
28163283
28173284 boolean useclient = false;
2818
- cRadio radio;
28193285
28203286 void ToggleRoot()
28213287 {
....@@ -2824,7 +3290,7 @@
28243290 if (useclient)
28253291 {
28263292 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3293
+ Globals.lighttouched = true;
28283294 //topView.object = client;
28293295 //frontView.object = client;
28303296 //sideView.object = client;
....@@ -2832,7 +3298,7 @@
28323298 else
28333299 {
28343300 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3301
+ Globals.lighttouched = true;
28363302 //topView.object = group;
28373303 //frontView.object = group;
28383304 //sideView.object = group;
....@@ -2867,6 +3333,28 @@
28673333 refreshContents();
28683334 }
28693335
3336
+ void TransformChildren()
3337
+ {
3338
+ Object3D obj;
3339
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3340
+ {
3341
+ obj = (Object3D)e.nextElement();
3342
+ obj.KeepTextureMatrices();
3343
+ obj.TransformChildren();
3344
+ obj.RestoreTextureMatrices();
3345
+
3346
+// if (obj.parent == null)
3347
+// {
3348
+// System.out.println("NULL PARENT!");
3349
+// new Exception().printStackTrace();
3350
+// }
3351
+// else
3352
+// TouchTransform(obj);
3353
+// //obj.parent.Touch();
3354
+ }
3355
+
3356
+ refreshContents();
3357
+ }
28703358
28713359 void ResetTransform()
28723360 {
....@@ -2979,7 +3467,7 @@
29793467 refreshContents();
29803468 }
29813469
2982
- void ResetCentroid()
3470
+ void ResetCentroid(boolean full)
29833471 {
29843472 Object3D obj;
29853473 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3482,16 @@
29943482 LA.matIdentity(Object3D.mat);
29953483 obj.getBounds(minima, maxima, false);
29963484 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3485
+ if (full)
3486
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983487 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993488 obj.TransformMesh(Object3D.mat);
3489
+
30003490 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3491
+ if (full)
3492
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023493 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3494
+
30033495 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043496 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053497 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +3520,8 @@
30283520
30293521 int size = obj.MemorySize();
30303522
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
3523
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3524
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30323525 }
30333526 }
30343527 catch (Exception e)
....@@ -3065,9 +3558,9 @@
30653558 obj = (Object3D)e.nextElement();
30663559
30673560 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3561
+ Grafreed.AnalyzeObject(obj);
30693562 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3563
+ Grafreed.AnalyzeObject(obj.bRep);
30713564
30723565 // System.err.println((size/1024) + " KB is the size of " + obj);
30733566 }
....@@ -3109,6 +3602,20 @@
31093602 void GenNormals(boolean crease)
31103603 {
31113604 group.GenNormalsS(crease);
3605
+
3606
+ refreshContents();
3607
+ }
3608
+
3609
+ void GenNormalsMESH()
3610
+ {
3611
+ group.GenNormalsMeshS();
3612
+
3613
+ refreshContents();
3614
+ }
3615
+
3616
+ void GenNormalsMINE()
3617
+ {
3618
+ group.selection.GenNormalsMINE();
31123619
31133620 refreshContents();
31143621 }
....@@ -3157,104 +3664,259 @@
31573664
31583665 //Object3D buffer;
31593666 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
-
3667
+// BoundaryRep temprep;
3668
+// Object3D nodes;
3669
+// Vector<Vertex> vertices;
3670
+//
3671
+// cGroup buffer;
3672
+//
3673
+// public void Vertex(Object3D node, Vertex v)
3674
+// {
3675
+//// vertices.add(v);
3676
+//// nodes.addElement(node);
3677
+////
3678
+//// if (temprep.GetCache(v) != null)
3679
+//// {
3680
+//// temprep.Remove(v);
3681
+//// } else
3682
+//// {
3683
+//// temprep.Remember(v);
3684
+//// }
3685
+//
3686
+// //Object3D node = nodes.get(index);
3687
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3688
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3689
+//
3690
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3691
+//
3692
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3693
+//
3694
+// cGroup g = new cGroup();
3695
+//
3696
+// if (g.toParent == null)
3697
+// {
3698
+// g.toParent = LA.newMatrix();
3699
+// g.fromParent = LA.newMatrix();
3700
+// }
3701
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3702
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3703
+//
3704
+// g.add(GrafreeD.clipboard);
3705
+//
3706
+// buffer.add(g);
3707
+// }
3708
+//
3709
+// public void Face(Object3D node, Face f)
3710
+// {
3711
+//
3712
+// }
3713
+//
3714
+// void ParseVerticesOld() // ??
3715
+// {
3716
+// //if (group.selection.size() != 1)
3717
+// // return;
3718
+//
3719
+// temprep = new BoundaryRep();
3720
+// nodes = new Object3D();
3721
+// vertices = new Vector<Vertex>();
3722
+//
3723
+// boolean epsequal = GrafreeD.epsequal;
3724
+// GrafreeD.epsequal = true;
3725
+//
3726
+// for (int i=0; i<group.selection.size(); i++)
3727
+// {
3728
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3729
+//
3730
+// group.selection.get(i).Parse(
3731
+//this );
3732
+//
3733
+// int repsize = temprep.VertexCount();
3734
+// int tablesize = temprep.vertextable.size();
3735
+// int nodesize = nodes.size();
3736
+//
3737
+// assert(vertices.size() == nodes.size());
3738
+//
3739
+// temprep.vertextable.elements();
3740
+//
3741
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3742
+//
3743
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3744
+// {
3745
+// cGroup g = new cGroup();
3746
+//
3747
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3748
+//
3749
+// Object3D node = nodes.get(index);
3750
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3751
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3752
+//
3753
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3754
+//
3755
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3756
+//
3757
+// if (g.toParent == null)
3758
+// {
3759
+// g.toParent = LA.newMatrix();
3760
+// g.fromParent = LA.newMatrix();
3761
+// }
3762
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3763
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3764
+//
3765
+// g.add(GrafreeD.clipboard);
3766
+//
3767
+// buffer.add(g);
3768
+// }
3769
+//
3770
+// makeSomething(buffer, i==group.selection.size()-1);
3771
+// }
3772
+//
3773
+// GrafreeD.epsequal = epsequal;
3774
+//
3775
+// //buffer = null;
3776
+// temprep = null;
3777
+// nodes = null;
3778
+//
3779
+// refreshContents();
3780
+// }
3781
+
31843782 void ParseVertices()
31853783 {
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;
3784
+ boolean epsequal = Grafreed.epsequal;
3785
+ Grafreed.epsequal = true;
31953786
31963787 for (int i=0; i<group.selection.size(); i++)
31973788 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3789
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993790
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3791
+ group.selection.get(i).Parse(
3792
+
3793
+ new iParse()
3794
+ {
3795
+ public void Vertex(Object3D node, Vertex v)
3796
+ {
3797
+ temp.set(v);
3798
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053799
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();
3800
+ cGroup g = new cGroup();
32113801
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3802
+ if (g.toParent == null)
3803
+ {
3804
+ g.toParent = LA.newMatrix();
3805
+ g.fromParent = LA.newMatrix();
3806
+ }
3807
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3808
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153809
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);
3810
+ g.add(Grafreed.clipboard);
32203811
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);
3812
+ buffer.add(g);
3813
+ }
32323814
3233
- g.add(GraphreeD.clipboard);
3815
+ public void Face(Object3D node, Face f)
3816
+ {
32343817
3235
- buffer.add(g);
3236
- }
3818
+ }
3819
+ }
3820
+ );
32373821
32383822 makeSomething(buffer, i==group.selection.size()-1);
32393823 }
32403824
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3825
+ Grafreed.epsequal = epsequal;
32463826
32473827 refreshContents();
32483828 }
3249
-
3829
+
3830
+ void TextureVertices()
3831
+ {
3832
+ for (int i=0; i<group.selection.size(); i++)
3833
+ {
3834
+ group.selection.get(i).Parse(
3835
+ new iParse()
3836
+ {
3837
+ public void Vertex(Object3D node, Vertex v)
3838
+ {
3839
+ cTexture tex = node.GetTextures();
3840
+ String pigment = Object3D.GetPigment(tex);
3841
+ //String bump = Object3D.GetBump(tex);
3842
+
3843
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3844
+
3845
+ try
3846
+ {
3847
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3848
+ }
3849
+ catch (Exception e)
3850
+ {
3851
+ System.err.println("FAIL: " + node);
3852
+ }
3853
+
3854
+ double s = v.s;
3855
+
3856
+ if (s == 1)
3857
+ s = 0;
3858
+
3859
+ double t = v.t;
3860
+
3861
+ if (t == 1)
3862
+ t = 0;
3863
+
3864
+ int indexs = (int) (texturedata.getWidth() * s);
3865
+ int indext = (int) (texturedata.getHeight() * t);
3866
+
3867
+ int index = indext * texturedata.getWidth() + indexs;
3868
+
3869
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3870
+
3871
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3872
+
3873
+ float scale = bytebuf.get(index*slide) & 0xFF;
3874
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3875
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3876
+ scale /= 3;
3877
+
3878
+ scale /= 0xFF;
3879
+ // c'est quoi ca? scale /= 4;
3880
+
3881
+ //v.AO = scale;
3882
+
3883
+ v.x += v.norm.x * scale;
3884
+ v.y += v.norm.y * scale;
3885
+ v.z += v.norm.z * scale;
3886
+ }
3887
+
3888
+ public void Face(Object3D node, Face f)
3889
+ {
3890
+ }
3891
+ }
3892
+ );
3893
+ }
3894
+
3895
+ refreshContents();
3896
+ }
3897
+
32503898 void Align()
32513899 {
3900
+ if (group.selection.size() == 0)
3901
+ return;
3902
+
3903
+ cVector bbmin = new cVector();
3904
+ cVector bbmax = new cVector();
3905
+
3906
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3907
+
3908
+ double dx = bbmax.x - bbmin.x;
3909
+ double dy = bbmax.y - bbmin.y;
3910
+ double dz = bbmax.z - bbmin.z;
3911
+
3912
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3913
+
32523914 for (int i=0; i<group.selection.size(); i++)
32533915 {
32543916 Object3D obj = group.selection.get(i);
32553917
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3918
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3919
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583920 }
32593921
32603922 refreshContents();
....@@ -3267,7 +3929,7 @@
32673929 // ref.SaveSupports();
32683930 // Object3D par = ref.parent;
32693931 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3932
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713933 // ref.parent = par;
32723934 // ref.RestoreSupports();
32733935
....@@ -3275,11 +3937,11 @@
32753937
32763938 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32773939
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
3940
+ boolean random = CameraPane.SWITCH;
3941
+ CameraPane.SWITCH = false; // parse all random nodes
32803942 lowres.linkVerticesThis(null);
32813943 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
3944
+ CameraPane.SWITCH = random;
32833945
32843946 System.err.flush();
32853947
....@@ -3297,7 +3959,7 @@
32973959 // lowres.SaveSupports();
32983960 // par = lowres.parent;
32993961 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3962
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013963 Object3D newlow = CloneObject(lowres, false);
33023964 newlow.name = sn.switchobject.get(i).name;
33033965 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3981,7 @@
33193981 return;
33203982
33213983 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3984
+ Object3D ref = Grafreed.clipboard.get(0);
33233985
33243986 Object3D newgroup = new Object3D("Po:" + poses.name);
33253987
....@@ -3488,7 +4150,7 @@
34884150 group.selection.RelinkToSupport(); // july 2014
34894151 System.out.println("DONE.");
34904152 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4153
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924154 }
34934155
34944156 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4175,20 @@
35134175
35144176 void ClipMesh()
35154177 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4178
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174179 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4180
+ Object3D content = Grafreed.clipboard.get(0);
35194181
35204182 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214183 content = ((cGroup)content).get(0);
35224184
35234185 // for (int i=0; i<group.selection.size(); i++)
35244186 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4187
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264188 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4189
+ group.selection.ClipMesh(Grafreed.clipboard);
35284190 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4191
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304192 System.out.println("DONE.");
35314193 refreshContents();
35324194 }
....@@ -3571,6 +4233,18 @@
35714233 void MarkLeaves(boolean hide)
35724234 {
35734235 group.selection.MarkLeaves(hide);
4236
+ refreshContents();
4237
+ }
4238
+
4239
+ void RewindLeaves(boolean hide)
4240
+ {
4241
+ group.selection.RewindLeaves(hide);
4242
+ refreshContents();
4243
+ }
4244
+
4245
+ void RandomLeaves(boolean hide)
4246
+ {
4247
+ group.selection.RandomLeaves(hide);
35744248 refreshContents();
35754249 }
35764250
....@@ -3659,7 +4333,7 @@
36594333 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604334
36614335 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4336
+ if(elem != group || !newWindow)
36634337 {
36644338 // if (!(elem instanceof Composite))
36654339 // newWindow = false;
....@@ -3749,7 +4423,6 @@
37494423 //case 702: // Event.LIST_DESELECT
37504424 group.deselectAll();
37514425 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37534426 if (tps != null)
37544427 {
37554428 for (int i=0; i < tps.length; i++)
....@@ -3758,31 +4431,30 @@
37584431
37594432 //if (child.parent != null)
37604433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
37614435 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37654436 }
37664437 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4438
+// else
4439
+// {
4440
+// objEditor.SetMaterial(group); // .GetMaterial());
4441
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4442
+// System.err.println("info : " + group.GetPath());
4443
+// }
37734444
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4445
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774446 CameraPane.flash = true;
37784447
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4448
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804449 // a camera
37814450 {
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;
4451
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4452
+ {
4453
+ CameraPane.camerachangeframe = 0; // don't refuse it
4454
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4455
+ }
4456
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4457
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864458 }
37874459
37884460 refreshContents();
....@@ -3793,6 +4465,26 @@
37934465
37944466 freezemodel = false;
37954467 }
4468
+
4469
+ void refreshContents(boolean cp)
4470
+ {
4471
+ if (!Globals.MOUSEDRAGGED)
4472
+ {
4473
+ objEditor.ClearInfo(); // .GetMaterial());
4474
+
4475
+ for (int i=0; i < group.selection.Size(); i++)
4476
+ {
4477
+ Object3D child = (Object3D) group.selection.get(i);
4478
+
4479
+ objEditor.AddInfo(child, this, true);
4480
+ System.err.println("info : " + child.GetPath());
4481
+ }
4482
+
4483
+ objEditor.SetText(); // jan 2014
4484
+ }
4485
+
4486
+ super.refreshContents(cp);
4487
+ }
37964488
37974489 void linkSomething(Object3D thing)
37984490 {
....@@ -3864,16 +4556,18 @@
38644556 {
38654557 if (group.selection.isEmpty())
38664558 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4559
+
4560
+ Grafreed.clipboardIsTempGroup = false;
38684561 Composite tGroup = null;
38694562 if (group.selection.size() > 0) // 1)
38704563 {
38714564 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4565
+ Grafreed.clipboardIsTempGroup = true;
38734566 }
38744567
38754568 if (cut)
38764569 {
4570
+ Save();
38774571 //int indices[] = jList.getSelectedIndices();
38784572 //for (int i = indices.length - 1; i >= 0; i--)
38794573 //jList.remove(indices[i]);
....@@ -3909,16 +4603,16 @@
39094603 //System.out.println("cut " + child);
39104604 //System.out.println("parent = " + child.parent);
39114605 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
39134607 tGroup.add/*Child*/(tmp);
39144608 else
3915
- GraphreeD.clipboard = tmp;
4609
+ Grafreed.clipboard = tmp;
39164610 }
39174611 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4612
+ if (Grafreed.clipboardIsTempGroup)
39194613 tGroup.add/*Child*/(child);
39204614 else
3921
- GraphreeD.clipboard = child;
4615
+ Grafreed.clipboard = child;
39224616 }
39234617
39244618 //ResetModel();
....@@ -3950,21 +4644,23 @@
39504644 //System.out.println("cut " + elem);
39514645 //System.out.println("parent = " + elem.parent);
39524646 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4647
+ if (Grafreed.clipboardIsTempGroup)
39544648 tGroup.add/*Child*/(tmp);
39554649 else
3956
- GraphreeD.clipboard = tmp;
4650
+ Grafreed.clipboard = tmp;
39574651 }
39584652 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
39604654 tGroup.add/*Child*/(child);
39614655 else
3962
- GraphreeD.clipboard = child;
4656
+ Grafreed.clipboard = child;
39634657 }
39644658
39654659 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4660
+
4661
+ if (Grafreed.clipboardIsTempGroup)
4662
+ Grafreed.clipboard = tGroup;
4663
+
39684664 if (cut)
39694665 {
39704666 ResetModel();
....@@ -3974,11 +4670,11 @@
39744670
39754671 void paste(boolean expand)
39764672 {
3977
- // if (GraphreeD.clipboard == null)
4673
+ // if (GrafreeD.clipboard == null)
39784674 // return;
39794675 boolean first = true;
39804676
3981
- if (GraphreeD.clipboardIsTempGroup)
4677
+ if (Grafreed.clipboardIsTempGroup)
39824678 {
39834679 Composite temp;
39844680
....@@ -3989,7 +4685,7 @@
39894685 temp = (Composite)Applet3D.clipboard.deepCopy();
39904686 */
39914687 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4688
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934689 {
39944690 Object3D child = (Object3D)e.nextElement();
39954691
....@@ -4003,7 +4699,7 @@
40034699 else
40044700 elem = child.deepCopy(); // ?
40054701 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4702
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074703 // elem = elem.get(0);
40084704 makeSomething(elem, true); // ?? first);
40094705 //group.addChild(elem);
....@@ -4023,23 +4719,23 @@
40234719 //Object3D cb = Applet3D.clipboard;
40244720 //temp.addChild(cb);
40254721 //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());
4722
+ assert(Grafreed.clipboard.parent == null);
4723
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4724
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4725
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4726
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314727 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4728
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4729
+ Grafreed.clipboard.get(0).parent = keepparent;
40344730 }
40354731
40364732 ResetModel();
40374733 refreshContents();
40384734 }
40394735
4040
- void pasteInto(boolean copyit)
4736
+ void pasteInto(boolean copyit, boolean clone)
40414737 {
4042
-// if (GraphreeD.clipboard == null)
4738
+// if (GrafreeD.clipboard == null)
40434739 // return;
40444740
40454741 if (group.selection.size() != 1)
....@@ -4066,15 +4762,22 @@
40664762 if (copyit)
40674763 {
40684764 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4765
+ if (clone)
4766
+ {
4767
+ CloneClipboard(false); // sept 2014
4768
+ }
4769
+ else
4770
+ {
4771
+ paste(false);
4772
+ }
40704773 }
40714774 else
40724775 {
40734776 boolean first = true;
40744777
4075
- if (GraphreeD.clipboardIsTempGroup)
4778
+ if (Grafreed.clipboardIsTempGroup)
40764779 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4780
+ Composite temp = (Composite)Grafreed.clipboard;
40784781 Object3D copy;
40794782 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804783 {
....@@ -4084,7 +4787,7 @@
40844787 }
40854788 } else
40864789 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4790
+ linkSomething(Grafreed.clipboard); //.get(0));
40884791 }
40894792 }
40904793 }
....@@ -4276,6 +4979,26 @@
42764979 makeSomething(csg);
42774980 }
42784981
4982
+ void Ungroup(Object3D g)
4983
+ {
4984
+ if (g instanceof HiddenObject)
4985
+ {
4986
+ HiddenObject h = (HiddenObject) g;
4987
+
4988
+ for (int i=0; i<h.ActualSize(); i++)
4989
+ {
4990
+ objEditor.makeSomething(h.get(i), false);
4991
+ }
4992
+ }
4993
+ else
4994
+ {
4995
+ for (int i=0; i<g.Size(); i++)
4996
+ {
4997
+ objEditor.makeSomething(g.get(i), false);
4998
+ }
4999
+ }
5000
+ }
5001
+
42795002 void ungroup()
42805003 {
42815004 /*
....@@ -4469,21 +5192,6 @@
44695192 }
44705193 */
44715194
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
-
44875195 /*
44885196 public void Callback(Object obj)
44895197 {
....@@ -4507,26 +5215,9 @@
45075215 }
45085216 */
45095217
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
-
45275218 String GetFile(String dialogName)
45285219 {
4529
- if (GraphreeD.standAlone)
5220
+ if (Grafreed.standAlone)
45305221 {
45315222 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325223 browser.show();
....@@ -4590,10 +5281,18 @@
45905281 cButton flashSelectionButton;
45915282 cButton editButton;
45925283 cButton uneditButton;
5284
+ JCheckBox allParamsButton;
45935285 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955286 cButton unselectButton;
45965287
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
5291
+ cButton undoButton;
5292
+ cButton redoButton;
5293
+ cButton saveButton;
5294
+ cButton oneStepButton;
5295
+
45975296 cButton screenfitButton;
45985297 cButton screenfitpointButton;
45995298 cButton snapobjectButton;
....@@ -4604,14 +5303,6 @@
46045303 cButton closeButton;
46055304
46065305 cButton setsupportButton;
4607
-
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;
46155306
46165307 //
46175308 //Composite
....@@ -4624,6 +5315,8 @@
46245315 private MenuItem lookFromItem;
46255316 private MenuItem switchItem;
46265317 private MenuItem cutItem;
5318
+ private MenuItem undoItem;
5319
+ private MenuItem redoItem;
46275320 private MenuItem duplicateItem;
46285321 private MenuItem cloneItem;
46295322 private MenuItem cloneSupportItem;
....@@ -4635,8 +5328,9 @@
46355328 private MenuItem resetsupportItem;
46365329 private MenuItem resetreferencesItem;
46375330 private MenuItem linkverticesItem;
5331
+ private MenuItem relinkverticesItem;
46385332 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5333
+ private MenuItem resetAllItem;
46405334 private MenuItem stepAllItem;
46415335 private MenuItem revertMeshItem;
46425336 private MenuItem poseMeshItem;
....@@ -4647,14 +5341,17 @@
46475341 private MenuItem mergeGeometriesItem;
46485342 private MenuItem copyItem;
46495343 private MenuItem pasteItem;
5344
+ private MenuItem pasteIntoItem;
46505345 private MenuItem pasteLinkItem;
46515346 private MenuItem pasteCloneItem;
46525347 private MenuItem pasteExpandItem;
46535348 private MenuItem clearItem;
46545349 private MenuItem clearAllItem;
46555350 private MenuItem genUVItem;
5351
+ private MenuItem genNormalsMESHItem;
46565352 private MenuItem genNormalsCADItem;
46575353 private MenuItem genNormalsORGANItem;
5354
+ private MenuItem genNormalsMINEItem;
46585355 private MenuItem stripifyItem;
46595356 private MenuItem unstripifyItem;
46605357 private MenuItem trimItem;
....@@ -4683,6 +5380,10 @@
46835380 private MenuItem showleavesItem;
46845381 private MenuItem markleavesItem;
46855382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
46865387
46875388 private MenuItem flipVItem;
46885389 private MenuItem unflipVItem;
....@@ -4694,8 +5395,11 @@
46945395 private MenuItem panoTexturesItem;
46955396
46965397 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5398
+ private MenuItem resetCentroidXZItem;
46985399 private MenuItem resetTransformItem;
5400
+ private MenuItem transformGeometryItem;
5401
+ private MenuItem transformChildrenItem;
5402
+ private MenuItem hideItem;
46995403 private MenuItem grabItem;
47005404 private MenuItem backItem;
47015405 private MenuItem frontItem;
....@@ -4716,6 +5420,7 @@
47165420
47175421 private MenuItem resetParentItem;
47185422 private MenuItem repairParentItem;
5423
+ private MenuItem repairShadowItem;
47195424 private MenuItem sortbysizeItem;
47205425 private MenuItem sortbynameItem;
47215426
....@@ -4728,16 +5433,19 @@
47285433 private MenuItem particleItem;
47295434 private MenuItem ragdollItem;
47305435 private MenuItem ragdoll2Item;
5436
+ private MenuItem heightFieldItem;
5437
+ private MenuItem textureFieldItem;
47315438 private MenuItem gridItem;
47325439 private MenuItem rectoidItem;
47335440 private MenuItem ellipsoidItem;
47345441 private MenuItem coneItem;
47355442 private MenuItem torusItem;
47365443 private MenuItem superItem;
5444
+ private MenuItem kleinItem;
47375445 private MenuItem blobItem;
47385446 private MenuItem latheItem;
47395447 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5448
+ private MenuItem overlayItem;
47415449 private MenuItem meshItem;
47425450 // private MenuItem meshGroupItem;
47435451 private MenuItem springItem;
....@@ -4746,6 +5454,7 @@
47465454 private MenuItem csgItem;
47475455 private MenuItem templateItem;
47485456 private MenuItem textureItem;
5457
+ private MenuItem billboardItem;
47495458 private MenuItem shadowXItem;
47505459 private MenuItem shadowYItem;
47515460 private MenuItem shadowZItem;
....@@ -4758,11 +5467,6 @@
47585467 private MenuItem doubleItem;
47595468 private MenuItem tripleItem;
47605469
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665470 private MenuItem computeAOItem;
47675471 private MenuItem recompileItem;
47685472 private MenuItem editScriptItem;
....@@ -4772,4 +5476,8 @@
47725476 private MenuItem analyzeItem;
47735477 private MenuItem dumpItem;
47745478 //boolean freezemodel = false;
5479
+
5480
+ Menu cameraMenu;
5481
+ MenuItem editCameraItem;
5482
+ MenuItem revertCameraItem;
47755483 }