.. | .. |
---|
12 | 12 | import com.jme.math.Vector3f; |
---|
13 | 13 | import com.jme.renderer.ColorRGBA; |
---|
14 | 14 | |
---|
| 15 | +import grafeme.ui.*; |
---|
15 | 16 | //import buoy.widget.BFileChooser; |
---|
16 | 17 | |
---|
17 | | -class GroupEditor extends ObjEditor implements iParse, //iCallBack, |
---|
| 18 | +class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
18 | 19 | ObjectUI, |
---|
19 | 20 | Runnable, |
---|
20 | 21 | ActionListener, |
---|
.. | .. |
---|
83 | 84 | |
---|
84 | 85 | void CloneSelection(boolean supports) |
---|
85 | 86 | { |
---|
86 | | - // Object3D keep = GraphreeD.clipboard; |
---|
| 87 | + // Object3D keep = GrafreeD.clipboard; |
---|
87 | 88 | //Object3D obj; |
---|
88 | 89 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
89 | 90 | { |
---|
.. | .. |
---|
97 | 98 | |
---|
98 | 99 | void CloneClipboard(boolean supports) |
---|
99 | 100 | { |
---|
100 | | - assert(GraphreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
102 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GraphreeD.clipboard.get(0), false)); |
---|
| 101 | + assert(GrafreeD.clipboard.parent == null); |
---|
| 102 | + Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
| 103 | + GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 104 | + if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
| 105 | + makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
105 | 106 | else |
---|
106 | | - makeSomething(CloneObject(GraphreeD.clipboard, false)); |
---|
107 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
| 108 | + GrafreeD.clipboard.get(0).parent = keepparent; |
---|
108 | 109 | } |
---|
109 | 110 | |
---|
110 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 119 | // obj.support = null; |
---|
119 | 120 | if (!supports) |
---|
120 | 121 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GraphreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
122 | 123 | obj.parent = parent; |
---|
123 | 124 | // obj.support = support; |
---|
124 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
149 | 150 | |
---|
150 | 151 | void SetupMenu2(ObjEditor oe) |
---|
151 | 152 | { |
---|
| 153 | + if (Globals.ADVANCED) |
---|
| 154 | + { |
---|
152 | 155 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 156 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 157 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 163 | lookAtItem.addActionListener(this); |
---|
161 | 164 | //lookFromItem.addActinoListener(this); |
---|
162 | 165 | //switchItem.addActionListener(this); |
---|
| 166 | + } |
---|
| 167 | + |
---|
163 | 168 | Menu menu; |
---|
164 | 169 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 170 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 171 | //editItem.addActionListener(this); |
---|
167 | 172 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
168 | 173 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 174 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 175 | cloneItem.addActionListener(this); |
---|
| 176 | + if (Globals.ADVANCED) |
---|
| 177 | + { |
---|
172 | 178 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 179 | cloneSupportItem.addActionListener(this); |
---|
| 180 | + } |
---|
174 | 181 | menu.add("-"); |
---|
175 | 182 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 183 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 185 | copyItem.addActionListener(this); |
---|
179 | 186 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 187 | pasteItem.addActionListener(this); |
---|
| 188 | + menu.add("-"); |
---|
| 189 | + |
---|
| 190 | + menu.add("-"); |
---|
| 191 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 192 | + pasteIntoItem.addActionListener(this); |
---|
181 | 193 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 194 | pasteLinkItem.addActionListener(this); |
---|
183 | 195 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 196 | pasteCloneItem.addActionListener(this); |
---|
185 | 197 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 198 | // pasteExpandItem.addActionListener(this); |
---|
| 199 | + menu.add("-"); |
---|
187 | 200 | clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | 201 | clearItem.addActionListener(this); |
---|
| 202 | + |
---|
| 203 | + if (Globals.ADVANCED) |
---|
| 204 | + { |
---|
| 205 | + // Deletes the cameras... |
---|
189 | 206 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 207 | clearAllItem.addActionListener(this); |
---|
191 | | - menu.add("-"); |
---|
192 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
| 208 | + } |
---|
| 209 | + |
---|
| 210 | + oe.menuBar.add(menu = new Menu("Setting")); |
---|
| 211 | + if (Globals.ADVANCED) |
---|
| 212 | + { |
---|
| 213 | + resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
193 | 214 | resetMeshItem.addActionListener(this); |
---|
194 | 215 | stepAllItem = menu.add(new MenuItem("Step All")); |
---|
195 | 216 | stepAllItem.addActionListener(this); |
---|
.. | .. |
---|
198 | 219 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
199 | 220 | resetreferencesItem.addActionListener(this); |
---|
200 | 221 | menu.add("-"); |
---|
| 222 | + } |
---|
201 | 223 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
202 | 224 | overwriteGeoItem.addActionListener(this); |
---|
203 | 225 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
209 | 231 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
210 | 232 | overwriteUVItem.addActionListener(this); |
---|
211 | 233 | menu.add("-"); |
---|
| 234 | + if (Globals.ADVANCED) |
---|
| 235 | + { |
---|
212 | 236 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
213 | 237 | generateMeshItem.addActionListener(this); |
---|
214 | 238 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
215 | 239 | poseMeshItem.addActionListener(this); |
---|
216 | 240 | menu.add("-"); |
---|
| 241 | + } |
---|
217 | 242 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
218 | 243 | resetsupportItem.addActionListener(this); |
---|
219 | 244 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
220 | 245 | linkverticesItem.addActionListener(this); |
---|
| 246 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 247 | + relinkverticesItem.addActionListener(this); |
---|
| 248 | + |
---|
| 249 | + if (Globals.ADVANCED) |
---|
| 250 | + { |
---|
221 | 251 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
222 | 252 | setMasterItem.addActionListener(this); |
---|
| 253 | + } |
---|
223 | 254 | |
---|
224 | | - oe.menuBar.add(menu = new Menu("Object")); |
---|
| 255 | + oe.menuBar.add(menu = new Menu("Group")); |
---|
225 | 256 | grabItem = menu.add(new MenuItem("Grab")); |
---|
226 | 257 | grabItem.addActionListener(this); |
---|
227 | | - frontItem = menu.add(new MenuItem("Front")); |
---|
228 | | - frontItem.addActionListener(this); |
---|
229 | 258 | backItem = menu.add(new MenuItem("Back")); |
---|
230 | 259 | backItem.addActionListener(this); |
---|
| 260 | + frontItem = menu.add(new MenuItem("Front")); |
---|
| 261 | + frontItem.addActionListener(this); |
---|
231 | 262 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
232 | 263 | compositeItem.addActionListener(this); |
---|
| 264 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
| 265 | + hideItem.addActionListener(this); |
---|
| 266 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 267 | + ungroupItem.addActionListener(this); |
---|
233 | 268 | menu.add("-"); |
---|
234 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 269 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
235 | 270 | 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); |
---|
240 | 271 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
241 | 272 | switchGeoItem.addActionListener(this); |
---|
242 | 273 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
243 | 274 | switchTransfoItem.addActionListener(this); |
---|
244 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 275 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
245 | 276 | morphItem.addActionListener(this); |
---|
| 277 | + |
---|
| 278 | + if (Globals.ADVANCED) |
---|
| 279 | + { |
---|
| 280 | + menu.add("-"); |
---|
| 281 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 282 | + physicsItem.addActionListener(this); |
---|
| 283 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 284 | + frameselectorItem.addActionListener(this); |
---|
246 | 285 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
247 | 286 | scriptNodeItem.addActionListener(this); |
---|
248 | 287 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
249 | 288 | cameraItem.addActionListener(this); |
---|
250 | | - menu.add("-"); |
---|
| 289 | + } |
---|
| 290 | + |
---|
| 291 | + oe.menuBar.add(menu = new Menu("Object")); |
---|
251 | 292 | textureItem = menu.add(new MenuItem("Texture")); |
---|
252 | 293 | textureItem.addActionListener(this); |
---|
| 294 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 295 | + billboardItem.addActionListener(this); |
---|
253 | 296 | csgItem = menu.add(new MenuItem("CSG")); |
---|
254 | 297 | csgItem.addActionListener(this); |
---|
255 | 298 | shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
.. | .. |
---|
258 | 301 | shadowYItem.addActionListener(this); |
---|
259 | 302 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
260 | 303 | shadowZItem.addActionListener(this); |
---|
| 304 | + if (Globals.ADVANCED) |
---|
| 305 | + { |
---|
| 306 | + menu.add("-"); |
---|
261 | 307 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
262 | 308 | linkerItem.addActionListener(this); |
---|
263 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
264 | | - templateItem.addActionListener(this); |
---|
265 | 309 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
266 | 310 | attributeItem.addActionListener(this); |
---|
| 311 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 312 | + templateItem.addActionListener(this); |
---|
267 | 313 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
268 | 314 | pointflowItem.addActionListener(this); |
---|
| 315 | + } |
---|
269 | 316 | menu.add("-"); |
---|
270 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
271 | | - transformgeometryItem.addActionListener(this); |
---|
272 | 317 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
273 | 318 | resetTransformItem.addActionListener(this); |
---|
274 | 319 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
275 | 320 | resetCentroidItem.addActionListener(this); |
---|
276 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
277 | | - ungroupItem.addActionListener(this); |
---|
| 321 | + transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 322 | + transformgeometryItem.addActionListener(this); |
---|
278 | 323 | |
---|
279 | 324 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
280 | 325 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
283 | 328 | genNormalsORGANItem.addActionListener(this); |
---|
284 | 329 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
285 | 330 | genNormalsCADItem.addActionListener(this); |
---|
| 331 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 332 | + genNormalsMESHItem.addActionListener(this); |
---|
| 333 | + if (Globals.ADVANCED) |
---|
| 334 | + { |
---|
| 335 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 336 | + genNormalsMINEItem.addActionListener(this); |
---|
| 337 | + } |
---|
286 | 338 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
287 | 339 | stripifyItem.addActionListener(this); |
---|
288 | 340 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
292 | 344 | untrimItem = menu.add(new MenuItem("Untrim")); |
---|
293 | 345 | untrimItem.addActionListener(this); |
---|
294 | 346 | menu.add("-"); |
---|
295 | | - clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
296 | | - clearMaterialsItem.addActionListener(this); |
---|
297 | 347 | clearColorsItem = menu.add(new MenuItem("Clear AO")); |
---|
298 | 348 | clearColorsItem.addActionListener(this); |
---|
299 | 349 | reverseNormalsItem = menu.add(new MenuItem("Reverse Normals")); |
---|
.. | .. |
---|
306 | 356 | reduce34MeshItem.addActionListener(this); |
---|
307 | 357 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
308 | 358 | increaseMeshItem.addActionListener(this); |
---|
309 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
310 | | - smoothMeshItem.addActionListener(this); |
---|
311 | 359 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
312 | 360 | clipMeshItem.addActionListener(this); |
---|
| 361 | + |
---|
| 362 | + if (Globals.ADVANCED) |
---|
| 363 | + { |
---|
| 364 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 365 | + smoothMeshItem.addActionListener(this); |
---|
| 366 | + } |
---|
| 367 | + |
---|
| 368 | + oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 369 | + clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
| 370 | + clearMaterialsItem.addActionListener(this); |
---|
313 | 371 | menu.add("-"); |
---|
314 | 372 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
315 | 373 | liveleavesItem.addActionListener(this); |
---|
316 | 374 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
317 | 375 | unliveleavesItem.addActionListener(this); |
---|
| 376 | + if (Globals.ADVANCED) |
---|
| 377 | + { |
---|
318 | 378 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
319 | 379 | supportleavesItem.addActionListener(this); |
---|
320 | 380 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
321 | 381 | unsupportleavesItem.addActionListener(this); |
---|
| 382 | + } |
---|
322 | 383 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
323 | 384 | hideleavesItem.addActionListener(this); |
---|
324 | 385 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
332 | 393 | flipVItem.addActionListener(this); |
---|
333 | 394 | unflipVItem = menu.add(new MenuItem("Unflip V")); |
---|
334 | 395 | unflipVItem.addActionListener(this); |
---|
335 | | - lowTexturesItem = menu.add(new MenuItem("Low Texture")); |
---|
| 396 | + lowTexturesItem = menu.add(new MenuItem("Low Texture (256)")); |
---|
336 | 397 | lowTexturesItem.addActionListener(this); |
---|
337 | | - normalTexturesItem = menu.add(new MenuItem("Normal Texture")); |
---|
| 398 | + normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)")); |
---|
338 | 399 | normalTexturesItem.addActionListener(this); |
---|
339 | | - highTexturesItem = menu.add(new MenuItem("High Texture")); |
---|
| 400 | + highTexturesItem = menu.add(new MenuItem("High Texture (1024)")); |
---|
340 | 401 | highTexturesItem.addActionListener(this); |
---|
341 | | - veryhighTexturesItem = menu.add(new MenuItem("Very high Texture")); |
---|
| 402 | + veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)")); |
---|
342 | 403 | veryhighTexturesItem.addActionListener(this); |
---|
343 | | - maxTexturesItem = menu.add(new MenuItem("Max Texture")); |
---|
| 404 | + maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)")); |
---|
344 | 405 | maxTexturesItem.addActionListener(this); |
---|
345 | | - panoTexturesItem = menu.add(new MenuItem("Panoramic Texture")); |
---|
| 406 | + panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)")); |
---|
346 | 407 | 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); |
---|
356 | 408 | |
---|
357 | 409 | oe.menuBar.add(menu = new Menu("Selection")); |
---|
358 | 410 | attachPigmentItem = menu.add(new MenuItem("Attach Pigment...")); |
---|
.. | .. |
---|
370 | 422 | sortbysizeItem.addActionListener(this); |
---|
371 | 423 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
372 | 424 | sortbynameItem.addActionListener(this); |
---|
| 425 | + if (Globals.ADVANCED) |
---|
| 426 | + { |
---|
| 427 | + menu.add("-"); |
---|
| 428 | + extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
| 429 | + extractGeometriesItem.addActionListener(this); |
---|
| 430 | + cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
| 431 | + cloneGeometriesItem.addActionListener(this); |
---|
| 432 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
| 433 | + shareGeometriesItem.addActionListener(this); |
---|
| 434 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
| 435 | + mergeGeometriesItem.addActionListener(this); |
---|
| 436 | + } |
---|
| 437 | + |
---|
373 | 438 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
374 | 439 | buildCreateMenu(menu); |
---|
375 | | - oe.menuBar.add(menu = new Menu("Tools")); |
---|
| 440 | + |
---|
| 441 | + oe.menuBar.add(menu = new Menu("Include")); |
---|
| 442 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 443 | + importOBJItem.addActionListener(this); |
---|
| 444 | + menu.add("-"); |
---|
| 445 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 446 | + import3DSItem.addActionListener(this); |
---|
| 447 | + menu.add("-"); |
---|
| 448 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 449 | + importVRMLX3DItem.addActionListener(this); |
---|
| 450 | + menu.add("-"); |
---|
| 451 | + importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
| 452 | + importGFDItem.addActionListener(this); |
---|
| 453 | + |
---|
| 454 | + oe.menuBar.add(menu = new Menu("Tools")); |
---|
376 | 455 | buildToolsMenu(menu); |
---|
377 | 456 | } |
---|
378 | 457 | |
---|
.. | .. |
---|
406 | 485 | oe.radioPanel.add(dummyButton); |
---|
407 | 486 | oe.buttonGroup.add(dummyButton); |
---|
408 | 487 | */ |
---|
409 | | - aConstraints.gridy += 1; |
---|
410 | | - oe.aConstraints.gridwidth = 1; |
---|
411 | | - oe.aConstraints.gridx = 0; |
---|
| 488 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
412 | 489 | |
---|
413 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 490 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 491 | + liveCB.setToolTipText("Enabled animation"); |
---|
414 | 492 | liveCB.addItemListener(this); |
---|
415 | 493 | |
---|
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); |
---|
| 494 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 495 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 496 | + oneStepButton.addActionListener(this); |
---|
| 497 | + |
---|
| 498 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 499 | + fastCB.setToolTipText("Fast mode"); |
---|
434 | 500 | fastCB.addItemListener(this); |
---|
435 | | - oe.aConstraints.gridx += 1; |
---|
436 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
437 | | - slowCB.addItemListener(this); |
---|
438 | | - oe.aConstraints.gridx += 1; |
---|
439 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
440 | | - boxCB.addItemListener(this); |
---|
441 | | - |
---|
442 | | -// oe.aConstraints.gridx += 1; |
---|
443 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
444 | | -// speakerMocapCB.addItemListener(this); |
---|
445 | | - |
---|
446 | | - if (false) |
---|
447 | | - { |
---|
448 | | - // handled in scripts |
---|
449 | | - oe.aConstraints.gridx += 1; |
---|
450 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
451 | | - speakerCameraCB.addItemListener(this); |
---|
452 | | - |
---|
453 | | - oe.aConstraints.gridx += 1; |
---|
454 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
455 | | - speakerFocusCB.addItemListener(this); |
---|
456 | | - |
---|
457 | | - oe.aConstraints.gridx += 1; |
---|
458 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
459 | | - smoothfocusCB.addItemListener(this); |
---|
460 | | - } |
---|
461 | | - |
---|
462 | | -//oe.aConstraints.gridx += 1; |
---|
463 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
464 | | -// debugCB.addItemListener(this); |
---|
465 | | - |
---|
466 | | - oe.aConstraints.gridx += 1; |
---|
467 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
468 | | - oeilCB.addItemListener(this); |
---|
469 | | - |
---|
470 | | - oe.aConstraints.gridx += 1; |
---|
471 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
472 | | - lookAtCB.addItemListener(this); |
---|
473 | | - |
---|
474 | | - oe.aConstraints.gridx += 1; |
---|
475 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 501 | + |
---|
| 502 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 503 | + trackCB.setToolTipText("Enable tracking"); |
---|
476 | 504 | trackCB.addItemListener(this); |
---|
477 | 505 | |
---|
478 | | - oe.aConstraints.gridx += 1; |
---|
479 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 506 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 507 | + screenfitButton.setToolTipText("Screen fit"); |
---|
480 | 508 | screenfitButton.addActionListener(this); |
---|
481 | | - oe.aConstraints.gridx += 1; |
---|
| 509 | + |
---|
482 | 510 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
483 | 511 | // 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; |
---|
488 | 512 | |
---|
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); |
---|
| 513 | + if (Globals.ADVANCED) |
---|
| 514 | + { |
---|
| 515 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 516 | + snapobjectButton.addActionListener(this); |
---|
| 517 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 518 | + } |
---|
| 519 | + |
---|
| 520 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 521 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
495 | 522 | flashSelectionButton.addActionListener(this); |
---|
496 | | - oe.aConstraints.gridx += 1; |
---|
497 | | - oe.aConstraints.weighty = 0; |
---|
498 | | - oe.aConstraints.gridwidth = 1; |
---|
499 | 523 | |
---|
500 | | - // |
---|
501 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 524 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 525 | + |
---|
| 526 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 527 | + twoButton.setToolTipText("Show center view only"); |
---|
502 | 528 | twoButton.addActionListener(this); |
---|
503 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 529 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 530 | fourButton.addActionListener(this); |
---|
505 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 531 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 532 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 533 | + sixButton.setToolTipText("2-column layout left"); |
---|
506 | 534 | sixButton.addActionListener(this); |
---|
507 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 535 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 536 | + threeButton.setToolTipText("2-column layout right"); |
---|
508 | 537 | threeButton.addActionListener(this); |
---|
509 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 538 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 539 | + sevenButton.setToolTipText("3-column layout"); |
---|
510 | 540 | sevenButton.addActionListener(this); |
---|
511 | 541 | // |
---|
512 | 542 | |
---|
513 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 543 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 544 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
514 | 545 | rootButton.addActionListener(this); |
---|
515 | | - oe.aConstraints.gridx += 1; |
---|
516 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 546 | + |
---|
| 547 | + oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 548 | + closeButton.setToolTipText("Close tab"); |
---|
517 | 549 | closeButton.addActionListener(this); |
---|
518 | 550 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
519 | 551 | //clearButton.addActionListener(this); |
---|
520 | | - oe.aConstraints.gridx += 1; |
---|
521 | 552 | |
---|
522 | | - oe.aConstraints.gridx = 1; // |
---|
523 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 553 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 554 | + |
---|
| 555 | + commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 556 | + editButton.setToolTipText("Edit selection"); |
---|
524 | 557 | editButton.addActionListener(this); |
---|
525 | | - oe.aConstraints.gridx += 1; |
---|
526 | | - oe.aConstraints.weighty = 0; |
---|
527 | | - oe.aConstraints.gridwidth = 1; |
---|
528 | 558 | |
---|
529 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 559 | + commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 560 | + uneditButton.setToolTipText("Unedit selection"); |
---|
530 | 561 | uneditButton.addActionListener(this); |
---|
531 | 562 | |
---|
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); |
---|
| 563 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 564 | + allParamsButton.setToolTipText("Edit all params"); |
---|
544 | 565 | allParamsButton.addActionListener(this); |
---|
545 | 566 | |
---|
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); |
---|
| 567 | + commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 568 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 569 | + clearPanelButton.addActionListener(this); |
---|
| 570 | + |
---|
| 571 | + commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 572 | + unselectButton.setToolTipText("Unselect"); |
---|
551 | 573 | unselectButton.addActionListener(this); |
---|
552 | 574 | |
---|
| 575 | + commandsPanel.preferredHeight = 1; |
---|
| 576 | + |
---|
| 577 | + oe.treePanel.add(commandsPanel); |
---|
| 578 | + oe.treePanel.Return(); |
---|
| 579 | + |
---|
553 | 580 | // oe.aConstraints.gridx += 1; |
---|
554 | 581 | // oe.aConstraints.weighty = 0; |
---|
555 | 582 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
561 | 588 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
562 | 589 | // gcButton.addActionListener(this); |
---|
563 | 590 | |
---|
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; |
---|
| 591 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 592 | + |
---|
| 593 | + JScrollPane jSP; |
---|
575 | 594 | //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); |
---|
| 595 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
577 | 596 | ResetModel(); |
---|
578 | | - oe.aConstraints.weighty = 0.5; |
---|
579 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
580 | | - oe.aConstraints.gridy += 1; |
---|
581 | | - oe.aConstraints.gridwidth = 1; |
---|
| 597 | + |
---|
| 598 | + oe.treePanel.add(jSPPanel); |
---|
| 599 | + oe.treePanel.Return(); |
---|
582 | 600 | |
---|
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); |
---|
| 601 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 602 | + |
---|
| 603 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 604 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
587 | 605 | colorCB.addItemListener(this); |
---|
588 | | - oe.aConstraints.gridx += 2; |
---|
589 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 606 | + |
---|
| 607 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 608 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
590 | 609 | materialCB.addItemListener(this); |
---|
591 | | - oe.aConstraints.gridx += 2; |
---|
592 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 610 | + |
---|
| 611 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 612 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
593 | 613 | textureCB.addItemListener(this); |
---|
594 | 614 | |
---|
595 | | - oe.aConstraints.gridx = 0; |
---|
596 | | - oe.aConstraints.gridy += 1; |
---|
| 615 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 616 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 617 | + oe.treePanel.Return(); |
---|
597 | 618 | |
---|
| 619 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 620 | +// mainPanel.setResizeWeight(0.5); |
---|
| 621 | + |
---|
598 | 622 | //jList.addListSelectionListener(this); |
---|
599 | 623 | oe.jTree.addTreeSelectionListener(this); |
---|
600 | 624 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
616 | 640 | radio.layout = sevenButton; |
---|
617 | 641 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
618 | 642 | } |
---|
| 643 | + |
---|
| 644 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 645 | + { |
---|
| 646 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 647 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 648 | + boxCB.addItemListener(this); |
---|
| 649 | + |
---|
| 650 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 651 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 652 | + zoomBoxCB.addItemListener(this); |
---|
| 653 | + |
---|
| 654 | + if (Globals.ADVANCED) |
---|
| 655 | + { |
---|
| 656 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 657 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 658 | + supportCB.addItemListener(this); |
---|
| 659 | + |
---|
| 660 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 661 | + // localCB.addItemListener(this); |
---|
| 662 | + |
---|
| 663 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 664 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 665 | + crowdCB.addItemListener(this); |
---|
| 666 | + |
---|
| 667 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 668 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 669 | + smoothCB.addItemListener(this); |
---|
| 670 | + |
---|
| 671 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 672 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 673 | + slowCB.addItemListener(this); |
---|
| 674 | + |
---|
| 675 | +// constraints.gridy += 1; |
---|
| 676 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 677 | +// speakerMocapCB.addItemListener(this); |
---|
| 678 | + |
---|
| 679 | + if (false) |
---|
| 680 | + { |
---|
| 681 | + // handled in scripts |
---|
| 682 | + //constraints.gridy += 1; |
---|
| 683 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 684 | + speakerCameraCB.addItemListener(this); |
---|
| 685 | + |
---|
| 686 | + //constraints.gridy += 1; |
---|
| 687 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 688 | + speakerFocusCB.addItemListener(this); |
---|
| 689 | + |
---|
| 690 | + //constraints.gridy += 1; |
---|
| 691 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 692 | + smoothfocusCB.addItemListener(this); |
---|
| 693 | + } |
---|
| 694 | + |
---|
| 695 | +//constraints.gridx += 1; |
---|
| 696 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 697 | +// debugCB.addItemListener(this); |
---|
| 698 | + |
---|
| 699 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 700 | + oeilCB.addItemListener(this); |
---|
| 701 | + |
---|
| 702 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 703 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 704 | + lookAtCB.addItemListener(this); |
---|
| 705 | + |
---|
| 706 | + } |
---|
| 707 | + |
---|
| 708 | + cGridBag fill = new cGridBag(); |
---|
| 709 | + |
---|
| 710 | + fill.preferredHeight = 200; |
---|
| 711 | + |
---|
| 712 | + panel.add(fill); |
---|
| 713 | + |
---|
| 714 | + } |
---|
619 | 715 | |
---|
620 | 716 | void EditObject(Object3D obj) |
---|
621 | 717 | { |
---|
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(); |
---|
| 718 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 719 | + radioButton.SetObject(obj); |
---|
| 720 | + radioButton.layout = sevenButton; |
---|
| 721 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 722 | + radioButton.addActionListener(this); |
---|
| 723 | + radioPanel.add(radioButton); |
---|
| 724 | + buttonGroup.add(radioButton); |
---|
| 725 | + radioButton.doClick(); |
---|
630 | 726 | } |
---|
631 | 727 | void SetupViews(ObjEditor oe) |
---|
632 | 728 | { |
---|
.. | .. |
---|
646 | 742 | JCheckBox fastCB; |
---|
647 | 743 | JCheckBox slowCB; |
---|
648 | 744 | JCheckBox boxCB; |
---|
| 745 | + JCheckBox zoomBoxCB; |
---|
649 | 746 | JCheckBox trackCB; |
---|
650 | 747 | JCheckBox smoothfocusCB; |
---|
651 | 748 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
688 | 785 | dropAttributes |= Object3D.TEXTURE; |
---|
689 | 786 | else |
---|
690 | 787 | dropAttributes &= ~Object3D.TEXTURE; |
---|
691 | | - } |
---|
692 | | - else if(e.getSource() == liveCB) |
---|
| 788 | + } else if(e.getSource() == liveCB) |
---|
693 | 789 | { |
---|
694 | 790 | cameraView.ToggleLive(); |
---|
695 | 791 | } |
---|
.. | .. |
---|
726 | 822 | Recompile(); |
---|
727 | 823 | cameraView.repaint(); |
---|
728 | 824 | // refreshContents(); |
---|
| 825 | + } |
---|
| 826 | + else if(e.getSource() == zoomBoxCB) |
---|
| 827 | + { |
---|
| 828 | + cameraView.ToggleZoomBoxMode(); |
---|
729 | 829 | } |
---|
730 | 830 | else if(e.getSource() == smoothfocusCB) |
---|
731 | 831 | { |
---|
.. | .. |
---|
894 | 994 | { |
---|
895 | 995 | loadClipboard(true); |
---|
896 | 996 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
897 | | - pasteInto(false); |
---|
| 997 | + pasteInto(false, false); |
---|
898 | 998 | } else { |
---|
899 | 999 | loadClipboard(false); |
---|
900 | 1000 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
901 | | - pasteInto(false); // true); // ??? |
---|
| 1001 | + pasteInto(false, false); // true); // ??? |
---|
902 | 1002 | } |
---|
903 | 1003 | } |
---|
904 | 1004 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1002 | 1102 | |
---|
1003 | 1103 | void buildCreateMenu(Menu menu) |
---|
1004 | 1104 | { |
---|
| 1105 | + //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
| 1106 | + //heightFieldItem.addActionListener(this); |
---|
1005 | 1107 | gridItem = menu.add(new MenuItem("Grid")); |
---|
1006 | 1108 | gridItem.addActionListener(this); |
---|
1007 | 1109 | rectoidItem = menu.add(new MenuItem("Box")); |
---|
.. | .. |
---|
1014 | 1116 | torusItem.addActionListener(this); |
---|
1015 | 1117 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1016 | 1118 | superItem.addActionListener(this); |
---|
| 1119 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1120 | + kleinItem.addActionListener(this); |
---|
1017 | 1121 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1018 | 1122 | particleItem.addActionListener(this); |
---|
| 1123 | + if (Globals.ADVANCED) |
---|
| 1124 | + { |
---|
1019 | 1125 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1020 | 1126 | ragdollItem.addActionListener(this); |
---|
1021 | 1127 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1022 | 1128 | ragdoll2Item.addActionListener(this); |
---|
| 1129 | + } |
---|
1023 | 1130 | menu.add("-"); |
---|
1024 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1131 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1025 | 1132 | meshItem.addActionListener(this); |
---|
1026 | 1133 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1027 | 1134 | // meshGroupItem.addActionListener(this); |
---|
| 1135 | + if (Globals.ADVANCED) |
---|
| 1136 | + { |
---|
1028 | 1137 | springItem = menu.add(new MenuItem("Spring")); |
---|
1029 | 1138 | springItem.addActionListener(this); |
---|
1030 | 1139 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1031 | 1140 | 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); |
---|
1036 | 1141 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1037 | 1142 | blobItem.addActionListener(this); |
---|
1038 | 1143 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1039 | 1144 | latheItem.addActionListener(this); |
---|
| 1145 | + } |
---|
| 1146 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1147 | + bezierItem.addActionListener(this); |
---|
| 1148 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1149 | + overlayItem.addActionListener(this); |
---|
1040 | 1150 | lightItem = menu.add(new MenuItem("Light")); |
---|
1041 | 1151 | lightItem.addActionListener(this); |
---|
1042 | 1152 | menu.add("-"); |
---|
.. | .. |
---|
1046 | 1156 | loopItem.addActionListener(this); |
---|
1047 | 1157 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1048 | 1158 | doubleItem.addActionListener(this); |
---|
| 1159 | + if (Globals.ADVANCED) |
---|
| 1160 | + { |
---|
1049 | 1161 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1050 | 1162 | 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); |
---|
| 1163 | + } |
---|
1060 | 1164 | } |
---|
1061 | 1165 | |
---|
1062 | 1166 | void buildToolsMenu(Menu menu) |
---|
1063 | 1167 | { |
---|
1064 | 1168 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1065 | 1169 | animationItem.addItemListener(this); |
---|
1066 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1170 | + animationItem.setState(Globals.ANIMATION); |
---|
1067 | 1171 | |
---|
1068 | 1172 | menu.add("-"); |
---|
1069 | 1173 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1070 | 1174 | parseverticesItem.addActionListener(this); |
---|
1071 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1175 | + textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
| 1176 | + textureFieldItem.addActionListener(this); |
---|
| 1177 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1072 | 1178 | alignItem.addActionListener(this); |
---|
1073 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1074 | | - mirrorItem.addActionListener(this); |
---|
1075 | 1179 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1076 | 1180 | reduceMorphItem.addActionListener(this); |
---|
1077 | 1181 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1078 | 1182 | reduce34MorphItem.addActionListener(this); |
---|
1079 | | - |
---|
| 1183 | + menu.add("-"); |
---|
1080 | 1184 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1081 | 1185 | computeAOItem.addActionListener(this); |
---|
1082 | | - menu.add("-"); |
---|
1083 | 1186 | |
---|
| 1187 | + if (Globals.ADVANCED) |
---|
| 1188 | + { |
---|
| 1189 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1190 | + mirrorItem.addActionListener(this); |
---|
| 1191 | + menu.add("-"); |
---|
1084 | 1192 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1085 | 1193 | memoryItem.addActionListener(this); |
---|
1086 | 1194 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1094 | 1202 | resetParentItem.addActionListener(this); |
---|
1095 | 1203 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1096 | 1204 | repairParentItem.addActionListener(this); |
---|
| 1205 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1206 | + repairShadowItem.addActionListener(this); |
---|
1097 | 1207 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1098 | 1208 | invariantsItem.addActionListener(this); |
---|
1099 | 1209 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1101 | 1211 | menu.add("-"); |
---|
1102 | 1212 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1103 | 1213 | editScriptItem.addActionListener(this); |
---|
| 1214 | + } |
---|
1104 | 1215 | } |
---|
1105 | 1216 | |
---|
1106 | 1217 | void ScreenFit() |
---|
.. | .. |
---|
1429 | 1540 | |
---|
1430 | 1541 | void Overwrite(int mask) |
---|
1431 | 1542 | { |
---|
1432 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1543 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1433 | 1544 | { |
---|
1434 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1545 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
1435 | 1546 | |
---|
1436 | 1547 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1437 | 1548 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1454 | 1565 | // |
---|
1455 | 1566 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1456 | 1567 | { |
---|
| 1568 | + Object source = event.getSource(); |
---|
1457 | 1569 | /* |
---|
1458 | 1570 | if (event.getSource() == nameField) |
---|
1459 | 1571 | { |
---|
.. | .. |
---|
1465 | 1577 | } |
---|
1466 | 1578 | else |
---|
1467 | 1579 | */ |
---|
1468 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1580 | + if (source == lookAtItem || source == lookFromItem) |
---|
1469 | 1581 | { |
---|
1470 | 1582 | ScreenFit(); |
---|
1471 | 1583 | } else |
---|
1472 | | - if (event.getSource() == switchItem) |
---|
| 1584 | + if (source == switchItem) |
---|
1473 | 1585 | { |
---|
1474 | 1586 | cVector v1 = new cVector(); |
---|
1475 | 1587 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1478 | 1590 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1479 | 1591 | objEditor.cameraView.repaint(); |
---|
1480 | 1592 | } else |
---|
1481 | | - if (event.getSource() == rectoidItem) |
---|
| 1593 | + if (source == rectoidItem) |
---|
1482 | 1594 | { |
---|
1483 | 1595 | makeSomething(new Box()); |
---|
1484 | 1596 | } else |
---|
1485 | | - if (event.getSource() == particleItem) |
---|
| 1597 | + if (source == particleItem) |
---|
1486 | 1598 | { |
---|
1487 | 1599 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1488 | 1600 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1503 | 1615 | applyExample(particleGeom, "SMOKE"); |
---|
1504 | 1616 | makeSomething(particleGeom); |
---|
1505 | 1617 | } else |
---|
1506 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1618 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1507 | 1619 | { |
---|
1508 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1620 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1509 | 1621 | |
---|
1510 | 1622 | ragdoll.toParent = LA.newMatrix(); |
---|
1511 | 1623 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1521 | 1633 | makeSomething(ragdoll); |
---|
1522 | 1634 | //makeSomething(new VehicleDemo()); |
---|
1523 | 1635 | } else |
---|
1524 | | - if (event.getSource() == gridItem) |
---|
| 1636 | + /* |
---|
| 1637 | + */ |
---|
| 1638 | + if (source == heightFieldItem) |
---|
| 1639 | + { |
---|
| 1640 | + Object3D obj = new Object3D(); |
---|
| 1641 | + |
---|
| 1642 | + obj.CreateMaterial(); |
---|
| 1643 | + obj.bRep = new BoundaryRep(); |
---|
| 1644 | + |
---|
| 1645 | + obj.bRep.CreateMesh(new iHeightField() |
---|
| 1646 | + { |
---|
| 1647 | + public double f(double x, double y) |
---|
| 1648 | + { |
---|
| 1649 | + // The Mandelbrot set is represented by coloring |
---|
| 1650 | + // each point (x,y) according to the number of |
---|
| 1651 | + // iterations it takes before the while loop in |
---|
| 1652 | + // this method ends. For points that are actually |
---|
| 1653 | + // in the Mandelbrot set, or very close to it, the |
---|
| 1654 | + // count will reach the maximum value, 80. These |
---|
| 1655 | + // points will be colored purple. All other colors |
---|
| 1656 | + // represent points that are definitely NOT in the set. |
---|
| 1657 | + x -= 600; |
---|
| 1658 | + y -= 500; |
---|
| 1659 | + x /= 200; |
---|
| 1660 | + y /= 200; |
---|
| 1661 | + int count = 0; |
---|
| 1662 | + double zx = x; |
---|
| 1663 | + double zy = y; |
---|
| 1664 | + while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) { |
---|
| 1665 | + double new_zx = zx*zx - zy*zy + x; |
---|
| 1666 | + zy = 2*zx*zy + y; |
---|
| 1667 | + zx = new_zx; |
---|
| 1668 | + count++; |
---|
| 1669 | + } |
---|
| 1670 | + return count; // Math.sqrt(count); |
---|
| 1671 | + } |
---|
| 1672 | + }, 1000,1000); |
---|
| 1673 | + |
---|
| 1674 | + makeSomething(obj); |
---|
| 1675 | + } else |
---|
| 1676 | + if (source == gridItem) |
---|
1525 | 1677 | { |
---|
1526 | 1678 | makeSomething(new Grid()); |
---|
1527 | 1679 | } else |
---|
1528 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1680 | + if (source == ellipsoidItem) |
---|
1529 | 1681 | { |
---|
1530 | 1682 | makeSomething(new Sphere()); |
---|
1531 | 1683 | } else |
---|
1532 | | - if (event.getSource() == coneItem) |
---|
| 1684 | + if (source == coneItem) |
---|
1533 | 1685 | { |
---|
1534 | 1686 | makeSomething(new Cone()); |
---|
1535 | 1687 | } else |
---|
1536 | | - if (event.getSource() == torusItem) |
---|
| 1688 | + if (source == torusItem) |
---|
1537 | 1689 | { |
---|
1538 | 1690 | makeSomething(new Torus()); |
---|
1539 | 1691 | } else |
---|
1540 | | - if (event.getSource() == superItem) |
---|
| 1692 | + if (source == superItem) |
---|
1541 | 1693 | { |
---|
1542 | 1694 | makeSomething(new Superellipsoid()); |
---|
1543 | 1695 | } else |
---|
1544 | | - if (event.getSource() == blobItem) |
---|
| 1696 | + if (source == kleinItem) |
---|
| 1697 | + { |
---|
| 1698 | + makeSomething(new Klein()); |
---|
| 1699 | + } else |
---|
| 1700 | + if (source == blobItem) |
---|
1545 | 1701 | { |
---|
1546 | 1702 | Blob blob = new Blob(); |
---|
1547 | 1703 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1549 | 1705 | //blob.retile(); |
---|
1550 | 1706 | makeSomething(blob); |
---|
1551 | 1707 | } else |
---|
1552 | | - if (event.getSource() == latheItem) |
---|
| 1708 | + if (source == latheItem) |
---|
1553 | 1709 | { |
---|
1554 | 1710 | makeSomething(new Lathe()); |
---|
1555 | 1711 | } else |
---|
1556 | | - if (event.getSource() == bezierItem) |
---|
| 1712 | + if (source == bezierItem) |
---|
1557 | 1713 | { |
---|
1558 | 1714 | makeSomething(new BezierSurface()); |
---|
1559 | 1715 | } else |
---|
1560 | | - if (event.getSource() == checkerItem) |
---|
| 1716 | + if (source == overlayItem) |
---|
1561 | 1717 | { |
---|
1562 | 1718 | /* |
---|
1563 | 1719 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1570 | 1726 | LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent); |
---|
1571 | 1727 | LA.matInvert(obj.toParent, obj.fromParent); |
---|
1572 | 1728 | */ |
---|
1573 | | - makeSomething(new CheckerIG()); |
---|
| 1729 | + makeSomething(new Checker()); |
---|
1574 | 1730 | } else |
---|
1575 | | - if (event.getSource() == meshItem) |
---|
| 1731 | + if (source == meshItem) |
---|
1576 | 1732 | { |
---|
1577 | 1733 | Object3D itemtomake = new Object3D(); |
---|
1578 | 1734 | Object3D child; |
---|
.. | .. |
---|
1593 | 1749 | makeSomething(child); |
---|
1594 | 1750 | } |
---|
1595 | 1751 | } else |
---|
1596 | | - if (event.getSource() == springItem) |
---|
| 1752 | + if (source == springItem) |
---|
1597 | 1753 | { |
---|
1598 | 1754 | cSpring s = new cSpring(); |
---|
1599 | 1755 | s.setup(); |
---|
1600 | 1756 | makeSomething(s); |
---|
1601 | 1757 | } else |
---|
1602 | | - if (event.getSource() == flagItem) |
---|
| 1758 | + if (source == flagItem) |
---|
1603 | 1759 | { |
---|
1604 | 1760 | cSpring s = new cFlag(); |
---|
1605 | 1761 | s.setup(); |
---|
1606 | 1762 | makeSomething(s); |
---|
1607 | 1763 | } else |
---|
1608 | | - if (event.getSource() == lightItem) |
---|
| 1764 | + if (source == lightItem) |
---|
1609 | 1765 | { |
---|
1610 | 1766 | makeSomething(new Light()); |
---|
1611 | 1767 | } else |
---|
1612 | | - if (event.getSource() == csgItem) |
---|
| 1768 | + if (source == csgItem) |
---|
1613 | 1769 | { |
---|
1614 | 1770 | group(new CSG()); |
---|
1615 | 1771 | } else |
---|
1616 | | - if (event.getSource() == templateItem) |
---|
| 1772 | + if (source == templateItem) |
---|
1617 | 1773 | { |
---|
1618 | 1774 | group(new cTemplate()); |
---|
1619 | 1775 | } else |
---|
1620 | | - if (event.getSource() == attributeItem) |
---|
| 1776 | + if (source == attributeItem) |
---|
1621 | 1777 | { |
---|
1622 | 1778 | makeSomething(new Attribute()); |
---|
1623 | 1779 | } else |
---|
1624 | | - if (event.getSource() == pointflowItem) |
---|
| 1780 | + if (source == pointflowItem) |
---|
1625 | 1781 | { |
---|
1626 | 1782 | makeSomething(new PointFlow()); |
---|
1627 | 1783 | } else |
---|
.. | .. |
---|
1633 | 1789 | } else |
---|
1634 | 1790 | */ |
---|
1635 | 1791 | |
---|
1636 | | - if (event.getSource() == superLoopItem) |
---|
| 1792 | + if (source == superLoopItem) |
---|
1637 | 1793 | { |
---|
1638 | 1794 | Composite g = new cGroup(); |
---|
1639 | 1795 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1655 | 1811 | |
---|
1656 | 1812 | group(g); |
---|
1657 | 1813 | } else |
---|
1658 | | - if (event.getSource() == loopItem) |
---|
| 1814 | + if (source == loopItem) |
---|
1659 | 1815 | { |
---|
1660 | 1816 | Composite csg = new GroupLeaf(); |
---|
1661 | 1817 | csg.count = 5; |
---|
.. | .. |
---|
1664 | 1820 | csg.addChild(child); |
---|
1665 | 1821 | child.addChild(csg); |
---|
1666 | 1822 | } else |
---|
1667 | | - if (event.getSource() == doubleItem) |
---|
| 1823 | + if (source == doubleItem) |
---|
1668 | 1824 | { |
---|
1669 | 1825 | Composite csg = new GroupLeaf(); |
---|
1670 | 1826 | csg.count = 5; |
---|
.. | .. |
---|
1676 | 1832 | csg.addChild(child); |
---|
1677 | 1833 | child.addChild(csg); |
---|
1678 | 1834 | } else |
---|
1679 | | - if (event.getSource() == tripleItem) |
---|
| 1835 | + if (source == tripleItem) |
---|
1680 | 1836 | { |
---|
1681 | 1837 | Composite csg = new GroupLeaf(); |
---|
1682 | 1838 | csg.count = 4; |
---|
.. | .. |
---|
1692 | 1848 | child.addChild(csg); |
---|
1693 | 1849 | } else |
---|
1694 | 1850 | |
---|
1695 | | - if (event.getSource() == importGFDItem) |
---|
| 1851 | + if (source == importGFDItem) |
---|
1696 | 1852 | { |
---|
1697 | 1853 | ImportGFD(); |
---|
1698 | 1854 | } else |
---|
1699 | | - if (event.getSource() == importVRMLX3DItem) |
---|
| 1855 | + if (source == importVRMLX3DItem) |
---|
1700 | 1856 | { |
---|
1701 | 1857 | ImportVRMLX3D(); |
---|
1702 | 1858 | } else |
---|
1703 | | - if (event.getSource() == import3DSItem) |
---|
| 1859 | + if (source == import3DSItem) |
---|
1704 | 1860 | { |
---|
1705 | 1861 | objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1706 | 1862 | } else |
---|
1707 | | - if (event.getSource() == importOBJItem) |
---|
| 1863 | + if (source == importOBJItem) |
---|
1708 | 1864 | { |
---|
1709 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1865 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1866 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 1867 | + browser.setVisible(true); |
---|
| 1868 | + String filename = browser.getFile(); |
---|
| 1869 | + if (filename != null && filename.length() > 0) |
---|
| 1870 | + { |
---|
| 1871 | + String fullname = browser.getDirectory() + filename; |
---|
| 1872 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 1873 | + } |
---|
1710 | 1874 | } else |
---|
1711 | | - if (event.getSource() == computeAOItem) |
---|
| 1875 | + if (source == computeAOItem) |
---|
1712 | 1876 | { |
---|
1713 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1714 | | - CameraPane.theRenderer.repaint(); |
---|
| 1877 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1878 | + Globals.theRenderer.repaint(); |
---|
1715 | 1879 | } else |
---|
1716 | | - if (event.getSource() == recompileItem) |
---|
| 1880 | + if (source == recompileItem) |
---|
1717 | 1881 | { |
---|
1718 | 1882 | Recompile(); |
---|
1719 | 1883 | refreshContents(); |
---|
1720 | 1884 | } else |
---|
1721 | | - if (event.getSource() == editScriptItem) |
---|
| 1885 | + if (source == editScriptItem) |
---|
1722 | 1886 | { |
---|
1723 | 1887 | OpenDialog(); |
---|
1724 | 1888 | refreshContents(); |
---|
1725 | 1889 | } else |
---|
1726 | | - if (event.getSource() == invariantsItem) |
---|
| 1890 | + if (source == invariantsItem) |
---|
1727 | 1891 | { |
---|
1728 | 1892 | System.out.println("Invariants:"); |
---|
1729 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 1893 | + GrafreeD.grafreeD.universe.invariants(); |
---|
1730 | 1894 | } else |
---|
1731 | | - if (event.getSource() == memoryItem) |
---|
| 1895 | + if (source == memoryItem) |
---|
1732 | 1896 | { |
---|
1733 | 1897 | //System.out.println("Invariants:"); |
---|
1734 | 1898 | PrintMemory(); |
---|
1735 | 1899 | } else |
---|
1736 | | - if (event.getSource() == pathItem) |
---|
| 1900 | + if (source == pathItem) |
---|
1737 | 1901 | { |
---|
1738 | 1902 | PrintPath(); |
---|
1739 | 1903 | } else |
---|
1740 | | - if (event.getSource() == analyzeItem) |
---|
| 1904 | + if (source == analyzeItem) |
---|
1741 | 1905 | { |
---|
1742 | 1906 | AnalyzeObject(); |
---|
1743 | 1907 | } else |
---|
1744 | | - if (event.getSource() == dumpItem) |
---|
| 1908 | + if (source == dumpItem) |
---|
1745 | 1909 | { |
---|
1746 | 1910 | DumpObject(); |
---|
1747 | 1911 | } else |
---|
1748 | | - if (event.getSource() == screenfitButton) |
---|
| 1912 | + if (source == oneStepButton) |
---|
| 1913 | + { |
---|
| 1914 | + Globals.ONESTEP = true; |
---|
| 1915 | + cameraView.repaint(); |
---|
| 1916 | + } else |
---|
| 1917 | + if (source == screenfitButton) |
---|
1749 | 1918 | { |
---|
1750 | 1919 | //Reload(lastConverter, lastFilename, true); |
---|
1751 | 1920 | ScreenFit(); |
---|
1752 | 1921 | } else |
---|
1753 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1922 | + if (source == screenfitpointButton) |
---|
1754 | 1923 | { |
---|
1755 | 1924 | //Reload(lastConverter, lastFilename, true); |
---|
1756 | 1925 | ScreenFitPoint(); |
---|
1757 | 1926 | } else |
---|
1758 | | - if (event.getSource() == snapobjectButton) |
---|
| 1927 | + if (source == snapobjectButton) |
---|
1759 | 1928 | { |
---|
1760 | 1929 | //Reload(lastConverter, lastFilename, true); |
---|
1761 | 1930 | SnapObject(); |
---|
.. | .. |
---|
1766 | 1935 | // Recompile(); |
---|
1767 | 1936 | // refreshContents(); |
---|
1768 | 1937 | // } else |
---|
1769 | | - if (event.getSource() == gcButton) |
---|
| 1938 | + if (source == gcButton) |
---|
1770 | 1939 | { |
---|
1771 | 1940 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1772 | 1941 | System.gc(); |
---|
1773 | 1942 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1774 | 1943 | } else |
---|
1775 | | - if (event.getSource() == editLeafItem) |
---|
| 1944 | + if (source == editLeafItem) |
---|
1776 | 1945 | { |
---|
1777 | 1946 | Object3D obj; |
---|
1778 | 1947 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1786 | 1955 | } |
---|
1787 | 1956 | refreshContents(true); |
---|
1788 | 1957 | } else |
---|
1789 | | - if (event.getSource() == openWindowItem) |
---|
| 1958 | + if (source == openWindowItem) |
---|
1790 | 1959 | { |
---|
1791 | 1960 | EditSelection(true); |
---|
1792 | 1961 | } else |
---|
1793 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 1962 | + if (source == cutItem || source == clearButton) |
---|
1794 | 1963 | { |
---|
1795 | 1964 | loadClipboard(true); |
---|
1796 | 1965 | } else |
---|
1797 | | - if (event.getSource() == duplicateItem) |
---|
| 1966 | + if (source == duplicateItem) |
---|
1798 | 1967 | { |
---|
1799 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 1968 | + Object3D keep = GrafreeD.clipboard; |
---|
1800 | 1969 | loadClipboard(false); |
---|
1801 | 1970 | paste(false); |
---|
1802 | | - GraphreeD.clipboard = keep; |
---|
| 1971 | + GrafreeD.clipboard = keep; |
---|
1803 | 1972 | } else |
---|
1804 | | - if (event.getSource() == cloneItem) |
---|
| 1973 | + if (source == cloneItem) |
---|
1805 | 1974 | { |
---|
1806 | 1975 | CloneSelection(false); |
---|
1807 | 1976 | } else |
---|
1808 | | - if (event.getSource() == cloneSupportItem) |
---|
| 1977 | + if (source == cloneSupportItem) |
---|
1809 | 1978 | { |
---|
1810 | 1979 | CloneSelection(true); |
---|
1811 | 1980 | } else |
---|
1812 | | - if (event.getSource() == copyItem) |
---|
| 1981 | + if (source == copyItem) |
---|
1813 | 1982 | { |
---|
1814 | 1983 | loadClipboard(false); |
---|
1815 | 1984 | } else |
---|
1816 | | - if (event.getSource() == pasteItem) |
---|
| 1985 | + if (source == pasteItem) |
---|
1817 | 1986 | { |
---|
1818 | 1987 | paste(false); |
---|
1819 | 1988 | } else |
---|
1820 | | - if (event.getSource() == pasteLinkItem) |
---|
| 1989 | + if (source == pasteIntoItem) |
---|
1821 | 1990 | { |
---|
1822 | | - pasteInto(false); |
---|
| 1991 | + pasteInto(true, false); |
---|
1823 | 1992 | } else |
---|
1824 | | - if (event.getSource() == pasteCloneItem) |
---|
| 1993 | + if (source == pasteLinkItem) |
---|
1825 | 1994 | { |
---|
1826 | | - pasteInto(true); |
---|
| 1995 | + pasteInto(false, false); |
---|
1827 | 1996 | } else |
---|
1828 | | - if (event.getSource() == pasteExpandItem) |
---|
| 1997 | + if (source == pasteCloneItem) |
---|
| 1998 | + { |
---|
| 1999 | + pasteInto(true, true); |
---|
| 2000 | + } else |
---|
| 2001 | + if (source == pasteExpandItem) |
---|
1829 | 2002 | { |
---|
1830 | 2003 | paste(true); |
---|
1831 | 2004 | } else |
---|
1832 | | - if (event.getSource() == synchronizeItem) |
---|
| 2005 | + if (source == synchronizeItem) |
---|
1833 | 2006 | { |
---|
1834 | 2007 | Overwrite(Object3D.TRANSFORM); |
---|
1835 | 2008 | } else |
---|
1836 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2009 | + if (source == overwriteNameItem) |
---|
1837 | 2010 | { |
---|
1838 | 2011 | Overwrite(Object3D.NAME); |
---|
1839 | 2012 | } else |
---|
1840 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2013 | + if (source == overwriteUVItem) |
---|
1841 | 2014 | { |
---|
1842 | 2015 | Overwrite(Object3D.UV); |
---|
1843 | 2016 | } else |
---|
1844 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2017 | + if (source == overwriteMatItem) |
---|
1845 | 2018 | { |
---|
| 2019 | + /* july 2015 |
---|
1846 | 2020 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1847 | | - Overwrite(Object3D.MATERIAL); |
---|
| 2021 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1848 | 2022 | else |
---|
1849 | 2023 | { |
---|
1850 | 2024 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1856 | 2030 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1857 | 2031 | } |
---|
1858 | 2032 | } |
---|
| 2033 | + */ |
---|
| 2034 | + |
---|
| 2035 | + Overwrite(dropAttributes); |
---|
1859 | 2036 | } |
---|
1860 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2037 | + if (source == overwriteGeoItem) |
---|
1861 | 2038 | { |
---|
1862 | 2039 | Overwrite(Object3D.GEOMETRY); |
---|
1863 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2040 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1864 | 2041 | // { |
---|
1865 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2042 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1866 | 2043 | // |
---|
1867 | 2044 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1868 | 2045 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1874 | 2051 | // refreshContents(); |
---|
1875 | 2052 | // } |
---|
1876 | 2053 | } else |
---|
1877 | | - if (event.getSource() == generateMeshItem) |
---|
| 2054 | + if (source == generateMeshItem) |
---|
1878 | 2055 | { |
---|
1879 | 2056 | //if (group.selection.size() == 1) |
---|
1880 | 2057 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1885 | 2062 | ResetModel(); |
---|
1886 | 2063 | refreshContents(); |
---|
1887 | 2064 | } else |
---|
1888 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2065 | + if (source == extractGeometriesItem) |
---|
1889 | 2066 | { |
---|
1890 | 2067 | boolean one = false; |
---|
1891 | 2068 | |
---|
.. | .. |
---|
1912 | 2089 | ResetModel(); |
---|
1913 | 2090 | refreshContents(); |
---|
1914 | 2091 | } else |
---|
1915 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2092 | + if (source == cloneGeometriesItem) |
---|
1916 | 2093 | { |
---|
1917 | 2094 | boolean one = false; |
---|
1918 | 2095 | |
---|
.. | .. |
---|
1938 | 2115 | ResetModel(); |
---|
1939 | 2116 | refreshContents(); |
---|
1940 | 2117 | } else |
---|
1941 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2118 | + if (source == shareGeometriesItem) |
---|
1942 | 2119 | { |
---|
1943 | 2120 | boolean one = false; |
---|
1944 | 2121 | |
---|
1945 | 2122 | if (group.selection.size() == 1) |
---|
1946 | 2123 | one = true; |
---|
1947 | 2124 | |
---|
| 2125 | + Object3D merge = null; |
---|
| 2126 | + |
---|
1948 | 2127 | Object3D content = new cGroup(); |
---|
1949 | 2128 | |
---|
1950 | 2129 | for (int i=0; i<group.selection.size(); i++) |
---|
1951 | 2130 | { |
---|
1952 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2131 | + merge = new Merge(group.selection.get(i)); |
---|
1953 | 2132 | |
---|
1954 | 2133 | if (one) |
---|
1955 | | - makeSomething(sel, false); |
---|
| 2134 | + makeSomething(merge, false); |
---|
1956 | 2135 | else |
---|
1957 | | - content.addChild(sel); |
---|
| 2136 | + content.addChild(merge); |
---|
1958 | 2137 | } |
---|
1959 | 2138 | |
---|
1960 | 2139 | if (!one) |
---|
1961 | | - makeSomething(content, false); |
---|
1962 | | - |
---|
1963 | | - ResetModel(); |
---|
1964 | | - refreshContents(); |
---|
| 2140 | + makeSomething(content, true); |
---|
| 2141 | + else |
---|
| 2142 | + { |
---|
| 2143 | + ResetModel(); |
---|
| 2144 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2145 | + refreshContents(); |
---|
| 2146 | + } |
---|
1965 | 2147 | } else |
---|
1966 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2148 | + if (source == mergeGeometriesItem) |
---|
1967 | 2149 | { |
---|
1968 | 2150 | boolean one = false; |
---|
1969 | 2151 | |
---|
.. | .. |
---|
1993 | 2175 | ResetModel(); |
---|
1994 | 2176 | refreshContents(); |
---|
1995 | 2177 | } else |
---|
1996 | | - if (event.getSource() == linkverticesItem) |
---|
| 2178 | + if (source == linkverticesItem) |
---|
1997 | 2179 | { |
---|
1998 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2180 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
1999 | 2181 | // { |
---|
2000 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2182 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2001 | 2183 | // |
---|
2002 | 2184 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2003 | 2185 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2006 | 2188 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2007 | 2189 | // refreshContents(); |
---|
2008 | 2190 | // } |
---|
2009 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2191 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
2010 | 2192 | { |
---|
2011 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2193 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2012 | 2194 | |
---|
2013 | 2195 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2014 | 2196 | content = ((cGroup)content).get(0); |
---|
2015 | 2197 | |
---|
2016 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2198 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2017 | 2199 | for (int i=0; i<group.selection.size(); i++) |
---|
2018 | 2200 | { |
---|
2019 | | - boolean random = CameraPane.RANDOM; |
---|
2020 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2201 | + boolean random = CameraPane.SWITCH; |
---|
| 2202 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2021 | 2203 | group.selection.get(i).linkVerticesThis(content); |
---|
2022 | 2204 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2023 | | - CameraPane.RANDOM = random; |
---|
| 2205 | + CameraPane.SWITCH = random; |
---|
2024 | 2206 | } |
---|
2025 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2207 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2026 | 2208 | refreshContents(); |
---|
2027 | 2209 | } |
---|
2028 | 2210 | } else |
---|
2029 | | - if (event.getSource() == resetsupportItem) |
---|
| 2211 | + if (source == resetsupportItem) |
---|
2030 | 2212 | { |
---|
2031 | 2213 | for (int i=0; i<group.selection.size(); i++) |
---|
2032 | 2214 | { |
---|
2033 | | - boolean random = CameraPane.RANDOM; |
---|
2034 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2215 | + boolean random = CameraPane.SWITCH; |
---|
| 2216 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2035 | 2217 | group.selection.get(i).linkVerticesThis(null); |
---|
2036 | | - CameraPane.RANDOM = random; |
---|
| 2218 | + CameraPane.SWITCH = random; |
---|
2037 | 2219 | } |
---|
2038 | 2220 | |
---|
2039 | 2221 | refreshContents(); |
---|
2040 | 2222 | } else |
---|
2041 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2223 | + if (source == relinkverticesItem) |
---|
| 2224 | + { |
---|
| 2225 | + boolean random = CameraPane.SWITCH; |
---|
| 2226 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2227 | + group.selection.RelinkToSupport(); |
---|
| 2228 | + CameraPane.SWITCH = random; |
---|
| 2229 | + |
---|
| 2230 | + refreshContents(); |
---|
| 2231 | + } else |
---|
| 2232 | + if (source == resetreferencesItem) |
---|
2042 | 2233 | { |
---|
2043 | 2234 | for (int i=0; i<group.selection.size(); i++) |
---|
2044 | 2235 | { |
---|
.. | .. |
---|
2047 | 2238 | |
---|
2048 | 2239 | refreshContents(); |
---|
2049 | 2240 | } else |
---|
2050 | | - if (event.getSource() == setMasterItem) |
---|
| 2241 | + if (source == setMasterItem) |
---|
2051 | 2242 | { |
---|
2052 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2243 | + if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2053 | 2244 | { |
---|
2054 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2245 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2055 | 2246 | |
---|
2056 | 2247 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2057 | 2248 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2060 | 2251 | refreshContents(); |
---|
2061 | 2252 | } |
---|
2062 | 2253 | } else |
---|
2063 | | - if (event.getSource() == poseMeshItem) |
---|
| 2254 | + if (source == poseMeshItem) |
---|
2064 | 2255 | { |
---|
2065 | 2256 | if (group.selection.size() == 1) |
---|
2066 | 2257 | { |
---|
2067 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2258 | + if (GrafreeD.clipboard.size() == 1) |
---|
2068 | 2259 | { |
---|
2069 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2260 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2070 | 2261 | |
---|
2071 | 2262 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2072 | 2263 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2079 | 2270 | } |
---|
2080 | 2271 | |
---|
2081 | 2272 | } else |
---|
2082 | | - if (event.getSource() == revertMeshItem) |
---|
| 2273 | + if (source == revertMeshItem) |
---|
2083 | 2274 | { |
---|
2084 | 2275 | RevertMeshes(); |
---|
2085 | 2276 | } else |
---|
2086 | | - if (event.getSource() == resetMeshItem) |
---|
| 2277 | + if (source == resetMeshItem) |
---|
2087 | 2278 | { |
---|
2088 | 2279 | ResetAll(); |
---|
2089 | 2280 | } else |
---|
2090 | | - if (event.getSource() == stepAllItem) |
---|
| 2281 | + if (source == stepAllItem) |
---|
2091 | 2282 | { |
---|
2092 | 2283 | StepAll(); |
---|
2093 | 2284 | } else |
---|
2094 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2285 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2095 | 2286 | { |
---|
2096 | 2287 | //int indices[] = jList.getSelectedIndices(); |
---|
2097 | 2288 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2099 | 2290 | |
---|
2100 | 2291 | ClearSelection(false); |
---|
2101 | 2292 | } else |
---|
2102 | | - if (event.getSource() == clearAllItem) |
---|
| 2293 | + if (source == clearAllItem) |
---|
2103 | 2294 | { |
---|
2104 | 2295 | ClearSelection(true); |
---|
2105 | 2296 | } else |
---|
2106 | | - if (event.getSource() == grabItem) |
---|
| 2297 | + if (source == grabItem) |
---|
2107 | 2298 | { |
---|
2108 | 2299 | group(new cGroup(), true); |
---|
2109 | 2300 | } else |
---|
2110 | | - if (event.getSource() == frontItem) |
---|
| 2301 | + if (source == hideItem) |
---|
| 2302 | + { |
---|
| 2303 | + group(new HiddenObject()); |
---|
| 2304 | + } else |
---|
| 2305 | + if (source == frontItem) |
---|
2111 | 2306 | { |
---|
2112 | 2307 | front(); |
---|
2113 | 2308 | } else |
---|
2114 | | - if (event.getSource() == backItem) |
---|
| 2309 | + if (source == backItem) |
---|
2115 | 2310 | { |
---|
2116 | 2311 | back(); |
---|
2117 | 2312 | } else |
---|
2118 | | - if (event.getSource() == cameraItem) |
---|
| 2313 | + if (source == cameraItem) |
---|
2119 | 2314 | { |
---|
2120 | 2315 | makeSomething(new Camera()); |
---|
2121 | 2316 | } else |
---|
2122 | | - if (event.getSource() == compositeItem) |
---|
| 2317 | + if (source == compositeItem) |
---|
2123 | 2318 | { |
---|
2124 | 2319 | group(new Composite()); |
---|
2125 | 2320 | } else |
---|
2126 | | - if (event.getSource() == randomItem) |
---|
| 2321 | + if (source == randomItem) |
---|
2127 | 2322 | { |
---|
2128 | 2323 | RandomNode random = new RandomNode(); |
---|
2129 | 2324 | group(random); |
---|
2130 | 2325 | if (random.size() > 0) |
---|
2131 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2326 | + random.name = random.get(0).name + "Switch"; |
---|
2132 | 2327 | } else |
---|
2133 | | - if (event.getSource() == physicsItem) |
---|
| 2328 | + if (source == physicsItem) |
---|
2134 | 2329 | { |
---|
2135 | 2330 | group(new PhysicsNode()); |
---|
2136 | 2331 | } else |
---|
2137 | | - if (event.getSource() == frameselectorItem) |
---|
| 2332 | + if (source == frameselectorItem) |
---|
2138 | 2333 | { |
---|
2139 | 2334 | for (int i=0; i<group.selection.size(); i++) |
---|
2140 | 2335 | { |
---|
.. | .. |
---|
2146 | 2341 | ResetModel(); |
---|
2147 | 2342 | refreshContents(); |
---|
2148 | 2343 | } else |
---|
2149 | | - if (event.getSource() == switchGeoItem) |
---|
| 2344 | + if (source == switchGeoItem) |
---|
2150 | 2345 | { |
---|
2151 | 2346 | for (int i=0; i<group.selection.size(); i++) |
---|
2152 | 2347 | { |
---|
.. | .. |
---|
2158 | 2353 | ResetModel(); |
---|
2159 | 2354 | refreshContents(); |
---|
2160 | 2355 | } else |
---|
2161 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2356 | + if (source == switchTransfoItem) |
---|
2162 | 2357 | { |
---|
2163 | 2358 | for (int i=0; i<group.selection.size(); i++) |
---|
2164 | 2359 | { |
---|
.. | .. |
---|
2170 | 2365 | ResetModel(); |
---|
2171 | 2366 | refreshContents(); |
---|
2172 | 2367 | } else |
---|
2173 | | - if (event.getSource() == morphItem) |
---|
| 2368 | + if (source == morphItem) |
---|
2174 | 2369 | { |
---|
2175 | 2370 | for (int i=0; i<group.selection.size(); i++) |
---|
2176 | 2371 | { |
---|
.. | .. |
---|
2182 | 2377 | ResetModel(); |
---|
2183 | 2378 | refreshContents(); |
---|
2184 | 2379 | } else |
---|
2185 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2380 | + if (source == scriptNodeItem) |
---|
2186 | 2381 | { |
---|
2187 | 2382 | boolean atleastone = false; |
---|
2188 | 2383 | |
---|
.. | .. |
---|
2221 | 2416 | } |
---|
2222 | 2417 | } |
---|
2223 | 2418 | } else |
---|
2224 | | - if (event.getSource() == linkerItem) |
---|
| 2419 | + if (source == linkerItem) |
---|
2225 | 2420 | { |
---|
2226 | 2421 | group(new cLinker()); |
---|
2227 | 2422 | } else |
---|
2228 | | - if (event.getSource() == textureItem) |
---|
| 2423 | + if (source == textureItem) |
---|
2229 | 2424 | { |
---|
2230 | 2425 | group(new TextureNode()); |
---|
2231 | 2426 | } else |
---|
2232 | | - if (event.getSource() == shadowXItem) |
---|
| 2427 | + if (source == billboardItem) |
---|
| 2428 | + { |
---|
| 2429 | + group(new BillboardNode()); |
---|
| 2430 | + } else |
---|
| 2431 | + if (source == shadowXItem) |
---|
2233 | 2432 | { |
---|
2234 | 2433 | CastShadow(0); |
---|
2235 | 2434 | } else |
---|
2236 | | - if (event.getSource() == shadowYItem) |
---|
| 2435 | + if (source == shadowYItem) |
---|
2237 | 2436 | { |
---|
2238 | 2437 | CastShadow(1); |
---|
2239 | 2438 | } else |
---|
2240 | | - if (event.getSource() == shadowZItem) |
---|
| 2439 | + if (source == shadowZItem) |
---|
2241 | 2440 | { |
---|
2242 | 2441 | CastShadow(2); |
---|
2243 | 2442 | } else |
---|
2244 | | - if (event.getSource() == ungroupItem) |
---|
| 2443 | + if (source == ungroupItem) |
---|
2245 | 2444 | { |
---|
2246 | | - ungroup(); |
---|
| 2445 | + //ungroup(); |
---|
| 2446 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2447 | + { |
---|
| 2448 | + Ungroup(group.selection.get(i)); |
---|
| 2449 | + } |
---|
| 2450 | + |
---|
| 2451 | + ClearSelection(false); |
---|
| 2452 | + |
---|
| 2453 | + refreshContents(); |
---|
2247 | 2454 | } else |
---|
2248 | | - if (event.getSource() == genUVItem) |
---|
| 2455 | + if (source == genUVItem) |
---|
2249 | 2456 | { |
---|
2250 | 2457 | GenUV(); |
---|
2251 | 2458 | } else |
---|
2252 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2459 | + if (source == genNormalsCADItem) |
---|
2253 | 2460 | { |
---|
2254 | 2461 | GenNormals(true); |
---|
2255 | 2462 | } else |
---|
2256 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2463 | + if (source == genNormalsMESHItem) |
---|
| 2464 | + { |
---|
| 2465 | + GenNormals(true); // TODO |
---|
| 2466 | + } else |
---|
| 2467 | + if (source == genNormalsORGANItem) |
---|
2257 | 2468 | { |
---|
2258 | 2469 | GenNormals(false); |
---|
2259 | 2470 | } else |
---|
2260 | | - if (event.getSource() == stripifyItem) |
---|
| 2471 | + if (source == genNormalsMINEItem) |
---|
| 2472 | + { |
---|
| 2473 | + GenNormalsMINE(); |
---|
| 2474 | + } else |
---|
| 2475 | + if (source == stripifyItem) |
---|
2261 | 2476 | { |
---|
2262 | 2477 | Stripify(); |
---|
2263 | 2478 | } else |
---|
2264 | | - if (event.getSource() == unstripifyItem) |
---|
| 2479 | + if (source == unstripifyItem) |
---|
2265 | 2480 | { |
---|
2266 | 2481 | Unstripify(); |
---|
2267 | 2482 | } else |
---|
2268 | | - if (event.getSource() == trimItem) |
---|
| 2483 | + if (source == trimItem) |
---|
2269 | 2484 | { |
---|
2270 | 2485 | Trim(); |
---|
2271 | 2486 | } else |
---|
2272 | | - if (event.getSource() == untrimItem) |
---|
| 2487 | + if (source == untrimItem) |
---|
2273 | 2488 | { |
---|
2274 | 2489 | Untrim(); |
---|
2275 | 2490 | } else |
---|
2276 | | - if (event.getSource() == clearColorsItem) |
---|
| 2491 | + if (source == clearColorsItem) |
---|
2277 | 2492 | { |
---|
2278 | 2493 | ClearColors(); |
---|
2279 | 2494 | } else |
---|
2280 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2495 | + if (source == clearMaterialsItem) |
---|
2281 | 2496 | { |
---|
2282 | 2497 | ClearMaterials(); |
---|
2283 | 2498 | } else |
---|
2284 | | - if (event.getSource() == liveleavesItem) |
---|
| 2499 | + if (source == liveleavesItem) |
---|
2285 | 2500 | { |
---|
2286 | 2501 | LiveLeaves(true); |
---|
2287 | 2502 | } else |
---|
2288 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2503 | + if (source == unliveleavesItem) |
---|
2289 | 2504 | { |
---|
2290 | 2505 | LiveLeaves(false); |
---|
2291 | 2506 | } else |
---|
2292 | | - if (event.getSource() == supportleavesItem) |
---|
| 2507 | + if (source == supportleavesItem) |
---|
2293 | 2508 | { |
---|
2294 | 2509 | SupportLeaves(true); |
---|
2295 | 2510 | } else |
---|
2296 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2511 | + if (source == unsupportleavesItem) |
---|
2297 | 2512 | { |
---|
2298 | 2513 | SupportLeaves(false); |
---|
2299 | 2514 | } else |
---|
2300 | | - if (event.getSource() == hideleavesItem) |
---|
| 2515 | + if (source == hideleavesItem) |
---|
2301 | 2516 | { |
---|
2302 | 2517 | HideLeaves(true); |
---|
2303 | 2518 | } else |
---|
2304 | | - if (event.getSource() == showleavesItem) |
---|
| 2519 | + if (source == showleavesItem) |
---|
2305 | 2520 | { |
---|
2306 | 2521 | HideLeaves(false); |
---|
2307 | 2522 | } else |
---|
2308 | | - if (event.getSource() == markleavesItem) |
---|
| 2523 | + if (source == markleavesItem) |
---|
2309 | 2524 | { |
---|
2310 | 2525 | MarkLeaves(true); |
---|
2311 | 2526 | } else |
---|
2312 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2527 | + if (source == unmarkleavesItem) |
---|
2313 | 2528 | { |
---|
2314 | 2529 | MarkLeaves(false); |
---|
2315 | 2530 | } else |
---|
2316 | | - if (event.getSource() == flipVItem) |
---|
| 2531 | + if (source == flipVItem) |
---|
2317 | 2532 | { |
---|
2318 | 2533 | FlipV(true); |
---|
2319 | 2534 | } else |
---|
2320 | | - if (event.getSource() == unflipVItem) |
---|
| 2535 | + if (source == unflipVItem) |
---|
2321 | 2536 | { |
---|
2322 | 2537 | FlipV(false); |
---|
2323 | 2538 | } else |
---|
2324 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2539 | + if (source == lowTexturesItem) |
---|
2325 | 2540 | { |
---|
2326 | 2541 | SetTexRes(0); |
---|
2327 | 2542 | } else |
---|
2328 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2543 | + if (source == normalTexturesItem) |
---|
2329 | 2544 | { |
---|
2330 | 2545 | SetTexRes(1); |
---|
2331 | 2546 | } else |
---|
2332 | | - if (event.getSource() == highTexturesItem) |
---|
| 2547 | + if (source == highTexturesItem) |
---|
2333 | 2548 | { |
---|
2334 | 2549 | SetTexRes(2); |
---|
2335 | 2550 | } else |
---|
2336 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2551 | + if (source == veryhighTexturesItem) |
---|
2337 | 2552 | { |
---|
2338 | 2553 | SetTexRes(3); |
---|
2339 | 2554 | } else |
---|
2340 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2555 | + if (source == maxTexturesItem) |
---|
2341 | 2556 | { |
---|
2342 | 2557 | SetTexRes(4); |
---|
2343 | 2558 | } else |
---|
2344 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2559 | + if (source == panoTexturesItem) |
---|
2345 | 2560 | { |
---|
2346 | 2561 | SetTexRes(5); |
---|
2347 | 2562 | } else |
---|
2348 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2563 | + if (source == reverseNormalsItem) |
---|
2349 | 2564 | { |
---|
2350 | 2565 | ReverseNormals(); |
---|
2351 | 2566 | } else |
---|
2352 | | - if (event.getSource() == parseverticesItem) |
---|
| 2567 | + if (source == parseverticesItem) |
---|
2353 | 2568 | { |
---|
2354 | 2569 | ParseVertices(); |
---|
2355 | 2570 | } else |
---|
2356 | | - if (event.getSource() == alignItem) |
---|
| 2571 | + if (source == textureFieldItem) |
---|
| 2572 | + { |
---|
| 2573 | + TextureVertices(); |
---|
| 2574 | + } else |
---|
| 2575 | + if (source == alignItem) |
---|
2357 | 2576 | { |
---|
2358 | 2577 | Align(); |
---|
2359 | 2578 | } else |
---|
2360 | | - if (event.getSource() == mirrorItem) |
---|
| 2579 | + if (source == mirrorItem) |
---|
2361 | 2580 | { |
---|
2362 | 2581 | MirrorPoses(); |
---|
2363 | 2582 | } else |
---|
2364 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2583 | + if (source == reduceMorphItem) |
---|
2365 | 2584 | { |
---|
2366 | 2585 | MeshReduction(false); |
---|
2367 | 2586 | } else |
---|
2368 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2587 | + if (source == reduce34MorphItem) |
---|
2369 | 2588 | { |
---|
2370 | 2589 | MeshReduction(true); |
---|
2371 | 2590 | } else |
---|
2372 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2591 | + if (source == reverseTrianglesItem) |
---|
2373 | 2592 | { |
---|
2374 | 2593 | ReverseTriangles(); |
---|
2375 | 2594 | } else |
---|
2376 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2595 | + if (source == reduceMeshItem) |
---|
2377 | 2596 | { |
---|
2378 | 2597 | ReduceMesh(false); |
---|
2379 | 2598 | } else |
---|
2380 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2599 | + if (source == reduce34MeshItem) |
---|
2381 | 2600 | { |
---|
2382 | 2601 | ReduceMesh(true); |
---|
2383 | 2602 | } else |
---|
2384 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2603 | + if (source == increaseMeshItem) |
---|
2385 | 2604 | { |
---|
2386 | 2605 | IncreaseMesh(); |
---|
2387 | 2606 | } else |
---|
2388 | | - if (event.getSource() == clipMeshItem) |
---|
| 2607 | + if (source == clipMeshItem) |
---|
2389 | 2608 | { |
---|
2390 | 2609 | ClipMesh(); |
---|
2391 | 2610 | } else |
---|
2392 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2611 | + if (source == smoothMeshItem) |
---|
2393 | 2612 | { |
---|
2394 | 2613 | SmoothMesh(); |
---|
2395 | 2614 | } else |
---|
2396 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2615 | + if (source == transformgeometryItem) |
---|
2397 | 2616 | { |
---|
2398 | 2617 | TransformGeometry(); |
---|
2399 | 2618 | } else |
---|
2400 | | - if (event.getSource() == resetTransformItem) |
---|
| 2619 | + if (source == resetTransformItem) |
---|
2401 | 2620 | { |
---|
2402 | 2621 | ResetTransform(); |
---|
2403 | 2622 | } else |
---|
2404 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2623 | + if (source == resetCentroidItem) |
---|
2405 | 2624 | { |
---|
2406 | 2625 | ResetCentroid(); |
---|
2407 | 2626 | } else |
---|
2408 | | - if (event.getSource() == resetParentItem) |
---|
| 2627 | + if (source == resetParentItem) |
---|
2409 | 2628 | { |
---|
2410 | 2629 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2411 | 2630 | { |
---|
.. | .. |
---|
2415 | 2634 | |
---|
2416 | 2635 | refreshContents(); |
---|
2417 | 2636 | } else |
---|
2418 | | - if (event.getSource() == repairParentItem) |
---|
| 2637 | + if (source == repairParentItem) |
---|
2419 | 2638 | { |
---|
2420 | 2639 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2421 | 2640 | { |
---|
.. | .. |
---|
2429 | 2648 | |
---|
2430 | 2649 | refreshContents(); |
---|
2431 | 2650 | } else |
---|
2432 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2651 | + if (source == repairShadowItem) |
---|
| 2652 | + { |
---|
| 2653 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2654 | + { |
---|
| 2655 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2656 | + obj.RepairShadow(); |
---|
| 2657 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2658 | +// { |
---|
| 2659 | +// obj.get(i).parent = obj; |
---|
| 2660 | +// } |
---|
| 2661 | + } |
---|
| 2662 | + |
---|
| 2663 | + refreshContents(); |
---|
| 2664 | + } else |
---|
| 2665 | + if (source == sortbysizeItem) |
---|
2433 | 2666 | { |
---|
2434 | 2667 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2435 | 2668 | { |
---|
.. | .. |
---|
2441 | 2674 | ResetModel(); |
---|
2442 | 2675 | refreshContents(); |
---|
2443 | 2676 | } else |
---|
2444 | | - if (event.getSource() == sortbynameItem) |
---|
| 2677 | + if (source == sortbynameItem) |
---|
2445 | 2678 | { |
---|
2446 | 2679 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2447 | 2680 | { |
---|
.. | .. |
---|
2453 | 2686 | ResetModel(); |
---|
2454 | 2687 | refreshContents(); |
---|
2455 | 2688 | } else |
---|
2456 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2689 | + if (source == attachPigmentItem) |
---|
2457 | 2690 | { |
---|
2458 | 2691 | String texture = GetFile("Attach pigment"); |
---|
2459 | 2692 | Object3D obj; |
---|
.. | .. |
---|
2465 | 2698 | |
---|
2466 | 2699 | refreshContents(); |
---|
2467 | 2700 | } else |
---|
2468 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2701 | + if (source == detachPigmentItem) |
---|
2469 | 2702 | { |
---|
2470 | 2703 | Object3D obj; |
---|
2471 | 2704 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2476 | 2709 | |
---|
2477 | 2710 | refreshContents(); |
---|
2478 | 2711 | } else |
---|
2479 | | - if (event.getSource() == attachBumpItem) |
---|
| 2712 | + if (source == attachBumpItem) |
---|
2480 | 2713 | { |
---|
2481 | 2714 | String texture = GetFile("Attach bump"); |
---|
2482 | 2715 | Object3D obj; |
---|
.. | .. |
---|
2488 | 2721 | |
---|
2489 | 2722 | refreshContents(); |
---|
2490 | 2723 | } else |
---|
2491 | | - if (event.getSource() == detachBumpItem) |
---|
| 2724 | + if (source == detachBumpItem) |
---|
2492 | 2725 | { |
---|
2493 | 2726 | Object3D obj; |
---|
2494 | 2727 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2499 | 2732 | |
---|
2500 | 2733 | refreshContents(); |
---|
2501 | 2734 | } else |
---|
2502 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2735 | + if (source == pigmentBumpItem) |
---|
2503 | 2736 | { |
---|
2504 | 2737 | Object3D obj; |
---|
2505 | 2738 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2510 | 2743 | |
---|
2511 | 2744 | refreshContents(); |
---|
2512 | 2745 | } else |
---|
2513 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2746 | + if (source == flashSelectionButton) |
---|
2514 | 2747 | { |
---|
2515 | 2748 | CameraPane.flash = true; |
---|
2516 | 2749 | refreshContents(); |
---|
2517 | 2750 | } else |
---|
2518 | | - if (event.getSource() == oneButton) |
---|
| 2751 | + if (source == oneButton) |
---|
2519 | 2752 | { |
---|
2520 | 2753 | } else |
---|
2521 | | - if (event.getSource() == twoButton) |
---|
| 2754 | + if (source == twoButton) |
---|
2522 | 2755 | { |
---|
2523 | 2756 | radio.layout = twoButton; |
---|
2524 | 2757 | // bug |
---|
2525 | 2758 | //gridPanel.setDividerLocation(1.0); |
---|
2526 | 2759 | //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(); |
---|
| 2760 | +// bigThree.remove(scenePanel); |
---|
| 2761 | +// bigThree.remove(centralPanel); |
---|
| 2762 | +// bigThree.remove(XYZPanel); |
---|
| 2763 | +// aWindowConstraints.gridx = 0; |
---|
| 2764 | +// aWindowConstraints.gridy = 0; |
---|
| 2765 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2766 | +// // aConstraints.gridheight = 3; |
---|
| 2767 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2768 | +// aWindowConstraints.weightx = 0; |
---|
| 2769 | +// aWindowConstraints.weighty = 1; |
---|
| 2770 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2771 | +// aWindowConstraints.weightx = 1; |
---|
| 2772 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2773 | +// // aConstraints.gridheight = 3; |
---|
| 2774 | +// aWindowConstraints.gridx = 1; |
---|
| 2775 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2776 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2777 | +// aWindowConstraints.weightx = 0; |
---|
| 2778 | +// aWindowConstraints.gridx = 4; |
---|
| 2779 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2780 | +// // aConstraints.gridheight = 3; |
---|
| 2781 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2782 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2783 | +// scenePanel.setVisible(false); |
---|
| 2784 | +// centralPanel.setVisible(true); |
---|
| 2785 | +// XYZPanel.setVisible(false); |
---|
| 2786 | + bigThree.ClearUI(); |
---|
| 2787 | + bigThree.add(centralPanel); |
---|
| 2788 | + bigThree.FlushUI(); |
---|
2551 | 2789 | } else |
---|
2552 | | - if (event.getSource() == threeButton) |
---|
| 2790 | + if (source == threeButton) |
---|
2553 | 2791 | { |
---|
2554 | 2792 | 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(); |
---|
| 2793 | + |
---|
| 2794 | +// bigThree.remove(scenePanel); |
---|
| 2795 | +// bigThree.remove(centralPanel); |
---|
| 2796 | +// bigThree.remove(XYZPanel); |
---|
| 2797 | +// aWindowConstraints.gridx = 0; |
---|
| 2798 | +// aWindowConstraints.gridy = 0; |
---|
| 2799 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2800 | +// // aConstraints.gridheight = 3; |
---|
| 2801 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2802 | +// aWindowConstraints.weightx = 0; |
---|
| 2803 | +// aWindowConstraints.weighty = 1; |
---|
| 2804 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2805 | +// aWindowConstraints.weightx = 1; |
---|
| 2806 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2807 | +// // aConstraints.gridheight = 3; |
---|
| 2808 | +// aWindowConstraints.gridx = 1; |
---|
| 2809 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2810 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2811 | +// aWindowConstraints.weightx = 0; |
---|
| 2812 | +// aWindowConstraints.gridx = 4; |
---|
| 2813 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2814 | +// // aConstraints.gridheight = 3; |
---|
| 2815 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2816 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2817 | +// bigThree.validate(); |
---|
| 2818 | +// scenePanel.setVisible(false); |
---|
| 2819 | +// centralPanel.setVisible(true); |
---|
| 2820 | +// XYZPanel.setVisible(true); |
---|
| 2821 | + bigThree.ClearUI(); |
---|
| 2822 | + bigThree.add(centralPanel); |
---|
| 2823 | + bigThree.add(XYZPanel); |
---|
| 2824 | + bigThree.FlushUI(); |
---|
2579 | 2825 | } else |
---|
2580 | | - if (event.getSource() == fourButton) |
---|
| 2826 | + if (source == fourButton) |
---|
2581 | 2827 | { |
---|
2582 | 2828 | 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(); |
---|
| 2829 | + |
---|
| 2830 | +// bigThree.remove(scenePanel); |
---|
| 2831 | +// bigThree.remove(centralPanel); |
---|
| 2832 | +// bigThree.remove(XYZPanel); |
---|
| 2833 | +// aWindowConstraints.gridx = 0; |
---|
| 2834 | +// aWindowConstraints.gridy = 0; |
---|
| 2835 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2836 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2837 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2838 | +// aWindowConstraints.weightx = 1; |
---|
| 2839 | +// aWindowConstraints.weighty = 1; |
---|
| 2840 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2841 | +// aWindowConstraints.weightx = 1; |
---|
| 2842 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2843 | +// // aConstraints.gridheight = 3; |
---|
| 2844 | +// aWindowConstraints.gridx = 1; |
---|
| 2845 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2846 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2847 | +// aWindowConstraints.weightx = 0; |
---|
| 2848 | +// aWindowConstraints.gridx = 4; |
---|
| 2849 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2850 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2851 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2852 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2853 | +// bigThree.validate(); |
---|
| 2854 | +// scenePanel.setVisible(true); |
---|
| 2855 | +// centralPanel.setVisible(false); |
---|
| 2856 | +// XYZPanel.setVisible(false); |
---|
| 2857 | + bigThree.ClearUI(); |
---|
| 2858 | + bigThree.add(scenePanel); |
---|
| 2859 | + bigThree.FlushUI(); |
---|
2607 | 2860 | } else |
---|
2608 | | - if (event.getSource() == sixButton) |
---|
| 2861 | + if (source == sixButton) |
---|
2609 | 2862 | { |
---|
2610 | 2863 | 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(); |
---|
| 2864 | + |
---|
| 2865 | +// bigThree.remove(scenePanel); |
---|
| 2866 | +// bigThree.remove(centralPanel); |
---|
| 2867 | +// bigThree.remove(XYZPanel); |
---|
| 2868 | +// aWindowConstraints.gridx = 0; |
---|
| 2869 | +// aWindowConstraints.gridy = 0; |
---|
| 2870 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2871 | +// // aConstraints.gridheight = 3; |
---|
| 2872 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2873 | +// aWindowConstraints.weightx = 0; |
---|
| 2874 | +// aWindowConstraints.weighty = 1; |
---|
| 2875 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2876 | +// aWindowConstraints.weightx = 1; |
---|
| 2877 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2878 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2879 | +// aWindowConstraints.gridx = 1; |
---|
| 2880 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2881 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2882 | +// aWindowConstraints.weightx = 0; |
---|
| 2883 | +// aWindowConstraints.gridx = 4; |
---|
| 2884 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2885 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2886 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2887 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2888 | +// bigThree.validate(); |
---|
| 2889 | +// scenePanel.setVisible(true); |
---|
| 2890 | +// centralPanel.setVisible(true); |
---|
| 2891 | +// XYZPanel.setVisible(false); |
---|
| 2892 | + bigThree.ClearUI(); |
---|
| 2893 | + bigThree.add(scenePanel); |
---|
| 2894 | + bigThree.add(centralPanel); |
---|
| 2895 | + bigThree.FlushUI(); |
---|
2635 | 2896 | } else |
---|
2636 | | - if (event.getSource() == sevenButton) |
---|
| 2897 | + if (source == sevenButton) |
---|
2637 | 2898 | { |
---|
2638 | 2899 | 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(); |
---|
| 2900 | + |
---|
| 2901 | +// bigThree.remove(scenePanel); |
---|
| 2902 | +// bigThree.remove(centralPanel); |
---|
| 2903 | +// bigThree.remove(XYZPanel); |
---|
| 2904 | +// aWindowConstraints.gridx = 0; |
---|
| 2905 | +// aWindowConstraints.gridy = 0; |
---|
| 2906 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2907 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2908 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2909 | +// aWindowConstraints.weightx = 0; |
---|
| 2910 | +// aWindowConstraints.weighty = 1; |
---|
| 2911 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2912 | +// aWindowConstraints.weightx = 1; |
---|
| 2913 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2914 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2915 | +// aWindowConstraints.gridx = 1; |
---|
| 2916 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2917 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2918 | +// aWindowConstraints.weightx = 0; |
---|
| 2919 | +// aWindowConstraints.gridx = 4; |
---|
| 2920 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2921 | +// // aConstraints.gridheight = 3; |
---|
| 2922 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2923 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2924 | +// bigThree.validate(); |
---|
| 2925 | +// scenePanel.setVisible(true); |
---|
| 2926 | +// centralPanel.setVisible(true); |
---|
| 2927 | +// XYZPanel.setVisible(true); |
---|
| 2928 | + bigThree.ClearUI(); |
---|
| 2929 | + bigThree.add(scenePanel); |
---|
| 2930 | + bigThree.add(centralPanel); |
---|
| 2931 | + bigThree.add(XYZPanel); |
---|
| 2932 | + bigThree.FlushUI(); |
---|
2663 | 2933 | } else |
---|
2664 | | - if (event.getSource() == rootButton) |
---|
| 2934 | + if (source == rootButton) |
---|
2665 | 2935 | { |
---|
2666 | 2936 | Object3D obj; |
---|
2667 | 2937 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2673 | 2943 | |
---|
2674 | 2944 | refreshContents(true); |
---|
2675 | 2945 | } else |
---|
2676 | | - if (event.getSource() == closeButton) |
---|
| 2946 | + if (source == closeButton) |
---|
2677 | 2947 | { |
---|
2678 | 2948 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2679 | 2949 | cRadio ab; |
---|
.. | .. |
---|
2694 | 2964 | } |
---|
2695 | 2965 | refreshContents(true); |
---|
2696 | 2966 | } else |
---|
2697 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 2967 | + if (source == editItem || source == editButton) |
---|
2698 | 2968 | { |
---|
2699 | 2969 | EditSelection(false); |
---|
2700 | 2970 | } else |
---|
2701 | | - if (event.getSource() == uneditButton) |
---|
| 2971 | + if (source == uneditButton) |
---|
2702 | 2972 | { |
---|
2703 | 2973 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2704 | 2974 | { |
---|
.. | .. |
---|
2710 | 2980 | |
---|
2711 | 2981 | child.editWindow = null; // ??????????? |
---|
2712 | 2982 | } |
---|
2713 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 2983 | + objEditor.ctrlPanel.FlushUI(); |
---|
2714 | 2984 | //objEditor.jTree.clearSelection(); |
---|
2715 | 2985 | //objEditor.ResetSliders(); |
---|
2716 | 2986 | refreshContents(true); |
---|
2717 | 2987 | } else |
---|
2718 | | - if (event.getSource() == clearPanelButton) |
---|
| 2988 | + if (source == clearPanelButton) |
---|
2719 | 2989 | { |
---|
2720 | 2990 | assert(copy == group); |
---|
2721 | 2991 | //copy.ClearUI(); |
---|
.. | .. |
---|
2726 | 2996 | listUI.clear(); |
---|
2727 | 2997 | refreshContents(true); |
---|
2728 | 2998 | } else |
---|
2729 | | - if (event.getSource() == allParamsButton) |
---|
| 2999 | + if (source == allParamsButton) |
---|
2730 | 3000 | { |
---|
2731 | 3001 | assert(copy == group); |
---|
2732 | 3002 | |
---|
.. | .. |
---|
2747 | 3017 | |
---|
2748 | 3018 | refreshContents(true); |
---|
2749 | 3019 | } else |
---|
2750 | | - if (event.getSource() == unselectButton) |
---|
| 3020 | + if (source == unselectButton) |
---|
2751 | 3021 | { |
---|
2752 | 3022 | objEditor.jTree.clearSelection(); |
---|
2753 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 3023 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2754 | 3024 | objEditor.ResetSliders(); |
---|
2755 | 3025 | refreshContents(true); |
---|
2756 | 3026 | } else |
---|
2757 | | - if(event.getSource() instanceof cRadio) |
---|
| 3027 | + if(source instanceof cRadio) |
---|
2758 | 3028 | { |
---|
2759 | 3029 | group.parent = keepparent; |
---|
2760 | 3030 | group.attributes = 0; |
---|
2761 | 3031 | //group.editWindow = null; |
---|
2762 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3032 | + /*cRadio*/ radio = (cRadio)source; |
---|
2763 | 3033 | Object3D obj = radio.GetObject(); |
---|
2764 | 3034 | System.out.println("Edit " + obj); |
---|
2765 | 3035 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2779 | 3049 | } |
---|
2780 | 3050 | |
---|
2781 | 3051 | copy = group; |
---|
2782 | | - //CameraPane.theRenderer.object = group; |
---|
| 3052 | + //Globals.theRenderer.object = group; |
---|
2783 | 3053 | if(!useclient) |
---|
2784 | 3054 | { |
---|
2785 | 3055 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2788 | 3058 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2789 | 3059 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2790 | 3060 | cameraView.object = group; |
---|
2791 | | - cameraView.lighttouched = true; |
---|
| 3061 | + //cameraView.lighttouched = true; |
---|
| 3062 | + Globals.lighttouched = true; |
---|
2792 | 3063 | topView.object = group; |
---|
2793 | 3064 | frontView.object = group; |
---|
2794 | 3065 | sideView.object = group; |
---|
.. | .. |
---|
2824 | 3095 | if (useclient) |
---|
2825 | 3096 | { |
---|
2826 | 3097 | cameraView.object = client; |
---|
2827 | | - cameraView.lighttouched = true; |
---|
| 3098 | + Globals.lighttouched = true; |
---|
2828 | 3099 | //topView.object = client; |
---|
2829 | 3100 | //frontView.object = client; |
---|
2830 | 3101 | //sideView.object = client; |
---|
.. | .. |
---|
2832 | 3103 | else |
---|
2833 | 3104 | { |
---|
2834 | 3105 | cameraView.object = group; |
---|
2835 | | - cameraView.lighttouched = true; |
---|
| 3106 | + Globals.lighttouched = true; |
---|
2836 | 3107 | //topView.object = group; |
---|
2837 | 3108 | //frontView.object = group; |
---|
2838 | 3109 | //sideView.object = group; |
---|
.. | .. |
---|
3065 | 3336 | obj = (Object3D)e.nextElement(); |
---|
3066 | 3337 | |
---|
3067 | 3338 | System.out.println("Object is: " + obj); |
---|
3068 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3339 | + GrafreeD.AnalyzeObject(obj); |
---|
3069 | 3340 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3070 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3341 | + GrafreeD.AnalyzeObject(obj.bRep); |
---|
3071 | 3342 | |
---|
3072 | 3343 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3073 | 3344 | } |
---|
.. | .. |
---|
3109 | 3380 | void GenNormals(boolean crease) |
---|
3110 | 3381 | { |
---|
3111 | 3382 | group.GenNormalsS(crease); |
---|
| 3383 | + |
---|
| 3384 | + refreshContents(); |
---|
| 3385 | + } |
---|
| 3386 | + |
---|
| 3387 | + void GenNormalsMINE() |
---|
| 3388 | + { |
---|
| 3389 | + group.selection.GenNormalsMINE(); |
---|
3112 | 3390 | |
---|
3113 | 3391 | refreshContents(); |
---|
3114 | 3392 | } |
---|
.. | .. |
---|
3157 | 3435 | |
---|
3158 | 3436 | //Object3D buffer; |
---|
3159 | 3437 | 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 | | - |
---|
| 3438 | +// BoundaryRep temprep; |
---|
| 3439 | +// Object3D nodes; |
---|
| 3440 | +// Vector<Vertex> vertices; |
---|
| 3441 | +// |
---|
| 3442 | +// cGroup buffer; |
---|
| 3443 | +// |
---|
| 3444 | +// public void Vertex(Object3D node, Vertex v) |
---|
| 3445 | +// { |
---|
| 3446 | +//// vertices.add(v); |
---|
| 3447 | +//// nodes.addElement(node); |
---|
| 3448 | +//// |
---|
| 3449 | +//// if (temprep.GetCache(v) != null) |
---|
| 3450 | +//// { |
---|
| 3451 | +//// temprep.Remove(v); |
---|
| 3452 | +//// } else |
---|
| 3453 | +//// { |
---|
| 3454 | +//// temprep.Remember(v); |
---|
| 3455 | +//// } |
---|
| 3456 | +// |
---|
| 3457 | +// //Object3D node = nodes.get(index); |
---|
| 3458 | +// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3459 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3460 | +// |
---|
| 3461 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3462 | +// |
---|
| 3463 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3464 | +// |
---|
| 3465 | +// cGroup g = new cGroup(); |
---|
| 3466 | +// |
---|
| 3467 | +// if (g.toParent == null) |
---|
| 3468 | +// { |
---|
| 3469 | +// g.toParent = LA.newMatrix(); |
---|
| 3470 | +// g.fromParent = LA.newMatrix(); |
---|
| 3471 | +// } |
---|
| 3472 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3473 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3474 | +// |
---|
| 3475 | +// g.add(GrafreeD.clipboard); |
---|
| 3476 | +// |
---|
| 3477 | +// buffer.add(g); |
---|
| 3478 | +// } |
---|
| 3479 | +// |
---|
| 3480 | +// public void Face(Object3D node, Face f) |
---|
| 3481 | +// { |
---|
| 3482 | +// |
---|
| 3483 | +// } |
---|
| 3484 | +// |
---|
| 3485 | +// void ParseVerticesOld() // ?? |
---|
| 3486 | +// { |
---|
| 3487 | +// //if (group.selection.size() != 1) |
---|
| 3488 | +// // return; |
---|
| 3489 | +// |
---|
| 3490 | +// temprep = new BoundaryRep(); |
---|
| 3491 | +// nodes = new Object3D(); |
---|
| 3492 | +// vertices = new Vector<Vertex>(); |
---|
| 3493 | +// |
---|
| 3494 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3495 | +// GrafreeD.epsequal = true; |
---|
| 3496 | +// |
---|
| 3497 | +// for (int i=0; i<group.selection.size(); i++) |
---|
| 3498 | +// { |
---|
| 3499 | +// Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3500 | +// |
---|
| 3501 | +// group.selection.get(i).Parse( |
---|
| 3502 | +//this ); |
---|
| 3503 | +// |
---|
| 3504 | +// int repsize = temprep.VertexCount(); |
---|
| 3505 | +// int tablesize = temprep.vertextable.size(); |
---|
| 3506 | +// int nodesize = nodes.size(); |
---|
| 3507 | +// |
---|
| 3508 | +// assert(vertices.size() == nodes.size()); |
---|
| 3509 | +// |
---|
| 3510 | +// temprep.vertextable.elements(); |
---|
| 3511 | +// |
---|
| 3512 | +// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet(); |
---|
| 3513 | +// |
---|
| 3514 | +// for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
| 3515 | +// { |
---|
| 3516 | +// cGroup g = new cGroup(); |
---|
| 3517 | +// |
---|
| 3518 | +// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k)); |
---|
| 3519 | +// |
---|
| 3520 | +// Object3D node = nodes.get(index); |
---|
| 3521 | +// temp.set(vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3522 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3523 | +// |
---|
| 3524 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3525 | +// |
---|
| 3526 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3527 | +// |
---|
| 3528 | +// if (g.toParent == null) |
---|
| 3529 | +// { |
---|
| 3530 | +// g.toParent = LA.newMatrix(); |
---|
| 3531 | +// g.fromParent = LA.newMatrix(); |
---|
| 3532 | +// } |
---|
| 3533 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3534 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3535 | +// |
---|
| 3536 | +// g.add(GrafreeD.clipboard); |
---|
| 3537 | +// |
---|
| 3538 | +// buffer.add(g); |
---|
| 3539 | +// } |
---|
| 3540 | +// |
---|
| 3541 | +// makeSomething(buffer, i==group.selection.size()-1); |
---|
| 3542 | +// } |
---|
| 3543 | +// |
---|
| 3544 | +// GrafreeD.epsequal = epsequal; |
---|
| 3545 | +// |
---|
| 3546 | +// //buffer = null; |
---|
| 3547 | +// temprep = null; |
---|
| 3548 | +// nodes = null; |
---|
| 3549 | +// |
---|
| 3550 | +// refreshContents(); |
---|
| 3551 | +// } |
---|
| 3552 | + |
---|
3184 | 3553 | void ParseVertices() |
---|
3185 | 3554 | { |
---|
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; |
---|
| 3555 | + boolean epsequal = GrafreeD.epsequal; |
---|
| 3556 | + GrafreeD.epsequal = true; |
---|
3195 | 3557 | |
---|
3196 | 3558 | for (int i=0; i<group.selection.size(); i++) |
---|
3197 | 3559 | { |
---|
3198 | | - Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3560 | + final cGroup buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
3199 | 3561 | |
---|
3200 | | - group.selection.get(i).Parse(this); |
---|
3201 | | - |
---|
3202 | | - int repsize = temprep.VertexCount(); |
---|
3203 | | - int tablesize = temprep.vertextable.size(); |
---|
3204 | | - int nodesize = nodes.size(); |
---|
| 3562 | + group.selection.get(i).Parse( |
---|
| 3563 | + |
---|
| 3564 | + new iParse() |
---|
| 3565 | + { |
---|
| 3566 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3567 | + { |
---|
| 3568 | + temp.set(v); |
---|
| 3569 | + LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
3205 | 3570 | |
---|
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(); |
---|
| 3571 | + cGroup g = new cGroup(); |
---|
3211 | 3572 | |
---|
3212 | | - for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
3213 | | - { |
---|
3214 | | - cGroup g = new cGroup(); |
---|
| 3573 | + if (g.toParent == null) |
---|
| 3574 | + { |
---|
| 3575 | + g.toParent = LA.newMatrix(); |
---|
| 3576 | + g.fromParent = LA.newMatrix(); |
---|
| 3577 | + } |
---|
| 3578 | + LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3579 | + LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3215 | 3580 | |
---|
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); |
---|
| 3581 | + g.add(GrafreeD.clipboard); |
---|
3220 | 3582 | |
---|
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); |
---|
| 3583 | + buffer.add(g); |
---|
| 3584 | + } |
---|
3232 | 3585 | |
---|
3233 | | - g.add(GraphreeD.clipboard); |
---|
| 3586 | + public void Face(Object3D node, Face f) |
---|
| 3587 | + { |
---|
3234 | 3588 | |
---|
3235 | | - buffer.add(g); |
---|
3236 | | - } |
---|
| 3589 | + } |
---|
| 3590 | + } |
---|
| 3591 | + ); |
---|
3237 | 3592 | |
---|
3238 | 3593 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3239 | 3594 | } |
---|
3240 | 3595 | |
---|
3241 | | - GraphreeD.epsequal = epsequal; |
---|
3242 | | - |
---|
3243 | | - //buffer = null; |
---|
3244 | | - temprep = null; |
---|
3245 | | - nodes = null; |
---|
| 3596 | + GrafreeD.epsequal = epsequal; |
---|
3246 | 3597 | |
---|
3247 | 3598 | refreshContents(); |
---|
3248 | 3599 | } |
---|
3249 | | - |
---|
| 3600 | + |
---|
| 3601 | + void TextureVertices() |
---|
| 3602 | + { |
---|
| 3603 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3604 | + { |
---|
| 3605 | + group.selection.get(i).Parse( |
---|
| 3606 | + new iParse() |
---|
| 3607 | + { |
---|
| 3608 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3609 | + { |
---|
| 3610 | + cTexture tex = node.GetTextures(); |
---|
| 3611 | + String pigment = Object3D.GetPigment(tex); |
---|
| 3612 | + //String bump = Object3D.GetBump(tex); |
---|
| 3613 | + |
---|
| 3614 | + com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3615 | + |
---|
| 3616 | + double s = v.s; |
---|
| 3617 | + |
---|
| 3618 | + if (s == 1) |
---|
| 3619 | + s = 0; |
---|
| 3620 | + |
---|
| 3621 | + double t = v.t; |
---|
| 3622 | + |
---|
| 3623 | + if (t == 1) |
---|
| 3624 | + t = 0; |
---|
| 3625 | + |
---|
| 3626 | + int indexs = (int) (texturedata.getWidth() * s); |
---|
| 3627 | + int indext = (int) (texturedata.getHeight() * t); |
---|
| 3628 | + |
---|
| 3629 | + int index = indext * texturedata.getWidth() + indexs; |
---|
| 3630 | + |
---|
| 3631 | + java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer(); |
---|
| 3632 | + |
---|
| 3633 | + int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight(); |
---|
| 3634 | + |
---|
| 3635 | + float scale = bytebuf.get(index*slide) & 0xFF; |
---|
| 3636 | + scale += bytebuf.get(index*slide+1) & 0xFF; |
---|
| 3637 | + scale += bytebuf.get(index*slide+2) & 0xFF; |
---|
| 3638 | + scale /= 3; |
---|
| 3639 | + |
---|
| 3640 | + scale /= 0xFF; |
---|
| 3641 | + // c'est quoi ca? scale /= 4; |
---|
| 3642 | + |
---|
| 3643 | + //v.AO = scale; |
---|
| 3644 | + |
---|
| 3645 | + v.x += v.norm.x * scale; |
---|
| 3646 | + v.y += v.norm.y * scale; |
---|
| 3647 | + v.z += v.norm.z * scale; |
---|
| 3648 | + } |
---|
| 3649 | + |
---|
| 3650 | + public void Face(Object3D node, Face f) |
---|
| 3651 | + { |
---|
| 3652 | + } |
---|
| 3653 | + } |
---|
| 3654 | + ); |
---|
| 3655 | + } |
---|
| 3656 | + |
---|
| 3657 | + refreshContents(); |
---|
| 3658 | + } |
---|
| 3659 | + |
---|
3250 | 3660 | void Align() |
---|
3251 | 3661 | { |
---|
| 3662 | + if (group.selection.size() == 0) |
---|
| 3663 | + return; |
---|
| 3664 | + |
---|
| 3665 | + cVector bbmin = new cVector(); |
---|
| 3666 | + cVector bbmax = new cVector(); |
---|
| 3667 | + |
---|
| 3668 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3669 | + |
---|
| 3670 | + double dx = bbmax.x - bbmin.x; |
---|
| 3671 | + double dy = bbmax.y - bbmin.y; |
---|
| 3672 | + double dz = bbmax.z - bbmin.z; |
---|
| 3673 | + |
---|
| 3674 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3675 | + |
---|
3252 | 3676 | for (int i=0; i<group.selection.size(); i++) |
---|
3253 | 3677 | { |
---|
3254 | 3678 | Object3D obj = group.selection.get(i); |
---|
3255 | 3679 | |
---|
3256 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3257 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3680 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3681 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3258 | 3682 | } |
---|
3259 | 3683 | |
---|
3260 | 3684 | refreshContents(); |
---|
.. | .. |
---|
3267 | 3691 | // ref.SaveSupports(); |
---|
3268 | 3692 | // Object3D par = ref.parent; |
---|
3269 | 3693 | // ref.parent = null; |
---|
3270 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 3694 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3271 | 3695 | // ref.parent = par; |
---|
3272 | 3696 | // ref.RestoreSupports(); |
---|
3273 | 3697 | |
---|
.. | .. |
---|
3275 | 3699 | |
---|
3276 | 3700 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3277 | 3701 | |
---|
3278 | | - boolean random = CameraPane.RANDOM; |
---|
3279 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3702 | + boolean random = CameraPane.SWITCH; |
---|
| 3703 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3280 | 3704 | lowres.linkVerticesThis(null); |
---|
3281 | 3705 | lowres.linkVerticesThis(sn); |
---|
3282 | | - CameraPane.RANDOM = random; |
---|
| 3706 | + CameraPane.SWITCH = random; |
---|
3283 | 3707 | |
---|
3284 | 3708 | System.err.flush(); |
---|
3285 | 3709 | |
---|
.. | .. |
---|
3297 | 3721 | // lowres.SaveSupports(); |
---|
3298 | 3722 | // par = lowres.parent; |
---|
3299 | 3723 | // lowres.parent = null; |
---|
3300 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 3724 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3301 | 3725 | Object3D newlow = CloneObject(lowres, false); |
---|
3302 | 3726 | newlow.name = sn.switchobject.get(i).name; |
---|
3303 | 3727 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3319 | 3743 | return; |
---|
3320 | 3744 | |
---|
3321 | 3745 | Object3D poses = group.selection.get(0); |
---|
3322 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 3746 | + Object3D ref = GrafreeD.clipboard.get(0); |
---|
3323 | 3747 | |
---|
3324 | 3748 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3325 | 3749 | |
---|
.. | .. |
---|
3488 | 3912 | group.selection.RelinkToSupport(); // july 2014 |
---|
3489 | 3913 | System.out.println("DONE."); |
---|
3490 | 3914 | refreshContents(); |
---|
3491 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 3915 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3492 | 3916 | } |
---|
3493 | 3917 | |
---|
3494 | 3918 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3513 | 3937 | |
---|
3514 | 3938 | void ClipMesh() |
---|
3515 | 3939 | { |
---|
3516 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 3940 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
3517 | 3941 | { |
---|
3518 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 3942 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
3519 | 3943 | |
---|
3520 | 3944 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3521 | 3945 | content = ((cGroup)content).get(0); |
---|
3522 | 3946 | |
---|
3523 | 3947 | // for (int i=0; i<group.selection.size(); i++) |
---|
3524 | 3948 | // { |
---|
3525 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 3949 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3526 | 3950 | // } |
---|
3527 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 3951 | + group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3528 | 3952 | } |
---|
3529 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 3953 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3530 | 3954 | System.out.println("DONE."); |
---|
3531 | 3955 | refreshContents(); |
---|
3532 | 3956 | } |
---|
.. | .. |
---|
3764 | 4188 | System.err.println("info : " + child.GetPath()); |
---|
3765 | 4189 | } |
---|
3766 | 4190 | } |
---|
3767 | | - else |
---|
3768 | | - { |
---|
3769 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3770 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3771 | | - System.err.println("info : " + group.GetPath()); |
---|
3772 | | - } |
---|
| 4191 | +// else |
---|
| 4192 | +// { |
---|
| 4193 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4194 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4195 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4196 | +// } |
---|
3773 | 4197 | |
---|
3774 | 4198 | objEditor.SetText(); // jan 2014 |
---|
3775 | 4199 | |
---|
3776 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4200 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
3777 | 4201 | CameraPane.flash = true; |
---|
3778 | 4202 | |
---|
3779 | 4203 | if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
3780 | 4204 | // a camera |
---|
3781 | 4205 | { |
---|
3782 | 4206 | 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; |
---|
| 4207 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4208 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4209 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3786 | 4210 | } |
---|
3787 | 4211 | |
---|
3788 | 4212 | refreshContents(); |
---|
.. | .. |
---|
3864 | 4288 | { |
---|
3865 | 4289 | if (group.selection.isEmpty()) |
---|
3866 | 4290 | return; |
---|
3867 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4291 | + GrafreeD.clipboardIsTempGroup = false; |
---|
3868 | 4292 | Composite tGroup = null; |
---|
3869 | 4293 | if (group.selection.size() > 0) // 1) |
---|
3870 | 4294 | { |
---|
3871 | 4295 | tGroup = new cGroup(); |
---|
3872 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4296 | + GrafreeD.clipboardIsTempGroup = true; |
---|
3873 | 4297 | } |
---|
3874 | 4298 | |
---|
3875 | 4299 | if (cut) |
---|
.. | .. |
---|
3909 | 4333 | //System.out.println("cut " + child); |
---|
3910 | 4334 | //System.out.println("parent = " + child.parent); |
---|
3911 | 4335 | // tmp.addChild(child); |
---|
3912 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4336 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3913 | 4337 | tGroup.add/*Child*/(tmp); |
---|
3914 | 4338 | else |
---|
3915 | | - GraphreeD.clipboard = tmp; |
---|
| 4339 | + GrafreeD.clipboard = tmp; |
---|
3916 | 4340 | } |
---|
3917 | 4341 | else |
---|
3918 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4342 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3919 | 4343 | tGroup.add/*Child*/(child); |
---|
3920 | 4344 | else |
---|
3921 | | - GraphreeD.clipboard = child; |
---|
| 4345 | + GrafreeD.clipboard = child; |
---|
3922 | 4346 | } |
---|
3923 | 4347 | |
---|
3924 | 4348 | //ResetModel(); |
---|
.. | .. |
---|
3950 | 4374 | //System.out.println("cut " + elem); |
---|
3951 | 4375 | //System.out.println("parent = " + elem.parent); |
---|
3952 | 4376 | // tmp.addChild(elem); |
---|
3953 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4377 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3954 | 4378 | tGroup.add/*Child*/(tmp); |
---|
3955 | 4379 | else |
---|
3956 | | - GraphreeD.clipboard = tmp; |
---|
| 4380 | + GrafreeD.clipboard = tmp; |
---|
3957 | 4381 | } |
---|
3958 | 4382 | else |
---|
3959 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4383 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3960 | 4384 | tGroup.add/*Child*/(child); |
---|
3961 | 4385 | else |
---|
3962 | | - GraphreeD.clipboard = child; |
---|
| 4386 | + GrafreeD.clipboard = child; |
---|
3963 | 4387 | } |
---|
3964 | 4388 | |
---|
3965 | 4389 | } |
---|
3966 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
3967 | | - GraphreeD.clipboard = tGroup; |
---|
| 4390 | + if (GrafreeD.clipboardIsTempGroup) |
---|
| 4391 | + GrafreeD.clipboard = tGroup; |
---|
3968 | 4392 | if (cut) |
---|
3969 | 4393 | { |
---|
3970 | 4394 | ResetModel(); |
---|
.. | .. |
---|
3974 | 4398 | |
---|
3975 | 4399 | void paste(boolean expand) |
---|
3976 | 4400 | { |
---|
3977 | | - // if (GraphreeD.clipboard == null) |
---|
| 4401 | + // if (GrafreeD.clipboard == null) |
---|
3978 | 4402 | // return; |
---|
3979 | 4403 | boolean first = true; |
---|
3980 | 4404 | |
---|
3981 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4405 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3982 | 4406 | { |
---|
3983 | 4407 | Composite temp; |
---|
3984 | 4408 | |
---|
.. | .. |
---|
3989 | 4413 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
3990 | 4414 | */ |
---|
3991 | 4415 | Object3D elem; |
---|
3992 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4416 | + for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
3993 | 4417 | { |
---|
3994 | 4418 | Object3D child = (Object3D)e.nextElement(); |
---|
3995 | 4419 | |
---|
.. | .. |
---|
4003 | 4427 | else |
---|
4004 | 4428 | elem = child.deepCopy(); // ? |
---|
4005 | 4429 | child.parent = keepparent; |
---|
4006 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4430 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4007 | 4431 | // elem = elem.get(0); |
---|
4008 | 4432 | makeSomething(elem, true); // ?? first); |
---|
4009 | 4433 | //group.addChild(elem); |
---|
.. | .. |
---|
4023 | 4447 | //Object3D cb = Applet3D.clipboard; |
---|
4024 | 4448 | //temp.addChild(cb); |
---|
4025 | 4449 | //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()); |
---|
| 4450 | + assert(GrafreeD.clipboard.parent == null); |
---|
| 4451 | + Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
| 4452 | + GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4453 | + if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
| 4454 | + makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
4031 | 4455 | else |
---|
4032 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4033 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4456 | + makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
| 4457 | + GrafreeD.clipboard.get(0).parent = keepparent; |
---|
4034 | 4458 | } |
---|
4035 | 4459 | |
---|
4036 | 4460 | ResetModel(); |
---|
4037 | 4461 | refreshContents(); |
---|
4038 | 4462 | } |
---|
4039 | 4463 | |
---|
4040 | | - void pasteInto(boolean copyit) |
---|
| 4464 | + void pasteInto(boolean copyit, boolean clone) |
---|
4041 | 4465 | { |
---|
4042 | | -// if (GraphreeD.clipboard == null) |
---|
| 4466 | +// if (GrafreeD.clipboard == null) |
---|
4043 | 4467 | // return; |
---|
4044 | 4468 | |
---|
4045 | 4469 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4066 | 4490 | if (copyit) |
---|
4067 | 4491 | { |
---|
4068 | 4492 | // paste(false); |
---|
4069 | | - CloneClipboard(false); // sept 2014 |
---|
| 4493 | + if (clone) |
---|
| 4494 | + { |
---|
| 4495 | + CloneClipboard(false); // sept 2014 |
---|
| 4496 | + } |
---|
| 4497 | + else |
---|
| 4498 | + { |
---|
| 4499 | + paste(false); |
---|
| 4500 | + } |
---|
4070 | 4501 | } |
---|
4071 | 4502 | else |
---|
4072 | 4503 | { |
---|
4073 | 4504 | boolean first = true; |
---|
4074 | 4505 | |
---|
4075 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4506 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4076 | 4507 | { |
---|
4077 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4508 | + Composite temp = (Composite)GrafreeD.clipboard; |
---|
4078 | 4509 | Object3D copy; |
---|
4079 | 4510 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4080 | 4511 | { |
---|
.. | .. |
---|
4084 | 4515 | } |
---|
4085 | 4516 | } else |
---|
4086 | 4517 | { |
---|
4087 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4518 | + linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
4088 | 4519 | } |
---|
4089 | 4520 | } |
---|
4090 | 4521 | } |
---|
.. | .. |
---|
4276 | 4707 | makeSomething(csg); |
---|
4277 | 4708 | } |
---|
4278 | 4709 | |
---|
| 4710 | + void Ungroup(Object3D g) |
---|
| 4711 | + { |
---|
| 4712 | + if (g instanceof HiddenObject) |
---|
| 4713 | + { |
---|
| 4714 | + HiddenObject h = (HiddenObject) g; |
---|
| 4715 | + |
---|
| 4716 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4717 | + { |
---|
| 4718 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4719 | + } |
---|
| 4720 | + } |
---|
| 4721 | + else |
---|
| 4722 | + { |
---|
| 4723 | + for (int i=0; i<g.Size(); i++) |
---|
| 4724 | + { |
---|
| 4725 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4726 | + } |
---|
| 4727 | + } |
---|
| 4728 | + } |
---|
| 4729 | + |
---|
4279 | 4730 | void ungroup() |
---|
4280 | 4731 | { |
---|
4281 | 4732 | /* |
---|
.. | .. |
---|
4471 | 4922 | |
---|
4472 | 4923 | void ImportGFD() |
---|
4473 | 4924 | { |
---|
4474 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD); |
---|
| 4925 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4475 | 4926 | browser.show(); |
---|
4476 | 4927 | String filename = browser.getFile(); |
---|
4477 | 4928 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4509 | 4960 | |
---|
4510 | 4961 | void ImportVRMLX3D() |
---|
4511 | 4962 | { |
---|
4512 | | - if (GraphreeD.standAlone) |
---|
| 4963 | + if (GrafreeD.standAlone) |
---|
4513 | 4964 | { |
---|
4514 | 4965 | /**/ |
---|
4515 | 4966 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4526 | 4977 | |
---|
4527 | 4978 | String GetFile(String dialogName) |
---|
4528 | 4979 | { |
---|
4529 | | - if (GraphreeD.standAlone) |
---|
| 4980 | + if (GrafreeD.standAlone) |
---|
4530 | 4981 | { |
---|
4531 | 4982 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4532 | 4983 | browser.show(); |
---|
.. | .. |
---|
4590 | 5041 | cButton flashSelectionButton; |
---|
4591 | 5042 | cButton editButton; |
---|
4592 | 5043 | cButton uneditButton; |
---|
| 5044 | + JCheckBox allParamsButton; |
---|
4593 | 5045 | cButton clearpanelButton; |
---|
4594 | | - cButton allParamsButton; |
---|
4595 | 5046 | cButton unselectButton; |
---|
4596 | 5047 | |
---|
| 5048 | + cButton oneStepButton; |
---|
| 5049 | + |
---|
4597 | 5050 | cButton screenfitButton; |
---|
4598 | 5051 | cButton screenfitpointButton; |
---|
4599 | 5052 | cButton snapobjectButton; |
---|
.. | .. |
---|
4635 | 5088 | private MenuItem resetsupportItem; |
---|
4636 | 5089 | private MenuItem resetreferencesItem; |
---|
4637 | 5090 | private MenuItem linkverticesItem; |
---|
| 5091 | + private MenuItem relinkverticesItem; |
---|
4638 | 5092 | private MenuItem setMasterItem; |
---|
4639 | 5093 | private MenuItem resetMeshItem; |
---|
4640 | 5094 | private MenuItem stepAllItem; |
---|
.. | .. |
---|
4647 | 5101 | private MenuItem mergeGeometriesItem; |
---|
4648 | 5102 | private MenuItem copyItem; |
---|
4649 | 5103 | private MenuItem pasteItem; |
---|
| 5104 | + private MenuItem pasteIntoItem; |
---|
4650 | 5105 | private MenuItem pasteLinkItem; |
---|
4651 | 5106 | private MenuItem pasteCloneItem; |
---|
4652 | 5107 | private MenuItem pasteExpandItem; |
---|
4653 | 5108 | private MenuItem clearItem; |
---|
4654 | 5109 | private MenuItem clearAllItem; |
---|
4655 | 5110 | private MenuItem genUVItem; |
---|
| 5111 | + private MenuItem genNormalsMESHItem; |
---|
4656 | 5112 | private MenuItem genNormalsCADItem; |
---|
4657 | 5113 | private MenuItem genNormalsORGANItem; |
---|
| 5114 | + private MenuItem genNormalsMINEItem; |
---|
4658 | 5115 | private MenuItem stripifyItem; |
---|
4659 | 5116 | private MenuItem unstripifyItem; |
---|
4660 | 5117 | private MenuItem trimItem; |
---|
.. | .. |
---|
4696 | 5153 | private MenuItem resetCentroidItem; |
---|
4697 | 5154 | private MenuItem transformgeometryItem; |
---|
4698 | 5155 | private MenuItem resetTransformItem; |
---|
| 5156 | + private MenuItem hideItem; |
---|
4699 | 5157 | private MenuItem grabItem; |
---|
4700 | 5158 | private MenuItem backItem; |
---|
4701 | 5159 | private MenuItem frontItem; |
---|
.. | .. |
---|
4716 | 5174 | |
---|
4717 | 5175 | private MenuItem resetParentItem; |
---|
4718 | 5176 | private MenuItem repairParentItem; |
---|
| 5177 | + private MenuItem repairShadowItem; |
---|
4719 | 5178 | private MenuItem sortbysizeItem; |
---|
4720 | 5179 | private MenuItem sortbynameItem; |
---|
4721 | 5180 | |
---|
.. | .. |
---|
4728 | 5187 | private MenuItem particleItem; |
---|
4729 | 5188 | private MenuItem ragdollItem; |
---|
4730 | 5189 | private MenuItem ragdoll2Item; |
---|
| 5190 | + private MenuItem heightFieldItem; |
---|
| 5191 | + private MenuItem textureFieldItem; |
---|
4731 | 5192 | private MenuItem gridItem; |
---|
4732 | 5193 | private MenuItem rectoidItem; |
---|
4733 | 5194 | private MenuItem ellipsoidItem; |
---|
4734 | 5195 | private MenuItem coneItem; |
---|
4735 | 5196 | private MenuItem torusItem; |
---|
4736 | 5197 | private MenuItem superItem; |
---|
| 5198 | + private MenuItem kleinItem; |
---|
4737 | 5199 | private MenuItem blobItem; |
---|
4738 | 5200 | private MenuItem latheItem; |
---|
4739 | 5201 | private MenuItem bezierItem; |
---|
4740 | | - private MenuItem checkerItem; |
---|
| 5202 | + private MenuItem overlayItem; |
---|
4741 | 5203 | private MenuItem meshItem; |
---|
4742 | 5204 | // private MenuItem meshGroupItem; |
---|
4743 | 5205 | private MenuItem springItem; |
---|
.. | .. |
---|
4746 | 5208 | private MenuItem csgItem; |
---|
4747 | 5209 | private MenuItem templateItem; |
---|
4748 | 5210 | private MenuItem textureItem; |
---|
| 5211 | + private MenuItem billboardItem; |
---|
4749 | 5212 | private MenuItem shadowXItem; |
---|
4750 | 5213 | private MenuItem shadowYItem; |
---|
4751 | 5214 | private MenuItem shadowZItem; |
---|