Normand Briere
2019-06-23 8088590686a45e71278f9a52bb9cc37943dc0c37
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,130 @@
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
+ menu.add("-");
180
+
181
+ menu.add("-");
182
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
183
+ pasteIntoItem.addActionListener(this);
184
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
185
+ pasteLinkItem.addActionListener(this);
186
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
187
+ pasteCloneItem.addActionListener(this);
188
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
189
+// pasteExpandItem.addActionListener(this);
190
+ menu.add("-");
191
+ clearItem = menu.add(new MenuItem("Clear"));
192
+ clearItem.addActionListener(this);
193
+
194
+ if (Globals.ADVANCED)
195
+ {
196
+ // Deletes the cameras...
197
+ clearAllItem = menu.add(new MenuItem("Clear All"));
198
+ clearAllItem.addActionListener(this);
199
+ }
200
+
201
+ menuBar.add(cameraMenu = new Menu("View"));
202
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
203
+ //zBufferItem.addActionListener(this);
204
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205
+ //normalLensItem.addActionListener(this);
206
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
+ revertCameraItem.addActionListener(this);
208
+
209
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
+ toggleFullScreenItem.addItemListener(this);
211
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
+ cameraMenu.add("-");
213
+
214
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
+ toggleTextureItem.addItemListener(this);
216
+ toggleTextureItem.setState(CameraPane.textureon);
217
+
218
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
+ toggleSwitchItem.addItemListener(this);
220
+ toggleSwitchItem.setState(CameraPane.SWITCH);
221
+
222
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ toggleHandleItem.addItemListener(this);
224
+ toggleHandleItem.setState(CameraPane.HANDLES);
225
+
226
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
227
+ togglePaintItem.addItemListener(this);
228
+ togglePaintItem.setState(CameraPane.PAINTMODE);
229
+
230
+ if (Globals.ADVANCED)
231
+ {
232
+ cameraMenu.add("-");
233
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
234
+ toggleLiveItem.addItemListener(this);
235
+ toggleLiveItem.setState(Globals.isLIVE());
236
+
237
+ cameraMenu.add(stepItem = new MenuItem("Step"));
238
+ stepItem.addActionListener(this);
239
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
240
+ // toggleDLItem.addItemListener(this);
241
+ // toggleDLItem.setState(false);
242
+
243
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
244
+ toggleRenderItem.addItemListener(this);
245
+ toggleRenderItem.setState(!CameraPane.frozen);
246
+
247
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248
+ toggleDebugItem.addItemListener(this);
249
+ toggleDebugItem.setState(Globals.DEBUG);
250
+
251
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252
+ toggleFrustumItem.addItemListener(this);
253
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
254
+
255
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
256
+ toggleFootContactItem.addItemListener(this);
257
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
258
+
259
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
260
+ toggleTimelineItem.addItemListener(this);
261
+ }
262
+
263
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
264
+// toggleRootItem.addItemListener(this);
265
+// toggleRootItem.setState(false);
266
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
267
+// animationItem.addItemListener(this);
268
+// animationItem.setState(CameraPane.ANIMATION);
269
+ cameraMenu.add("-");
270
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
271
+ editCameraItem.addActionListener(this);
272
+
273
+ if (Globals.ADVANCED)
274
+ {
152275 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153276 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154277 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,44 +283,17 @@
160283 lookAtItem.addActionListener(this);
161284 //lookFromItem.addActinoListener(this);
162285 //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);
286
+ }
287
+
288
+ oe.menuBar.add(menu = new Menu("Setting"));
289
+ if (Globals.ADVANCED)
290
+ {
196291 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197292 revertMeshItem.addActionListener(this);
198293 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199294 resetreferencesItem.addActionListener(this);
200295 menu.add("-");
296
+ }
201297 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202298 overwriteGeoItem.addActionListener(this);
203299 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,47 +305,68 @@
209305 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210306 overwriteUVItem.addActionListener(this);
211307 menu.add("-");
308
+ if (Globals.ADVANCED)
309
+ {
212310 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213311 generateMeshItem.addActionListener(this);
214312 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215313 poseMeshItem.addActionListener(this);
216314 menu.add("-");
315
+ }
217316 resetsupportItem = menu.add(new MenuItem("Reset support"));
218317 resetsupportItem.addActionListener(this);
219318 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220319 linkverticesItem.addActionListener(this);
320
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
321
+ relinkverticesItem.addActionListener(this);
322
+
323
+ if (Globals.ADVANCED)
324
+ {
221325 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222326 setMasterItem.addActionListener(this);
327
+ }
223328
224
- oe.menuBar.add(menu = new Menu("Object"));
329
+ oe.menuBar.add(menu = new Menu("Group"));
225330 grabItem = menu.add(new MenuItem("Grab"));
226331 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229332 backItem = menu.add(new MenuItem("Back"));
230333 backItem.addActionListener(this);
334
+ frontItem = menu.add(new MenuItem("Front"));
335
+ frontItem.addActionListener(this);
231336 compositeItem = menu.add(new MenuItem("Composite"));
232337 compositeItem.addActionListener(this);
338
+ hideItem = menu.add(new MenuItem("Hidden Group"));
339
+ hideItem.addActionListener(this);
340
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
341
+ ungroupItem.addActionListener(this);
233342 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
343
+ randomItem = menu.add(new MenuItem("Switch node"));
235344 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);
240345 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241346 switchGeoItem.addActionListener(this);
242347 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243348 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
349
+ morphItem = menu.add(new MenuItem("Morph Group"));
245350 morphItem.addActionListener(this);
351
+
352
+ if (Globals.ADVANCED)
353
+ {
354
+ menu.add("-");
355
+ physicsItem = menu.add(new MenuItem("Physics"));
356
+ physicsItem.addActionListener(this);
357
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
358
+ frameselectorItem.addActionListener(this);
246359 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247360 scriptNodeItem.addActionListener(this);
248361 cameraItem = menu.add(new MenuItem("Camera"));
249362 cameraItem.addActionListener(this);
250
- menu.add("-");
363
+ }
364
+
365
+ oe.menuBar.add(menu = new Menu("Object"));
251366 textureItem = menu.add(new MenuItem("Texture"));
252367 textureItem.addActionListener(this);
368
+ billboardItem = menu.add(new MenuItem("Billboard"));
369
+ billboardItem.addActionListener(this);
253370 csgItem = menu.add(new MenuItem("CSG"));
254371 csgItem.addActionListener(this);
255372 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -258,23 +375,29 @@
258375 shadowYItem.addActionListener(this);
259376 shadowZItem = menu.add(new MenuItem("Shadow Z"));
260377 shadowZItem.addActionListener(this);
378
+ if (Globals.ADVANCED)
379
+ {
380
+ menu.add("-");
261381 linkerItem = menu.add(new MenuItem("Linker"));
262382 linkerItem.addActionListener(this);
263
- templateItem = menu.add(new MenuItem("Template"));
264
- templateItem.addActionListener(this);
265383 attributeItem = menu.add(new MenuItem("Attribute"));
266384 attributeItem.addActionListener(this);
385
+ templateItem = menu.add(new MenuItem("Template"));
386
+ templateItem.addActionListener(this);
267387 pointflowItem = menu.add(new MenuItem("Point Flow"));
268388 pointflowItem.addActionListener(this);
389
+ }
269390 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272391 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273392 resetTransformItem.addActionListener(this);
274393 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275394 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
395
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
396
+ resetCentroidXZItem.addActionListener(this);
397
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
398
+ transformGeometryItem.addActionListener(this);
399
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
400
+ transformChildrenItem.addActionListener(this);
278401
279402 oe.menuBar.add(menu = new Menu("Geometry"));
280403 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +406,13 @@
283406 genNormalsORGANItem.addActionListener(this);
284407 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285408 genNormalsCADItem.addActionListener(this);
409
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
410
+ genNormalsMESHItem.addActionListener(this);
411
+ if (Globals.ADVANCED)
412
+ {
413
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
414
+ genNormalsMINEItem.addActionListener(this);
415
+ }
286416 stripifyItem = menu.add(new MenuItem("Stripify"));
287417 stripifyItem.addActionListener(this);
288418 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +422,6 @@
292422 untrimItem = menu.add(new MenuItem("Untrim"));
293423 untrimItem.addActionListener(this);
294424 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297425 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298426 clearColorsItem.addActionListener(this);
299427 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +434,34 @@
306434 reduce34MeshItem.addActionListener(this);
307435 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308436 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311437 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312438 clipMeshItem.addActionListener(this);
439
+
440
+ if (Globals.ADVANCED)
441
+ {
442
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
443
+ smoothMeshItem.addActionListener(this);
444
+ }
445
+
446
+ oe.menuBar.add(menu = new Menu("Attributes"));
447
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
448
+ clearMaterialsItem.addActionListener(this);
449
+ resetAllItem = menu.add(new MenuItem("Reset All"));
450
+ resetAllItem.addActionListener(this);
451
+ stepAllItem = menu.add(new MenuItem("Step All"));
452
+ stepAllItem.addActionListener(this);
313453 menu.add("-");
314454 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315455 liveleavesItem.addActionListener(this);
316456 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317457 unliveleavesItem.addActionListener(this);
458
+ if (Globals.ADVANCED)
459
+ {
318460 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319461 supportleavesItem.addActionListener(this);
320462 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321463 unsupportleavesItem.addActionListener(this);
464
+ }
322465 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323466 hideleavesItem.addActionListener(this);
324467 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +470,31 @@
327470 markleavesItem.addActionListener(this);
328471 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329472 unmarkleavesItem.addActionListener(this);
473
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
474
+ rewindleavesItem.addActionListener(this);
475
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
476
+ unrewindleavesItem.addActionListener(this);
477
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
478
+ randomleavesItem.addActionListener(this);
479
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
480
+ unrandomleavesItem.addActionListener(this);
330481 menu.add("-");
331482 flipVItem = menu.add(new MenuItem("Flip V"));
332483 flipVItem.addActionListener(this);
333484 unflipVItem = menu.add(new MenuItem("Unflip V"));
334485 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
486
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336487 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
488
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338489 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
490
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340491 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
492
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342493 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
494
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344495 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
496
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346497 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);
356498
357499 oe.menuBar.add(menu = new Menu("Selection"));
358500 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,14 +512,41 @@
370512 sortbysizeItem.addActionListener(this);
371513 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372514 sortbynameItem.addActionListener(this);
515
+ menu.add("-");
516
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
517
+ shareGeometriesItem.addActionListener(this);
518
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
519
+ mergeGeometriesItem.addActionListener(this);
520
+ if (Globals.ADVANCED)
521
+ {
522
+ // Pretty much the same as duplicate and clone.
523
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
524
+ extractGeometriesItem.addActionListener(this);
525
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
526
+ cloneGeometriesItem.addActionListener(this);
527
+ }
528
+
373529 oe.menuBar.add(menu = new Menu("Insert"));
374530 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
531
+
532
+ oe.menuBar.add(menu = new Menu("Tools"));
376533 buildToolsMenu(menu);
377534 }
378535
379536 void SetupUI2(ObjEditor oe)
380537 {
538
+ // June 2019
539
+ if (oe == null)
540
+ {
541
+ //super.SetupUI2(this);
542
+ //return;
543
+ }
544
+
545
+ if (copy != group)
546
+ {
547
+ //super.SetupUI2(this);
548
+ }
549
+
381550 //new Exception().printStackTrace();
382551
383552 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -406,150 +575,122 @@
406575 oe.radioPanel.add(dummyButton);
407576 oe.buttonGroup.add(dummyButton);
408577 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
578
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412579
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
580
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
581
+ //minButton.setToolTipText("Minimize window");
582
+ //minButton.addActionListener(this);
583
+
584
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ maxButton.setToolTipText("Maximize window");
586
+ maxButton.addActionListener(this);
587
+
588
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
+ fullButton.setToolTipText("Full-screen window");
590
+ fullButton.addActionListener(this);
591
+
592
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
593
+ undoButton.setToolTipText("Undo changes");
594
+ undoButton.addActionListener(this);
595
+
596
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ redoButton.setToolTipText("Redo changes");
598
+ redoButton.addActionListener(this);
599
+
600
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
601
+ saveButton.setToolTipText("Save changes");
602
+ saveButton.addActionListener(this);
603
+
604
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
605
+ liveCB.setToolTipText("Enable animation");
414606 liveCB.addItemListener(this);
415607
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);
608
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ oneStepButton.setToolTipText("Animate one step forward");
610
+ oneStepButton.addActionListener(this);
611
+
612
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
+ fastCB.setToolTipText("Fast mode");
434614 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);
615
+
616
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
617
+ trackCB.setToolTipText("Enable tracking");
476618 trackCB.addItemListener(this);
477619
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
620
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ screenfitButton.setToolTipText("Screen fit");
480622 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
623
+
482624 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483625 // 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;
488626
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);
627
+ if (Globals.ADVANCED)
628
+ {
629
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ snapobjectButton.addActionListener(this);
631
+ snapobjectButton.setToolTipText("Snap Object");
632
+ }
633
+
634
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ flashSelectionButton.setToolTipText("Show selection");
495636 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499637
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
638
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
639
+
640
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641
+ twoButton.setToolTipText("Show center view only");
502642 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
643
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504644 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
645
+ fourButton.setToolTipText("Show left panel only");
646
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ sixButton.setToolTipText("2-column layout left");
506648 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
649
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ threeButton.setToolTipText("2-column layout right");
508651 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
652
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
653
+ sevenButton.setToolTipText("3-column layout");
510654 sevenButton.addActionListener(this);
511655 //
512656
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
657
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
658
+ rootButton.setToolTipText("Edit selection in new tab");
514659 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
660
+
661
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ closeButton.setToolTipText("Close tab");
517663 closeButton.addActionListener(this);
518664 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519665 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521666
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
667
+ cGridBag commandsPanel = new cGridBag();
668
+
669
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ editButton.setToolTipText("Edit selection");
524671 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528672
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
673
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ uneditButton.setToolTipText("Unedit selection");
530675 uneditButton.addActionListener(this);
531676
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);
677
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
678
+ allParamsButton.setToolTipText("Edit all params");
544679 allParamsButton.addActionListener(this);
545680
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);
681
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ clearPanelButton.setToolTipText("Clear edit panel");
683
+ clearPanelButton.addActionListener(this);
684
+
685
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ unselectButton.setToolTipText("Unselect");
551687 unselectButton.addActionListener(this);
552688
689
+ commandsPanel.preferredHeight = 1;
690
+
691
+ oe.treePanel.add(commandsPanel);
692
+ oe.treePanel.Return();
693
+
553694 // oe.aConstraints.gridx += 1;
554695 // oe.aConstraints.weighty = 0;
555696 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +702,37 @@
561702 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562703 // gcButton.addActionListener(this);
563704
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;
705
+ cGridBag jSPPanel = new cGridBag();
706
+
707
+ JScrollPane jSP;
575708 //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);
709
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577710 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
711
+
712
+ oe.treePanel.add(jSPPanel);
713
+ oe.treePanel.Return();
582714
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);
715
+ cGridBag copyOptionsPanel = new cGridBag();
716
+
717
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
718
+ colorCB.setToolTipText("Copy color when dropped");
587719 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
720
+
721
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
722
+ materialCB.setToolTipText("Copy material when dropped");
590723 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
724
+
725
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
726
+ textureCB.setToolTipText("Copy texture when dropped");
593727 textureCB.addItemListener(this);
594728
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
729
+ copyOptionsPanel.preferredHeight = 1;
730
+ oe.treePanel.add(copyOptionsPanel);
731
+ oe.treePanel.Return();
597732
733
+// mainPanel.setDividerLocation(0.5); //1.0);
734
+// mainPanel.setResizeWeight(0.5);
735
+
598736 //jList.addListSelectionListener(this);
599737 oe.jTree.addTreeSelectionListener(this);
600738 //jTree.setRootVisible(false);
....@@ -616,20 +754,95 @@
616754 radio.layout = sevenButton;
617755 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618756 }
757
+
758
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
759
+ {
760
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
761
+ boxCB.setToolTipText("Display bounding boxes");
762
+ boxCB.addItemListener(this);
763
+
764
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
765
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
766
+ zoomBoxCB.addItemListener(this);
767
+
768
+ if (true) // Globals.ADVANCED)
769
+ {
770
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
771
+ supportCB.setToolTipText("Enable rigging");
772
+ supportCB.addItemListener(this);
773
+
774
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
775
+ // localCB.addItemListener(this);
776
+
777
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
778
+ crowdCB.setToolTipText("Used for crowds");
779
+ crowdCB.addItemListener(this);
780
+
781
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
782
+ smoothCB.setToolTipText("Snapping delay");
783
+ smoothCB.addItemListener(this);
784
+
785
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
786
+ slowCB.setToolTipText("Smooth interpolation");
787
+ slowCB.addItemListener(this);
788
+
789
+// constraints.gridy += 1;
790
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
791
+// speakerMocapCB.addItemListener(this);
792
+
793
+ if (false)
794
+ {
795
+ // handled in scripts
796
+ //constraints.gridy += 1;
797
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
798
+ speakerCameraCB.addItemListener(this);
799
+
800
+ //constraints.gridy += 1;
801
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
802
+ speakerFocusCB.addItemListener(this);
803
+
804
+ //constraints.gridy += 1;
805
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
806
+ smoothfocusCB.addItemListener(this);
807
+ }
808
+
809
+//constraints.gridx += 1;
810
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
811
+// debugCB.addItemListener(this);
812
+
813
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
814
+ oeilCB.addItemListener(this);
815
+
816
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
817
+ lookAtCB.setToolTipText("Look-at target");
818
+ lookAtCB.addItemListener(this);
819
+
820
+ }
821
+
822
+ cGridBag fill = new cGridBag();
823
+
824
+ fill.preferredHeight = 200;
825
+
826
+ panel.add(fill);
827
+
828
+ }
619829
620830 void EditObject(Object3D obj)
621831 {
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();
832
+ cRadio radioButton = new cRadio(obj.name);
833
+ radioButton.SetObject(obj);
834
+ radioButton.layout = sevenButton;
835
+ radioButton.SetCamera(cameraView.renderCamera, false);
836
+ radioButton.addActionListener(this);
837
+ radioPanel.add(radioButton);
838
+ buttonGroup.add(radioButton);
839
+ radioButton.doClick();
630840 }
841
+
631842 void SetupViews(ObjEditor oe)
632843 {
844
+ theFrame = this;
845
+
633846 oe.SetupViews();
634847
635848 System.out.println("SetupViews");
....@@ -646,6 +859,7 @@
646859 JCheckBox fastCB;
647860 JCheckBox slowCB;
648861 JCheckBox boxCB;
862
+ JCheckBox zoomBoxCB;
649863 JCheckBox trackCB;
650864 JCheckBox smoothfocusCB;
651865 // JCheckBox speakerMocapCB;
....@@ -688,10 +902,10 @@
688902 dropAttributes |= Object3D.TEXTURE;
689903 else
690904 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
905
+ } else if(e.getSource() == liveCB)
693906 {
694907 cameraView.ToggleLive();
908
+ refreshContents(false);
695909 }
696910 else if(e.getSource() == supportCB)
697911 {
....@@ -726,6 +940,10 @@
726940 Recompile();
727941 cameraView.repaint();
728942 // refreshContents();
943
+ }
944
+ else if(e.getSource() == zoomBoxCB)
945
+ {
946
+ cameraView.ToggleZoomBoxMode();
729947 }
730948 else if(e.getSource() == smoothfocusCB)
731949 {
....@@ -840,7 +1058,9 @@
8401058 // objEditor.DropFile((java.io.File[]) object, true);
8411059 // return;
8421060 // }
843
- if (string.charAt(0) == '/')
1061
+
1062
+ // File path for Mac and Windows
1063
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441064 {
8451065 // file(s)
8461066 String[] names = string.split("\n");
....@@ -867,7 +1087,7 @@
8671087
8681088 flashIt = false;
8691089 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1090
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711091 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721092
8731093 if (group.selection.size() == 1)
....@@ -894,11 +1114,11 @@
8941114 {
8951115 loadClipboard(true);
8961116 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
1117
+ pasteInto(false, false);
8981118 } else {
8991119 loadClipboard(false);
9001120 objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
1121
+ pasteInto(false, false); // true); // ???
9021122 }
9031123 }
9041124 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1002,6 +1222,8 @@
10021222
10031223 void buildCreateMenu(Menu menu)
10041224 {
1225
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1226
+ //heightFieldItem.addActionListener(this);
10051227 gridItem = menu.add(new MenuItem("Grid"));
10061228 gridItem.addActionListener(this);
10071229 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,29 +1236,37 @@
10141236 torusItem.addActionListener(this);
10151237 superItem = menu.add(new MenuItem("Superellipsoid"));
10161238 superItem.addActionListener(this);
1239
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1240
+ kleinItem.addActionListener(this);
10171241 particleItem = menu.add(new MenuItem("Particle system"));
10181242 particleItem.addActionListener(this);
1243
+ if (Globals.ADVANCED)
1244
+ {
10191245 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201246 ragdollItem.addActionListener(this);
10211247 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221248 ragdoll2Item.addActionListener(this);
1249
+ }
10231250 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1251
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251252 meshItem.addActionListener(this);
10261253 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271254 // meshGroupItem.addActionListener(this);
1255
+ if (Globals.ADVANCED)
1256
+ {
10281257 springItem = menu.add(new MenuItem("Spring"));
10291258 springItem.addActionListener(this);
10301259 flagItem = menu.add(new MenuItem("Flag"));
10311260 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);
10361261 blobItem = menu.add(new MenuItem("Blob"));
10371262 blobItem.addActionListener(this);
10381263 latheItem = menu.add(new MenuItem("Lathe"));
10391264 latheItem.addActionListener(this);
1265
+ }
1266
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1267
+ bezierItem.addActionListener(this);
1268
+ overlayItem = menu.add(new MenuItem("Overlay"));
1269
+ overlayItem.addActionListener(this);
10401270 lightItem = menu.add(new MenuItem("Light"));
10411271 lightItem.addActionListener(this);
10421272 menu.add("-");
....@@ -1046,46 +1276,44 @@
10461276 loopItem.addActionListener(this);
10471277 doubleItem = menu.add(new MenuItem("Fork"));
10481278 doubleItem.addActionListener(this);
1279
+ if (Globals.ADVANCED)
1280
+ {
10491281 tripleItem = menu.add(new MenuItem("Trident"));
10501282 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);
1283
+ }
10601284 }
10611285
10621286 void buildToolsMenu(Menu menu)
10631287 {
10641288 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651289 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1290
+ animationItem.setState(Globals.ANIMATION);
10671291
10681292 menu.add("-");
10691293 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701294 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1295
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1296
+ textureFieldItem.addActionListener(this);
1297
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721298 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751299 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761300 reduceMorphItem.addActionListener(this);
10771301 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781302 reduce34MorphItem.addActionListener(this);
1079
-
1303
+ menu.add("-");
10801304 menu.add(computeAOItem = new MenuItem("Compute AO"));
10811305 computeAOItem.addActionListener(this);
1082
- menu.add("-");
10831306
1307
+ if (Globals.ADVANCED)
1308
+ {
1309
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1310
+ mirrorItem.addActionListener(this);
1311
+ menu.add("-");
10841312 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851313 memoryItem.addActionListener(this);
10861314 menu.add(analyzeItem = new MenuItem("Analyze"));
10871315 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1316
+ menu.add(dumpItem = new MenuItem("Print"));
10891317 dumpItem.addActionListener(this);
10901318 // menu.add(pathItem = new MenuItem("From-to path"));
10911319 // pathItem.addActionListener(this);
....@@ -1094,6 +1322,8 @@
10941322 resetParentItem.addActionListener(this);
10951323 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961324 repairParentItem.addActionListener(this);
1325
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1326
+ repairShadowItem.addActionListener(this);
10971327 menu.add(invariantsItem = new MenuItem("Invariants"));
10981328 invariantsItem.addActionListener(this);
10991329 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1331,7 @@
11011331 menu.add("-");
11021332 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031333 editScriptItem.addActionListener(this);
1334
+ }
11041335 }
11051336
11061337 void ScreenFit()
....@@ -1429,9 +1660,9 @@
14291660
14301661 void Overwrite(int mask)
14311662 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1663
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14331664 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1665
+ Object3D content = Grafreed.clipboard.get(0);
14351666
14361667 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371668 content = ((cGroup)content).get(0);
....@@ -1454,6 +1685,7 @@
14541685 //
14551686 public void actionPerformed(ActionEvent event) // , Object arg)
14561687 {
1688
+ Object source = event.getSource();
14571689 /*
14581690 if (event.getSource() == nameField)
14591691 {
....@@ -1465,11 +1697,11 @@
14651697 }
14661698 else
14671699 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1700
+ if (source == lookAtItem || source == lookFromItem)
14691701 {
14701702 ScreenFit();
14711703 } else
1472
- if (event.getSource() == switchItem)
1704
+ if (source == switchItem)
14731705 {
14741706 cVector v1 = new cVector();
14751707 cVector v2 = new cVector();
....@@ -1478,11 +1710,11 @@
14781710 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791711 objEditor.cameraView.repaint();
14801712 } else
1481
- if (event.getSource() == rectoidItem)
1713
+ if (source == rectoidItem)
14821714 {
14831715 makeSomething(new Box());
14841716 } else
1485
- if (event.getSource() == particleItem)
1717
+ if (source == particleItem)
14861718 {
14871719 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881720 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1735,9 @@
15031735 applyExample(particleGeom, "SMOKE");
15041736 makeSomething(particleGeom);
15051737 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1738
+ if (source == ragdollItem || source == ragdoll2Item)
15071739 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1740
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091741
15101742 ragdoll.toParent = LA.newMatrix();
15111743 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1753,71 @@
15211753 makeSomething(ragdoll);
15221754 //makeSomething(new VehicleDemo());
15231755 } else
1524
- if (event.getSource() == gridItem)
1756
+ /*
1757
+ */
1758
+ if (source == heightFieldItem)
1759
+ {
1760
+ Object3D obj = new Object3D();
1761
+
1762
+ obj.CreateMaterial();
1763
+ obj.bRep = new BoundaryRep();
1764
+
1765
+ obj.bRep.CreateMesh(new iHeightField()
1766
+ {
1767
+ public double f(double x, double y)
1768
+ {
1769
+ // The Mandelbrot set is represented by coloring
1770
+ // each point (x,y) according to the number of
1771
+ // iterations it takes before the while loop in
1772
+ // this method ends. For points that are actually
1773
+ // in the Mandelbrot set, or very close to it, the
1774
+ // count will reach the maximum value, 80. These
1775
+ // points will be colored purple. All other colors
1776
+ // represent points that are definitely NOT in the set.
1777
+ x -= 600;
1778
+ y -= 500;
1779
+ x /= 200;
1780
+ y /= 200;
1781
+ int count = 0;
1782
+ double zx = x;
1783
+ double zy = y;
1784
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1785
+ double new_zx = zx*zx - zy*zy + x;
1786
+ zy = 2*zx*zy + y;
1787
+ zx = new_zx;
1788
+ count++;
1789
+ }
1790
+ return count; // Math.sqrt(count);
1791
+ }
1792
+ }, 1000,1000);
1793
+
1794
+ makeSomething(obj);
1795
+ } else
1796
+ if (source == gridItem)
15251797 {
15261798 makeSomething(new Grid());
15271799 } else
1528
- if (event.getSource() == ellipsoidItem)
1800
+ if (source == ellipsoidItem)
15291801 {
15301802 makeSomething(new Sphere());
15311803 } else
1532
- if (event.getSource() == coneItem)
1804
+ if (source == coneItem)
15331805 {
15341806 makeSomething(new Cone());
15351807 } else
1536
- if (event.getSource() == torusItem)
1808
+ if (source == torusItem)
15371809 {
15381810 makeSomething(new Torus());
15391811 } else
1540
- if (event.getSource() == superItem)
1812
+ if (source == superItem)
15411813 {
15421814 makeSomething(new Superellipsoid());
15431815 } else
1544
- if (event.getSource() == blobItem)
1816
+ if (source == kleinItem)
1817
+ {
1818
+ makeSomething(new Klein());
1819
+ } else
1820
+ if (source == blobItem)
15451821 {
15461822 Blob blob = new Blob();
15471823 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1825,15 @@
15491825 //blob.retile();
15501826 makeSomething(blob);
15511827 } else
1552
- if (event.getSource() == latheItem)
1828
+ if (source == latheItem)
15531829 {
15541830 makeSomething(new Lathe());
15551831 } else
1556
- if (event.getSource() == bezierItem)
1832
+ if (source == bezierItem)
15571833 {
15581834 makeSomething(new BezierSurface());
15591835 } else
1560
- if (event.getSource() == checkerItem)
1836
+ if (source == overlayItem)
15611837 {
15621838 /*
15631839 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1846,9 @@
15701846 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711847 LA.matInvert(obj.toParent, obj.fromParent);
15721848 */
1573
- makeSomething(new CheckerIG());
1849
+ makeSomething(new Checker());
15741850 } else
1575
- if (event.getSource() == meshItem)
1851
+ if (source == meshItem)
15761852 {
15771853 Object3D itemtomake = new Object3D();
15781854 Object3D child;
....@@ -1593,35 +1869,35 @@
15931869 makeSomething(child);
15941870 }
15951871 } else
1596
- if (event.getSource() == springItem)
1872
+ if (source == springItem)
15971873 {
15981874 cSpring s = new cSpring();
15991875 s.setup();
16001876 makeSomething(s);
16011877 } else
1602
- if (event.getSource() == flagItem)
1878
+ if (source == flagItem)
16031879 {
16041880 cSpring s = new cFlag();
16051881 s.setup();
16061882 makeSomething(s);
16071883 } else
1608
- if (event.getSource() == lightItem)
1884
+ if (source == lightItem)
16091885 {
16101886 makeSomething(new Light());
16111887 } else
1612
- if (event.getSource() == csgItem)
1888
+ if (source == csgItem)
16131889 {
16141890 group(new CSG());
16151891 } else
1616
- if (event.getSource() == templateItem)
1892
+ if (source == templateItem)
16171893 {
16181894 group(new cTemplate());
16191895 } else
1620
- if (event.getSource() == attributeItem)
1896
+ if (source == attributeItem)
16211897 {
16221898 makeSomething(new Attribute());
16231899 } else
1624
- if (event.getSource() == pointflowItem)
1900
+ if (source == pointflowItem)
16251901 {
16261902 makeSomething(new PointFlow());
16271903 } else
....@@ -1633,7 +1909,7 @@
16331909 } else
16341910 */
16351911
1636
- if (event.getSource() == superLoopItem)
1912
+ if (source == superLoopItem)
16371913 {
16381914 Composite g = new cGroup();
16391915 for (int i=0; i<15; i++)
....@@ -1655,7 +1931,7 @@
16551931
16561932 group(g);
16571933 } else
1658
- if (event.getSource() == loopItem)
1934
+ if (source == loopItem)
16591935 {
16601936 Composite csg = new GroupLeaf();
16611937 csg.count = 5;
....@@ -1664,7 +1940,7 @@
16641940 csg.addChild(child);
16651941 child.addChild(csg);
16661942 } else
1667
- if (event.getSource() == doubleItem)
1943
+ if (source == doubleItem)
16681944 {
16691945 Composite csg = new GroupLeaf();
16701946 csg.count = 5;
....@@ -1676,7 +1952,7 @@
16761952 csg.addChild(child);
16771953 child.addChild(csg);
16781954 } else
1679
- if (event.getSource() == tripleItem)
1955
+ if (source == tripleItem)
16801956 {
16811957 Composite csg = new GroupLeaf();
16821958 csg.count = 4;
....@@ -1691,71 +1967,83 @@
16911967 csg.addChild(child);
16921968 child.addChild(csg);
16931969 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
1970
+ if (source == computeAOItem)
16961971 {
1697
- ImportGFD();
1972
+ Globals.drawMode = CameraPane.OCCLUSION;
1973
+ Globals.theRenderer.repaint();
16981974 } 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)
1975
+ if (source == recompileItem)
17171976 {
17181977 Recompile();
17191978 refreshContents();
17201979 } else
1721
- if (event.getSource() == editScriptItem)
1980
+ if (source == editScriptItem)
17221981 {
17231982 OpenDialog();
17241983 refreshContents();
17251984 } else
1726
- if (event.getSource() == invariantsItem)
1985
+ if (source == invariantsItem)
17271986 {
17281987 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1988
+ Grafreed.grafreeD.universe.invariants();
17301989 } else
1731
- if (event.getSource() == memoryItem)
1990
+ if (source == memoryItem)
17321991 {
17331992 //System.out.println("Invariants:");
17341993 PrintMemory();
17351994 } else
1736
- if (event.getSource() == pathItem)
1995
+ if (source == pathItem)
17371996 {
17381997 PrintPath();
17391998 } else
1740
- if (event.getSource() == analyzeItem)
1999
+ if (source == analyzeItem)
17412000 {
17422001 AnalyzeObject();
17432002 } else
1744
- if (event.getSource() == dumpItem)
2003
+ if (source == dumpItem)
17452004 {
17462005 DumpObject();
17472006 } else
1748
- if (event.getSource() == screenfitButton)
2007
+ if (source == minButton)
2008
+ {
2009
+ Minimize();
2010
+ } else
2011
+ if (source == maxButton)
2012
+ {
2013
+ Maximize();
2014
+ } else
2015
+ if (source == fullButton)
2016
+ {
2017
+ ToggleFullScreen();
2018
+ } else
2019
+ if (source == undoButton)
2020
+ {
2021
+ Undo();
2022
+ } else
2023
+ if (source == redoButton)
2024
+ {
2025
+ Redo();
2026
+ } else
2027
+ if (source == saveButton)
2028
+ {
2029
+ Save();
2030
+ } else
2031
+ if (source == oneStepButton)
2032
+ {
2033
+ Globals.ONESTEP = true;
2034
+ cameraView.repaint();
2035
+ } else
2036
+ if (source == screenfitButton)
17492037 {
17502038 //Reload(lastConverter, lastFilename, true);
17512039 ScreenFit();
17522040 } else
1753
- if (event.getSource() == screenfitpointButton)
2041
+ if (source == screenfitpointButton)
17542042 {
17552043 //Reload(lastConverter, lastFilename, true);
17562044 ScreenFitPoint();
17572045 } else
1758
- if (event.getSource() == snapobjectButton)
2046
+ if (source == snapobjectButton)
17592047 {
17602048 //Reload(lastConverter, lastFilename, true);
17612049 SnapObject();
....@@ -1766,13 +2054,13 @@
17662054 // Recompile();
17672055 // refreshContents();
17682056 // } else
1769
- if (event.getSource() == gcButton)
2057
+ if (source == gcButton)
17702058 {
17712059 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722060 System.gc();
17732061 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742062 } else
1775
- if (event.getSource() == editLeafItem)
2063
+ if (source == editLeafItem)
17762064 {
17772065 Object3D obj;
17782066 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2074,78 @@
17862074 }
17872075 refreshContents(true);
17882076 } else
1789
- if (event.getSource() == openWindowItem)
2077
+ if (source == openWindowItem)
17902078 {
17912079 EditSelection(true);
17922080 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2081
+ if (source == cutItem || source == clearButton)
17942082 {
17952083 loadClipboard(true);
17962084 } else
1797
- if (event.getSource() == duplicateItem)
2085
+ if (source == undoItem)
17982086 {
1799
- Object3D keep = GraphreeD.clipboard;
2087
+ Undo();
2088
+ } else
2089
+ if (source == redoItem)
2090
+ {
2091
+ Redo();
2092
+ } else
2093
+ if (source == duplicateItem)
2094
+ {
2095
+ Object3D keep = Grafreed.clipboard;
18002096 loadClipboard(false);
18012097 paste(false);
1802
- GraphreeD.clipboard = keep;
2098
+ Grafreed.clipboard = keep;
18032099 } else
1804
- if (event.getSource() == cloneItem)
2100
+ if (source == cloneItem)
18052101 {
18062102 CloneSelection(false);
18072103 } else
1808
- if (event.getSource() == cloneSupportItem)
2104
+ if (source == cloneSupportItem)
18092105 {
18102106 CloneSelection(true);
18112107 } else
1812
- if (event.getSource() == copyItem)
2108
+ if (source == copyItem)
18132109 {
18142110 loadClipboard(false);
18152111 } else
1816
- if (event.getSource() == pasteItem)
2112
+ if (source == pasteItem)
18172113 {
18182114 paste(false);
18192115 } else
1820
- if (event.getSource() == pasteLinkItem)
2116
+ if (source == pasteIntoItem)
18212117 {
1822
- pasteInto(false);
2118
+ pasteInto(true, false);
18232119 } else
1824
- if (event.getSource() == pasteCloneItem)
2120
+ if (source == pasteLinkItem)
18252121 {
1826
- pasteInto(true);
2122
+ pasteInto(false, false);
18272123 } else
1828
- if (event.getSource() == pasteExpandItem)
2124
+ if (source == pasteCloneItem)
2125
+ {
2126
+ pasteInto(true, true);
2127
+ } else
2128
+ if (source == pasteExpandItem)
18292129 {
18302130 paste(true);
18312131 } else
1832
- if (event.getSource() == synchronizeItem)
2132
+ if (source == synchronizeItem)
18332133 {
18342134 Overwrite(Object3D.TRANSFORM);
18352135 } else
1836
- if (event.getSource() == overwriteNameItem)
2136
+ if (source == overwriteNameItem)
18372137 {
18382138 Overwrite(Object3D.NAME);
18392139 } else
1840
- if (event.getSource() == overwriteUVItem)
2140
+ if (source == overwriteUVItem)
18412141 {
18422142 Overwrite(Object3D.UV);
18432143 } else
1844
- if (event.getSource() == overwriteMatItem)
2144
+ if (source == overwriteMatItem)
18452145 {
2146
+ /* july 2015
18462147 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2148
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482149 else
18492150 {
18502151 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2157,16 @@
18562157 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572158 }
18582159 }
2160
+ */
2161
+
2162
+ Overwrite(dropAttributes);
18592163 }
1860
- if (event.getSource() == overwriteGeoItem)
2164
+ if (source == overwriteGeoItem)
18612165 {
18622166 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2167
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642168 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2169
+// Object3D content = GrafreeD.clipboard.get(0);
18662170 //
18672171 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682172 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2178,7 @@
18742178 // refreshContents();
18752179 // }
18762180 } else
1877
- if (event.getSource() == generateMeshItem)
2181
+ if (source == generateMeshItem)
18782182 {
18792183 //if (group.selection.size() == 1)
18802184 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2189,7 @@
18852189 ResetModel();
18862190 refreshContents();
18872191 } else
1888
- if (event.getSource() == extractGeometriesItem)
2192
+ if (source == extractGeometriesItem)
18892193 {
18902194 boolean one = false;
18912195
....@@ -1912,7 +2216,7 @@
19122216 ResetModel();
19132217 refreshContents();
19142218 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2219
+ if (source == cloneGeometriesItem)
19162220 {
19172221 boolean one = false;
19182222
....@@ -1938,32 +2242,37 @@
19382242 ResetModel();
19392243 refreshContents();
19402244 } else
1941
- if (event.getSource() == shareGeometriesItem)
2245
+ if (source == shareGeometriesItem)
19422246 {
19432247 boolean one = false;
19442248
19452249 if (group.selection.size() == 1)
19462250 one = true;
19472251
2252
+ Object3D merge = null;
2253
+
19482254 Object3D content = new cGroup();
19492255
19502256 for (int i=0; i<group.selection.size(); i++)
19512257 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2258
+ merge = new Merge(group.selection.get(i));
19532259
19542260 if (one)
1955
- makeSomething(sel, false);
2261
+ makeSomething(merge, false);
19562262 else
1957
- content.addChild(sel);
2263
+ content.addChild(merge);
19582264 }
19592265
19602266 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2267
+ makeSomething(content, true);
2268
+ else
2269
+ {
2270
+ ResetModel();
2271
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2272
+ refreshContents();
2273
+ }
19652274 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2275
+ if (source == mergeGeometriesItem)
19672276 {
19682277 boolean one = false;
19692278
....@@ -1993,11 +2302,11 @@
19932302 ResetModel();
19942303 refreshContents();
19952304 } else
1996
- if (event.getSource() == linkverticesItem)
2305
+ if (source == linkverticesItem)
19972306 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2307
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992308 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2309
+// Object3D content = GrafreeD.clipboard.get(0);
20012310 //
20022311 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032312 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2315,48 @@
20062315 // group.selection.get(0).setMasterThis(content); // should be identity
20072316 // refreshContents();
20082317 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2318
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102319 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2320
+ Object3D content = Grafreed.clipboard.get(0);
20122321
20132322 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142323 content = ((cGroup)content).get(0);
20152324
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2325
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172326 for (int i=0; i<group.selection.size(); i++)
20182327 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2328
+ boolean random = CameraPane.SWITCH;
2329
+ CameraPane.SWITCH = false; // parse all random nodes
20212330 group.selection.get(i).linkVerticesThis(content);
20222331 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2332
+ CameraPane.SWITCH = random;
20242333 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2334
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262335 refreshContents();
20272336 }
20282337 } else
2029
- if (event.getSource() == resetsupportItem)
2338
+ if (source == resetsupportItem)
20302339 {
20312340 for (int i=0; i<group.selection.size(); i++)
20322341 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2342
+ boolean random = CameraPane.SWITCH;
2343
+ CameraPane.SWITCH = false; // parse all random nodes
20352344 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2345
+ CameraPane.SWITCH = random;
20372346 }
20382347
20392348 refreshContents();
20402349 } else
2041
- if (event.getSource() == resetreferencesItem)
2350
+ if (source == relinkverticesItem)
2351
+ {
2352
+ boolean random = CameraPane.SWITCH;
2353
+ CameraPane.SWITCH = false; // parse all random nodes
2354
+ group.selection.RelinkToSupport();
2355
+ CameraPane.SWITCH = random;
2356
+
2357
+ refreshContents();
2358
+ } else
2359
+ if (source == resetreferencesItem)
20422360 {
20432361 for (int i=0; i<group.selection.size(); i++)
20442362 {
....@@ -2047,11 +2365,11 @@
20472365
20482366 refreshContents();
20492367 } else
2050
- if (event.getSource() == setMasterItem)
2368
+ if (source == setMasterItem)
20512369 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2370
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532371 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2372
+ Object3D content = Grafreed.clipboard.get(0);
20552373
20562374 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572375 content = ((cGroup)content).get(0);
....@@ -2060,13 +2378,13 @@
20602378 refreshContents();
20612379 }
20622380 } else
2063
- if (event.getSource() == poseMeshItem)
2381
+ if (source == poseMeshItem)
20642382 {
20652383 if (group.selection.size() == 1)
20662384 {
2067
- if (GraphreeD.clipboard.size() == 1)
2385
+ if (Grafreed.clipboard.size() == 1)
20682386 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2387
+ Object3D content = Grafreed.clipboard.get(0);
20702388
20712389 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722390 content = ((cGroup)content).get(0);
....@@ -2079,19 +2397,19 @@
20792397 }
20802398
20812399 } else
2082
- if (event.getSource() == revertMeshItem)
2400
+ if (source == revertMeshItem)
20832401 {
20842402 RevertMeshes();
20852403 } else
2086
- if (event.getSource() == resetMeshItem)
2404
+ if (source == resetAllItem)
20872405 {
20882406 ResetAll();
20892407 } else
2090
- if (event.getSource() == stepAllItem)
2408
+ if (source == stepAllItem)
20912409 {
20922410 StepAll();
20932411 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2412
+ if (source == clearItem) // || event.getSource() == clearButton)
20952413 {
20962414 //int indices[] = jList.getSelectedIndices();
20972415 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2417,46 @@
20992417
21002418 ClearSelection(false);
21012419 } else
2102
- if (event.getSource() == clearAllItem)
2420
+ if (source == clearAllItem)
21032421 {
21042422 ClearSelection(true);
21052423 } else
2106
- if (event.getSource() == grabItem)
2424
+ if (source == grabItem)
21072425 {
21082426 group(new cGroup(), true);
21092427 } else
2110
- if (event.getSource() == frontItem)
2428
+ if (source == hideItem)
2429
+ {
2430
+ group(new HiddenObject());
2431
+ } else
2432
+ if (source == frontItem)
21112433 {
21122434 front();
21132435 } else
2114
- if (event.getSource() == backItem)
2436
+ if (source == backItem)
21152437 {
21162438 back();
21172439 } else
2118
- if (event.getSource() == cameraItem)
2440
+ if (source == cameraItem)
21192441 {
21202442 makeSomething(new Camera());
21212443 } else
2122
- if (event.getSource() == compositeItem)
2444
+ if (source == compositeItem)
21232445 {
21242446 group(new Composite());
21252447 } else
2126
- if (event.getSource() == randomItem)
2448
+ if (source == randomItem)
21272449 {
21282450 RandomNode random = new RandomNode();
21292451 group(random);
21302452 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2453
+ random.name = random.get(0).name + "Switch";
21322454 } else
2133
- if (event.getSource() == physicsItem)
2455
+ if (source == physicsItem)
21342456 {
21352457 group(new PhysicsNode());
21362458 } else
2137
- if (event.getSource() == frameselectorItem)
2459
+ if (source == frameselectorItem)
21382460 {
21392461 for (int i=0; i<group.selection.size(); i++)
21402462 {
....@@ -2146,7 +2468,7 @@
21462468 ResetModel();
21472469 refreshContents();
21482470 } else
2149
- if (event.getSource() == switchGeoItem)
2471
+ if (source == switchGeoItem)
21502472 {
21512473 for (int i=0; i<group.selection.size(); i++)
21522474 {
....@@ -2158,7 +2480,7 @@
21582480 ResetModel();
21592481 refreshContents();
21602482 } else
2161
- if (event.getSource() == switchTransfoItem)
2483
+ if (source == switchTransfoItem)
21622484 {
21632485 for (int i=0; i<group.selection.size(); i++)
21642486 {
....@@ -2170,7 +2492,7 @@
21702492 ResetModel();
21712493 refreshContents();
21722494 } else
2173
- if (event.getSource() == morphItem)
2495
+ if (source == morphItem)
21742496 {
21752497 for (int i=0; i<group.selection.size(); i++)
21762498 {
....@@ -2182,7 +2504,7 @@
21822504 ResetModel();
21832505 refreshContents();
21842506 } else
2185
- if (event.getSource() == scriptNodeItem)
2507
+ if (source == scriptNodeItem)
21862508 {
21872509 boolean atleastone = false;
21882510
....@@ -2221,191 +2543,239 @@
22212543 }
22222544 }
22232545 } else
2224
- if (event.getSource() == linkerItem)
2546
+ if (source == linkerItem)
22252547 {
22262548 group(new cLinker());
22272549 } else
2228
- if (event.getSource() == textureItem)
2550
+ if (source == textureItem)
22292551 {
22302552 group(new TextureNode());
22312553 } else
2232
- if (event.getSource() == shadowXItem)
2554
+ if (source == billboardItem)
2555
+ {
2556
+ group(new BillboardNode());
2557
+ } else
2558
+ if (source == shadowXItem)
22332559 {
22342560 CastShadow(0);
22352561 } else
2236
- if (event.getSource() == shadowYItem)
2562
+ if (source == shadowYItem)
22372563 {
22382564 CastShadow(1);
22392565 } else
2240
- if (event.getSource() == shadowZItem)
2566
+ if (source == shadowZItem)
22412567 {
22422568 CastShadow(2);
22432569 } else
2244
- if (event.getSource() == ungroupItem)
2570
+ if (source == ungroupItem)
22452571 {
2246
- ungroup();
2572
+ //ungroup();
2573
+ for (int i=0; i<group.selection.size(); i++)
2574
+ {
2575
+ Ungroup(group.selection.get(i));
2576
+ }
2577
+
2578
+ ClearSelection(false);
2579
+
2580
+ refreshContents();
22472581 } else
2248
- if (event.getSource() == genUVItem)
2582
+ if (source == genUVItem)
22492583 {
22502584 GenUV();
22512585 } else
2252
- if (event.getSource() == genNormalsCADItem)
2586
+ if (source == genNormalsCADItem)
22532587 {
22542588 GenNormals(true);
22552589 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2590
+ if (source == genNormalsMESHItem)
2591
+ {
2592
+ GenNormalsMESH();
2593
+ } else
2594
+ if (source == genNormalsORGANItem)
22572595 {
22582596 GenNormals(false);
22592597 } else
2260
- if (event.getSource() == stripifyItem)
2598
+ if (source == genNormalsMINEItem)
2599
+ {
2600
+ GenNormalsMINE();
2601
+ } else
2602
+ if (source == stripifyItem)
22612603 {
22622604 Stripify();
22632605 } else
2264
- if (event.getSource() == unstripifyItem)
2606
+ if (source == unstripifyItem)
22652607 {
22662608 Unstripify();
22672609 } else
2268
- if (event.getSource() == trimItem)
2610
+ if (source == trimItem)
22692611 {
22702612 Trim();
22712613 } else
2272
- if (event.getSource() == untrimItem)
2614
+ if (source == untrimItem)
22732615 {
22742616 Untrim();
22752617 } else
2276
- if (event.getSource() == clearColorsItem)
2618
+ if (source == clearColorsItem)
22772619 {
22782620 ClearColors();
22792621 } else
2280
- if (event.getSource() == clearMaterialsItem)
2622
+ if (source == clearMaterialsItem)
22812623 {
22822624 ClearMaterials();
22832625 } else
2284
- if (event.getSource() == liveleavesItem)
2626
+ if (source == liveleavesItem)
22852627 {
22862628 LiveLeaves(true);
22872629 } else
2288
- if (event.getSource() == unliveleavesItem)
2630
+ if (source == unliveleavesItem)
22892631 {
22902632 LiveLeaves(false);
22912633 } else
2292
- if (event.getSource() == supportleavesItem)
2634
+ if (source == supportleavesItem)
22932635 {
22942636 SupportLeaves(true);
22952637 } else
2296
- if (event.getSource() == unsupportleavesItem)
2638
+ if (source == unsupportleavesItem)
22972639 {
22982640 SupportLeaves(false);
22992641 } else
2300
- if (event.getSource() == hideleavesItem)
2642
+ if (source == hideleavesItem)
23012643 {
23022644 HideLeaves(true);
23032645 } else
2304
- if (event.getSource() == showleavesItem)
2646
+ if (source == showleavesItem)
23052647 {
23062648 HideLeaves(false);
23072649 } else
2308
- if (event.getSource() == markleavesItem)
2650
+ if (source == markleavesItem)
23092651 {
23102652 MarkLeaves(true);
23112653 } else
2312
- if (event.getSource() == unmarkleavesItem)
2654
+ if (source == unmarkleavesItem)
23132655 {
23142656 MarkLeaves(false);
23152657 } else
2316
- if (event.getSource() == flipVItem)
2658
+ if (source == rewindleavesItem)
2659
+ {
2660
+ RewindLeaves(true);
2661
+ } else
2662
+ if (source == unrewindleavesItem)
2663
+ {
2664
+ RewindLeaves(false);
2665
+ } else
2666
+ if (source == randomleavesItem)
2667
+ {
2668
+ RandomLeaves(true);
2669
+ } else
2670
+ if (source == unrandomleavesItem)
2671
+ {
2672
+ RandomLeaves(false);
2673
+ } else
2674
+ if (source == flipVItem)
23172675 {
23182676 FlipV(true);
23192677 } else
2320
- if (event.getSource() == unflipVItem)
2678
+ if (source == unflipVItem)
23212679 {
23222680 FlipV(false);
23232681 } else
2324
- if (event.getSource() == lowTexturesItem)
2682
+ if (source == lowTexturesItem)
23252683 {
23262684 SetTexRes(0);
23272685 } else
2328
- if (event.getSource() == normalTexturesItem)
2686
+ if (source == normalTexturesItem)
23292687 {
23302688 SetTexRes(1);
23312689 } else
2332
- if (event.getSource() == highTexturesItem)
2690
+ if (source == highTexturesItem)
23332691 {
23342692 SetTexRes(2);
23352693 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2694
+ if (source == veryhighTexturesItem)
23372695 {
23382696 SetTexRes(3);
23392697 } else
2340
- if (event.getSource() == maxTexturesItem)
2698
+ if (source == maxTexturesItem)
23412699 {
23422700 SetTexRes(4);
23432701 } else
2344
- if (event.getSource() == panoTexturesItem)
2702
+ if (source == panoTexturesItem)
23452703 {
23462704 SetTexRes(5);
23472705 } else
2348
- if (event.getSource() == reverseNormalsItem)
2706
+ if (source == reverseNormalsItem)
23492707 {
23502708 ReverseNormals();
23512709 } else
2352
- if (event.getSource() == parseverticesItem)
2710
+ if (source == parseverticesItem)
23532711 {
23542712 ParseVertices();
23552713 } else
2356
- if (event.getSource() == alignItem)
2714
+ if (source == textureFieldItem)
2715
+ {
2716
+ TextureVertices();
2717
+ } else
2718
+ if (source == alignItem)
23572719 {
23582720 Align();
23592721 } else
2360
- if (event.getSource() == mirrorItem)
2722
+ if (source == mirrorItem)
23612723 {
23622724 MirrorPoses();
23632725 } else
2364
- if (event.getSource() == reduceMorphItem)
2726
+ if (source == reduceMorphItem)
23652727 {
23662728 MeshReduction(false);
23672729 } else
2368
- if (event.getSource() == reduce34MorphItem)
2730
+ if (source == reduce34MorphItem)
23692731 {
23702732 MeshReduction(true);
23712733 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2734
+ if (source == reverseTrianglesItem)
23732735 {
23742736 ReverseTriangles();
23752737 } else
2376
- if (event.getSource() == reduceMeshItem)
2738
+ if (source == reduceMeshItem)
23772739 {
23782740 ReduceMesh(false);
23792741 } else
2380
- if (event.getSource() == reduce34MeshItem)
2742
+ if (source == reduce34MeshItem)
23812743 {
23822744 ReduceMesh(true);
23832745 } else
2384
- if (event.getSource() == increaseMeshItem)
2746
+ if (source == increaseMeshItem)
23852747 {
23862748 IncreaseMesh();
23872749 } else
2388
- if (event.getSource() == clipMeshItem)
2750
+ if (source == clipMeshItem)
23892751 {
23902752 ClipMesh();
23912753 } else
2392
- if (event.getSource() == smoothMeshItem)
2754
+ if (source == smoothMeshItem)
23932755 {
23942756 SmoothMesh();
23952757 } else
2396
- if (event.getSource() == transformgeometryItem)
2758
+ if (source == transformGeometryItem)
23972759 {
23982760 TransformGeometry();
23992761 } else
2400
- if (event.getSource() == resetTransformItem)
2762
+ if (source == transformChildrenItem)
2763
+ {
2764
+ TransformChildren();
2765
+ } else
2766
+ if (source == resetTransformItem)
24012767 {
24022768 ResetTransform();
24032769 } else
2404
- if (event.getSource() == resetCentroidItem)
2770
+ if (source == resetCentroidItem)
24052771 {
2406
- ResetCentroid();
2772
+ ResetCentroid(true);
24072773 } else
2408
- if (event.getSource() == resetParentItem)
2774
+ if (source == resetCentroidXZItem)
2775
+ {
2776
+ ResetCentroid(false);
2777
+ } else
2778
+ if (source == resetParentItem)
24092779 {
24102780 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112781 {
....@@ -2415,7 +2785,7 @@
24152785
24162786 refreshContents();
24172787 } else
2418
- if (event.getSource() == repairParentItem)
2788
+ if (source == repairParentItem)
24192789 {
24202790 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212791 {
....@@ -2429,7 +2799,21 @@
24292799
24302800 refreshContents();
24312801 } else
2432
- if (event.getSource() == sortbysizeItem)
2802
+ if (source == repairShadowItem)
2803
+ {
2804
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2805
+ {
2806
+ Object3D obj = (Object3D)e.nextElement();
2807
+ obj.RepairShadow();
2808
+// for (int i=0; i<obj.size(); i++)
2809
+// {
2810
+// obj.get(i).parent = obj;
2811
+// }
2812
+ }
2813
+
2814
+ refreshContents();
2815
+ } else
2816
+ if (source == sortbysizeItem)
24332817 {
24342818 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352819 {
....@@ -2441,7 +2825,7 @@
24412825 ResetModel();
24422826 refreshContents();
24432827 } else
2444
- if (event.getSource() == sortbynameItem)
2828
+ if (source == sortbynameItem)
24452829 {
24462830 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472831 {
....@@ -2453,7 +2837,7 @@
24532837 ResetModel();
24542838 refreshContents();
24552839 } else
2456
- if (event.getSource() == attachPigmentItem)
2840
+ if (source == attachPigmentItem)
24572841 {
24582842 String texture = GetFile("Attach pigment");
24592843 Object3D obj;
....@@ -2465,7 +2849,7 @@
24652849
24662850 refreshContents();
24672851 } else
2468
- if (event.getSource() == detachPigmentItem)
2852
+ if (source == detachPigmentItem)
24692853 {
24702854 Object3D obj;
24712855 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2860,7 @@
24762860
24772861 refreshContents();
24782862 } else
2479
- if (event.getSource() == attachBumpItem)
2863
+ if (source == attachBumpItem)
24802864 {
24812865 String texture = GetFile("Attach bump");
24822866 Object3D obj;
....@@ -2488,7 +2872,7 @@
24882872
24892873 refreshContents();
24902874 } else
2491
- if (event.getSource() == detachBumpItem)
2875
+ if (source == detachBumpItem)
24922876 {
24932877 Object3D obj;
24942878 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2883,7 @@
24992883
25002884 refreshContents();
25012885 } else
2502
- if (event.getSource() == pigmentBumpItem)
2886
+ if (source == pigmentBumpItem)
25032887 {
25042888 Object3D obj;
25052889 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2894,221 @@
25102894
25112895 refreshContents();
25122896 } else
2513
- if (event.getSource() == flashSelectionButton)
2897
+ if (source == flashSelectionButton)
25142898 {
25152899 CameraPane.flash = true;
25162900 refreshContents();
25172901 } else
2518
- if (event.getSource() == oneButton)
2902
+ if (source == oneButton)
25192903 {
25202904 } else
2521
- if (event.getSource() == twoButton)
2905
+ if (source == twoButton)
25222906 {
25232907 radio.layout = twoButton;
25242908 // bug
25252909 //gridPanel.setDividerLocation(1.0);
25262910 //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();
2911
+// bigThree.remove(scenePanel);
2912
+// bigThree.remove(centralPanel);
2913
+// bigThree.remove(XYZPanel);
2914
+// aWindowConstraints.gridx = 0;
2915
+// aWindowConstraints.gridy = 0;
2916
+// aWindowConstraints.gridwidth = 1;
2917
+// // aConstraints.gridheight = 3;
2918
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2919
+// aWindowConstraints.weightx = 0;
2920
+// aWindowConstraints.weighty = 1;
2921
+// //bigThree.add(jtp, aWindowConstraints);
2922
+// aWindowConstraints.weightx = 1;
2923
+// aWindowConstraints.gridwidth = 3;
2924
+// // aConstraints.gridheight = 3;
2925
+// aWindowConstraints.gridx = 1;
2926
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2927
+// bigThree.add(centralPanel, aWindowConstraints);
2928
+// aWindowConstraints.weightx = 0;
2929
+// aWindowConstraints.gridx = 4;
2930
+// aWindowConstraints.gridwidth = 1;
2931
+// // aConstraints.gridheight = 3;
2932
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2933
+// //bigThree.add(XYZPanel, aWindowConstraints);
2934
+// scenePanel.setVisible(false);
2935
+// centralPanel.setVisible(true);
2936
+// XYZPanel.setVisible(false);
2937
+ bigThree.ClearUI();
2938
+ bigThree.add(centralPanel);
2939
+ bigThree.FlushUI();
2940
+
2941
+ cameraView.requestFocusInWindow();
2942
+
2943
+// refreshContents(true);
2944
+//
2945
+// try
2946
+// {
2947
+// java.awt.Robot bot = new java.awt.Robot();
2948
+// int mask = InputEvent.BUTTON1_MASK;
2949
+// bot.mouseMove(100, 100);
2950
+// bot.mousePress(mask);
2951
+// bot.mouseRelease(mask);
2952
+// }
2953
+// catch (Exception e)
2954
+// {
2955
+//
2956
+// }
2957
+
25512958 } else
2552
- if (event.getSource() == threeButton)
2959
+ if (source == threeButton)
25532960 {
25542961 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();
2962
+
2963
+// bigThree.remove(scenePanel);
2964
+// bigThree.remove(centralPanel);
2965
+// bigThree.remove(XYZPanel);
2966
+// aWindowConstraints.gridx = 0;
2967
+// aWindowConstraints.gridy = 0;
2968
+// aWindowConstraints.gridwidth = 1;
2969
+// // aConstraints.gridheight = 3;
2970
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2971
+// aWindowConstraints.weightx = 0;
2972
+// aWindowConstraints.weighty = 1;
2973
+// //bigThree.add(jtp, aWindowConstraints);
2974
+// aWindowConstraints.weightx = 1;
2975
+// aWindowConstraints.gridwidth = 3;
2976
+// // aConstraints.gridheight = 3;
2977
+// aWindowConstraints.gridx = 1;
2978
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2979
+// bigThree.add(centralPanel, aWindowConstraints);
2980
+// aWindowConstraints.weightx = 0;
2981
+// aWindowConstraints.gridx = 4;
2982
+// aWindowConstraints.gridwidth = 1;
2983
+// // aConstraints.gridheight = 3;
2984
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2985
+// bigThree.add(XYZPanel, aWindowConstraints);
2986
+// bigThree.validate();
2987
+// scenePanel.setVisible(false);
2988
+// centralPanel.setVisible(true);
2989
+// XYZPanel.setVisible(true);
2990
+ bigThree.ClearUI();
2991
+ bigThree.add(centralPanel);
2992
+ bigThree.add(XYZPanel);
2993
+ bigThree.FlushUI();
2994
+
2995
+ cameraView.requestFocusInWindow();
25792996 } else
2580
- if (event.getSource() == fourButton)
2997
+ if (source == fourButton)
25812998 {
25822999 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();
3000
+
3001
+// bigThree.remove(scenePanel);
3002
+// bigThree.remove(centralPanel);
3003
+// bigThree.remove(XYZPanel);
3004
+// aWindowConstraints.gridx = 0;
3005
+// aWindowConstraints.gridy = 0;
3006
+// aWindowConstraints.gridwidth = 1;
3007
+// // aWindowConstraints.gridheight = 3;
3008
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3009
+// aWindowConstraints.weightx = 1;
3010
+// aWindowConstraints.weighty = 1;
3011
+// bigThree.add(scenePanel, aWindowConstraints);
3012
+// aWindowConstraints.weightx = 1;
3013
+// aWindowConstraints.gridwidth = 3;
3014
+// // aConstraints.gridheight = 3;
3015
+// aWindowConstraints.gridx = 1;
3016
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3017
+// //bigThree.add(cameraPanel, aWindowConstraints);
3018
+// aWindowConstraints.weightx = 0;
3019
+// aWindowConstraints.gridx = 4;
3020
+// aWindowConstraints.gridwidth = 1;
3021
+// // aWindowConstraints.gridheight = 3;
3022
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3023
+// //bigThree.add(XYZPanel, aWindowConstraints);
3024
+// bigThree.validate();
3025
+// scenePanel.setVisible(true);
3026
+// centralPanel.setVisible(false);
3027
+// XYZPanel.setVisible(false);
3028
+ bigThree.ClearUI();
3029
+ bigThree.add(scenePanel);
3030
+ bigThree.FlushUI();
3031
+
3032
+ cameraView.requestFocusInWindow();
26073033 } else
2608
- if (event.getSource() == sixButton)
3034
+ if (source == sixButton)
26093035 {
26103036 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();
3037
+
3038
+// bigThree.remove(scenePanel);
3039
+// bigThree.remove(centralPanel);
3040
+// bigThree.remove(XYZPanel);
3041
+// aWindowConstraints.gridx = 0;
3042
+// aWindowConstraints.gridy = 0;
3043
+// aWindowConstraints.gridwidth = 1;
3044
+// // aConstraints.gridheight = 3;
3045
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3046
+// aWindowConstraints.weightx = 0;
3047
+// aWindowConstraints.weighty = 1;
3048
+// bigThree.add(scenePanel, aWindowConstraints);
3049
+// aWindowConstraints.weightx = 1;
3050
+// aWindowConstraints.gridwidth = 3;
3051
+// // aWindowConstraints.gridheight = 3;
3052
+// aWindowConstraints.gridx = 1;
3053
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3054
+// bigThree.add(centralPanel, aWindowConstraints);
3055
+// aWindowConstraints.weightx = 0;
3056
+// aWindowConstraints.gridx = 4;
3057
+// aWindowConstraints.gridwidth = 1;
3058
+// // aWindowConstraints.gridheight = 3;
3059
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3060
+// //bigThree.add(XYZPanel, aConstraints);
3061
+// bigThree.validate();
3062
+// scenePanel.setVisible(true);
3063
+// centralPanel.setVisible(true);
3064
+// XYZPanel.setVisible(false);
3065
+ bigThree.ClearUI();
3066
+ bigThree.add(scenePanel);
3067
+ bigThree.add(centralPanel);
3068
+ bigThree.FlushUI();
3069
+
3070
+ cameraView.requestFocusInWindow();
26353071 } else
2636
- if (event.getSource() == sevenButton)
3072
+ if (source == sevenButton)
26373073 {
26383074 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();
3075
+
3076
+// bigThree.remove(scenePanel);
3077
+// bigThree.remove(centralPanel);
3078
+// bigThree.remove(XYZPanel);
3079
+// aWindowConstraints.gridx = 0;
3080
+// aWindowConstraints.gridy = 0;
3081
+// aWindowConstraints.gridwidth = 1;
3082
+// // aWindowConstraints.gridheight = 3;
3083
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3084
+// aWindowConstraints.weightx = 0;
3085
+// aWindowConstraints.weighty = 1;
3086
+// bigThree.add(scenePanel, aWindowConstraints);
3087
+// aWindowConstraints.weightx = 1;
3088
+// aWindowConstraints.gridwidth = 3;
3089
+// // aWindowConstraints.gridheight = 3;
3090
+// aWindowConstraints.gridx = 1;
3091
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3092
+// bigThree.add(centralPanel, aWindowConstraints);
3093
+// aWindowConstraints.weightx = 0;
3094
+// aWindowConstraints.gridx = 4;
3095
+// aWindowConstraints.gridwidth = 1;
3096
+// // aConstraints.gridheight = 3;
3097
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3098
+// bigThree.add(XYZPanel, aWindowConstraints);
3099
+// bigThree.validate();
3100
+// scenePanel.setVisible(true);
3101
+// centralPanel.setVisible(true);
3102
+// XYZPanel.setVisible(true);
3103
+ bigThree.ClearUI();
3104
+ bigThree.add(scenePanel);
3105
+ bigThree.add(centralPanel);
3106
+ bigThree.add(XYZPanel);
3107
+ bigThree.FlushUI();
3108
+
3109
+ cameraView.requestFocusInWindow();
26633110 } else
2664
- if (event.getSource() == rootButton)
3111
+ if (source == rootButton)
26653112 {
26663113 Object3D obj;
26673114 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,9 +3118,10 @@
26713118 EditObject(obj);
26723119 }
26733120
3121
+ cameraView.requestFocusInWindow();
26743122 refreshContents(true);
26753123 } else
2676
- if (event.getSource() == closeButton)
3124
+ if (source == closeButton)
26773125 {
26783126 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793127 cRadio ab;
....@@ -2692,13 +3140,15 @@
26923140 break;
26933141 }
26943142 }
3143
+
3144
+ cameraView.requestFocusInWindow();
26953145 refreshContents(true);
26963146 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3147
+ if (source == editItem || source == editButton)
26983148 {
26993149 EditSelection(false);
27003150 } else
2701
- if (event.getSource() == uneditButton)
3151
+ if (source == uneditButton)
27023152 {
27033153 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043154 {
....@@ -2708,14 +3158,14 @@
27083158 child.CloseUI();
27093159 listUI.remove(child);
27103160
2711
- child.editWindow = null; // ???????????
3161
+ //child.editWindow = null; // ???????????
27123162 }
2713
- objEditor.ctrlPanel.revalidate();
3163
+ objEditor.ctrlPanel.FlushUI();
27143164 //objEditor.jTree.clearSelection();
27153165 //objEditor.ResetSliders();
27163166 refreshContents(true);
27173167 } else
2718
- if (event.getSource() == clearPanelButton)
3168
+ if (source == clearPanelButton)
27193169 {
27203170 assert(copy == group);
27213171 //copy.ClearUI();
....@@ -2726,7 +3176,7 @@
27263176 listUI.clear();
27273177 refreshContents(true);
27283178 } else
2729
- if (event.getSource() == allParamsButton)
3179
+ if (source == allParamsButton)
27303180 {
27313181 assert(copy == group);
27323182
....@@ -2747,19 +3197,19 @@
27473197
27483198 refreshContents(true);
27493199 } else
2750
- if (event.getSource() == unselectButton)
3200
+ if (source == unselectButton)
27513201 {
27523202 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3203
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543204 objEditor.ResetSliders();
27553205 refreshContents(true);
27563206 } else
2757
- if(event.getSource() instanceof cRadio)
3207
+ if(source instanceof cRadio)
27583208 {
27593209 group.parent = keepparent;
27603210 group.attributes = 0;
27613211 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3212
+ /*cRadio*/ radio = (cRadio)source;
27633213 Object3D obj = radio.GetObject();
27643214 System.out.println("Edit " + obj);
27653215 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3229,7 @@
27793229 }
27803230
27813231 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3232
+ //Globals.theRenderer.object = group;
27833233 if(!useclient)
27843234 {
27853235 cameraView.renderCamera = radio.camera;
....@@ -2788,12 +3238,16 @@
27883238 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893239 cameraView.targetLookAt.set(radio.camera.lookAt);
27903240 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3241
+ //cameraView.lighttouched = true;
3242
+ Globals.lighttouched = true;
27923243 topView.object = group;
27933244 frontView.object = group;
27943245 sideView.object = group;
27953246 }
2796
- group.editWindow = this;
3247
+
3248
+// fix "+" issue
3249
+ //group.editWindow = this;
3250
+
27973251 /*
27983252 currentLayout = radio.layout;
27993253 if (currentLayout == null)
....@@ -2805,8 +3259,23 @@
28053259 //group.parent = null; // ROOT
28063260 //group.attributes = -1;
28073261 ResetModel();
3262
+
3263
+ cameraView.requestFocusInWindow();
28083264 refreshContents(true);
2809
- }
3265
+ } else if (event.getSource() == editCameraItem)
3266
+ {
3267
+ cameraView.ProtectCamera();
3268
+ cameraView.repaint();
3269
+ return;
3270
+ } else if (event.getSource() == revertCameraItem)
3271
+ {
3272
+ cameraView.RevertCamera();
3273
+ cameraView.repaint();
3274
+ return;
3275
+ // } else if (event.getSource() == textureButton)
3276
+ // {
3277
+ // return; // true;
3278
+ }
28103279 else
28113280 {
28123281 //return super.action(event, arg);
....@@ -2815,7 +3284,6 @@
28153284 }
28163285
28173286 boolean useclient = false;
2818
- cRadio radio;
28193287
28203288 void ToggleRoot()
28213289 {
....@@ -2824,7 +3292,7 @@
28243292 if (useclient)
28253293 {
28263294 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3295
+ Globals.lighttouched = true;
28283296 //topView.object = client;
28293297 //frontView.object = client;
28303298 //sideView.object = client;
....@@ -2832,7 +3300,7 @@
28323300 else
28333301 {
28343302 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3303
+ Globals.lighttouched = true;
28363304 //topView.object = group;
28373305 //frontView.object = group;
28383306 //sideView.object = group;
....@@ -2867,6 +3335,28 @@
28673335 refreshContents();
28683336 }
28693337
3338
+ void TransformChildren()
3339
+ {
3340
+ Object3D obj;
3341
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3342
+ {
3343
+ obj = (Object3D)e.nextElement();
3344
+ obj.KeepTextureMatrices();
3345
+ obj.TransformChildren();
3346
+ obj.RestoreTextureMatrices();
3347
+
3348
+// if (obj.parent == null)
3349
+// {
3350
+// System.out.println("NULL PARENT!");
3351
+// new Exception().printStackTrace();
3352
+// }
3353
+// else
3354
+// TouchTransform(obj);
3355
+// //obj.parent.Touch();
3356
+ }
3357
+
3358
+ refreshContents();
3359
+ }
28703360
28713361 void ResetTransform()
28723362 {
....@@ -2979,7 +3469,7 @@
29793469 refreshContents();
29803470 }
29813471
2982
- void ResetCentroid()
3472
+ void ResetCentroid(boolean full)
29833473 {
29843474 Object3D obj;
29853475 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3484,16 @@
29943484 LA.matIdentity(Object3D.mat);
29953485 obj.getBounds(minima, maxima, false);
29963486 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3487
+ if (full)
3488
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983489 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993490 obj.TransformMesh(Object3D.mat);
3491
+
30003492 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3493
+ if (full)
3494
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023495 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3496
+
30033497 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043498 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053499 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +3522,8 @@
30283522
30293523 int size = obj.MemorySize();
30303524
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
3525
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3526
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30323527 }
30333528 }
30343529 catch (Exception e)
....@@ -3065,9 +3560,9 @@
30653560 obj = (Object3D)e.nextElement();
30663561
30673562 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3563
+ Grafreed.AnalyzeObject(obj);
30693564 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3565
+ Grafreed.AnalyzeObject(obj.bRep);
30713566
30723567 // System.err.println((size/1024) + " KB is the size of " + obj);
30733568 }
....@@ -3109,6 +3604,20 @@
31093604 void GenNormals(boolean crease)
31103605 {
31113606 group.GenNormalsS(crease);
3607
+
3608
+ refreshContents();
3609
+ }
3610
+
3611
+ void GenNormalsMESH()
3612
+ {
3613
+ group.GenNormalsMeshS();
3614
+
3615
+ refreshContents();
3616
+ }
3617
+
3618
+ void GenNormalsMINE()
3619
+ {
3620
+ group.selection.GenNormalsMINE();
31123621
31133622 refreshContents();
31143623 }
....@@ -3157,104 +3666,259 @@
31573666
31583667 //Object3D buffer;
31593668 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
-
3669
+// BoundaryRep temprep;
3670
+// Object3D nodes;
3671
+// Vector<Vertex> vertices;
3672
+//
3673
+// cGroup buffer;
3674
+//
3675
+// public void Vertex(Object3D node, Vertex v)
3676
+// {
3677
+//// vertices.add(v);
3678
+//// nodes.addElement(node);
3679
+////
3680
+//// if (temprep.GetCache(v) != null)
3681
+//// {
3682
+//// temprep.Remove(v);
3683
+//// } else
3684
+//// {
3685
+//// temprep.Remember(v);
3686
+//// }
3687
+//
3688
+// //Object3D node = nodes.get(index);
3689
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3690
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3691
+//
3692
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3693
+//
3694
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3695
+//
3696
+// cGroup g = new cGroup();
3697
+//
3698
+// if (g.toParent == null)
3699
+// {
3700
+// g.toParent = LA.newMatrix();
3701
+// g.fromParent = LA.newMatrix();
3702
+// }
3703
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3704
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3705
+//
3706
+// g.add(GrafreeD.clipboard);
3707
+//
3708
+// buffer.add(g);
3709
+// }
3710
+//
3711
+// public void Face(Object3D node, Face f)
3712
+// {
3713
+//
3714
+// }
3715
+//
3716
+// void ParseVerticesOld() // ??
3717
+// {
3718
+// //if (group.selection.size() != 1)
3719
+// // return;
3720
+//
3721
+// temprep = new BoundaryRep();
3722
+// nodes = new Object3D();
3723
+// vertices = new Vector<Vertex>();
3724
+//
3725
+// boolean epsequal = GrafreeD.epsequal;
3726
+// GrafreeD.epsequal = true;
3727
+//
3728
+// for (int i=0; i<group.selection.size(); i++)
3729
+// {
3730
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3731
+//
3732
+// group.selection.get(i).Parse(
3733
+//this );
3734
+//
3735
+// int repsize = temprep.VertexCount();
3736
+// int tablesize = temprep.vertextable.size();
3737
+// int nodesize = nodes.size();
3738
+//
3739
+// assert(vertices.size() == nodes.size());
3740
+//
3741
+// temprep.vertextable.elements();
3742
+//
3743
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3744
+//
3745
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3746
+// {
3747
+// cGroup g = new cGroup();
3748
+//
3749
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3750
+//
3751
+// Object3D node = nodes.get(index);
3752
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3753
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3754
+//
3755
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3756
+//
3757
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3758
+//
3759
+// if (g.toParent == null)
3760
+// {
3761
+// g.toParent = LA.newMatrix();
3762
+// g.fromParent = LA.newMatrix();
3763
+// }
3764
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3765
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3766
+//
3767
+// g.add(GrafreeD.clipboard);
3768
+//
3769
+// buffer.add(g);
3770
+// }
3771
+//
3772
+// makeSomething(buffer, i==group.selection.size()-1);
3773
+// }
3774
+//
3775
+// GrafreeD.epsequal = epsequal;
3776
+//
3777
+// //buffer = null;
3778
+// temprep = null;
3779
+// nodes = null;
3780
+//
3781
+// refreshContents();
3782
+// }
3783
+
31843784 void ParseVertices()
31853785 {
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;
3786
+ boolean epsequal = Grafreed.epsequal;
3787
+ Grafreed.epsequal = true;
31953788
31963789 for (int i=0; i<group.selection.size(); i++)
31973790 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3791
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993792
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3793
+ group.selection.get(i).Parse(
3794
+
3795
+ new iParse()
3796
+ {
3797
+ public void Vertex(Object3D node, Vertex v)
3798
+ {
3799
+ temp.set(v);
3800
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053801
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();
3802
+ cGroup g = new cGroup();
32113803
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3804
+ if (g.toParent == null)
3805
+ {
3806
+ g.toParent = LA.newMatrix();
3807
+ g.fromParent = LA.newMatrix();
3808
+ }
3809
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3810
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153811
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);
3812
+ g.add(Grafreed.clipboard);
32203813
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);
3814
+ buffer.add(g);
3815
+ }
32323816
3233
- g.add(GraphreeD.clipboard);
3817
+ public void Face(Object3D node, Face f)
3818
+ {
32343819
3235
- buffer.add(g);
3236
- }
3820
+ }
3821
+ }
3822
+ );
32373823
32383824 makeSomething(buffer, i==group.selection.size()-1);
32393825 }
32403826
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3827
+ Grafreed.epsequal = epsequal;
32463828
32473829 refreshContents();
32483830 }
3249
-
3831
+
3832
+ void TextureVertices()
3833
+ {
3834
+ for (int i=0; i<group.selection.size(); i++)
3835
+ {
3836
+ group.selection.get(i).Parse(
3837
+ new iParse()
3838
+ {
3839
+ public void Vertex(Object3D node, Vertex v)
3840
+ {
3841
+ cTexture tex = node.GetTextures();
3842
+ String pigment = Object3D.GetPigment(tex);
3843
+ //String bump = Object3D.GetBump(tex);
3844
+
3845
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3846
+
3847
+ try
3848
+ {
3849
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3850
+ }
3851
+ catch (Exception e)
3852
+ {
3853
+ System.err.println("FAIL: " + node);
3854
+ }
3855
+
3856
+ double s = v.s;
3857
+
3858
+ if (s == 1)
3859
+ s = 0;
3860
+
3861
+ double t = v.t;
3862
+
3863
+ if (t == 1)
3864
+ t = 0;
3865
+
3866
+ int indexs = (int) (texturedata.getWidth() * s);
3867
+ int indext = (int) (texturedata.getHeight() * t);
3868
+
3869
+ int index = indext * texturedata.getWidth() + indexs;
3870
+
3871
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3872
+
3873
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3874
+
3875
+ float scale = bytebuf.get(index*slide) & 0xFF;
3876
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3877
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3878
+ scale /= 3;
3879
+
3880
+ scale /= 0xFF;
3881
+ // c'est quoi ca? scale /= 4;
3882
+
3883
+ //v.AO = scale;
3884
+
3885
+ v.x += v.norm.x * scale;
3886
+ v.y += v.norm.y * scale;
3887
+ v.z += v.norm.z * scale;
3888
+ }
3889
+
3890
+ public void Face(Object3D node, Face f)
3891
+ {
3892
+ }
3893
+ }
3894
+ );
3895
+ }
3896
+
3897
+ refreshContents();
3898
+ }
3899
+
32503900 void Align()
32513901 {
3902
+ if (group.selection.size() == 0)
3903
+ return;
3904
+
3905
+ cVector bbmin = new cVector();
3906
+ cVector bbmax = new cVector();
3907
+
3908
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3909
+
3910
+ double dx = bbmax.x - bbmin.x;
3911
+ double dy = bbmax.y - bbmin.y;
3912
+ double dz = bbmax.z - bbmin.z;
3913
+
3914
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3915
+
32523916 for (int i=0; i<group.selection.size(); i++)
32533917 {
32543918 Object3D obj = group.selection.get(i);
32553919
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3920
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3921
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583922 }
32593923
32603924 refreshContents();
....@@ -3267,7 +3931,7 @@
32673931 // ref.SaveSupports();
32683932 // Object3D par = ref.parent;
32693933 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3934
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713935 // ref.parent = par;
32723936 // ref.RestoreSupports();
32733937
....@@ -3275,11 +3939,11 @@
32753939
32763940 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32773941
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
3942
+ boolean random = CameraPane.SWITCH;
3943
+ CameraPane.SWITCH = false; // parse all random nodes
32803944 lowres.linkVerticesThis(null);
32813945 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
3946
+ CameraPane.SWITCH = random;
32833947
32843948 System.err.flush();
32853949
....@@ -3297,7 +3961,7 @@
32973961 // lowres.SaveSupports();
32983962 // par = lowres.parent;
32993963 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3964
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013965 Object3D newlow = CloneObject(lowres, false);
33023966 newlow.name = sn.switchobject.get(i).name;
33033967 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3983,7 @@
33193983 return;
33203984
33213985 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3986
+ Object3D ref = Grafreed.clipboard.get(0);
33233987
33243988 Object3D newgroup = new Object3D("Po:" + poses.name);
33253989
....@@ -3488,7 +4152,7 @@
34884152 group.selection.RelinkToSupport(); // july 2014
34894153 System.out.println("DONE.");
34904154 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4155
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924156 }
34934157
34944158 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4177,20 @@
35134177
35144178 void ClipMesh()
35154179 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4180
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174181 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4182
+ Object3D content = Grafreed.clipboard.get(0);
35194183
35204184 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214185 content = ((cGroup)content).get(0);
35224186
35234187 // for (int i=0; i<group.selection.size(); i++)
35244188 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4189
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264190 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4191
+ group.selection.ClipMesh(Grafreed.clipboard);
35284192 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4193
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304194 System.out.println("DONE.");
35314195 refreshContents();
35324196 }
....@@ -3571,6 +4235,18 @@
35714235 void MarkLeaves(boolean hide)
35724236 {
35734237 group.selection.MarkLeaves(hide);
4238
+ refreshContents();
4239
+ }
4240
+
4241
+ void RewindLeaves(boolean hide)
4242
+ {
4243
+ group.selection.RewindLeaves(hide);
4244
+ refreshContents();
4245
+ }
4246
+
4247
+ void RandomLeaves(boolean hide)
4248
+ {
4249
+ group.selection.RandomLeaves(hide);
35744250 refreshContents();
35754251 }
35764252
....@@ -3659,7 +4335,7 @@
36594335 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604336
36614337 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4338
+ if(elem != group || !newWindow)
36634339 {
36644340 // if (!(elem instanceof Composite))
36654341 // newWindow = false;
....@@ -3749,7 +4425,6 @@
37494425 //case 702: // Event.LIST_DESELECT
37504426 group.deselectAll();
37514427 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37534428 if (tps != null)
37544429 {
37554430 for (int i=0; i < tps.length; i++)
....@@ -3758,31 +4433,30 @@
37584433
37594434 //if (child.parent != null)
37604435 //child.parent.addSelectee(child);
4436
+ objEditor.SetMaterial(child);
37614437 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37654438 }
37664439 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4440
+// else
4441
+// {
4442
+// objEditor.SetMaterial(group); // .GetMaterial());
4443
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4444
+// System.err.println("info : " + group.GetPath());
4445
+// }
37734446
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4447
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774448 CameraPane.flash = true;
37784449
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4450
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804451 // a camera
37814452 {
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;
4453
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4454
+ {
4455
+ CameraPane.camerachangeframe = 0; // don't refuse it
4456
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4457
+ }
4458
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4459
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864460 }
37874461
37884462 refreshContents();
....@@ -3793,6 +4467,26 @@
37934467
37944468 freezemodel = false;
37954469 }
4470
+
4471
+ void refreshContents(boolean cp)
4472
+ {
4473
+ if (!Globals.MOUSEDRAGGED)
4474
+ {
4475
+ objEditor.ClearInfo(); // .GetMaterial());
4476
+
4477
+ for (int i=0; i < group.selection.Size(); i++)
4478
+ {
4479
+ Object3D child = (Object3D) group.selection.get(i);
4480
+
4481
+ objEditor.AddInfo(child, this, true);
4482
+ System.err.println("info : " + child.GetPath());
4483
+ }
4484
+
4485
+ objEditor.SetText(); // jan 2014
4486
+ }
4487
+
4488
+ super.refreshContents(cp);
4489
+ }
37964490
37974491 void linkSomething(Object3D thing)
37984492 {
....@@ -3864,16 +4558,18 @@
38644558 {
38654559 if (group.selection.isEmpty())
38664560 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4561
+
4562
+ Grafreed.clipboardIsTempGroup = false;
38684563 Composite tGroup = null;
38694564 if (group.selection.size() > 0) // 1)
38704565 {
38714566 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4567
+ Grafreed.clipboardIsTempGroup = true;
38734568 }
38744569
38754570 if (cut)
38764571 {
4572
+ Save();
38774573 //int indices[] = jList.getSelectedIndices();
38784574 //for (int i = indices.length - 1; i >= 0; i--)
38794575 //jList.remove(indices[i]);
....@@ -3909,16 +4605,16 @@
39094605 //System.out.println("cut " + child);
39104606 //System.out.println("parent = " + child.parent);
39114607 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4608
+ if (Grafreed.clipboardIsTempGroup)
39134609 tGroup.add/*Child*/(tmp);
39144610 else
3915
- GraphreeD.clipboard = tmp;
4611
+ Grafreed.clipboard = tmp;
39164612 }
39174613 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4614
+ if (Grafreed.clipboardIsTempGroup)
39194615 tGroup.add/*Child*/(child);
39204616 else
3921
- GraphreeD.clipboard = child;
4617
+ Grafreed.clipboard = child;
39224618 }
39234619
39244620 //ResetModel();
....@@ -3950,21 +4646,23 @@
39504646 //System.out.println("cut " + elem);
39514647 //System.out.println("parent = " + elem.parent);
39524648 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4649
+ if (Grafreed.clipboardIsTempGroup)
39544650 tGroup.add/*Child*/(tmp);
39554651 else
3956
- GraphreeD.clipboard = tmp;
4652
+ Grafreed.clipboard = tmp;
39574653 }
39584654 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4655
+ if (Grafreed.clipboardIsTempGroup)
39604656 tGroup.add/*Child*/(child);
39614657 else
3962
- GraphreeD.clipboard = child;
4658
+ Grafreed.clipboard = child;
39634659 }
39644660
39654661 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4662
+
4663
+ if (Grafreed.clipboardIsTempGroup)
4664
+ Grafreed.clipboard = tGroup;
4665
+
39684666 if (cut)
39694667 {
39704668 ResetModel();
....@@ -3974,11 +4672,11 @@
39744672
39754673 void paste(boolean expand)
39764674 {
3977
- // if (GraphreeD.clipboard == null)
4675
+ // if (GrafreeD.clipboard == null)
39784676 // return;
39794677 boolean first = true;
39804678
3981
- if (GraphreeD.clipboardIsTempGroup)
4679
+ if (Grafreed.clipboardIsTempGroup)
39824680 {
39834681 Composite temp;
39844682
....@@ -3989,7 +4687,7 @@
39894687 temp = (Composite)Applet3D.clipboard.deepCopy();
39904688 */
39914689 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4690
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934691 {
39944692 Object3D child = (Object3D)e.nextElement();
39954693
....@@ -4003,7 +4701,7 @@
40034701 else
40044702 elem = child.deepCopy(); // ?
40054703 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4704
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074705 // elem = elem.get(0);
40084706 makeSomething(elem, true); // ?? first);
40094707 //group.addChild(elem);
....@@ -4023,23 +4721,23 @@
40234721 //Object3D cb = Applet3D.clipboard;
40244722 //temp.addChild(cb);
40254723 //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());
4724
+ assert(Grafreed.clipboard.parent == null);
4725
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4726
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4727
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4728
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40314729 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4730
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4731
+ Grafreed.clipboard.get(0).parent = keepparent;
40344732 }
40354733
40364734 ResetModel();
40374735 refreshContents();
40384736 }
40394737
4040
- void pasteInto(boolean copyit)
4738
+ void pasteInto(boolean copyit, boolean clone)
40414739 {
4042
-// if (GraphreeD.clipboard == null)
4740
+// if (GrafreeD.clipboard == null)
40434741 // return;
40444742
40454743 if (group.selection.size() != 1)
....@@ -4066,15 +4764,22 @@
40664764 if (copyit)
40674765 {
40684766 // paste(false);
4069
- CloneClipboard(false); // sept 2014
4767
+ if (clone)
4768
+ {
4769
+ CloneClipboard(false); // sept 2014
4770
+ }
4771
+ else
4772
+ {
4773
+ paste(false);
4774
+ }
40704775 }
40714776 else
40724777 {
40734778 boolean first = true;
40744779
4075
- if (GraphreeD.clipboardIsTempGroup)
4780
+ if (Grafreed.clipboardIsTempGroup)
40764781 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4782
+ Composite temp = (Composite)Grafreed.clipboard;
40784783 Object3D copy;
40794784 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804785 {
....@@ -4084,7 +4789,7 @@
40844789 }
40854790 } else
40864791 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4792
+ linkSomething(Grafreed.clipboard); //.get(0));
40884793 }
40894794 }
40904795 }
....@@ -4276,6 +4981,26 @@
42764981 makeSomething(csg);
42774982 }
42784983
4984
+ void Ungroup(Object3D g)
4985
+ {
4986
+ if (g instanceof HiddenObject)
4987
+ {
4988
+ HiddenObject h = (HiddenObject) g;
4989
+
4990
+ for (int i=0; i<h.ActualSize(); i++)
4991
+ {
4992
+ objEditor.makeSomething(h.get(i), false);
4993
+ }
4994
+ }
4995
+ else
4996
+ {
4997
+ for (int i=0; i<g.Size(); i++)
4998
+ {
4999
+ objEditor.makeSomething(g.get(i), false);
5000
+ }
5001
+ }
5002
+ }
5003
+
42795004 void ungroup()
42805005 {
42815006 /*
....@@ -4469,21 +5194,6 @@
44695194 }
44705195 */
44715196
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
-
44875197 /*
44885198 public void Callback(Object obj)
44895199 {
....@@ -4507,26 +5217,9 @@
45075217 }
45085218 */
45095219
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
-
45275220 String GetFile(String dialogName)
45285221 {
4529
- if (GraphreeD.standAlone)
5222
+ if (Grafreed.standAlone)
45305223 {
45315224 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325225 browser.show();
....@@ -4590,10 +5283,18 @@
45905283 cButton flashSelectionButton;
45915284 cButton editButton;
45925285 cButton uneditButton;
5286
+ JCheckBox allParamsButton;
45935287 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955288 cButton unselectButton;
45965289
5290
+ cButton minButton;
5291
+ cButton maxButton;
5292
+ cButton fullButton;
5293
+ cButton undoButton;
5294
+ cButton redoButton;
5295
+ cButton saveButton;
5296
+ cButton oneStepButton;
5297
+
45975298 cButton screenfitButton;
45985299 cButton screenfitpointButton;
45995300 cButton snapobjectButton;
....@@ -4604,14 +5305,6 @@
46045305 cButton closeButton;
46055306
46065307 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;
46155308
46165309 //
46175310 //Composite
....@@ -4624,6 +5317,8 @@
46245317 private MenuItem lookFromItem;
46255318 private MenuItem switchItem;
46265319 private MenuItem cutItem;
5320
+ private MenuItem undoItem;
5321
+ private MenuItem redoItem;
46275322 private MenuItem duplicateItem;
46285323 private MenuItem cloneItem;
46295324 private MenuItem cloneSupportItem;
....@@ -4635,8 +5330,9 @@
46355330 private MenuItem resetsupportItem;
46365331 private MenuItem resetreferencesItem;
46375332 private MenuItem linkverticesItem;
5333
+ private MenuItem relinkverticesItem;
46385334 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5335
+ private MenuItem resetAllItem;
46405336 private MenuItem stepAllItem;
46415337 private MenuItem revertMeshItem;
46425338 private MenuItem poseMeshItem;
....@@ -4647,14 +5343,17 @@
46475343 private MenuItem mergeGeometriesItem;
46485344 private MenuItem copyItem;
46495345 private MenuItem pasteItem;
5346
+ private MenuItem pasteIntoItem;
46505347 private MenuItem pasteLinkItem;
46515348 private MenuItem pasteCloneItem;
46525349 private MenuItem pasteExpandItem;
46535350 private MenuItem clearItem;
46545351 private MenuItem clearAllItem;
46555352 private MenuItem genUVItem;
5353
+ private MenuItem genNormalsMESHItem;
46565354 private MenuItem genNormalsCADItem;
46575355 private MenuItem genNormalsORGANItem;
5356
+ private MenuItem genNormalsMINEItem;
46585357 private MenuItem stripifyItem;
46595358 private MenuItem unstripifyItem;
46605359 private MenuItem trimItem;
....@@ -4683,6 +5382,10 @@
46835382 private MenuItem showleavesItem;
46845383 private MenuItem markleavesItem;
46855384 private MenuItem unmarkleavesItem;
5385
+ private MenuItem rewindleavesItem;
5386
+ private MenuItem unrewindleavesItem;
5387
+ private MenuItem randomleavesItem;
5388
+ private MenuItem unrandomleavesItem;
46865389
46875390 private MenuItem flipVItem;
46885391 private MenuItem unflipVItem;
....@@ -4694,8 +5397,11 @@
46945397 private MenuItem panoTexturesItem;
46955398
46965399 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5400
+ private MenuItem resetCentroidXZItem;
46985401 private MenuItem resetTransformItem;
5402
+ private MenuItem transformGeometryItem;
5403
+ private MenuItem transformChildrenItem;
5404
+ private MenuItem hideItem;
46995405 private MenuItem grabItem;
47005406 private MenuItem backItem;
47015407 private MenuItem frontItem;
....@@ -4716,6 +5422,7 @@
47165422
47175423 private MenuItem resetParentItem;
47185424 private MenuItem repairParentItem;
5425
+ private MenuItem repairShadowItem;
47195426 private MenuItem sortbysizeItem;
47205427 private MenuItem sortbynameItem;
47215428
....@@ -4728,16 +5435,19 @@
47285435 private MenuItem particleItem;
47295436 private MenuItem ragdollItem;
47305437 private MenuItem ragdoll2Item;
5438
+ private MenuItem heightFieldItem;
5439
+ private MenuItem textureFieldItem;
47315440 private MenuItem gridItem;
47325441 private MenuItem rectoidItem;
47335442 private MenuItem ellipsoidItem;
47345443 private MenuItem coneItem;
47355444 private MenuItem torusItem;
47365445 private MenuItem superItem;
5446
+ private MenuItem kleinItem;
47375447 private MenuItem blobItem;
47385448 private MenuItem latheItem;
47395449 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5450
+ private MenuItem overlayItem;
47415451 private MenuItem meshItem;
47425452 // private MenuItem meshGroupItem;
47435453 private MenuItem springItem;
....@@ -4746,6 +5456,7 @@
47465456 private MenuItem csgItem;
47475457 private MenuItem templateItem;
47485458 private MenuItem textureItem;
5459
+ private MenuItem billboardItem;
47495460 private MenuItem shadowXItem;
47505461 private MenuItem shadowYItem;
47515462 private MenuItem shadowZItem;
....@@ -4758,11 +5469,6 @@
47585469 private MenuItem doubleItem;
47595470 private MenuItem tripleItem;
47605471
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47665472 private MenuItem computeAOItem;
47675473 private MenuItem recompileItem;
47685474 private MenuItem editScriptItem;
....@@ -4772,4 +5478,8 @@
47725478 private MenuItem analyzeItem;
47735479 private MenuItem dumpItem;
47745480 //boolean freezemodel = false;
5481
+
5482
+ Menu cameraMenu;
5483
+ MenuItem editCameraItem;
5484
+ MenuItem revertCameraItem;
47755485 }