Normand Briere
2019-07-28 a434119e65146fe53d612c28e1ee7af532d1b70a
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,
....@@ -22,6 +23,31 @@
2223 DragGestureListener, DragSourceListener, DropTargetListener,
2324 ItemListener // ListSelectionListener
2425 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row3)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row3.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF));
32
+ skyboxButton.setToolTipText(s);
33
+ skyboxButton.addActionListener(new ActionListener()
34
+ {
35
+ @Override
36
+ public void actionPerformed(ActionEvent e)
37
+ {
38
+ ChangeSkybox(path);
39
+ }
40
+ });
41
+ }
42
+
43
+ public void ChangeSkybox(String name)
44
+ {
45
+ cameraView.envyoff = false;
46
+ cameraView.skyboxname = name;
47
+ cameraView.skyboxext = "jpg";
48
+ cameraView.repaint();
49
+ }
50
+
2551 //ObjEditor objEditor;
2652 public void closeUI2()
2753 {
....@@ -59,6 +85,12 @@
5985 this.copy = this.group = group;
6086 //selectees = this.group.selectees;
6187
88
+ if (copy.versions == null)
89
+ {
90
+ copy.versions = new byte[100][];
91
+ copy.versionindex = -1;
92
+ }
93
+
6294 if(ui)
6395 SetupUI(objEditor);
6496 }
....@@ -73,17 +105,29 @@
73105 this.copy = this.group = copy;
74106 //selectees = this.group.selectees;
75107
76
- SetupMenu2(objEditor);
108
+ SetupMenu2(this); //objEditor);
77109 SetupUI2(objEditor);
78110 objEditor.SetupUI(true);
79111 SetupViews(objEditor);
80112
81113 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
114
+
115
+ if (copy.versions == null)
116
+ {
117
+ copy.versions = new byte[100][];
118
+ copy.versionindex = -1;
119
+
120
+ Save(true);
121
+ }
82122 }
83123
84124 void CloneSelection(boolean supports)
85125 {
86
- // Object3D keep = GraphreeD.clipboard;
126
+ if (Globals.REPLACEONMAKE)
127
+ Save();
128
+ boolean keep = Globals.REPLACEONMAKE;
129
+ Globals.REPLACEONMAKE = false;
130
+ // Object3D keep = GrafreeD.clipboard;
87131 //Object3D obj;
88132 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
89133 {
....@@ -93,18 +137,19 @@
93137
94138 makeSomething(clone, i==group.selection.size()-1);
95139 }
140
+ Globals.REPLACEONMAKE = keep;
96141 }
97142
98143 void CloneClipboard(boolean supports)
99144 {
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));
145
+ assert(Grafreed.clipboard.parent == null);
146
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
147
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
148
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
149
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105150 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
151
+ makeSomething(CloneObject(Grafreed.clipboard, false));
152
+ Grafreed.clipboard.get(0).parent = keepparent;
108153 }
109154
110155 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +163,7 @@
118163 // obj.support = null;
119164 if (!supports)
120165 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
166
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122167 obj.parent = parent;
123168 // obj.support = support;
124169 // clone.support = support; // aout 2013
....@@ -147,30 +192,29 @@
147192
148193 //JTextField nameField;
149194
150
- void SetupMenu2(ObjEditor oe)
195
+ void SetupMenu2(GroupEditor oe)
151196 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
197
+ oe.jTree = new cTree();
198
+
163199 Menu menu;
164200 oe.menuBar.add(menu = new Menu("Edit"));
165201 //editItem = menu.add(new MenuItem("Edit"));
166202 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
203
+
204
+// undoItem = menu.add(new MenuItem("Undo"));
205
+// undoItem.addActionListener(this);
206
+// redoItem = menu.add(new MenuItem("Redo"));
207
+// redoItem.addActionListener(this);
208
+// menu.add("-");
209
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168210 duplicateItem.addActionListener(this);
169
- menu.add("-");
170211 cloneItem = menu.add(new MenuItem("Clone"));
171212 cloneItem.addActionListener(this);
213
+ if (Globals.ADVANCED)
214
+ {
172215 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173216 cloneSupportItem.addActionListener(this);
217
+ }
174218 menu.add("-");
175219 cutItem = menu.add(new MenuItem("Cut"));
176220 cutItem.addActionListener(this);
....@@ -178,26 +222,123 @@
178222 copyItem.addActionListener(this);
179223 pasteItem = menu.add(new MenuItem("Paste"));
180224 pasteItem.addActionListener(this);
225
+
226
+ menu.add("-");
227
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
228
+ pasteIntoItem.addActionListener(this);
181229 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182230 pasteLinkItem.addActionListener(this);
183231 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184232 pasteCloneItem.addActionListener(this);
185233 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186234 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
235
+ menu.add("-");
236
+ deleteItem = menu.add(new MenuItem("Delete"));
237
+ deleteItem.addActionListener(this);
238
+
239
+ if (Globals.ADVANCED)
240
+ {
241
+ // Deletes the cameras...
189242 clearAllItem = menu.add(new MenuItem("Clear All"));
190243 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);
244
+ }
245
+
246
+ menuBar.add(cameraMenu = new Menu("View"));
247
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
248
+ //zBufferItem.addActionListener(this);
249
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
250
+ //normalLensItem.addActionListener(this);
251
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
252
+ restoreCameraItem.addActionListener(this);
253
+
254
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
255
+// toggleFullScreenItem.addItemListener(this);
256
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
257
+// cameraMenu.add("-");
258
+//
259
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
260
+// toggleTextureItem.addItemListener(this);
261
+// toggleTextureItem.setState(CameraPane.textureon);
262
+//
263
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
264
+// toggleSwitchItem.addItemListener(this);
265
+// toggleSwitchItem.setState(CameraPane.SWITCH);
266
+
267
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
268
+ toggleHandleItem.addItemListener(this);
269
+ toggleHandleItem.setState(CameraPane.HANDLES);
270
+
271
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
272
+ togglePaintItem.addItemListener(this);
273
+ togglePaintItem.setState(CameraPane.PAINTMODE);
274
+
275
+ if (Globals.ADVANCED)
276
+ {
277
+ cameraMenu.add("-");
278
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
279
+ toggleLiveItem.addItemListener(this);
280
+ toggleLiveItem.setState(Globals.isLIVE());
281
+
282
+ cameraMenu.add(stepItem = new MenuItem("Step"));
283
+ stepItem.addActionListener(this);
284
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
285
+ // toggleDLItem.addItemListener(this);
286
+ // toggleDLItem.setState(false);
287
+
288
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
289
+ toggleRenderItem.addItemListener(this);
290
+ toggleRenderItem.setState(!CameraPane.frozen);
291
+
292
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
293
+ toggleDebugItem.addItemListener(this);
294
+ toggleDebugItem.setState(Globals.DEBUG);
295
+
296
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
297
+ toggleFrustumItem.addItemListener(this);
298
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
299
+
300
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
301
+ toggleFootContactItem.addItemListener(this);
302
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
303
+
304
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
305
+ toggleTimelineItem.addItemListener(this);
306
+ }
307
+
308
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
309
+// toggleRootItem.addItemListener(this);
310
+// toggleRootItem.setState(false);
311
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
312
+// animationItem.addItemListener(this);
313
+// animationItem.setState(CameraPane.ANIMATION);
314
+ cameraMenu.add("-");
315
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
316
+ editCameraItem.addActionListener(this);
317
+
318
+ if (Globals.ADVANCED)
319
+ {
320
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
321
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
322
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
323
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
324
+ oe.cameraMenu.add("-");
325
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
326
+ openWindowItem.addActionListener(this);
327
+ editLeafItem.addActionListener(this);
328
+ lookAtItem.addActionListener(this);
329
+ //lookFromItem.addActinoListener(this);
330
+ //switchViewItem.addActionListener(this);
331
+ }
332
+
333
+ oe.menuBar.add(menu = new Menu("Setting"));
334
+ if (Globals.ADVANCED)
335
+ {
196336 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197337 revertMeshItem.addActionListener(this);
198338 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199339 resetreferencesItem.addActionListener(this);
200340 menu.add("-");
341
+ }
201342 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202343 overwriteGeoItem.addActionListener(this);
203344 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,72 +350,104 @@
209350 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210351 overwriteUVItem.addActionListener(this);
211352 menu.add("-");
353
+ if (Globals.ADVANCED)
354
+ {
212355 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213356 generateMeshItem.addActionListener(this);
214357 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215358 poseMeshItem.addActionListener(this);
216359 menu.add("-");
360
+ }
217361 resetsupportItem = menu.add(new MenuItem("Reset support"));
218362 resetsupportItem.addActionListener(this);
219363 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220364 linkverticesItem.addActionListener(this);
365
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
366
+ relinkverticesItem.addActionListener(this);
367
+
368
+ if (Globals.ADVANCED)
369
+ {
221370 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222371 setMasterItem.addActionListener(this);
372
+ }
223373
224
- oe.menuBar.add(menu = new Menu("Object"));
225
- grabItem = menu.add(new MenuItem("Grab"));
226
- grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
374
+ oe.menuBar.add(menu = new Menu("Group"));
375
+// grabItem = menu.add(new MenuItem("Grab"));
376
+// grabItem.addActionListener(this);
229377 backItem = menu.add(new MenuItem("Back"));
230378 backItem.addActionListener(this);
231
- compositeItem = menu.add(new MenuItem("Composite"));
232
- compositeItem.addActionListener(this);
233
- menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
235
- randomItem.addActionListener(this);
236
- physicsItem = menu.add(new MenuItem("Physics"));
237
- physicsItem.addActionListener(this);
238
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
239
- frameselectorItem.addActionListener(this);
379
+ frontItem = menu.add(new MenuItem("Front"));
380
+ frontItem.addActionListener(this);
381
+// compositeItem = menu.add(new MenuItem("Composite"));
382
+// compositeItem.addActionListener(this);
383
+
384
+ if (Globals.ADVANCED)
385
+ {
386
+ hideItem = menu.add(new MenuItem("Hidden Group"));
387
+ hideItem.addActionListener(this);
388
+ }
389
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
390
+ ungroupItem.addActionListener(this);
391
+
392
+// menu.add("-");
393
+//
394
+// switchItem = menu.add(new MenuItem("Switch node"));
395
+// switchItem.addActionListener(this);
396
+ if (Globals.ADVANCED)
397
+ {
240398 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241399 switchGeoItem.addActionListener(this);
242400 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243401 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
402
+ morphItem = menu.add(new MenuItem("Morph Group"));
245403 morphItem.addActionListener(this);
404
+
405
+ menu.add("-");
406
+ physicsItem = menu.add(new MenuItem("Physics"));
407
+ physicsItem.addActionListener(this);
408
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
409
+ frameselectorItem.addActionListener(this);
246410 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247411 scriptNodeItem.addActionListener(this);
248
- cameraItem = menu.add(new MenuItem("Camera"));
249
- cameraItem.addActionListener(this);
250
- menu.add("-");
251
- textureItem = menu.add(new MenuItem("Texture"));
252
- textureItem.addActionListener(this);
412
+ }
413
+
414
+ oe.menuBar.add(menu = new Menu("Object"));
415
+// textureItem = menu.add(new MenuItem("Texture"));
416
+// textureItem.addActionListener(this);
417
+ billboardItem = menu.add(new MenuItem("Billboard"));
418
+ billboardItem.addActionListener(this);
253419 csgItem = menu.add(new MenuItem("CSG"));
254420 csgItem.addActionListener(this);
255
- shadowXItem = menu.add(new MenuItem("Shadow X"));
421
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
256422 shadowXItem.addActionListener(this);
257
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
423
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
258424 shadowYItem.addActionListener(this);
259
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
425
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
260426 shadowZItem.addActionListener(this);
427
+ attributeItem = menu.add(new MenuItem("Attribute"));
428
+ attributeItem.addActionListener(this);
429
+
430
+ if (Globals.ADVANCED)
431
+ {
432
+ menu.add("-");
261433 linkerItem = menu.add(new MenuItem("Linker"));
262434 linkerItem.addActionListener(this);
263435 templateItem = menu.add(new MenuItem("Template"));
264436 templateItem.addActionListener(this);
265
- attributeItem = menu.add(new MenuItem("Attribute"));
266
- attributeItem.addActionListener(this);
267437 pointflowItem = menu.add(new MenuItem("Point Flow"));
268438 pointflowItem.addActionListener(this);
439
+ }
269440 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272441 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273442 resetTransformItem.addActionListener(this);
274443 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275444 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
445
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
446
+ resetCentroidXZItem.addActionListener(this);
447
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
448
+ transformGeometryItem.addActionListener(this);
449
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
450
+ transformChildrenItem.addActionListener(this);
278451
279452 oe.menuBar.add(menu = new Menu("Geometry"));
280453 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +456,13 @@
283456 genNormalsORGANItem.addActionListener(this);
284457 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285458 genNormalsCADItem.addActionListener(this);
459
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
460
+ genNormalsMESHItem.addActionListener(this);
461
+ if (Globals.ADVANCED)
462
+ {
463
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
464
+ genNormalsMINEItem.addActionListener(this);
465
+ }
286466 stripifyItem = menu.add(new MenuItem("Stripify"));
287467 stripifyItem.addActionListener(this);
288468 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +472,6 @@
292472 untrimItem = menu.add(new MenuItem("Untrim"));
293473 untrimItem.addActionListener(this);
294474 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297475 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298476 clearColorsItem.addActionListener(this);
299477 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +484,34 @@
306484 reduce34MeshItem.addActionListener(this);
307485 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308486 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311487 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312488 clipMeshItem.addActionListener(this);
489
+
490
+ if (Globals.ADVANCED)
491
+ {
492
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
493
+ smoothMeshItem.addActionListener(this);
494
+ }
495
+
496
+ oe.menuBar.add(menu = new Menu("Attributes"));
497
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
498
+ clearMaterialsItem.addActionListener(this);
499
+ resetAllItem = menu.add(new MenuItem("Reset All"));
500
+ resetAllItem.addActionListener(this);
501
+ stepAllItem = menu.add(new MenuItem("Step All"));
502
+ stepAllItem.addActionListener(this);
313503 menu.add("-");
314504 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315505 liveleavesItem.addActionListener(this);
316506 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317507 unliveleavesItem.addActionListener(this);
508
+ if (Globals.ADVANCED)
509
+ {
318510 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319511 supportleavesItem.addActionListener(this);
320512 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321513 unsupportleavesItem.addActionListener(this);
514
+ }
322515 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323516 hideleavesItem.addActionListener(this);
324517 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +520,31 @@
327520 markleavesItem.addActionListener(this);
328521 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329522 unmarkleavesItem.addActionListener(this);
523
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
524
+ rewindleavesItem.addActionListener(this);
525
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
526
+ unrewindleavesItem.addActionListener(this);
527
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
528
+ randomleavesItem.addActionListener(this);
529
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
530
+ unrandomleavesItem.addActionListener(this);
330531 menu.add("-");
331532 flipVItem = menu.add(new MenuItem("Flip V"));
332533 flipVItem.addActionListener(this);
333534 unflipVItem = menu.add(new MenuItem("Unflip V"));
334535 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
536
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336537 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
538
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338539 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
540
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340541 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
542
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342543 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
544
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344545 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
546
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346547 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);
356548
357549 oe.menuBar.add(menu = new Menu("Selection"));
358550 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -361,23 +553,56 @@
361553 attachBumpItem.addActionListener(this);
362554 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
363555 pigmentBumpItem.addActionListener(this);
556
+ //embedTexturesItem
364557 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
365558 detachPigmentItem.addActionListener(this);
366559 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
367560 detachBumpItem.addActionListener(this);
561
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
562
+ embedTexturesItem.addActionListener(this);
563
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
564
+ deEmbedTexturesItem.addActionListener(this);
368565 menu.add("-");
369566 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
370567 sortbysizeItem.addActionListener(this);
371568 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372569 sortbynameItem.addActionListener(this);
570
+ menu.add("-");
571
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
572
+ shareGeometriesItem.addActionListener(this);
573
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
574
+ mergeGeometriesItem.addActionListener(this);
575
+ if (Globals.ADVANCED)
576
+ {
577
+ // Pretty much the same as duplicate and clone.
578
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
579
+ extractGeometriesItem.addActionListener(this);
580
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
581
+ cloneGeometriesItem.addActionListener(this);
582
+ }
583
+
373584 oe.menuBar.add(menu = new Menu("Insert"));
374585 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
586
+
587
+ oe.menuBar.add(menu = new Menu("Tools"));
376588 buildToolsMenu(menu);
377589 }
378590
591
+
379592 void SetupUI2(ObjEditor oe)
380593 {
594
+ // June 2019
595
+ if (oe == null)
596
+ {
597
+ //super.SetupUI2(this);
598
+ //return;
599
+ }
600
+
601
+ if (copy != group)
602
+ {
603
+ //super.SetupUI2(this);
604
+ }
605
+
381606 //new Exception().printStackTrace();
382607
383608 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -406,150 +631,327 @@
406631 oe.radioPanel.add(dummyButton);
407632 oe.buttonGroup.add(dummyButton);
408633 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
634
+ cGridBag copyOptionsPanel = new cGridBag();
635
+
636
+ copyOptionsPanel.preferredHeight = 2;
412637
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
638
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
639
+
640
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641
+ //minButton.setToolTipText("Minimize window");
642
+ //minButton.addActionListener(this);
643
+
644
+ if (Globals.ADVANCED)
645
+ {
646
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ maxButton.setToolTipText("Maximize window");
648
+ maxButton.addActionListener(this);
649
+ }
650
+
651
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ fullButton.setToolTipText("Full-screen window");
653
+ fullButton.addActionListener(this);
654
+
655
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ screenfitButton.setToolTipText("Screen fit");
657
+ screenfitButton.addActionListener(this);
658
+
659
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
660
+ restoreCameraButton.setToolTipText("Restore viewpoint");
661
+ restoreCameraButton.addActionListener(this);
662
+
663
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
+ saveButton.setToolTipText("New version");
665
+ saveButton.addActionListener(this);
666
+
667
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
+ undoButton.setToolTipText("Previous version");
669
+ undoButton.addActionListener(this);
670
+ undoButton.setEnabled(false);
671
+
672
+ cGridBag updown = new cGridBag().setVertical(true);
673
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ restoreButton.setToolTipText("Restore current");
675
+ restoreButton.addActionListener(this);
676
+ restoreButton.setEnabled(false);
677
+
678
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ replaceButton.setToolTipText("Replace current");
680
+ replaceButton.addActionListener(this);
681
+ replaceButton.setEnabled(false);
682
+
683
+ copyOptionsPanel.add(updown);
684
+
685
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ redoButton.setToolTipText("Next version");
687
+ redoButton.addActionListener(this);
688
+ redoButton.setEnabled(false);
689
+
690
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
691
+ liveCB.setToolTipText("Enable animation");
414692 liveCB.addItemListener(this);
415693
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);
694
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
+ oneStepButton.setToolTipText("Animate one step forward");
696
+ oneStepButton.addActionListener(this);
697
+
698
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
699
+ fastCB.setToolTipText("Fast mode");
434700 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);
701
+
702
+ //oe.toolboxPanel.Return();
703
+
704
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
705
+// trackCB.setToolTipText("Enable tracking");
706
+// trackCB.addItemListener(this);
441707
442
-// oe.aConstraints.gridx += 1;
443
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
444
-// speakerMocapCB.addItemListener(this);
445
-
446
- if (false)
447
- {
448
- // handled in scripts
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
451
- speakerCameraCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
455
- speakerFocusCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
459
- smoothfocusCB.addItemListener(this);
460
- }
461
-
462
-//oe.aConstraints.gridx += 1;
463
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
464
-// debugCB.addItemListener(this);
465
-
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
468
- oeilCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
472
- lookAtCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
476
- trackCB.addItemListener(this);
477
-
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
480
- screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
482708 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483709 // 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;
488710
489
- //aConstraints.gridx = 0;
490
- //aConstraints.gridy += 1;
491
- oe.aConstraints.weighty = 0;
492
- oe.aConstraints.gridwidth = 1;
493
-
494
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
495
- flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499
-
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
502
- twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
711
+ if (Globals.ADVANCED)
712
+ {
713
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
714
+ snapobjectButton.addActionListener(this);
715
+ snapobjectButton.setToolTipText("Snap Object");
716
+
717
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504718 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
506
- sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
719
+ fourButton.setToolTipText("Show control panel only");
720
+ }
721
+
722
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
723
+
724
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ twoButton.setToolTipText("Show 3D view only");
726
+ twoButton.addActionListener(this);
727
+ this.fullscreenLayout = twoButton;
728
+
729
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ threeButton.setToolTipText("Show controls and 3D view");
508731 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
510
- sevenButton.addActionListener(this);
732
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ sixButton.setToolTipText("Show 3D view and controls");
734
+ sixButton.addActionListener(this);
735
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
736
+// sevenButton.setToolTipText("3-column layout");
737
+// sevenButton.addActionListener(this);
511738 //
512739
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
740
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ rootButton.setToolTipText("Open selection in new tab");
514742 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
743
+
744
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ closeButton.setToolTipText("Close tab");
517746 closeButton.addActionListener(this);
518747 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519748 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521
-
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
524
- editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528749
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
750
+ cGridBag row1 = new cGridBag();
751
+
752
+ // INSERT
753
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
754
+ gridButton.setToolTipText("Create grid");
755
+ gridButton.addActionListener(this);
756
+
757
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
758
+ boxButton.setToolTipText("Create box");
759
+ boxButton.addActionListener(this);
760
+
761
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ sphereButton.setToolTipText("Create sphere");
763
+ sphereButton.addActionListener(this);
764
+
765
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ coneButton.setToolTipText("Create cone");
767
+ coneButton.addActionListener(this);
768
+
769
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
770
+ torusButton.setToolTipText("Create torus");
771
+ torusButton.addActionListener(this);
772
+
773
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
774
+ superButton.setToolTipText("Create superellipsoid");
775
+ superButton.addActionListener(this);
776
+
777
+ if (Globals.ADVANCED)
778
+ {
779
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ kleinButton.setToolTipText("Create Klein bottle");
781
+ kleinButton.addActionListener(this);
782
+ }
783
+
784
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ particlesButton.setToolTipText("Create particle system");
786
+ particlesButton.addActionListener(this);
787
+
788
+ oe.toolboxPanel.add(row1);
789
+
790
+ cGridBag row2 = new cGridBag();
791
+
792
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
793
+ groupButton.setToolTipText("Create group");
794
+ groupButton.addActionListener(this);
795
+
796
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
797
+ compositeButton.setToolTipText("Create composite");
798
+ compositeButton.addActionListener(this);
799
+
800
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ switchButton.setToolTipText("Create item switcher");
802
+ switchButton.addActionListener(this);
803
+
804
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ loopButton.setToolTipText("Create loop");
806
+ loopButton.addActionListener(this);
807
+
808
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ textureButton.setToolTipText("Create texture");
810
+ textureButton.addActionListener(this);
811
+
812
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
813
+ overlayButton.setToolTipText("Create overlay");
814
+ overlayButton.addActionListener(this);
815
+
816
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
817
+ lightButton.setToolTipText("Create light");
818
+ lightButton.addActionListener(this);
819
+
820
+ oe.toolboxPanel.add(row2);
821
+
822
+ // ENVYMAPS
823
+ cGridBag row3 = new cGridBag();
824
+ row3.preferredHeight = 20;
825
+
826
+ AddSkyboxButton("default", "rgb", row3);
827
+ AddSkyboxButton("default", "cornell", row3);
828
+ AddSkyboxButton("default", "uffizi", row3);
829
+ AddSkyboxButton("default", "CloudyHills", row3);
830
+ AddSkyboxButton("default", "skycube", row3);
831
+
832
+ oe.toolboxPanel.add(row3);
833
+
834
+ cGridBag row4 = new cGridBag();
835
+ row4.preferredHeight = 20;
836
+
837
+ AddSkyboxButton("bridge", "Bridge2", row4);
838
+ AddSkyboxButton("urban", "GamlaStan2", row4);
839
+ AddSkyboxButton("urban", "Parliament", row4);
840
+ AddSkyboxButton("urban", "Roundabout", row4);
841
+
842
+ oe.toolboxPanel.add(row4);
843
+
844
+ cGridBag row5 = new cGridBag();
845
+ row5.preferredHeight = 20;
846
+
847
+ AddSkyboxButton("urban", "SaintLazarusChurch", row5);
848
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row5);
849
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row5);
850
+ AddSkyboxButton("urban", "UnionSquare", row5);
851
+
852
+ oe.toolboxPanel.add(row5);
853
+
854
+ cGridBag row6 = new cGridBag();
855
+ row6.preferredHeight = 20;
856
+
857
+ AddSkyboxButton("park", "BerzeliiPark", row6);
858
+ AddSkyboxButton("park", "Buddha", row6);
859
+ AddSkyboxButton("park", "CNTower2", row6);
860
+ //AddSkyboxButton("park", "Fatbursparken", row6);
861
+ AddSkyboxButton("park", "NiagaraFalls1", row6);
862
+
863
+ oe.toolboxPanel.add(row6);
864
+
865
+ cGridBag row7 = new cGridBag();
866
+ row7.preferredHeight = 20;
867
+
868
+ AddSkyboxButton("park", "NiagaraFalls3", row7);
869
+ AddSkyboxButton("park", "Park", row7);
870
+ //AddSkyboxButton("park", "Park2", row6);
871
+ //AddSkyboxButton("park", "Path", row6);
872
+ AddSkyboxButton("park", "Pond", row7);
873
+ AddSkyboxButton("park", "Skansen", row7);
874
+
875
+ oe.toolboxPanel.add(row7);
876
+
877
+ cGridBag row8 = new cGridBag();
878
+ row8.preferredHeight = 20;
879
+
880
+ AddSkyboxButton("park", "Skansen2", row8);
881
+ AddSkyboxButton("park", "Skansen3", row8);
882
+ AddSkyboxButton("park", "Skansen4", row8);
883
+ AddSkyboxButton("park", "Skansen5", row8);
884
+
885
+ oe.toolboxPanel.add(row8);
886
+
887
+ cGridBag row9 = new cGridBag();
888
+ row9.preferredHeight = 20;
889
+
890
+ AddSkyboxButton("park", "Stairs", row9);
891
+ //AddSkyboxButton("park", "Tantolunden", row6);
892
+ //AddSkyboxButton("park", "Tantolunden3", row6);
893
+ AddSkyboxButton("park", "Tantolunden4", row9);
894
+
895
+ oe.toolboxPanel.add(row9);
896
+/*
897
+BerzeliiPark
898
+Buddha
899
+CNTower2
900
+Fatbursparken
901
+NiagaraFalls1
902
+NiagaraFalls3
903
+Park
904
+Park2
905
+Path
906
+Pond
907
+Skansen
908
+Skansen2
909
+Skansen3
910
+Skansen4
911
+Skansen5
912
+Stairs
913
+Tantolunden
914
+Tantolunden3
915
+Tantolunden4
916
+ */
917
+
918
+ for (int i=1; --i>=0;)
919
+ {
920
+ //oe.toolboxPanel.Return();
921
+ oe.toolboxPanel.add(new cGridBag());
922
+ }
923
+
924
+ // EDIT panel
925
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
926
+ editButton.setToolTipText("Pin selection controls");
927
+ editButton.addActionListener(this);
928
+
929
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
930
+ uneditButton.setToolTipText("Remove selection controls");
530931 uneditButton.addActionListener(this);
531932
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);
933
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
934
+ allParamsButton.setToolTipText("Show all controle");
544935 allParamsButton.addActionListener(this);
545936
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);
937
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
938
+ clearPanelButton.setToolTipText("Clear edit panel");
939
+ clearPanelButton.addActionListener(this);
940
+
941
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+ unselectButton.setToolTipText("Unselect");
551943 unselectButton.addActionListener(this);
552944
945
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
946
+ flashSelectionButton.setToolTipText("Highlight selection");
947
+ flashSelectionButton.addActionListener(this);
948
+
949
+ editCommandsPanel.preferredHeight = 1;
950
+
951
+ SetPinStates(false);
952
+// oe.treePanel.add(commandsPanel);
953
+// oe.treePanel.Return();
954
+
553955 // oe.aConstraints.gridx += 1;
554956 // oe.aConstraints.weighty = 0;
555957 // oe.aConstraints.gridwidth = 1;
....@@ -561,47 +963,32 @@
561963 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562964 // gcButton.addActionListener(this);
563965
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;
966
+ cGridBag jSPPanel = new cGridBag();
967
+
968
+ JScrollPane jSP;
575969 //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);
970
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
577971 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
582
-
583
- oe.aConstraints.weighty = 0;
584
- oe.aConstraints.gridwidth = 2;
585
-
586
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
587
- colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
590
- materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
593
- textureCB.addItemListener(this);
594
-
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
597972
973
+ oe.treePanel.add(jSPPanel);
974
+ oe.treePanel.Return();
975
+
976
+ oe.treePanel.add(copyOptionsPanel);
977
+ oe.treePanel.Return();
978
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
979
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
980
+ sliderPane.preferredHeight = 1;
981
+
982
+// mainPanel.setDividerLocation(0.1); //1.0);
983
+ mainPanel.setResizeWeight(0.4);
984
+
598985 //jList.addListSelectionListener(this);
599986 oe.jTree.addTreeSelectionListener(this);
600987 //jTree.setRootVisible(false);
601988 //jTree.setEditable(true);
602989 oe.jTree.setDragEnabled(true);
603990 //jTree.setPreferredSize(new Dimension(10,10));
604
- jSP.setPreferredSize(new Dimension(100,200));
991
+ //jSP.setPreferredSize(new Dimension(100,200));
605992
606993 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
607994
....@@ -613,23 +1000,160 @@
6131000 dgr.addDragGestureListener(this);
6141001 }catch(Exception e) {}
6151002 */
616
- radio.layout = sevenButton;
1003
+ radio.layout = sixButton; // sevenButton;
6171004 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6181005 }
1006
+
1007
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1008
+ {
1009
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1010
+ colorCB.setToolTipText("Copy color when dropped");
1011
+ colorCB.addItemListener(this);
1012
+
1013
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1014
+ materialCB.setToolTipText("Copy material when dropped");
1015
+ materialCB.addItemListener(this);
1016
+
1017
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1018
+ textureCB.setToolTipText("Copy texture when dropped");
1019
+ textureCB.addItemListener(this);
1020
+
1021
+ panel.Return();
1022
+
1023
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1024
+ boxCB.setToolTipText("Display bounding boxes");
1025
+ boxCB.addItemListener(this);
1026
+
1027
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1028
+ zoomBoxCB.setToolTipText("Display only for wheel");
1029
+ zoomBoxCB.addItemListener(this);
1030
+
1031
+ if (true) // Globals.ADVANCED)
1032
+ {
1033
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1034
+// supportCB.setToolTipText("Enable rigging");
1035
+// supportCB.addItemListener(this);
1036
+
1037
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1038
+ freezeCB.setToolTipText("Fast moving camera");
1039
+ freezeCB.addItemListener(this);
1040
+
1041
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1042
+ // localCB.addItemListener(this);
1043
+
1044
+ panel.Return();
1045
+
1046
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1047
+ crowdCB.setToolTipText("Used for crowds");
1048
+ crowdCB.addItemListener(this);
1049
+
1050
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1051
+ smoothCB.setToolTipText("Snapping delay");
1052
+ smoothCB.addItemListener(this);
1053
+
1054
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1055
+ slowCB.setToolTipText("Smooth interpolation");
1056
+ slowCB.addItemListener(this);
1057
+
1058
+// constraints.gridy += 1;
1059
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1060
+// speakerMocapCB.addItemListener(this);
1061
+
1062
+ panel.Return();
1063
+
1064
+ if (false)
1065
+ {
1066
+ // handled in scripts
1067
+ //constraints.gridy += 1;
1068
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1069
+ speakerCameraCB.addItemListener(this);
1070
+
1071
+ //constraints.gridy += 1;
1072
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1073
+ speakerFocusCB.addItemListener(this);
1074
+
1075
+ //constraints.gridy += 1;
1076
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1077
+ smoothfocusCB.addItemListener(this);
1078
+ panel.Return();
1079
+ }
1080
+
1081
+//constraints.gridx += 1;
1082
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1083
+// debugCB.addItemListener(this);
1084
+
1085
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1086
+ trackCB.setToolTipText("Enable tracking target");
1087
+ trackCB.addItemListener(this);
1088
+
1089
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1090
+ oeilCB.setToolTipText("Move camera when tracking");
1091
+ oeilCB.addItemListener(this);
1092
+
1093
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1094
+ shadowCB.setToolTipText("When live compute shadows");
1095
+ shadowCB.addItemListener(this);
1096
+
1097
+ panel.Return();
1098
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1099
+ toggleTextureCB.setToolTipText("Load textures");
1100
+ toggleTextureCB.addItemListener(this);
1101
+
1102
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1103
+ toggleSwitchCB.setToolTipText("Choose a single item");
1104
+ toggleSwitchCB.addItemListener(this);
1105
+
1106
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1107
+ autokeepCB.setToolTipText("On structure change");
1108
+ autokeepCB.addItemListener(this);
1109
+
1110
+ panel.Return();
1111
+ if (Globals.ADVANCED)
1112
+ {
1113
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1114
+ lookAtCB.setToolTipText("Look-at target");
1115
+ lookAtCB.addItemListener(this);
1116
+ }
1117
+
1118
+ }
1119
+
1120
+ cGridBag fill = new cGridBag();
1121
+ fill.preferredHeight = 200;
1122
+ cGridBag fill2 = new cGridBag();
1123
+ fill2.preferredHeight = 200;
1124
+ cGridBag fill3 = new cGridBag();
1125
+ fill3.preferredHeight = 200;
1126
+
1127
+ panel.add(fill);
1128
+ panel.add(fill2);
1129
+ panel.add(fill3);
1130
+
1131
+ }
6191132
6201133 void EditObject(Object3D obj)
6211134 {
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();
1135
+ cRadio radioButton = new cRadio(obj.name);
1136
+
1137
+ // June 2019. Patch to avoid bug with transparency.
1138
+ radioButton.hadMaterial = obj.material != null;
1139
+ if (!radioButton.hadMaterial)
1140
+ {
1141
+ obj.material = new cMaterial();
1142
+ }
1143
+
1144
+ radioButton.SetObject(obj);
1145
+ radioButton.layout = sixButton; // sevenButton;
1146
+ radioButton.SetCamera(cameraView.renderCamera, false);
1147
+ radioButton.addActionListener(this);
1148
+ radioPanel.add(radioButton);
1149
+ buttonGroup.add(radioButton);
1150
+ radioButton.doClick();
6301151 }
1152
+
6311153 void SetupViews(ObjEditor oe)
6321154 {
1155
+ theFrame = this;
1156
+
6331157 oe.SetupViews();
6341158
6351159 System.out.println("SetupViews");
....@@ -638,22 +1162,28 @@
6381162 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6391163 }
6401164
641
- JCheckBox liveCB;
642
- JCheckBox supportCB;
643
- JCheckBox localCB;
644
- JCheckBox crowdCB;
645
- JCheckBox smoothCB;
646
- JCheckBox fastCB;
647
- JCheckBox slowCB;
648
- JCheckBox boxCB;
649
- JCheckBox trackCB;
650
- JCheckBox smoothfocusCB;
1165
+ cToggleButton liveCB;
1166
+ cCheckBox supportCB;
1167
+ cCheckBox localCB;
1168
+ cCheckBox crowdCB;
1169
+ cCheckBox smoothCB;
1170
+ cToggleButton fastCB;
1171
+ cCheckBox slowCB;
1172
+ cCheckBox boxCB;
1173
+ cCheckBox zoomBoxCB;
1174
+ cCheckBox freezeCB;
1175
+ //cToggleButton trackCB;
1176
+ cCheckBox trackCB;
1177
+ cCheckBox smoothfocusCB;
6511178 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
1179
+ cCheckBox speakerCameraCB;
1180
+ cCheckBox speakerFocusCB;
1181
+ cCheckBox debugCB;
1182
+
1183
+ cCheckBox oeilCB;
1184
+ cCheckBox shadowCB;
1185
+ cCheckBox autokeepCB;
1186
+ cCheckBox lookAtCB;
6571187
6581188 // static int COLOR = 1;
6591189 // static int MATERIAL = 2;
....@@ -661,9 +1191,9 @@
6611191
6621192 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6631193
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
1194
+ cCheckBox colorCB;
1195
+ cCheckBox materialCB;
1196
+ cCheckBox textureCB;
6671197
6681198 public void itemStateChanged(ItemEvent e)
6691199 {
....@@ -688,10 +1218,10 @@
6881218 dropAttributes |= Object3D.TEXTURE;
6891219 else
6901220 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
1221
+ } else if(e.getSource() == liveCB)
6931222 {
6941223 cameraView.ToggleLive();
1224
+ refreshContents(false);
6951225 }
6961226 else if(e.getSource() == supportCB)
6971227 {
....@@ -727,6 +1257,10 @@
7271257 cameraView.repaint();
7281258 // refreshContents();
7291259 }
1260
+ else if(e.getSource() == zoomBoxCB)
1261
+ {
1262
+ cameraView.ToggleZoomBoxMode();
1263
+ }
7301264 else if(e.getSource() == smoothfocusCB)
7311265 {
7321266 cameraView.ToggleSmoothFocus();
....@@ -752,6 +1286,18 @@
7521286 {
7531287 cameraView.ToggleOeil();
7541288 }
1289
+ else if(e.getSource() == shadowCB)
1290
+ {
1291
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1292
+ }
1293
+ else if(e.getSource() == freezeCB)
1294
+ {
1295
+ Globals.FREEZEONMOVE ^= true;
1296
+ }
1297
+ else if(e.getSource() == autokeepCB)
1298
+ {
1299
+ Globals.REPLACEONMAKE ^= true;
1300
+ }
7551301 else if(e.getSource() == lookAtCB)
7561302 {
7571303 cameraView.ToggleLookAt();
....@@ -768,7 +1314,8 @@
7681314
7691315 /**/
7701316 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1317
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1318
+ TreePath path = objEditor.jTree.getSelectionPath();
7721319 if ((path == null) || (path.getPathCount() <= 1)) {
7731320 // We can't move the root node or an empty selection
7741321 return;
....@@ -831,8 +1378,6 @@
8311378 }
8321379 }
8331380
834
- String string = (String) object;
835
-
8361381 System.out.println("Transfer = " + object + "; drop : " + target);
8371382 // if( object instanceof java.io.File[])
8381383 // {
....@@ -840,7 +1385,11 @@
8401385 // objEditor.DropFile((java.io.File[]) object, true);
8411386 // return;
8421387 // }
843
- if (string.charAt(0) == '/')
1388
+
1389
+ String string = object.toString();
1390
+
1391
+ // File path for Mac and Windows
1392
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441393 {
8451394 // file(s)
8461395 String[] names = string.split("\n");
....@@ -867,7 +1416,7 @@
8671416
8681417 flashIt = false;
8691418 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1419
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711420 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721421
8731422 if (group.selection.size() == 1)
....@@ -883,23 +1432,33 @@
8831432
8841433 assert target == objEditor.jTree;
8851434 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1435
+ Object3D destinationLeaf;
8861436 try {
887
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1437
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
8881438 } catch (Exception e) {
8891439 System.out.println("destinationPath : " + destinationPath);
8901440 return;
8911441 }
8921442
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1443
+ for (int i=group.selection.size(); --i>=0;)
8941444 {
1445
+ Object3D child = (Object3D)group.selection.elementAt(i);
1446
+
1447
+ // Cannot move into itself
1448
+ if (child == destinationLeaf)
1449
+ return;
1450
+ }
1451
+
1452
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1453
+// {
8951454 loadClipboard(true);
8961455 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1456
+ pasteInto(false, false);
1457
+// } else {
1458
+// loadClipboard(false);
1459
+// objEditor.jTree.setSelectionPath(destinationPath);
1460
+// pasteInto(false, false); // true); // ???
1461
+// }
9031462 }
9041463 public void dropActionChanged(DropTargetDragEvent dtde)
9051464 // Called if the user has modified the current drop gesture
....@@ -1002,90 +1561,109 @@
10021561
10031562 void buildCreateMenu(Menu menu)
10041563 {
1005
- gridItem = menu.add(new MenuItem("Grid"));
1006
- gridItem.addActionListener(this);
1007
- rectoidItem = menu.add(new MenuItem("Box"));
1008
- rectoidItem.addActionListener(this);
1009
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1010
- ellipsoidItem.addActionListener(this);
1011
- coneItem = menu.add(new MenuItem("Cone"));
1012
- coneItem.addActionListener(this);
1013
- torusItem = menu.add(new MenuItem("Torus"));
1014
- torusItem.addActionListener(this);
1015
- superItem = menu.add(new MenuItem("Superellipsoid"));
1016
- superItem.addActionListener(this);
1017
- particleItem = menu.add(new MenuItem("Particle system"));
1018
- particleItem.addActionListener(this);
1564
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1565
+ //heightFieldItem.addActionListener(this);
1566
+// gridItem = menu.add(new MenuItem("Grid"));
1567
+// gridItem.addActionListener(this);
1568
+// rectoidItem = menu.add(new MenuItem("Box"));
1569
+// rectoidItem.addActionListener(this);
1570
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1571
+// ellipsoidItem.addActionListener(this);
1572
+// coneItem = menu.add(new MenuItem("Cone"));
1573
+// coneItem.addActionListener(this);
1574
+// torusItem = menu.add(new MenuItem("Torus"));
1575
+// torusItem.addActionListener(this);
1576
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1577
+// superItem.addActionListener(this);
1578
+
1579
+ cameraItem = menu.add(new MenuItem("Camera"));
1580
+ cameraItem.addActionListener(this);
1581
+
1582
+ if (!Globals.ADVANCED)
1583
+ {
1584
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1585
+ kleinItem.addActionListener(this);
1586
+ }
1587
+
1588
+// particleItem = menu.add(new MenuItem("Particle system"));
1589
+// particleItem.addActionListener(this);
1590
+ if (Globals.ADVANCED)
1591
+ {
10191592 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201593 ragdollItem.addActionListener(this);
10211594 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221595 ragdoll2Item.addActionListener(this);
1596
+ }
10231597 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1598
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251599 meshItem.addActionListener(this);
10261600 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271601 // meshGroupItem.addActionListener(this);
1602
+ if (Globals.ADVANCED)
1603
+ {
10281604 springItem = menu.add(new MenuItem("Spring"));
10291605 springItem.addActionListener(this);
10301606 flagItem = menu.add(new MenuItem("Flag"));
10311607 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);
10361608 blobItem = menu.add(new MenuItem("Blob"));
10371609 blobItem.addActionListener(this);
10381610 latheItem = menu.add(new MenuItem("Lathe"));
10391611 latheItem.addActionListener(this);
1040
- lightItem = menu.add(new MenuItem("Light"));
1041
- lightItem.addActionListener(this);
1612
+ }
1613
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1614
+ bezierItem.addActionListener(this);
1615
+// overlayItem = menu.add(new MenuItem("Overlay"));
1616
+// overlayItem.addActionListener(this);
1617
+// lightItem = menu.add(new MenuItem("Light"));
1618
+// lightItem.addActionListener(this);
10421619 menu.add("-");
10431620 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10441621 //superLoopItem.addActionListener(this);
1045
- loopItem = menu.add(new MenuItem("Loop"));
1046
- loopItem.addActionListener(this);
1622
+// loopItem = menu.add(new MenuItem("Loop"));
1623
+// loopItem.addActionListener(this);
10471624 doubleItem = menu.add(new MenuItem("Fork"));
10481625 doubleItem.addActionListener(this);
1626
+ if (Globals.ADVANCED)
1627
+ {
10491628 tripleItem = menu.add(new MenuItem("Trident"));
10501629 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);
1630
+ }
10601631 }
10611632
10621633 void buildToolsMenu(Menu menu)
10631634 {
10641635 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651636 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1637
+ animationItem.setState(Globals.ANIMATION);
1638
+
1639
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1640
+ archiveItem.addActionListener(this);
10671641
10681642 menu.add("-");
10691643 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701644 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1645
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1646
+ textureFieldItem.addActionListener(this);
1647
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721648 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751649 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761650 reduceMorphItem.addActionListener(this);
10771651 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781652 reduce34MorphItem.addActionListener(this);
1079
-
1080
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1081
- computeAOItem.addActionListener(this);
10821653 menu.add("-");
1083
-
10841654 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851655 memoryItem.addActionListener(this);
1656
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1657
+ computeAOItem.addActionListener(this);
1658
+
1659
+ if (Globals.ADVANCED)
1660
+ {
1661
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1662
+ mirrorItem.addActionListener(this);
1663
+ menu.add("-");
10861664 menu.add(analyzeItem = new MenuItem("Analyze"));
10871665 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1666
+ menu.add(dumpItem = new MenuItem("Print"));
10891667 dumpItem.addActionListener(this);
10901668 // menu.add(pathItem = new MenuItem("From-to path"));
10911669 // pathItem.addActionListener(this);
....@@ -1094,6 +1672,8 @@
10941672 resetParentItem.addActionListener(this);
10951673 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961674 repairParentItem.addActionListener(this);
1675
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1676
+ repairShadowItem.addActionListener(this);
10971677 menu.add(invariantsItem = new MenuItem("Invariants"));
10981678 invariantsItem.addActionListener(this);
10991679 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1681,7 @@
11011681 menu.add("-");
11021682 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031683 editScriptItem.addActionListener(this);
1684
+ }
11041685 }
11051686
11061687 void ScreenFit()
....@@ -1223,9 +1804,34 @@
12231804 shadow.material = new cMaterial(obj.material);
12241805 shadow.material.diffuse = 0.0001f;
12251806 shadow.material.specular = 0.0001f;
1807
+ //shadow.projectedVertices[1].x = 300;
12261808
12271809 makeSomething(shadow);
12281810 }
1811
+
1812
+ private void ClearUnpinned()
1813
+ {
1814
+ //for (Object3D obj : listUI)
1815
+ for (int i=listUI.size(); --i>=0;)
1816
+ {
1817
+ Object3D obj = listUI.elementAt(i);
1818
+ if (!obj.pinned)
1819
+ {
1820
+ obj.CloseUI();
1821
+ listUI.remove(i);
1822
+ }
1823
+ }
1824
+ }
1825
+
1826
+ private void EditElement(Object3D elem, boolean newWindow)
1827
+ {
1828
+ // if (!(elem instanceof Composite))
1829
+ // newWindow = false;
1830
+ listUI.add(elem);
1831
+ elem.openEditWindow(this, newWindow); //, false);
1832
+ System.out.println("edit : " + elem);
1833
+ elem.editWindow.refreshContents(true); // ? new
1834
+ }
12291835
12301836 /**
12311837 * applyExample
....@@ -1429,9 +2035,9 @@
14292035
14302036 void Overwrite(int mask)
14312037 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2038
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14332039 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
2040
+ Object3D content = Grafreed.clipboard.get(0);
14352041
14362042 if (content instanceof cGroup && ((cGroup)content).transientlink )
14372043 content = ((cGroup)content).get(0);
....@@ -1454,6 +2060,7 @@
14542060 //
14552061 public void actionPerformed(ActionEvent event) // , Object arg)
14562062 {
2063
+ Object source = event.getSource();
14572064 /*
14582065 if (event.getSource() == nameField)
14592066 {
....@@ -1465,11 +2072,11 @@
14652072 }
14662073 else
14672074 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2075
+ if (source == lookAtItem || source == lookFromItem)
14692076 {
14702077 ScreenFit();
14712078 } else
1472
- if (event.getSource() == switchItem)
2079
+ if (source == switchViewItem)
14732080 {
14742081 cVector v1 = new cVector();
14752082 cVector v2 = new cVector();
....@@ -1478,11 +2085,11 @@
14782085 objEditor.cameraView.renderCamera.setAim(v2, v1);
14792086 objEditor.cameraView.repaint();
14802087 } else
1481
- if (event.getSource() == rectoidItem)
2088
+ if (source == rectoidItem || source == boxButton)
14822089 {
14832090 makeSomething(new Box());
14842091 } else
1485
- if (event.getSource() == particleItem)
2092
+ if (source == particleItem || source == particlesButton)
14862093 {
14872094 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14882095 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +2110,9 @@
15032110 applyExample(particleGeom, "SMOKE");
15042111 makeSomething(particleGeom);
15052112 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2113
+ if (source == ragdollItem || source == ragdoll2Item)
15072114 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2115
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15092116
15102117 ragdoll.toParent = LA.newMatrix();
15112118 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +2128,71 @@
15212128 makeSomething(ragdoll);
15222129 //makeSomething(new VehicleDemo());
15232130 } else
1524
- if (event.getSource() == gridItem)
2131
+ /*
2132
+ */
2133
+ if (source == heightFieldItem)
2134
+ {
2135
+ Object3D obj = new Object3D();
2136
+
2137
+ obj.CreateMaterial();
2138
+ obj.bRep = new BoundaryRep();
2139
+
2140
+ obj.bRep.CreateMesh(new iHeightField()
2141
+ {
2142
+ public double f(double x, double y)
2143
+ {
2144
+ // The Mandelbrot set is represented by coloring
2145
+ // each point (x,y) according to the number of
2146
+ // iterations it takes before the while loop in
2147
+ // this method ends. For points that are actually
2148
+ // in the Mandelbrot set, or very close to it, the
2149
+ // count will reach the maximum value, 80. These
2150
+ // points will be colored purple. All other colors
2151
+ // represent points that are definitely NOT in the set.
2152
+ x -= 600;
2153
+ y -= 500;
2154
+ x /= 200;
2155
+ y /= 200;
2156
+ int count = 0;
2157
+ double zx = x;
2158
+ double zy = y;
2159
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
2160
+ double new_zx = zx*zx - zy*zy + x;
2161
+ zy = 2*zx*zy + y;
2162
+ zx = new_zx;
2163
+ count++;
2164
+ }
2165
+ return count; // Math.sqrt(count);
2166
+ }
2167
+ }, 1000,1000);
2168
+
2169
+ makeSomething(obj);
2170
+ } else
2171
+ if (source == gridItem || source == gridButton)
15252172 {
15262173 makeSomething(new Grid());
15272174 } else
1528
- if (event.getSource() == ellipsoidItem)
2175
+ if (source == ellipsoidItem || source == sphereButton)
15292176 {
15302177 makeSomething(new Sphere());
15312178 } else
1532
- if (event.getSource() == coneItem)
2179
+ if (source == coneItem || source == coneButton)
15332180 {
15342181 makeSomething(new Cone());
15352182 } else
1536
- if (event.getSource() == torusItem)
2183
+ if (source == torusItem || source == torusButton)
15372184 {
15382185 makeSomething(new Torus());
15392186 } else
1540
- if (event.getSource() == superItem)
2187
+ if (source == superItem || source == superButton)
15412188 {
15422189 makeSomething(new Superellipsoid());
15432190 } else
1544
- if (event.getSource() == blobItem)
2191
+ if (source == kleinItem || source == kleinButton)
2192
+ {
2193
+ makeSomething(new Klein());
2194
+ } else
2195
+ if (source == blobItem)
15452196 {
15462197 Blob blob = new Blob();
15472198 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +2200,15 @@
15492200 //blob.retile();
15502201 makeSomething(blob);
15512202 } else
1552
- if (event.getSource() == latheItem)
2203
+ if (source == latheItem)
15532204 {
15542205 makeSomething(new Lathe());
15552206 } else
1556
- if (event.getSource() == bezierItem)
2207
+ if (source == bezierItem)
15572208 {
15582209 makeSomething(new BezierSurface());
15592210 } else
1560
- if (event.getSource() == checkerItem)
2211
+ if (source == overlayItem || source == overlayButton)
15612212 {
15622213 /*
15632214 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +2221,9 @@
15702221 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15712222 LA.matInvert(obj.toParent, obj.fromParent);
15722223 */
1573
- makeSomething(new CheckerIG());
2224
+ makeSomething(new Checker());
15742225 } else
1575
- if (event.getSource() == meshItem)
2226
+ if (source == meshItem)
15762227 {
15772228 Object3D itemtomake = new Object3D();
15782229 Object3D child;
....@@ -1593,35 +2244,52 @@
15932244 makeSomething(child);
15942245 }
15952246 } else
1596
- if (event.getSource() == springItem)
2247
+ if (source == springItem)
15972248 {
15982249 cSpring s = new cSpring();
15992250 s.setup();
16002251 makeSomething(s);
16012252 } else
1602
- if (event.getSource() == flagItem)
2253
+ if (source == flagItem)
16032254 {
16042255 cSpring s = new cFlag();
16052256 s.setup();
16062257 makeSomething(s);
16072258 } else
1608
- if (event.getSource() == lightItem)
2259
+ if (source == lightItem || source == lightButton)
16092260 {
16102261 makeSomething(new Light());
16112262 } else
1612
- if (event.getSource() == csgItem)
2263
+// if (source == skybox1Button ||
2264
+// source == skybox2Button ||
2265
+// source == skybox3Button ||
2266
+// source == skybox4Button ||
2267
+// source == skybox5Button ||
2268
+// source == skybox6Button ||
2269
+// source == skybox7Button ||
2270
+// source == skybox11Button ||
2271
+// source == skybox12Button ||
2272
+// source == skybox13Button ||
2273
+// source == skybox14Button ||
2274
+// source == skybox15Button ||
2275
+// source == skybox16Button ||
2276
+// source == skybox17Button)
2277
+// {
2278
+// ChangeSkybox(source);
2279
+// } else
2280
+ if (source == csgItem)
16132281 {
16142282 group(new CSG());
16152283 } else
1616
- if (event.getSource() == templateItem)
2284
+ if (source == templateItem)
16172285 {
16182286 group(new cTemplate());
16192287 } else
1620
- if (event.getSource() == attributeItem)
2288
+ if (source == attributeItem)
16212289 {
16222290 makeSomething(new Attribute());
16232291 } else
1624
- if (event.getSource() == pointflowItem)
2292
+ if (source == pointflowItem)
16252293 {
16262294 makeSomething(new PointFlow());
16272295 } else
....@@ -1633,7 +2301,7 @@
16332301 } else
16342302 */
16352303
1636
- if (event.getSource() == superLoopItem)
2304
+ if (source == superLoopItem)
16372305 {
16382306 Composite g = new cGroup();
16392307 for (int i=0; i<15; i++)
....@@ -1655,30 +2323,30 @@
16552323
16562324 group(g);
16572325 } else
1658
- if (event.getSource() == loopItem)
2326
+ if (source == loopItem || source == loopButton)
16592327 {
16602328 Composite csg = new GroupLeaf();
16612329 csg.count = 5;
16622330 group(csg);
1663
- Composite child = new cGroup();
2331
+ Composite child = new cGroup("Branch");
16642332 csg.addChild(child);
16652333 child.addChild(csg);
16662334 } else
1667
- if (event.getSource() == doubleItem)
2335
+ if (source == doubleItem)
16682336 {
1669
- Composite csg = new GroupLeaf();
2337
+ Composite csg = new GroupLeaf("Fork");
16702338 csg.count = 5;
16712339 group(csg);
1672
- Composite child = new cGroup();
2340
+ Composite child = new cGroup("Branch A");
16732341 csg.addChild(child);
16742342 child.addChild(csg);
1675
- child = new cGroup();
2343
+ child = new cGroup("Branch B");
16762344 csg.addChild(child);
16772345 child.addChild(csg);
16782346 } else
1679
- if (event.getSource() == tripleItem)
2347
+ if (source == tripleItem)
16802348 {
1681
- Composite csg = new GroupLeaf();
2349
+ Composite csg = new GroupLeaf("Trident");
16822350 csg.count = 4;
16832351 group(csg);
16842352 Composite child = new cGroup();
....@@ -1691,73 +2359,98 @@
16912359 csg.addChild(child);
16922360 child.addChild(csg);
16932361 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2362
+ if (source == computeAOItem)
16962363 {
1697
- ImportGFD();
2364
+ Globals.drawMode = CameraPane.OCCLUSION;
2365
+ cameraView.repaint();
16982366 } 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)
2367
+ if (source == recompileItem)
17172368 {
17182369 Recompile();
17192370 refreshContents();
17202371 } else
1721
- if (event.getSource() == editScriptItem)
2372
+ if (source == editScriptItem)
17222373 {
17232374 OpenDialog();
17242375 refreshContents();
17252376 } else
1726
- if (event.getSource() == invariantsItem)
2377
+ if (source == invariantsItem)
17272378 {
17282379 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2380
+ Grafreed.grafreeD.universe.invariants();
17302381 } else
1731
- if (event.getSource() == memoryItem)
2382
+ if (source == memoryItem)
17322383 {
17332384 //System.out.println("Invariants:");
17342385 PrintMemory();
17352386 } else
1736
- if (event.getSource() == pathItem)
2387
+ if (source == pathItem)
17372388 {
17382389 PrintPath();
17392390 } else
1740
- if (event.getSource() == analyzeItem)
2391
+ if (source == analyzeItem)
17412392 {
17422393 AnalyzeObject();
17432394 } else
1744
- if (event.getSource() == dumpItem)
2395
+ if (source == dumpItem)
17452396 {
17462397 DumpObject();
17472398 } else
1748
- if (event.getSource() == screenfitButton)
2399
+ if (source == minButton)
17492400 {
1750
- //Reload(lastConverter, lastFilename, true);
2401
+ Minimize();
2402
+ } else
2403
+ if (source == maxButton)
2404
+ {
2405
+ Maximize();
2406
+ } else
2407
+ if (source == fullButton)
2408
+ {
2409
+ ToggleFullScreen();
2410
+ } else
2411
+ if (source == undoButton)
2412
+ {
2413
+ // Go to previous version
2414
+ //if (!Undo())
2415
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2416
+ Undo();
2417
+ } else
2418
+ if (source == restoreButton)
2419
+ {
2420
+ // Restore current version
2421
+ Restore();
2422
+ } else
2423
+ if (source == replaceButton)
2424
+ {
2425
+ // Overwrite current version
2426
+ Replace();
2427
+ } else
2428
+ if (source == redoButton)
2429
+ {
2430
+ // Go to next version
2431
+ Redo();
2432
+ } else
2433
+ if (source == saveButton)
2434
+ {
2435
+ // Save a new version
2436
+ if (!Save(true))
2437
+ java.awt.Toolkit.getDefaultToolkit().beep();
2438
+ } else
2439
+ if (source == oneStepButton)
2440
+ {
2441
+ Globals.ONESTEP = true;
2442
+ cameraView.repaint();
2443
+ } else
2444
+ if (source == screenfitButton)
2445
+ {
17512446 ScreenFit();
17522447 } else
1753
- if (event.getSource() == screenfitpointButton)
2448
+ if (source == screenfitpointButton)
17542449 {
1755
- //Reload(lastConverter, lastFilename, true);
17562450 ScreenFitPoint();
17572451 } else
1758
- if (event.getSource() == snapobjectButton)
2452
+ if (source == snapobjectButton)
17592453 {
1760
- //Reload(lastConverter, lastFilename, true);
17612454 SnapObject();
17622455 } else
17632456 // if (event.getSource() == recompileButton)
....@@ -1766,13 +2459,13 @@
17662459 // Recompile();
17672460 // refreshContents();
17682461 // } else
1769
- if (event.getSource() == gcButton)
2462
+ if (source == gcButton)
17702463 {
17712464 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722465 System.gc();
17732466 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742467 } else
1775
- if (event.getSource() == editLeafItem)
2468
+ if (source == editLeafItem)
17762469 {
17772470 Object3D obj;
17782471 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2479,78 @@
17862479 }
17872480 refreshContents(true);
17882481 } else
1789
- if (event.getSource() == openWindowItem)
2482
+ if (source == openWindowItem)
17902483 {
17912484 EditSelection(true);
17922485 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2486
+ if (source == cutItem || source == clearButton)
17942487 {
17952488 loadClipboard(true);
17962489 } else
1797
- if (event.getSource() == duplicateItem)
2490
+ if (source == undoItem)
17982491 {
1799
- Object3D keep = GraphreeD.clipboard;
2492
+ Undo();
2493
+ } else
2494
+ if (source == redoItem)
2495
+ {
2496
+ Redo();
2497
+ } else
2498
+ if (source == duplicateItem)
2499
+ {
2500
+ Object3D keep = Grafreed.clipboard;
18002501 loadClipboard(false);
18012502 paste(false);
1802
- GraphreeD.clipboard = keep;
2503
+ Grafreed.clipboard = keep;
18032504 } else
1804
- if (event.getSource() == cloneItem)
2505
+ if (source == cloneItem)
18052506 {
18062507 CloneSelection(false);
18072508 } else
1808
- if (event.getSource() == cloneSupportItem)
2509
+ if (source == cloneSupportItem)
18092510 {
18102511 CloneSelection(true);
18112512 } else
1812
- if (event.getSource() == copyItem)
2513
+ if (source == copyItem)
18132514 {
18142515 loadClipboard(false);
18152516 } else
1816
- if (event.getSource() == pasteItem)
2517
+ if (source == pasteItem)
18172518 {
18182519 paste(false);
18192520 } else
1820
- if (event.getSource() == pasteLinkItem)
2521
+ if (source == pasteIntoItem)
18212522 {
1822
- pasteInto(false);
2523
+ pasteInto(true, false);
18232524 } else
1824
- if (event.getSource() == pasteCloneItem)
2525
+ if (source == pasteLinkItem)
18252526 {
1826
- pasteInto(true);
2527
+ pasteInto(false, false);
18272528 } else
1828
- if (event.getSource() == pasteExpandItem)
2529
+ if (source == pasteCloneItem)
2530
+ {
2531
+ pasteInto(true, true);
2532
+ } else
2533
+ if (source == pasteExpandItem)
18292534 {
18302535 paste(true);
18312536 } else
1832
- if (event.getSource() == synchronizeItem)
2537
+ if (source == synchronizeItem)
18332538 {
18342539 Overwrite(Object3D.TRANSFORM);
18352540 } else
1836
- if (event.getSource() == overwriteNameItem)
2541
+ if (source == overwriteNameItem)
18372542 {
18382543 Overwrite(Object3D.NAME);
18392544 } else
1840
- if (event.getSource() == overwriteUVItem)
2545
+ if (source == overwriteUVItem)
18412546 {
18422547 Overwrite(Object3D.UV);
18432548 } else
1844
- if (event.getSource() == overwriteMatItem)
2549
+ if (source == overwriteMatItem)
18452550 {
2551
+ /* july 2015
18462552 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2553
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482554 else
18492555 {
18502556 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2562,16 @@
18562562 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572563 }
18582564 }
2565
+ */
2566
+
2567
+ Overwrite(dropAttributes);
18592568 }
1860
- if (event.getSource() == overwriteGeoItem)
2569
+ if (source == overwriteGeoItem)
18612570 {
18622571 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2572
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642573 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2574
+// Object3D content = GrafreeD.clipboard.get(0);
18662575 //
18672576 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682577 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2583,7 @@
18742583 // refreshContents();
18752584 // }
18762585 } else
1877
- if (event.getSource() == generateMeshItem)
2586
+ if (source == generateMeshItem)
18782587 {
18792588 //if (group.selection.size() == 1)
18802589 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2594,7 @@
18852594 ResetModel();
18862595 refreshContents();
18872596 } else
1888
- if (event.getSource() == extractGeometriesItem)
2597
+ if (source == extractGeometriesItem)
18892598 {
18902599 boolean one = false;
18912600
....@@ -1912,7 +2621,7 @@
19122621 ResetModel();
19132622 refreshContents();
19142623 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2624
+ if (source == cloneGeometriesItem)
19162625 {
19172626 boolean one = false;
19182627
....@@ -1938,32 +2647,37 @@
19382647 ResetModel();
19392648 refreshContents();
19402649 } else
1941
- if (event.getSource() == shareGeometriesItem)
2650
+ if (source == shareGeometriesItem)
19422651 {
19432652 boolean one = false;
19442653
19452654 if (group.selection.size() == 1)
19462655 one = true;
19472656
2657
+ Object3D merge = null;
2658
+
19482659 Object3D content = new cGroup();
19492660
19502661 for (int i=0; i<group.selection.size(); i++)
19512662 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2663
+ merge = new Merge(group.selection.get(i));
19532664
19542665 if (one)
1955
- makeSomething(sel, false);
2666
+ makeSomething(merge, false);
19562667 else
1957
- content.addChild(sel);
2668
+ content.addChild(merge);
19582669 }
19592670
19602671 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2672
+ makeSomething(content, true);
2673
+ else
2674
+ {
2675
+ ResetModel();
2676
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2677
+ refreshContents();
2678
+ }
19652679 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2680
+ if (source == mergeGeometriesItem)
19672681 {
19682682 boolean one = false;
19692683
....@@ -1993,11 +2707,11 @@
19932707 ResetModel();
19942708 refreshContents();
19952709 } else
1996
- if (event.getSource() == linkverticesItem)
2710
+ if (source == linkverticesItem)
19972711 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2712
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992713 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2714
+// Object3D content = GrafreeD.clipboard.get(0);
20012715 //
20022716 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032717 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2720,48 @@
20062720 // group.selection.get(0).setMasterThis(content); // should be identity
20072721 // refreshContents();
20082722 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2723
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102724 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2725
+ Object3D content = Grafreed.clipboard.get(0);
20122726
20132727 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142728 content = ((cGroup)content).get(0);
20152729
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2730
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172731 for (int i=0; i<group.selection.size(); i++)
20182732 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2733
+ boolean random = CameraPane.SWITCH;
2734
+ CameraPane.SWITCH = false; // parse all random nodes
20212735 group.selection.get(i).linkVerticesThis(content);
20222736 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2737
+ CameraPane.SWITCH = random;
20242738 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2739
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262740 refreshContents();
20272741 }
20282742 } else
2029
- if (event.getSource() == resetsupportItem)
2743
+ if (source == resetsupportItem)
20302744 {
20312745 for (int i=0; i<group.selection.size(); i++)
20322746 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2747
+ boolean random = CameraPane.SWITCH;
2748
+ CameraPane.SWITCH = false; // parse all random nodes
20352749 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2750
+ CameraPane.SWITCH = random;
20372751 }
20382752
20392753 refreshContents();
20402754 } else
2041
- if (event.getSource() == resetreferencesItem)
2755
+ if (source == relinkverticesItem)
2756
+ {
2757
+ boolean random = CameraPane.SWITCH;
2758
+ CameraPane.SWITCH = false; // parse all random nodes
2759
+ group.selection.RelinkToSupport();
2760
+ CameraPane.SWITCH = random;
2761
+
2762
+ refreshContents();
2763
+ } else
2764
+ if (source == resetreferencesItem)
20422765 {
20432766 for (int i=0; i<group.selection.size(); i++)
20442767 {
....@@ -2047,11 +2770,11 @@
20472770
20482771 refreshContents();
20492772 } else
2050
- if (event.getSource() == setMasterItem)
2773
+ if (source == setMasterItem)
20512774 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2775
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532776 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2777
+ Object3D content = Grafreed.clipboard.get(0);
20552778
20562779 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572780 content = ((cGroup)content).get(0);
....@@ -2060,13 +2783,13 @@
20602783 refreshContents();
20612784 }
20622785 } else
2063
- if (event.getSource() == poseMeshItem)
2786
+ if (source == poseMeshItem)
20642787 {
20652788 if (group.selection.size() == 1)
20662789 {
2067
- if (GraphreeD.clipboard.size() == 1)
2790
+ if (Grafreed.clipboard.size() == 1)
20682791 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2792
+ Object3D content = Grafreed.clipboard.get(0);
20702793
20712794 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722795 content = ((cGroup)content).get(0);
....@@ -2079,19 +2802,19 @@
20792802 }
20802803
20812804 } else
2082
- if (event.getSource() == revertMeshItem)
2805
+ if (source == revertMeshItem)
20832806 {
20842807 RevertMeshes();
20852808 } else
2086
- if (event.getSource() == resetMeshItem)
2809
+ if (source == resetAllItem)
20872810 {
20882811 ResetAll();
20892812 } else
2090
- if (event.getSource() == stepAllItem)
2813
+ if (source == stepAllItem)
20912814 {
20922815 StepAll();
20932816 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2817
+ if (source == deleteItem) // || event.getSource() == clearButton)
20952818 {
20962819 //int indices[] = jList.getSelectedIndices();
20972820 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2822,46 @@
20992822
21002823 ClearSelection(false);
21012824 } else
2102
- if (event.getSource() == clearAllItem)
2825
+ if (source == clearAllItem)
21032826 {
21042827 ClearSelection(true);
21052828 } else
2106
- if (event.getSource() == grabItem)
2829
+ if (source == grabItem || source == groupButton)
21072830 {
2108
- group(new cGroup(), true);
2831
+ group(new cGroup(), false); // true);
21092832 } else
2110
- if (event.getSource() == frontItem)
2833
+ if (source == hideItem)
2834
+ {
2835
+ group(new HiddenObject());
2836
+ } else
2837
+ if (source == frontItem)
21112838 {
21122839 front();
21132840 } else
2114
- if (event.getSource() == backItem)
2841
+ if (source == backItem)
21152842 {
21162843 back();
21172844 } else
2118
- if (event.getSource() == cameraItem)
2845
+ if (source == cameraItem)
21192846 {
21202847 makeSomething(new Camera());
21212848 } else
2122
- if (event.getSource() == compositeItem)
2849
+ if (source == compositeItem || source == compositeButton)
21232850 {
21242851 group(new Composite());
21252852 } else
2126
- if (event.getSource() == randomItem)
2853
+ if (source == switchItem || source == switchButton)
21272854 {
21282855 RandomNode random = new RandomNode();
21292856 group(random);
21302857 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2858
+ random.name = random.get(0).name + "Switch";
21322859 } else
2133
- if (event.getSource() == physicsItem)
2860
+ if (source == physicsItem)
21342861 {
21352862 group(new PhysicsNode());
21362863 } else
2137
- if (event.getSource() == frameselectorItem)
2864
+ if (source == frameselectorItem)
21382865 {
21392866 for (int i=0; i<group.selection.size(); i++)
21402867 {
....@@ -2146,7 +2873,7 @@
21462873 ResetModel();
21472874 refreshContents();
21482875 } else
2149
- if (event.getSource() == switchGeoItem)
2876
+ if (source == switchGeoItem)
21502877 {
21512878 for (int i=0; i<group.selection.size(); i++)
21522879 {
....@@ -2158,7 +2885,7 @@
21582885 ResetModel();
21592886 refreshContents();
21602887 } else
2161
- if (event.getSource() == switchTransfoItem)
2888
+ if (source == switchTransfoItem)
21622889 {
21632890 for (int i=0; i<group.selection.size(); i++)
21642891 {
....@@ -2170,7 +2897,7 @@
21702897 ResetModel();
21712898 refreshContents();
21722899 } else
2173
- if (event.getSource() == morphItem)
2900
+ if (source == morphItem)
21742901 {
21752902 for (int i=0; i<group.selection.size(); i++)
21762903 {
....@@ -2182,7 +2909,7 @@
21822909 ResetModel();
21832910 refreshContents();
21842911 } else
2185
- if (event.getSource() == scriptNodeItem)
2912
+ if (source == scriptNodeItem)
21862913 {
21872914 boolean atleastone = false;
21882915
....@@ -2221,191 +2948,252 @@
22212948 }
22222949 }
22232950 } else
2224
- if (event.getSource() == linkerItem)
2951
+ if (source == linkerItem)
22252952 {
22262953 group(new cLinker());
22272954 } else
2228
- if (event.getSource() == textureItem)
2955
+ if (source == textureItem || source == textureButton)
22292956 {
22302957 group(new TextureNode());
22312958 } else
2232
- if (event.getSource() == shadowXItem)
2959
+ if (source == billboardItem)
2960
+ {
2961
+ group(new BillboardNode());
2962
+ } else
2963
+ if (source == shadowXItem)
22332964 {
22342965 CastShadow(0);
22352966 } else
2236
- if (event.getSource() == shadowYItem)
2967
+ if (source == shadowYItem)
22372968 {
22382969 CastShadow(1);
22392970 } else
2240
- if (event.getSource() == shadowZItem)
2971
+ if (source == shadowZItem)
22412972 {
22422973 CastShadow(2);
22432974 } else
2244
- if (event.getSource() == ungroupItem)
2975
+ if (source == ungroupItem || source == ungroupButton)
22452976 {
2246
- ungroup();
2977
+ boolean hasRoot = false;
2978
+
2979
+ for (int i=0; i<group.selection.size(); i++)
2980
+ {
2981
+ if (group.selection.get(i) == group)
2982
+ {
2983
+ hasRoot = true;
2984
+ break;
2985
+ }
2986
+ }
2987
+
2988
+ if (!hasRoot)
2989
+ {
2990
+ for (int i=0; i<group.selection.size(); i++)
2991
+ {
2992
+ Ungroup(group.selection.get(i));
2993
+ }
2994
+
2995
+ ClearSelection(false);
2996
+
2997
+ refreshContents();
2998
+ }
22472999 } else
2248
- if (event.getSource() == genUVItem)
3000
+ if (source == genUVItem)
22493001 {
22503002 GenUV();
22513003 } else
2252
- if (event.getSource() == genNormalsCADItem)
3004
+ if (source == genNormalsCADItem)
22533005 {
22543006 GenNormals(true);
22553007 } else
2256
- if (event.getSource() == genNormalsORGANItem)
3008
+ if (source == genNormalsMESHItem)
3009
+ {
3010
+ GenNormalsMESH();
3011
+ } else
3012
+ if (source == genNormalsORGANItem)
22573013 {
22583014 GenNormals(false);
22593015 } else
2260
- if (event.getSource() == stripifyItem)
3016
+ if (source == genNormalsMINEItem)
3017
+ {
3018
+ GenNormalsMINE();
3019
+ } else
3020
+ if (source == stripifyItem)
22613021 {
22623022 Stripify();
22633023 } else
2264
- if (event.getSource() == unstripifyItem)
3024
+ if (source == unstripifyItem)
22653025 {
22663026 Unstripify();
22673027 } else
2268
- if (event.getSource() == trimItem)
3028
+ if (source == trimItem)
22693029 {
22703030 Trim();
22713031 } else
2272
- if (event.getSource() == untrimItem)
3032
+ if (source == untrimItem)
22733033 {
22743034 Untrim();
22753035 } else
2276
- if (event.getSource() == clearColorsItem)
3036
+ if (source == clearColorsItem)
22773037 {
22783038 ClearColors();
22793039 } else
2280
- if (event.getSource() == clearMaterialsItem)
3040
+ if (source == clearMaterialsItem)
22813041 {
22823042 ClearMaterials();
22833043 } else
2284
- if (event.getSource() == liveleavesItem)
3044
+ if (source == liveleavesItem)
22853045 {
22863046 LiveLeaves(true);
22873047 } else
2288
- if (event.getSource() == unliveleavesItem)
3048
+ if (source == unliveleavesItem)
22893049 {
22903050 LiveLeaves(false);
22913051 } else
2292
- if (event.getSource() == supportleavesItem)
3052
+ if (source == supportleavesItem)
22933053 {
22943054 SupportLeaves(true);
22953055 } else
2296
- if (event.getSource() == unsupportleavesItem)
3056
+ if (source == unsupportleavesItem)
22973057 {
22983058 SupportLeaves(false);
22993059 } else
2300
- if (event.getSource() == hideleavesItem)
3060
+ if (source == hideleavesItem)
23013061 {
23023062 HideLeaves(true);
23033063 } else
2304
- if (event.getSource() == showleavesItem)
3064
+ if (source == showleavesItem)
23053065 {
23063066 HideLeaves(false);
23073067 } else
2308
- if (event.getSource() == markleavesItem)
3068
+ if (source == markleavesItem)
23093069 {
23103070 MarkLeaves(true);
23113071 } else
2312
- if (event.getSource() == unmarkleavesItem)
3072
+ if (source == unmarkleavesItem)
23133073 {
23143074 MarkLeaves(false);
23153075 } else
2316
- if (event.getSource() == flipVItem)
3076
+ if (source == rewindleavesItem)
3077
+ {
3078
+ RewindLeaves(true);
3079
+ } else
3080
+ if (source == unrewindleavesItem)
3081
+ {
3082
+ RewindLeaves(false);
3083
+ } else
3084
+ if (source == randomleavesItem)
3085
+ {
3086
+ RandomLeaves(true);
3087
+ } else
3088
+ if (source == unrandomleavesItem)
3089
+ {
3090
+ RandomLeaves(false);
3091
+ } else
3092
+ if (source == flipVItem)
23173093 {
23183094 FlipV(true);
23193095 } else
2320
- if (event.getSource() == unflipVItem)
3096
+ if (source == unflipVItem)
23213097 {
23223098 FlipV(false);
23233099 } else
2324
- if (event.getSource() == lowTexturesItem)
3100
+ if (source == lowTexturesItem)
23253101 {
23263102 SetTexRes(0);
23273103 } else
2328
- if (event.getSource() == normalTexturesItem)
3104
+ if (source == normalTexturesItem)
23293105 {
23303106 SetTexRes(1);
23313107 } else
2332
- if (event.getSource() == highTexturesItem)
3108
+ if (source == highTexturesItem)
23333109 {
23343110 SetTexRes(2);
23353111 } else
2336
- if (event.getSource() == veryhighTexturesItem)
3112
+ if (source == veryhighTexturesItem)
23373113 {
23383114 SetTexRes(3);
23393115 } else
2340
- if (event.getSource() == maxTexturesItem)
3116
+ if (source == maxTexturesItem)
23413117 {
23423118 SetTexRes(4);
23433119 } else
2344
- if (event.getSource() == panoTexturesItem)
3120
+ if (source == panoTexturesItem)
23453121 {
23463122 SetTexRes(5);
23473123 } else
2348
- if (event.getSource() == reverseNormalsItem)
3124
+ if (source == reverseNormalsItem)
23493125 {
23503126 ReverseNormals();
23513127 } else
2352
- if (event.getSource() == parseverticesItem)
3128
+ if (source == parseverticesItem)
23533129 {
23543130 ParseVertices();
23553131 } else
2356
- if (event.getSource() == alignItem)
3132
+ if (source == textureFieldItem)
3133
+ {
3134
+ TextureVertices();
3135
+ } else
3136
+ if (source == alignItem)
23573137 {
23583138 Align();
23593139 } else
2360
- if (event.getSource() == mirrorItem)
3140
+ if (source == mirrorItem)
23613141 {
23623142 MirrorPoses();
23633143 } else
2364
- if (event.getSource() == reduceMorphItem)
3144
+ if (source == reduceMorphItem)
23653145 {
23663146 MeshReduction(false);
23673147 } else
2368
- if (event.getSource() == reduce34MorphItem)
3148
+ if (source == reduce34MorphItem)
23693149 {
23703150 MeshReduction(true);
23713151 } else
2372
- if (event.getSource() == reverseTrianglesItem)
3152
+ if (source == reverseTrianglesItem)
23733153 {
23743154 ReverseTriangles();
23753155 } else
2376
- if (event.getSource() == reduceMeshItem)
3156
+ if (source == reduceMeshItem)
23773157 {
23783158 ReduceMesh(false);
23793159 } else
2380
- if (event.getSource() == reduce34MeshItem)
3160
+ if (source == reduce34MeshItem)
23813161 {
23823162 ReduceMesh(true);
23833163 } else
2384
- if (event.getSource() == increaseMeshItem)
3164
+ if (source == increaseMeshItem)
23853165 {
23863166 IncreaseMesh();
23873167 } else
2388
- if (event.getSource() == clipMeshItem)
3168
+ if (source == clipMeshItem)
23893169 {
23903170 ClipMesh();
23913171 } else
2392
- if (event.getSource() == smoothMeshItem)
3172
+ if (source == smoothMeshItem)
23933173 {
23943174 SmoothMesh();
23953175 } else
2396
- if (event.getSource() == transformgeometryItem)
3176
+ if (source == transformGeometryItem)
23973177 {
23983178 TransformGeometry();
23993179 } else
2400
- if (event.getSource() == resetTransformItem)
3180
+ if (source == transformChildrenItem)
3181
+ {
3182
+ TransformChildren();
3183
+ } else
3184
+ if (source == resetTransformItem)
24013185 {
24023186 ResetTransform();
24033187 } else
2404
- if (event.getSource() == resetCentroidItem)
3188
+ if (source == resetCentroidItem)
24053189 {
2406
- ResetCentroid();
3190
+ ResetCentroid(true);
24073191 } else
2408
- if (event.getSource() == resetParentItem)
3192
+ if (source == resetCentroidXZItem)
3193
+ {
3194
+ ResetCentroid(false);
3195
+ } else
3196
+ if (source == resetParentItem)
24093197 {
24103198 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24113199 {
....@@ -2415,7 +3203,7 @@
24153203
24163204 refreshContents();
24173205 } else
2418
- if (event.getSource() == repairParentItem)
3206
+ if (source == repairParentItem)
24193207 {
24203208 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24213209 {
....@@ -2429,7 +3217,21 @@
24293217
24303218 refreshContents();
24313219 } else
2432
- if (event.getSource() == sortbysizeItem)
3220
+ if (source == repairShadowItem)
3221
+ {
3222
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3223
+ {
3224
+ Object3D obj = (Object3D)e.nextElement();
3225
+ obj.RepairShadow();
3226
+// for (int i=0; i<obj.size(); i++)
3227
+// {
3228
+// obj.get(i).parent = obj;
3229
+// }
3230
+ }
3231
+
3232
+ refreshContents();
3233
+ } else
3234
+ if (source == sortbysizeItem)
24333235 {
24343236 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24353237 {
....@@ -2441,7 +3243,7 @@
24413243 ResetModel();
24423244 refreshContents();
24433245 } else
2444
- if (event.getSource() == sortbynameItem)
3246
+ if (source == sortbynameItem)
24453247 {
24463248 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24473249 {
....@@ -2453,7 +3255,7 @@
24533255 ResetModel();
24543256 refreshContents();
24553257 } else
2456
- if (event.getSource() == attachPigmentItem)
3258
+ if (source == attachPigmentItem)
24573259 {
24583260 String texture = GetFile("Attach pigment");
24593261 Object3D obj;
....@@ -2465,7 +3267,7 @@
24653267
24663268 refreshContents();
24673269 } else
2468
- if (event.getSource() == detachPigmentItem)
3270
+ if (source == detachPigmentItem)
24693271 {
24703272 Object3D obj;
24713273 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +3278,7 @@
24763278
24773279 refreshContents();
24783280 } else
2479
- if (event.getSource() == attachBumpItem)
3281
+ if (source == attachBumpItem)
24803282 {
24813283 String texture = GetFile("Attach bump");
24823284 Object3D obj;
....@@ -2488,18 +3290,18 @@
24883290
24893291 refreshContents();
24903292 } else
2491
- if (event.getSource() == detachBumpItem)
3293
+ if (source == detachBumpItem)
24923294 {
24933295 Object3D obj;
24943296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24953297 {
24963298 obj = (Object3D)e.nextElement();
2497
- obj.SetBumpTexture(null);
3299
+ obj.ResetBumpTexture();
24983300 }
24993301
25003302 refreshContents();
25013303 } else
2502
- if (event.getSource() == pigmentBumpItem)
3304
+ if (source == pigmentBumpItem)
25033305 {
25043306 Object3D obj;
25053307 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +3312,262 @@
25103312
25113313 refreshContents();
25123314 } else
2513
- if (event.getSource() == flashSelectionButton)
3315
+ if (source == embedTexturesItem)
3316
+ {
3317
+ Object3D obj;
3318
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3319
+ {
3320
+ obj = (Object3D)e.nextElement();
3321
+ obj.EmbedTextures(true);
3322
+ }
3323
+
3324
+ refreshContents();
3325
+ } else
3326
+ if (source == deEmbedTexturesItem)
3327
+ {
3328
+ Object3D obj;
3329
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3330
+ {
3331
+ obj = (Object3D)e.nextElement();
3332
+ obj.EmbedTextures(false);
3333
+ }
3334
+
3335
+ CameraPane.texturepigment.clear();
3336
+ CameraPane.texturebump.clear();
3337
+
3338
+ refreshContents();
3339
+ } else
3340
+ if (source == flashSelectionButton)
25143341 {
25153342 CameraPane.flash = true;
25163343 refreshContents();
25173344 } else
2518
- if (event.getSource() == oneButton)
3345
+ if (source == oneButton)
25193346 {
25203347 } else
2521
- if (event.getSource() == twoButton)
3348
+ if (source == twoButton)
25223349 {
25233350 radio.layout = twoButton;
3351
+
3352
+ if (CameraPane.FULLSCREEN)
3353
+ fullscreenLayout = radio.layout;
3354
+
25243355 // bug
25253356 //gridPanel.setDividerLocation(1.0);
25263357 //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();
3358
+// bigThree.remove(scenePanel);
3359
+// bigThree.remove(centralPanel);
3360
+// bigThree.remove(XYZPanel);
3361
+// aWindowConstraints.gridx = 0;
3362
+// aWindowConstraints.gridy = 0;
3363
+// aWindowConstraints.gridwidth = 1;
3364
+// // aConstraints.gridheight = 3;
3365
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3366
+// aWindowConstraints.weightx = 0;
3367
+// aWindowConstraints.weighty = 1;
3368
+// //bigThree.add(jtp, aWindowConstraints);
3369
+// aWindowConstraints.weightx = 1;
3370
+// aWindowConstraints.gridwidth = 3;
3371
+// // aConstraints.gridheight = 3;
3372
+// aWindowConstraints.gridx = 1;
3373
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3374
+// bigThree.add(centralPanel, aWindowConstraints);
3375
+// aWindowConstraints.weightx = 0;
3376
+// aWindowConstraints.gridx = 4;
3377
+// aWindowConstraints.gridwidth = 1;
3378
+// // aConstraints.gridheight = 3;
3379
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3380
+// //bigThree.add(XYZPanel, aWindowConstraints);
3381
+// scenePanel.setVisible(false);
3382
+// centralPanel.setVisible(true);
3383
+// XYZPanel.setVisible(false);
3384
+ bigThree.ClearUI();
3385
+ bigThree.add(centralPanel);
3386
+ bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
3389
+
3390
+// refreshContents(true);
3391
+//
3392
+// try
3393
+// {
3394
+// java.awt.Robot bot = new java.awt.Robot();
3395
+// int mask = InputEvent.BUTTON1_MASK;
3396
+// bot.mouseMove(100, 100);
3397
+// bot.mousePress(mask);
3398
+// bot.mouseRelease(mask);
3399
+// }
3400
+// catch (Exception e)
3401
+// {
3402
+//
3403
+// }
3404
+
25513405 } else
2552
- if (event.getSource() == threeButton)
3406
+ if (source == threeButton)
25533407 {
25543408 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();
3409
+
3410
+ if (CameraPane.FULLSCREEN)
3411
+ fullscreenLayout = radio.layout;
3412
+
3413
+// bigThree.remove(scenePanel);
3414
+// bigThree.remove(centralPanel);
3415
+// bigThree.remove(XYZPanel);
3416
+// aWindowConstraints.gridx = 0;
3417
+// aWindowConstraints.gridy = 0;
3418
+// aWindowConstraints.gridwidth = 1;
3419
+// // aConstraints.gridheight = 3;
3420
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3421
+// aWindowConstraints.weightx = 0;
3422
+// aWindowConstraints.weighty = 1;
3423
+// //bigThree.add(jtp, aWindowConstraints);
3424
+// aWindowConstraints.weightx = 1;
3425
+// aWindowConstraints.gridwidth = 3;
3426
+// // aConstraints.gridheight = 3;
3427
+// aWindowConstraints.gridx = 1;
3428
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3429
+// bigThree.add(centralPanel, aWindowConstraints);
3430
+// aWindowConstraints.weightx = 0;
3431
+// aWindowConstraints.gridx = 4;
3432
+// aWindowConstraints.gridwidth = 1;
3433
+// // aConstraints.gridheight = 3;
3434
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3435
+// bigThree.add(XYZPanel, aWindowConstraints);
3436
+// bigThree.validate();
3437
+// scenePanel.setVisible(false);
3438
+// centralPanel.setVisible(true);
3439
+// XYZPanel.setVisible(true);
3440
+ bigThree.ClearUI();
3441
+ bigThree.add(scenePanel);
3442
+ bigThree.add(centralPanel);
3443
+ bigThree.FlushUI();
3444
+
3445
+ cameraView.requestFocusInWindow();
25793446 } else
2580
- if (event.getSource() == fourButton)
3447
+ if (source == fourButton)
25813448 {
25823449 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();
3450
+
3451
+ if (CameraPane.FULLSCREEN)
3452
+ fullscreenLayout = radio.layout;
3453
+
3454
+// bigThree.remove(scenePanel);
3455
+// bigThree.remove(centralPanel);
3456
+// bigThree.remove(XYZPanel);
3457
+// aWindowConstraints.gridx = 0;
3458
+// aWindowConstraints.gridy = 0;
3459
+// aWindowConstraints.gridwidth = 1;
3460
+// // aWindowConstraints.gridheight = 3;
3461
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3462
+// aWindowConstraints.weightx = 1;
3463
+// aWindowConstraints.weighty = 1;
3464
+// bigThree.add(scenePanel, aWindowConstraints);
3465
+// aWindowConstraints.weightx = 1;
3466
+// aWindowConstraints.gridwidth = 3;
3467
+// // aConstraints.gridheight = 3;
3468
+// aWindowConstraints.gridx = 1;
3469
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3470
+// //bigThree.add(cameraPanel, aWindowConstraints);
3471
+// aWindowConstraints.weightx = 0;
3472
+// aWindowConstraints.gridx = 4;
3473
+// aWindowConstraints.gridwidth = 1;
3474
+// // aWindowConstraints.gridheight = 3;
3475
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3476
+// //bigThree.add(XYZPanel, aWindowConstraints);
3477
+// bigThree.validate();
3478
+// scenePanel.setVisible(true);
3479
+// centralPanel.setVisible(false);
3480
+// XYZPanel.setVisible(false);
3481
+ bigThree.ClearUI();
3482
+ bigThree.add(scenePanel);
3483
+ bigThree.FlushUI();
3484
+
3485
+ cameraView.requestFocusInWindow();
26073486 } else
2608
- if (event.getSource() == sixButton)
3487
+ if (source == sixButton)
26093488 {
26103489 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();
3490
+
3491
+ if (CameraPane.FULLSCREEN)
3492
+ fullscreenLayout = radio.layout;
3493
+
3494
+// bigThree.remove(scenePanel);
3495
+// bigThree.remove(centralPanel);
3496
+// bigThree.remove(XYZPanel);
3497
+// aWindowConstraints.gridx = 0;
3498
+// aWindowConstraints.gridy = 0;
3499
+// aWindowConstraints.gridwidth = 1;
3500
+// // aConstraints.gridheight = 3;
3501
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3502
+// aWindowConstraints.weightx = 0;
3503
+// aWindowConstraints.weighty = 1;
3504
+// bigThree.add(scenePanel, aWindowConstraints);
3505
+// aWindowConstraints.weightx = 1;
3506
+// aWindowConstraints.gridwidth = 3;
3507
+// // aWindowConstraints.gridheight = 3;
3508
+// aWindowConstraints.gridx = 1;
3509
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3510
+// bigThree.add(centralPanel, aWindowConstraints);
3511
+// aWindowConstraints.weightx = 0;
3512
+// aWindowConstraints.gridx = 4;
3513
+// aWindowConstraints.gridwidth = 1;
3514
+// // aWindowConstraints.gridheight = 3;
3515
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3516
+// //bigThree.add(XYZPanel, aConstraints);
3517
+// bigThree.validate();
3518
+// scenePanel.setVisible(true);
3519
+// centralPanel.setVisible(true);
3520
+// XYZPanel.setVisible(false);
3521
+ bigThree.ClearUI();
3522
+ bigThree.add(centralPanel);
3523
+ bigThree.add(scenePanel);
3524
+ bigThree.FlushUI();
3525
+
3526
+ cameraView.requestFocusInWindow();
26353527 } else
2636
- if (event.getSource() == sevenButton)
3528
+ if (source == sevenButton)
26373529 {
26383530 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();
3531
+
3532
+ if (CameraPane.FULLSCREEN)
3533
+ fullscreenLayout = radio.layout;
3534
+
3535
+// bigThree.remove(scenePanel);
3536
+// bigThree.remove(centralPanel);
3537
+// bigThree.remove(XYZPanel);
3538
+// aWindowConstraints.gridx = 0;
3539
+// aWindowConstraints.gridy = 0;
3540
+// aWindowConstraints.gridwidth = 1;
3541
+// // aWindowConstraints.gridheight = 3;
3542
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3543
+// aWindowConstraints.weightx = 0;
3544
+// aWindowConstraints.weighty = 1;
3545
+// bigThree.add(scenePanel, aWindowConstraints);
3546
+// aWindowConstraints.weightx = 1;
3547
+// aWindowConstraints.gridwidth = 3;
3548
+// // aWindowConstraints.gridheight = 3;
3549
+// aWindowConstraints.gridx = 1;
3550
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3551
+// bigThree.add(centralPanel, aWindowConstraints);
3552
+// aWindowConstraints.weightx = 0;
3553
+// aWindowConstraints.gridx = 4;
3554
+// aWindowConstraints.gridwidth = 1;
3555
+// // aConstraints.gridheight = 3;
3556
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3557
+// bigThree.add(XYZPanel, aWindowConstraints);
3558
+// bigThree.validate();
3559
+// scenePanel.setVisible(true);
3560
+// centralPanel.setVisible(true);
3561
+// XYZPanel.setVisible(true);
3562
+ bigThree.ClearUI();
3563
+ bigThree.add(scenePanel);
3564
+ bigThree.add(centralPanel);
3565
+ bigThree.add(XYZPanel);
3566
+ bigThree.FlushUI();
3567
+
3568
+ cameraView.requestFocusInWindow();
26633569 } else
2664
- if (event.getSource() == rootButton)
3570
+ if (source == rootButton)
26653571 {
26663572 Object3D obj;
26673573 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,66 +3577,84 @@
26713577 EditObject(obj);
26723578 }
26733579
3580
+ cameraView.requestFocusInWindow();
26743581 refreshContents(true);
26753582 } else
2676
- if (event.getSource() == closeButton)
3583
+ if (source == closeButton)
26773584 {
26783585 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793586 cRadio ab;
26803587 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813588 {
26823589 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3590
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843591 {
3592
+ // Patch to avoid bug with transparency.
3593
+ if (!ab.hadMaterial)
3594
+ {
3595
+ ab.object.material = null;
3596
+ }
3597
+
26853598 buttonGroup.remove(ab);
26863599 radioPanel.remove(ab);
26873600
2688
- ab.GetObject().editWindow = null;
3601
+ //ab.GetObject().editWindow = null;
3602
+ ab.GetObject().manipWindow = null;
26893603 // ab.GetObject().objectUI = null; // ?????????
26903604
26913605 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923606 break;
26933607 }
26943608 }
3609
+
3610
+ cameraView.requestFocusInWindow();
26953611 refreshContents(true);
26963612 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3613
+ if (source == editItem || source == editButton)
26983614 {
3615
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3616
+ {
3617
+ Object3D child = (Object3D)e.nextElement();
3618
+ child.pinned = true;
3619
+ }
3620
+
26993621 EditSelection(false);
27003622 } else
2701
- if (event.getSource() == uneditButton)
3623
+ if (source == uneditButton)
27023624 {
27033625 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043626 {
27053627 Object3D child = (Object3D)e.nextElement();
27063628 if(child.editWindow != null)
27073629 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3630
+ child.pinned = false;
27083631 child.CloseUI();
27093632 listUI.remove(child);
27103633
2711
- child.editWindow = null; // ???????????
3634
+ //child.editWindow = null; // ???????????
27123635 }
2713
- objEditor.ctrlPanel.revalidate();
3636
+ objEditor.ctrlPanel.FlushUI();
27143637 //objEditor.jTree.clearSelection();
27153638 //objEditor.ResetSliders();
27163639 refreshContents(true);
27173640 } else
2718
- if (event.getSource() == clearPanelButton)
3641
+ if (source == clearPanelButton)
27193642 {
27203643 assert(copy == group);
27213644 //copy.ClearUI();
27223645 for (Object3D obj : listUI)
27233646 {
3647
+ obj.pinned = false;
27243648 obj.CloseUI();
27253649 }
27263650 listUI.clear();
27273651 refreshContents(true);
27283652 } else
2729
- if (event.getSource() == allParamsButton)
3653
+ if (source == allParamsButton)
27303654 {
27313655 assert(copy == group);
27323656
2733
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3657
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27343658
27353659 for (Object3D obj : listUI)
27363660 {
....@@ -2747,19 +3671,19 @@
27473671
27483672 refreshContents(true);
27493673 } else
2750
- if (event.getSource() == unselectButton)
3674
+ if (source == unselectButton)
27513675 {
27523676 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3677
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543678 objEditor.ResetSliders();
27553679 refreshContents(true);
27563680 } else
2757
- if(event.getSource() instanceof cRadio)
3681
+ if(source instanceof cRadio)
27583682 {
27593683 group.parent = keepparent;
27603684 group.attributes = 0;
27613685 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3686
+ /*cRadio*/ radio = (cRadio)source;
27633687 Object3D obj = radio.GetObject();
27643688 System.out.println("Edit " + obj);
27653689 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3703,10 @@
27793703 }
27803704
27813705 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3706
+
3707
+ SetUndoStates();
3708
+
3709
+ //Globals.theRenderer.object = group;
27833710 if(!useclient)
27843711 {
27853712 cameraView.renderCamera = radio.camera;
....@@ -2788,25 +3715,52 @@
27883715 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893716 cameraView.targetLookAt.set(radio.camera.lookAt);
27903717 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3718
+ //cameraView.lighttouched = true;
3719
+ Globals.lighttouched = true;
27923720 topView.object = group;
27933721 frontView.object = group;
27943722 sideView.object = group;
27953723 }
2796
- group.editWindow = this;
3724
+
3725
+// fix "+" issue
3726
+ //group.editWindow = this;
3727
+ group.manipWindow = this;
3728
+
27973729 /*
27983730 currentLayout = radio.layout;
27993731 if (currentLayout == null)
28003732 currentLayout = sevenButton;
28013733 */
28023734 radio.layout.doClick();
3735
+
3736
+ ClearUnpinned();
3737
+ //Grafreed.Assert(group != null);
3738
+ //Grafreed.Assert(group.selection != null);
3739
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3740
+ if (group.selection == null || group.selection.size() == 1)
3741
+ EditSelection(false);
28033742 keepparent = group.parent;
28043743 // PARENT = NULL or not???
28053744 //group.parent = null; // ROOT
28063745 //group.attributes = -1;
28073746 ResetModel();
3747
+
3748
+ cameraView.requestFocusInWindow();
28083749 refreshContents(true);
2809
- }
3750
+ } else if (event.getSource() == editCameraItem)
3751
+ {
3752
+ cameraView.ProtectCamera();
3753
+ cameraView.repaint();
3754
+ return;
3755
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3756
+ {
3757
+ cameraView.RevertCamera();
3758
+ cameraView.repaint();
3759
+ return;
3760
+ // } else if (event.getSource() == textureButton)
3761
+ // {
3762
+ // return; // true;
3763
+ }
28103764 else
28113765 {
28123766 //return super.action(event, arg);
....@@ -2815,7 +3769,6 @@
28153769 }
28163770
28173771 boolean useclient = false;
2818
- cRadio radio;
28193772
28203773 void ToggleRoot()
28213774 {
....@@ -2824,7 +3777,7 @@
28243777 if (useclient)
28253778 {
28263779 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3780
+ Globals.lighttouched = true;
28283781 //topView.object = client;
28293782 //frontView.object = client;
28303783 //sideView.object = client;
....@@ -2832,7 +3785,7 @@
28323785 else
28333786 {
28343787 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3788
+ Globals.lighttouched = true;
28363789 //topView.object = group;
28373790 //frontView.object = group;
28383791 //sideView.object = group;
....@@ -2867,6 +3820,28 @@
28673820 refreshContents();
28683821 }
28693822
3823
+ void TransformChildren()
3824
+ {
3825
+ Object3D obj;
3826
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3827
+ {
3828
+ obj = (Object3D)e.nextElement();
3829
+ obj.KeepTextureMatrices();
3830
+ obj.TransformChildren();
3831
+ obj.RestoreTextureMatrices();
3832
+
3833
+// if (obj.parent == null)
3834
+// {
3835
+// System.out.println("NULL PARENT!");
3836
+// new Exception().printStackTrace();
3837
+// }
3838
+// else
3839
+// TouchTransform(obj);
3840
+// //obj.parent.Touch();
3841
+ }
3842
+
3843
+ refreshContents();
3844
+ }
28703845
28713846 void ResetTransform()
28723847 {
....@@ -2979,7 +3954,7 @@
29793954 refreshContents();
29803955 }
29813956
2982
- void ResetCentroid()
3957
+ void ResetCentroid(boolean full)
29833958 {
29843959 Object3D obj;
29853960 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +3969,16 @@
29943969 LA.matIdentity(Object3D.mat);
29953970 obj.getBounds(minima, maxima, false);
29963971 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3972
+ if (full)
3973
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29983974 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29993975 obj.TransformMesh(Object3D.mat);
3976
+
30003977 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3978
+ if (full)
3979
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30023980 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3981
+
30033982 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30043983 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30053984 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +4007,8 @@
30284007
30294008 int size = obj.MemorySize();
30304009
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
4010
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4011
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30324012 }
30334013 }
30344014 catch (Exception e)
....@@ -3065,9 +4045,9 @@
30654045 obj = (Object3D)e.nextElement();
30664046
30674047 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
4048
+ Grafreed.AnalyzeObject(obj);
30694049 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
4050
+ Grafreed.AnalyzeObject(obj.bRep);
30714051
30724052 // System.err.println((size/1024) + " KB is the size of " + obj);
30734053 }
....@@ -3109,6 +4089,20 @@
31094089 void GenNormals(boolean crease)
31104090 {
31114091 group.GenNormalsS(crease);
4092
+
4093
+ refreshContents();
4094
+ }
4095
+
4096
+ void GenNormalsMESH()
4097
+ {
4098
+ group.GenNormalsMeshS();
4099
+
4100
+ refreshContents();
4101
+ }
4102
+
4103
+ void GenNormalsMINE()
4104
+ {
4105
+ group.selection.GenNormalsMINE();
31124106
31134107 refreshContents();
31144108 }
....@@ -3157,104 +4151,259 @@
31574151
31584152 //Object3D buffer;
31594153 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
-
4154
+// BoundaryRep temprep;
4155
+// Object3D nodes;
4156
+// Vector<Vertex> vertices;
4157
+//
4158
+// cGroup buffer;
4159
+//
4160
+// public void Vertex(Object3D node, Vertex v)
4161
+// {
4162
+//// vertices.add(v);
4163
+//// nodes.addElement(node);
4164
+////
4165
+//// if (temprep.GetCache(v) != null)
4166
+//// {
4167
+//// temprep.Remove(v);
4168
+//// } else
4169
+//// {
4170
+//// temprep.Remember(v);
4171
+//// }
4172
+//
4173
+// //Object3D node = nodes.get(index);
4174
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
4175
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4176
+//
4177
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4178
+//
4179
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4180
+//
4181
+// cGroup g = new cGroup();
4182
+//
4183
+// if (g.toParent == null)
4184
+// {
4185
+// g.toParent = LA.newMatrix();
4186
+// g.fromParent = LA.newMatrix();
4187
+// }
4188
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4189
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4190
+//
4191
+// g.add(GrafreeD.clipboard);
4192
+//
4193
+// buffer.add(g);
4194
+// }
4195
+//
4196
+// public void Face(Object3D node, Face f)
4197
+// {
4198
+//
4199
+// }
4200
+//
4201
+// void ParseVerticesOld() // ??
4202
+// {
4203
+// //if (group.selection.size() != 1)
4204
+// // return;
4205
+//
4206
+// temprep = new BoundaryRep();
4207
+// nodes = new Object3D();
4208
+// vertices = new Vector<Vertex>();
4209
+//
4210
+// boolean epsequal = GrafreeD.epsequal;
4211
+// GrafreeD.epsequal = true;
4212
+//
4213
+// for (int i=0; i<group.selection.size(); i++)
4214
+// {
4215
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4216
+//
4217
+// group.selection.get(i).Parse(
4218
+//this );
4219
+//
4220
+// int repsize = temprep.VertexCount();
4221
+// int tablesize = temprep.vertextable.size();
4222
+// int nodesize = nodes.size();
4223
+//
4224
+// assert(vertices.size() == nodes.size());
4225
+//
4226
+// temprep.vertextable.elements();
4227
+//
4228
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
4229
+//
4230
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
4231
+// {
4232
+// cGroup g = new cGroup();
4233
+//
4234
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
4235
+//
4236
+// Object3D node = nodes.get(index);
4237
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
4238
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4239
+//
4240
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4241
+//
4242
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4243
+//
4244
+// if (g.toParent == null)
4245
+// {
4246
+// g.toParent = LA.newMatrix();
4247
+// g.fromParent = LA.newMatrix();
4248
+// }
4249
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4250
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4251
+//
4252
+// g.add(GrafreeD.clipboard);
4253
+//
4254
+// buffer.add(g);
4255
+// }
4256
+//
4257
+// makeSomething(buffer, i==group.selection.size()-1);
4258
+// }
4259
+//
4260
+// GrafreeD.epsequal = epsequal;
4261
+//
4262
+// //buffer = null;
4263
+// temprep = null;
4264
+// nodes = null;
4265
+//
4266
+// refreshContents();
4267
+// }
4268
+
31844269 void ParseVertices()
31854270 {
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;
4271
+ boolean epsequal = Grafreed.epsequal;
4272
+ Grafreed.epsequal = true;
31954273
31964274 for (int i=0; i<group.selection.size(); i++)
31974275 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4276
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31994277
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
4278
+ group.selection.get(i).Parse(
4279
+
4280
+ new iParse()
4281
+ {
4282
+ public void Vertex(Object3D node, Vertex v)
4283
+ {
4284
+ temp.set(v);
4285
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32054286
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();
4287
+ cGroup g = new cGroup();
32114288
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
4289
+ if (g.toParent == null)
4290
+ {
4291
+ g.toParent = LA.newMatrix();
4292
+ g.fromParent = LA.newMatrix();
4293
+ }
4294
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4295
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32154296
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);
4297
+ g.add(Grafreed.clipboard);
32204298
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);
4299
+ buffer.add(g);
4300
+ }
32324301
3233
- g.add(GraphreeD.clipboard);
4302
+ public void Face(Object3D node, Face f)
4303
+ {
32344304
3235
- buffer.add(g);
3236
- }
4305
+ }
4306
+ }
4307
+ );
32374308
32384309 makeSomething(buffer, i==group.selection.size()-1);
32394310 }
32404311
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
4312
+ Grafreed.epsequal = epsequal;
32464313
32474314 refreshContents();
32484315 }
3249
-
4316
+
4317
+ void TextureVertices()
4318
+ {
4319
+ for (int i=0; i<group.selection.size(); i++)
4320
+ {
4321
+ group.selection.get(i).Parse(
4322
+ new iParse()
4323
+ {
4324
+ public void Vertex(Object3D node, Vertex v)
4325
+ {
4326
+ cTexture tex = node.GetTextures();
4327
+ String pigment = Object3D.GetPigment(tex);
4328
+ //String bump = Object3D.GetBump(tex);
4329
+
4330
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4331
+
4332
+ try
4333
+ {
4334
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4335
+ }
4336
+ catch (Exception e)
4337
+ {
4338
+ System.err.println("FAIL: " + node);
4339
+ }
4340
+
4341
+ double s = v.s;
4342
+
4343
+ if (s == 1)
4344
+ s = 0;
4345
+
4346
+ double t = v.t;
4347
+
4348
+ if (t == 1)
4349
+ t = 0;
4350
+
4351
+ int indexs = (int) (texturedata.getWidth() * s);
4352
+ int indext = (int) (texturedata.getHeight() * t);
4353
+
4354
+ int index = indext * texturedata.getWidth() + indexs;
4355
+
4356
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
4357
+
4358
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
4359
+
4360
+ float scale = bytebuf.get(index*slide) & 0xFF;
4361
+ scale += bytebuf.get(index*slide+1) & 0xFF;
4362
+ scale += bytebuf.get(index*slide+2) & 0xFF;
4363
+ scale /= 3;
4364
+
4365
+ scale /= 0xFF;
4366
+ // c'est quoi ca? scale /= 4;
4367
+
4368
+ //v.AO = scale;
4369
+
4370
+ v.x += v.norm.x * scale;
4371
+ v.y += v.norm.y * scale;
4372
+ v.z += v.norm.z * scale;
4373
+ }
4374
+
4375
+ public void Face(Object3D node, Face f)
4376
+ {
4377
+ }
4378
+ }
4379
+ );
4380
+ }
4381
+
4382
+ refreshContents();
4383
+ }
4384
+
32504385 void Align()
32514386 {
4387
+ if (group.selection.size() == 0)
4388
+ return;
4389
+
4390
+ cVector bbmin = new cVector();
4391
+ cVector bbmax = new cVector();
4392
+
4393
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4394
+
4395
+ double dx = bbmax.x - bbmin.x;
4396
+ double dy = bbmax.y - bbmin.y;
4397
+ double dz = bbmax.z - bbmin.z;
4398
+
4399
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4400
+
32524401 for (int i=0; i<group.selection.size(); i++)
32534402 {
32544403 Object3D obj = group.selection.get(i);
32554404
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4405
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4406
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584407 }
32594408
32604409 refreshContents();
....@@ -3267,7 +4416,7 @@
32674416 // ref.SaveSupports();
32684417 // Object3D par = ref.parent;
32694418 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4419
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714420 // ref.parent = par;
32724421 // ref.RestoreSupports();
32734422
....@@ -3275,11 +4424,11 @@
32754424
32764425 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774426
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4427
+ boolean random = CameraPane.SWITCH;
4428
+ CameraPane.SWITCH = false; // parse all random nodes
32804429 lowres.linkVerticesThis(null);
32814430 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4431
+ CameraPane.SWITCH = random;
32834432
32844433 System.err.flush();
32854434
....@@ -3297,7 +4446,7 @@
32974446 // lowres.SaveSupports();
32984447 // par = lowres.parent;
32994448 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4449
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014450 Object3D newlow = CloneObject(lowres, false);
33024451 newlow.name = sn.switchobject.get(i).name;
33034452 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4468,7 @@
33194468 return;
33204469
33214470 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4471
+ Object3D ref = Grafreed.clipboard.get(0);
33234472
33244473 Object3D newgroup = new Object3D("Po:" + poses.name);
33254474
....@@ -3488,7 +4637,7 @@
34884637 group.selection.RelinkToSupport(); // july 2014
34894638 System.out.println("DONE.");
34904639 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4640
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924641 }
34934642
34944643 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4662,20 @@
35134662
35144663 void ClipMesh()
35154664 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4665
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174666 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4667
+ Object3D content = Grafreed.clipboard.get(0);
35194668
35204669 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214670 content = ((cGroup)content).get(0);
35224671
35234672 // for (int i=0; i<group.selection.size(); i++)
35244673 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4674
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264675 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4676
+ group.selection.ClipMesh(Grafreed.clipboard);
35284677 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4678
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304679 System.out.println("DONE.");
35314680 refreshContents();
35324681 }
....@@ -3571,6 +4720,18 @@
35714720 void MarkLeaves(boolean hide)
35724721 {
35734722 group.selection.MarkLeaves(hide);
4723
+ refreshContents();
4724
+ }
4725
+
4726
+ void RewindLeaves(boolean hide)
4727
+ {
4728
+ group.selection.RewindLeaves(hide);
4729
+ refreshContents();
4730
+ }
4731
+
4732
+ void RandomLeaves(boolean hide)
4733
+ {
4734
+ group.selection.RandomLeaves(hide);
35744735 refreshContents();
35754736 }
35764737
....@@ -3645,28 +4806,25 @@
36454806 // }
36464807 // }
36474808
3648
- static boolean allparams = true;
3649
-
3650
- static Vector<Object3D> listUI = new Vector<Object3D>();
3651
-
36524809 void EditSelection(boolean newWindow)
36534810 {
4811
+ if (group.selection == null)
4812
+ {
4813
+ EditElement(group, newWindow); // ? new
4814
+ return;
4815
+ }
4816
+
36544817 // aConstraints.gridy = 0;
36554818 for (int i=0; i<group.selection.size(); i++)
36564819 {
36574820 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36584821 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4822
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604823
36614824 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4825
+ if(elem != group || !newWindow)
36634826 {
3664
- // if (!(elem instanceof Composite))
3665
- // newWindow = false;
3666
- listUI.add(elem);
3667
- elem.openEditWindow(this, newWindow); //, false);
3668
- System.out.println("edit : " + elem);
3669
- elem.editWindow.refreshContents(true); // ? new
4827
+ EditElement(elem, newWindow); // ? new
36704828 }
36714829 }
36724830 }
....@@ -3741,7 +4899,8 @@
37414899 //new Exception().printStackTrace();
37424900
37434901 freezemodel = true;
3744
-
4902
+ ClearUnpinned();
4903
+
37454904 /**/
37464905 //switch (event.id)
37474906 {
....@@ -3749,7 +4908,6 @@
37494908 //case 702: // Event.LIST_DESELECT
37504909 group.deselectAll();
37514910 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37534911 if (tps != null)
37544912 {
37554913 for (int i=0; i < tps.length; i++)
....@@ -3758,33 +4916,39 @@
37584916
37594917 //if (child.parent != null)
37604918 //child.parent.addSelectee(child);
4919
+ objEditor.SetMaterial(child);
37614920 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37654921 }
37664922 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4923
+// else
4924
+// {
4925
+// objEditor.SetMaterial(group); // .GetMaterial());
4926
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4927
+// System.err.println("info : " + group.GetPath());
4928
+// }
37734929
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4930
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37774931 CameraPane.flash = true;
37784932
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4933
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37804934 // a camera
37814935 {
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;
4936
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4937
+ {
4938
+ CameraPane.camerachangeframe = 0; // don't refuse it
4939
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4940
+ }
4941
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4942
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864943 }
37874944
4945
+ if (tps != null && tps.length == 1)
4946
+ {
4947
+ EditSelection(false);
4948
+ }
4949
+
4950
+ SetPinStates(tps != null && tps.length > 0);
4951
+
37884952 refreshContents();
37894953 //return true;
37904954 }
....@@ -3793,6 +4957,35 @@
37934957
37944958 freezemodel = false;
37954959 }
4960
+
4961
+ void SetPinStates(boolean enabled)
4962
+ {
4963
+ editButton.setEnabled(enabled);
4964
+ uneditButton.setEnabled(enabled);
4965
+ unselectButton.setEnabled(enabled);
4966
+ flashSelectionButton.setEnabled(enabled);
4967
+ }
4968
+
4969
+ void refreshContents(boolean cp)
4970
+ {
4971
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4972
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4973
+ {
4974
+ objEditor.ClearInfo(); // .GetMaterial());
4975
+
4976
+ for (int i=0; i < group.selection.Size(); i++)
4977
+ {
4978
+ Object3D child = (Object3D) group.selection.get(i);
4979
+
4980
+ objEditor.AddInfo(child, this, true);
4981
+ System.err.println("info : " + child.GetPath());
4982
+ }
4983
+
4984
+ objEditor.SetText(); // jan 2014
4985
+ }
4986
+
4987
+ super.refreshContents(cp);
4988
+ }
37964989
37974990 void linkSomething(Object3D thing)
37984991 {
....@@ -3864,16 +5057,19 @@
38645057 {
38655058 if (group.selection.isEmpty())
38665059 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
5060
+
5061
+ Grafreed.clipboardIsTempGroup = false;
38685062 Composite tGroup = null;
38695063 if (group.selection.size() > 0) // 1)
38705064 {
38715065 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
5066
+ Grafreed.clipboardIsTempGroup = true;
38735067 }
38745068
38755069 if (cut)
38765070 {
5071
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5072
+// Save();
38775073 //int indices[] = jList.getSelectedIndices();
38785074 //for (int i = indices.length - 1; i >= 0; i--)
38795075 //jList.remove(indices[i]);
....@@ -3909,16 +5105,16 @@
39095105 //System.out.println("cut " + child);
39105106 //System.out.println("parent = " + child.parent);
39115107 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
5108
+ if (Grafreed.clipboardIsTempGroup)
39135109 tGroup.add/*Child*/(tmp);
39145110 else
3915
- GraphreeD.clipboard = tmp;
5111
+ Grafreed.clipboard = tmp;
39165112 }
39175113 else
3918
- if (GraphreeD.clipboardIsTempGroup)
5114
+ if (Grafreed.clipboardIsTempGroup)
39195115 tGroup.add/*Child*/(child);
39205116 else
3921
- GraphreeD.clipboard = child;
5117
+ Grafreed.clipboard = child;
39225118 }
39235119
39245120 //ResetModel();
....@@ -3950,21 +5146,23 @@
39505146 //System.out.println("cut " + elem);
39515147 //System.out.println("parent = " + elem.parent);
39525148 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
5149
+ if (Grafreed.clipboardIsTempGroup)
39545150 tGroup.add/*Child*/(tmp);
39555151 else
3956
- GraphreeD.clipboard = tmp;
5152
+ Grafreed.clipboard = tmp;
39575153 }
39585154 else
3959
- if (GraphreeD.clipboardIsTempGroup)
5155
+ if (Grafreed.clipboardIsTempGroup)
39605156 tGroup.add/*Child*/(child);
39615157 else
3962
- GraphreeD.clipboard = child;
5158
+ Grafreed.clipboard = child;
39635159 }
39645160
39655161 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
5162
+
5163
+ if (Grafreed.clipboardIsTempGroup)
5164
+ Grafreed.clipboard = tGroup;
5165
+
39685166 if (cut)
39695167 {
39705168 ResetModel();
....@@ -3974,11 +5172,15 @@
39745172
39755173 void paste(boolean expand)
39765174 {
3977
- // if (GraphreeD.clipboard == null)
5175
+ if (Globals.REPLACEONMAKE)
5176
+ Save();
5177
+ boolean keep = Globals.REPLACEONMAKE;
5178
+ Globals.REPLACEONMAKE = false;
5179
+ // if (GrafreeD.clipboard == null)
39785180 // return;
39795181 boolean first = true;
39805182
3981
- if (GraphreeD.clipboardIsTempGroup)
5183
+ if (Grafreed.clipboardIsTempGroup)
39825184 {
39835185 Composite temp;
39845186
....@@ -3989,7 +5191,7 @@
39895191 temp = (Composite)Applet3D.clipboard.deepCopy();
39905192 */
39915193 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5194
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39935195 {
39945196 Object3D child = (Object3D)e.nextElement();
39955197
....@@ -4003,7 +5205,7 @@
40035205 else
40045206 elem = child.deepCopy(); // ?
40055207 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5208
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40075209 // elem = elem.get(0);
40085210 makeSomething(elem, true); // ?? first);
40095211 //group.addChild(elem);
....@@ -4023,23 +5225,24 @@
40235225 //Object3D cb = Applet3D.clipboard;
40245226 //temp.addChild(cb);
40255227 //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());
5228
+ assert(Grafreed.clipboard.parent == null);
5229
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5230
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5231
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5232
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40315233 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
5234
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5235
+ Grafreed.clipboard.get(0).parent = keepparent;
40345236 }
40355237
5238
+ Globals.REPLACEONMAKE = keep;
40365239 ResetModel();
40375240 refreshContents();
40385241 }
40395242
4040
- void pasteInto(boolean copyit)
5243
+ void pasteInto(boolean copyit, boolean clone)
40415244 {
4042
-// if (GraphreeD.clipboard == null)
5245
+// if (GrafreeD.clipboard == null)
40435246 // return;
40445247
40455248 if (group.selection.size() != 1)
....@@ -4066,15 +5269,22 @@
40665269 if (copyit)
40675270 {
40685271 // paste(false);
4069
- CloneClipboard(false); // sept 2014
5272
+ if (clone)
5273
+ {
5274
+ CloneClipboard(false); // sept 2014
5275
+ }
5276
+ else
5277
+ {
5278
+ paste(false);
5279
+ }
40705280 }
40715281 else
40725282 {
40735283 boolean first = true;
40745284
4075
- if (GraphreeD.clipboardIsTempGroup)
5285
+ if (Grafreed.clipboardIsTempGroup)
40765286 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
5287
+ Composite temp = (Composite)Grafreed.clipboard;
40785288 Object3D copy;
40795289 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40805290 {
....@@ -4084,7 +5294,7 @@
40845294 }
40855295 } else
40865296 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
5297
+ linkSomething(Grafreed.clipboard); //.get(0));
40885298 }
40895299 }
40905300 }
....@@ -4161,6 +5371,10 @@
41615371
41625372 void group(Object3D csg, boolean grab)
41635373 {
5374
+ if (Globals.REPLACEONMAKE)
5375
+ Save();
5376
+ boolean keep = Globals.REPLACEONMAKE;
5377
+ Globals.REPLACEONMAKE = false;
41645378 if (//false) // why??
41655379 !group.selection.isEmpty())
41665380 {
....@@ -4274,8 +5488,34 @@
42745488 //node.add(csg);
42755489 //makeSomething(node);
42765490 makeSomething(csg);
5491
+ Globals.REPLACEONMAKE = keep;
42775492 }
42785493
5494
+ void Ungroup(Object3D g)
5495
+ {
5496
+ if (Globals.REPLACEONMAKE)
5497
+ Save();
5498
+ boolean keep = Globals.REPLACEONMAKE;
5499
+ Globals.REPLACEONMAKE = false;
5500
+ if (g instanceof HiddenObject)
5501
+ {
5502
+ HiddenObject h = (HiddenObject) g;
5503
+
5504
+ for (int i=0; i<h.ActualSize(); i++)
5505
+ {
5506
+ objEditor.makeSomething(h.get(i), false);
5507
+ }
5508
+ }
5509
+ else
5510
+ {
5511
+ for (int i=0; i<g.Size(); i++)
5512
+ {
5513
+ objEditor.makeSomething(g.get(i), false);
5514
+ }
5515
+ }
5516
+ Globals.REPLACEONMAKE = keep;
5517
+ }
5518
+
42795519 void ungroup()
42805520 {
42815521 /*
....@@ -4469,21 +5709,6 @@
44695709 }
44705710 */
44715711
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
-
44875712 /*
44885713 public void Callback(Object obj)
44895714 {
....@@ -4507,26 +5732,9 @@
45075732 }
45085733 */
45095734
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
-
45275735 String GetFile(String dialogName)
45285736 {
4529
- if (GraphreeD.standAlone)
5737
+ if (Grafreed.standAlone)
45305738 {
45315739 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325740 browser.show();
....@@ -4590,10 +5798,49 @@
45905798 cButton flashSelectionButton;
45915799 cButton editButton;
45925800 cButton uneditButton;
5801
+ JCheckBox allParamsButton;
45935802 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955803 cButton unselectButton;
45965804
5805
+ cButton restoreCameraButton;
5806
+
5807
+ cButton saveButton;
5808
+ cButton oneStepButton;
5809
+
5810
+ cButton groupButton;
5811
+ cButton ungroupButton;
5812
+ cButton compositeButton;
5813
+ cButton switchButton;
5814
+ cButton loopButton;
5815
+ cButton textureButton;
5816
+
5817
+ cButton skybox1Button;
5818
+ cButton skybox2Button;
5819
+ cButton skybox3Button;
5820
+ cButton skybox4Button;
5821
+ cButton skybox5Button;
5822
+ cButton skybox6Button;
5823
+ cButton skybox7Button;
5824
+
5825
+ cButton skybox11Button;
5826
+ cButton skybox12Button;
5827
+ cButton skybox13Button;
5828
+ cButton skybox14Button;
5829
+ cButton skybox15Button;
5830
+ cButton skybox16Button;
5831
+ cButton skybox17Button;
5832
+
5833
+ cButton gridButton;
5834
+ cButton boxButton;
5835
+ cButton sphereButton;
5836
+ cButton coneButton;
5837
+ cButton torusButton;
5838
+ cButton superButton;
5839
+ cButton kleinButton;
5840
+ cButton particlesButton;
5841
+ cButton overlayButton;
5842
+ cButton lightButton;
5843
+
45975844 cButton screenfitButton;
45985845 cButton screenfitpointButton;
45995846 cButton snapobjectButton;
....@@ -4605,14 +5852,6 @@
46055852
46065853 cButton setsupportButton;
46075854
4608
- cButton twoButton;
4609
- cButton sixButton;
4610
- cButton threeButton;
4611
- cButton sevenButton;
4612
- cButton fourButton; // full panel
4613
- cButton oneButton; // full XYZ
4614
- //cButton currentLayout;
4615
-
46165855 //
46175856 //Composite
46185857 Object3D // to do !!
....@@ -4622,9 +5861,11 @@
46225861 //JTree jTree;
46235862 private MenuItem lookAtItem;
46245863 private MenuItem lookFromItem;
4625
- private MenuItem switchItem;
5864
+ private MenuItem switchViewItem;
46265865 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
5866
+ private MenuItem undoItem;
5867
+ private MenuItem redoItem;
5868
+ private JMenuItem duplicateItem;
46285869 private MenuItem cloneItem;
46295870 private MenuItem cloneSupportItem;
46305871 private MenuItem overwriteGeoItem;
....@@ -4635,8 +5876,9 @@
46355876 private MenuItem resetsupportItem;
46365877 private MenuItem resetreferencesItem;
46375878 private MenuItem linkverticesItem;
5879
+ private MenuItem relinkverticesItem;
46385880 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5881
+ private MenuItem resetAllItem;
46405882 private MenuItem stepAllItem;
46415883 private MenuItem revertMeshItem;
46425884 private MenuItem poseMeshItem;
....@@ -4647,14 +5889,17 @@
46475889 private MenuItem mergeGeometriesItem;
46485890 private MenuItem copyItem;
46495891 private MenuItem pasteItem;
5892
+ private MenuItem pasteIntoItem;
46505893 private MenuItem pasteLinkItem;
46515894 private MenuItem pasteCloneItem;
46525895 private MenuItem pasteExpandItem;
4653
- private MenuItem clearItem;
5896
+ private MenuItem deleteItem;
46545897 private MenuItem clearAllItem;
46555898 private MenuItem genUVItem;
5899
+ private MenuItem genNormalsMESHItem;
46565900 private MenuItem genNormalsCADItem;
46575901 private MenuItem genNormalsORGANItem;
5902
+ private MenuItem genNormalsMINEItem;
46585903 private MenuItem stripifyItem;
46595904 private MenuItem unstripifyItem;
46605905 private MenuItem trimItem;
....@@ -4683,6 +5928,10 @@
46835928 private MenuItem showleavesItem;
46845929 private MenuItem markleavesItem;
46855930 private MenuItem unmarkleavesItem;
5931
+ private MenuItem rewindleavesItem;
5932
+ private MenuItem unrewindleavesItem;
5933
+ private MenuItem randomleavesItem;
5934
+ private MenuItem unrandomleavesItem;
46865935
46875936 private MenuItem flipVItem;
46885937 private MenuItem unflipVItem;
....@@ -4694,14 +5943,17 @@
46945943 private MenuItem panoTexturesItem;
46955944
46965945 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
5946
+ private MenuItem resetCentroidXZItem;
46985947 private MenuItem resetTransformItem;
5948
+ private MenuItem transformGeometryItem;
5949
+ private MenuItem transformChildrenItem;
5950
+ private MenuItem hideItem;
46995951 private MenuItem grabItem;
47005952 private MenuItem backItem;
47015953 private MenuItem frontItem;
47025954 private MenuItem cameraItem;
47035955 private MenuItem compositeItem;
4704
- private MenuItem randomItem;
5956
+ private MenuItem switchItem;
47055957 private MenuItem physicsItem;
47065958 private MenuItem frameselectorItem;
47075959 private MenuItem scriptNodeItem;
....@@ -4716,6 +5968,7 @@
47165968
47175969 private MenuItem resetParentItem;
47185970 private MenuItem repairParentItem;
5971
+ private MenuItem repairShadowItem;
47195972 private MenuItem sortbysizeItem;
47205973 private MenuItem sortbynameItem;
47215974
....@@ -4724,20 +5977,25 @@
47245977 private MenuItem attachBumpItem;
47255978 private MenuItem detachBumpItem;
47265979 private MenuItem pigmentBumpItem;
5980
+ private MenuItem embedTexturesItem;
5981
+ private MenuItem deEmbedTexturesItem;
47275982
47285983 private MenuItem particleItem;
47295984 private MenuItem ragdollItem;
47305985 private MenuItem ragdoll2Item;
5986
+ private MenuItem heightFieldItem;
5987
+ private MenuItem textureFieldItem;
47315988 private MenuItem gridItem;
47325989 private MenuItem rectoidItem;
47335990 private MenuItem ellipsoidItem;
47345991 private MenuItem coneItem;
47355992 private MenuItem torusItem;
47365993 private MenuItem superItem;
5994
+ private MenuItem kleinItem;
47375995 private MenuItem blobItem;
47385996 private MenuItem latheItem;
47395997 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
5998
+ private MenuItem overlayItem;
47415999 private MenuItem meshItem;
47426000 // private MenuItem meshGroupItem;
47436001 private MenuItem springItem;
....@@ -4746,6 +6004,7 @@
47466004 private MenuItem csgItem;
47476005 private MenuItem templateItem;
47486006 private MenuItem textureItem;
6007
+ private MenuItem billboardItem;
47496008 private MenuItem shadowXItem;
47506009 private MenuItem shadowYItem;
47516010 private MenuItem shadowZItem;
....@@ -4758,11 +6017,6 @@
47586017 private MenuItem doubleItem;
47596018 private MenuItem tripleItem;
47606019
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47666020 private MenuItem computeAOItem;
47676021 private MenuItem recompileItem;
47686022 private MenuItem editScriptItem;
....@@ -4772,4 +6026,8 @@
47726026 private MenuItem analyzeItem;
47736027 private MenuItem dumpItem;
47746028 //boolean freezemodel = false;
6029
+
6030
+ Menu cameraMenu;
6031
+ MenuItem editCameraItem;
6032
+ MenuItem restoreCameraItem;
47756033 }