.. | .. |
---|
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 | + importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
| 443 | + importGFDItem.addActionListener(this); |
---|
| 444 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
| 445 | + importVRMLX3DItem.addActionListener(this); |
---|
| 446 | + importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
| 447 | + importOBJItem.addActionListener(this); |
---|
| 448 | + import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
| 449 | + import3DSItem.addActionListener(this); |
---|
| 450 | + |
---|
| 451 | + oe.menuBar.add(menu = new Menu("Tools")); |
---|
376 | 452 | buildToolsMenu(menu); |
---|
377 | 453 | } |
---|
378 | 454 | |
---|
.. | .. |
---|
406 | 482 | oe.radioPanel.add(dummyButton); |
---|
407 | 483 | oe.buttonGroup.add(dummyButton); |
---|
408 | 484 | */ |
---|
409 | | - aConstraints.gridy += 1; |
---|
410 | | - oe.aConstraints.gridwidth = 1; |
---|
411 | | - oe.aConstraints.gridx = 0; |
---|
| 485 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
412 | 486 | |
---|
413 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 487 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 488 | + liveCB.setToolTipText("Enabled animation"); |
---|
414 | 489 | liveCB.addItemListener(this); |
---|
415 | 490 | |
---|
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); |
---|
| 491 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 492 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 493 | + oneStepButton.addActionListener(this); |
---|
| 494 | + |
---|
| 495 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 496 | + fastCB.setToolTipText("Fast mode"); |
---|
434 | 497 | 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); |
---|
| 498 | + |
---|
| 499 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 500 | + trackCB.setToolTipText("Enable tracking"); |
---|
476 | 501 | trackCB.addItemListener(this); |
---|
477 | 502 | |
---|
478 | | - oe.aConstraints.gridx += 1; |
---|
479 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 503 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 504 | + screenfitButton.setToolTipText("Screen fit"); |
---|
480 | 505 | screenfitButton.addActionListener(this); |
---|
481 | | - oe.aConstraints.gridx += 1; |
---|
| 506 | + |
---|
482 | 507 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
483 | 508 | // 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 | 509 | |
---|
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); |
---|
| 510 | + if (Globals.ADVANCED) |
---|
| 511 | + { |
---|
| 512 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 513 | + snapobjectButton.addActionListener(this); |
---|
| 514 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 515 | + } |
---|
| 516 | + |
---|
| 517 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 518 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
495 | 519 | flashSelectionButton.addActionListener(this); |
---|
496 | | - oe.aConstraints.gridx += 1; |
---|
497 | | - oe.aConstraints.weighty = 0; |
---|
498 | | - oe.aConstraints.gridwidth = 1; |
---|
499 | 520 | |
---|
500 | | - // |
---|
501 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 521 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 522 | + |
---|
| 523 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 524 | + twoButton.setToolTipText("Show center view only"); |
---|
502 | 525 | twoButton.addActionListener(this); |
---|
503 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 526 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 527 | fourButton.addActionListener(this); |
---|
505 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 528 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 529 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 530 | + sixButton.setToolTipText("2-column layout left"); |
---|
506 | 531 | sixButton.addActionListener(this); |
---|
507 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 532 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 533 | + threeButton.setToolTipText("2-column layout right"); |
---|
508 | 534 | threeButton.addActionListener(this); |
---|
509 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 535 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 536 | + sevenButton.setToolTipText("3-column layout"); |
---|
510 | 537 | sevenButton.addActionListener(this); |
---|
511 | 538 | // |
---|
512 | 539 | |
---|
513 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 540 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 541 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
514 | 542 | rootButton.addActionListener(this); |
---|
515 | | - oe.aConstraints.gridx += 1; |
---|
516 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 543 | + |
---|
| 544 | + oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 545 | + closeButton.setToolTipText("Close tab"); |
---|
517 | 546 | closeButton.addActionListener(this); |
---|
518 | 547 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
519 | 548 | //clearButton.addActionListener(this); |
---|
520 | | - oe.aConstraints.gridx += 1; |
---|
521 | 549 | |
---|
522 | | - oe.aConstraints.gridx = 1; // |
---|
523 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 550 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 551 | + |
---|
| 552 | + commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 553 | + editButton.setToolTipText("Edit selection"); |
---|
524 | 554 | editButton.addActionListener(this); |
---|
525 | | - oe.aConstraints.gridx += 1; |
---|
526 | | - oe.aConstraints.weighty = 0; |
---|
527 | | - oe.aConstraints.gridwidth = 1; |
---|
528 | 555 | |
---|
529 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 556 | + commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 557 | + uneditButton.setToolTipText("Unedit selection"); |
---|
530 | 558 | uneditButton.addActionListener(this); |
---|
531 | 559 | |
---|
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); |
---|
| 560 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 561 | + allParamsButton.setToolTipText("Edit all params"); |
---|
544 | 562 | allParamsButton.addActionListener(this); |
---|
545 | 563 | |
---|
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); |
---|
| 564 | + commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 565 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 566 | + clearPanelButton.addActionListener(this); |
---|
| 567 | + |
---|
| 568 | + commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 569 | + unselectButton.setToolTipText("Unselect"); |
---|
551 | 570 | unselectButton.addActionListener(this); |
---|
552 | 571 | |
---|
| 572 | + commandsPanel.preferredHeight = 1; |
---|
| 573 | + |
---|
| 574 | + oe.treePanel.add(commandsPanel); |
---|
| 575 | + oe.treePanel.Return(); |
---|
| 576 | + |
---|
553 | 577 | // oe.aConstraints.gridx += 1; |
---|
554 | 578 | // oe.aConstraints.weighty = 0; |
---|
555 | 579 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
561 | 585 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
562 | 586 | // gcButton.addActionListener(this); |
---|
563 | 587 | |
---|
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; |
---|
| 588 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 589 | + |
---|
| 590 | + JScrollPane jSP; |
---|
575 | 591 | //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); |
---|
| 592 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
577 | 593 | ResetModel(); |
---|
578 | | - oe.aConstraints.weighty = 0.5; |
---|
579 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
580 | | - oe.aConstraints.gridy += 1; |
---|
581 | | - oe.aConstraints.gridwidth = 1; |
---|
| 594 | + |
---|
| 595 | + oe.treePanel.add(jSPPanel); |
---|
| 596 | + oe.treePanel.Return(); |
---|
582 | 597 | |
---|
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); |
---|
| 598 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 599 | + |
---|
| 600 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 601 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
587 | 602 | colorCB.addItemListener(this); |
---|
588 | | - oe.aConstraints.gridx += 2; |
---|
589 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 605 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
590 | 606 | materialCB.addItemListener(this); |
---|
591 | | - oe.aConstraints.gridx += 2; |
---|
592 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 607 | + |
---|
| 608 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 609 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
593 | 610 | textureCB.addItemListener(this); |
---|
594 | 611 | |
---|
595 | | - oe.aConstraints.gridx = 0; |
---|
596 | | - oe.aConstraints.gridy += 1; |
---|
| 612 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 613 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 614 | + oe.treePanel.Return(); |
---|
597 | 615 | |
---|
| 616 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 617 | +// mainPanel.setResizeWeight(0.5); |
---|
| 618 | + |
---|
598 | 619 | //jList.addListSelectionListener(this); |
---|
599 | 620 | oe.jTree.addTreeSelectionListener(this); |
---|
600 | 621 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
616 | 637 | radio.layout = sevenButton; |
---|
617 | 638 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
618 | 639 | } |
---|
| 640 | + |
---|
| 641 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 642 | + { |
---|
| 643 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 644 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 645 | + boxCB.addItemListener(this); |
---|
| 646 | + |
---|
| 647 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 648 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 649 | + zoomBoxCB.addItemListener(this); |
---|
| 650 | + |
---|
| 651 | + if (Globals.ADVANCED) |
---|
| 652 | + { |
---|
| 653 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 654 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 655 | + supportCB.addItemListener(this); |
---|
| 656 | + |
---|
| 657 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 658 | + // localCB.addItemListener(this); |
---|
| 659 | + |
---|
| 660 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 661 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 662 | + crowdCB.addItemListener(this); |
---|
| 663 | + |
---|
| 664 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 665 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 666 | + smoothCB.addItemListener(this); |
---|
| 667 | + |
---|
| 668 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 669 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 670 | + slowCB.addItemListener(this); |
---|
| 671 | + |
---|
| 672 | +// constraints.gridy += 1; |
---|
| 673 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 674 | +// speakerMocapCB.addItemListener(this); |
---|
| 675 | + |
---|
| 676 | + if (false) |
---|
| 677 | + { |
---|
| 678 | + // handled in scripts |
---|
| 679 | + //constraints.gridy += 1; |
---|
| 680 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 681 | + speakerCameraCB.addItemListener(this); |
---|
| 682 | + |
---|
| 683 | + //constraints.gridy += 1; |
---|
| 684 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 685 | + speakerFocusCB.addItemListener(this); |
---|
| 686 | + |
---|
| 687 | + //constraints.gridy += 1; |
---|
| 688 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 689 | + smoothfocusCB.addItemListener(this); |
---|
| 690 | + } |
---|
| 691 | + |
---|
| 692 | +//constraints.gridx += 1; |
---|
| 693 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 694 | +// debugCB.addItemListener(this); |
---|
| 695 | + |
---|
| 696 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 697 | + oeilCB.addItemListener(this); |
---|
| 698 | + |
---|
| 699 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 700 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 701 | + lookAtCB.addItemListener(this); |
---|
| 702 | + |
---|
| 703 | + } |
---|
| 704 | + |
---|
| 705 | + cGridBag fill = new cGridBag(); |
---|
| 706 | + |
---|
| 707 | + fill.preferredHeight = 200; |
---|
| 708 | + |
---|
| 709 | + panel.add(fill); |
---|
| 710 | + |
---|
| 711 | + } |
---|
619 | 712 | |
---|
620 | 713 | void EditObject(Object3D obj) |
---|
621 | 714 | { |
---|
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(); |
---|
| 715 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 716 | + radioButton.SetObject(obj); |
---|
| 717 | + radioButton.layout = sevenButton; |
---|
| 718 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 719 | + radioButton.addActionListener(this); |
---|
| 720 | + radioPanel.add(radioButton); |
---|
| 721 | + buttonGroup.add(radioButton); |
---|
| 722 | + radioButton.doClick(); |
---|
630 | 723 | } |
---|
631 | 724 | void SetupViews(ObjEditor oe) |
---|
632 | 725 | { |
---|
.. | .. |
---|
646 | 739 | JCheckBox fastCB; |
---|
647 | 740 | JCheckBox slowCB; |
---|
648 | 741 | JCheckBox boxCB; |
---|
| 742 | + JCheckBox zoomBoxCB; |
---|
649 | 743 | JCheckBox trackCB; |
---|
650 | 744 | JCheckBox smoothfocusCB; |
---|
651 | 745 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
688 | 782 | dropAttributes |= Object3D.TEXTURE; |
---|
689 | 783 | else |
---|
690 | 784 | dropAttributes &= ~Object3D.TEXTURE; |
---|
691 | | - } |
---|
692 | | - else if(e.getSource() == liveCB) |
---|
| 785 | + } else if(e.getSource() == liveCB) |
---|
693 | 786 | { |
---|
694 | 787 | cameraView.ToggleLive(); |
---|
695 | 788 | } |
---|
.. | .. |
---|
726 | 819 | Recompile(); |
---|
727 | 820 | cameraView.repaint(); |
---|
728 | 821 | // refreshContents(); |
---|
| 822 | + } |
---|
| 823 | + else if(e.getSource() == zoomBoxCB) |
---|
| 824 | + { |
---|
| 825 | + cameraView.ToggleZoomBoxMode(); |
---|
729 | 826 | } |
---|
730 | 827 | else if(e.getSource() == smoothfocusCB) |
---|
731 | 828 | { |
---|
.. | .. |
---|
894 | 991 | { |
---|
895 | 992 | loadClipboard(true); |
---|
896 | 993 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
897 | | - pasteInto(false); |
---|
| 994 | + pasteInto(false, false); |
---|
898 | 995 | } else { |
---|
899 | 996 | loadClipboard(false); |
---|
900 | 997 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
901 | | - pasteInto(false); // true); // ??? |
---|
| 998 | + pasteInto(false, false); // true); // ??? |
---|
902 | 999 | } |
---|
903 | 1000 | } |
---|
904 | 1001 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1002 | 1099 | |
---|
1003 | 1100 | void buildCreateMenu(Menu menu) |
---|
1004 | 1101 | { |
---|
| 1102 | + //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
| 1103 | + //heightFieldItem.addActionListener(this); |
---|
1005 | 1104 | gridItem = menu.add(new MenuItem("Grid")); |
---|
1006 | 1105 | gridItem.addActionListener(this); |
---|
1007 | 1106 | rectoidItem = menu.add(new MenuItem("Box")); |
---|
.. | .. |
---|
1014 | 1113 | torusItem.addActionListener(this); |
---|
1015 | 1114 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1016 | 1115 | superItem.addActionListener(this); |
---|
| 1116 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1117 | + kleinItem.addActionListener(this); |
---|
1017 | 1118 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1018 | 1119 | particleItem.addActionListener(this); |
---|
| 1120 | + if (Globals.ADVANCED) |
---|
| 1121 | + { |
---|
1019 | 1122 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1020 | 1123 | ragdollItem.addActionListener(this); |
---|
1021 | 1124 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1022 | 1125 | ragdoll2Item.addActionListener(this); |
---|
| 1126 | + } |
---|
1023 | 1127 | menu.add("-"); |
---|
1024 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1128 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1025 | 1129 | meshItem.addActionListener(this); |
---|
1026 | 1130 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1027 | 1131 | // meshGroupItem.addActionListener(this); |
---|
| 1132 | + if (Globals.ADVANCED) |
---|
| 1133 | + { |
---|
1028 | 1134 | springItem = menu.add(new MenuItem("Spring")); |
---|
1029 | 1135 | springItem.addActionListener(this); |
---|
1030 | 1136 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1031 | 1137 | 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 | 1138 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1037 | 1139 | blobItem.addActionListener(this); |
---|
1038 | 1140 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1039 | 1141 | latheItem.addActionListener(this); |
---|
| 1142 | + } |
---|
| 1143 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1144 | + bezierItem.addActionListener(this); |
---|
| 1145 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1146 | + overlayItem.addActionListener(this); |
---|
1040 | 1147 | lightItem = menu.add(new MenuItem("Light")); |
---|
1041 | 1148 | lightItem.addActionListener(this); |
---|
1042 | 1149 | menu.add("-"); |
---|
.. | .. |
---|
1046 | 1153 | loopItem.addActionListener(this); |
---|
1047 | 1154 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1048 | 1155 | doubleItem.addActionListener(this); |
---|
| 1156 | + if (Globals.ADVANCED) |
---|
| 1157 | + { |
---|
1049 | 1158 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1050 | 1159 | 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); |
---|
| 1160 | + } |
---|
1060 | 1161 | } |
---|
1061 | 1162 | |
---|
1062 | 1163 | void buildToolsMenu(Menu menu) |
---|
1063 | 1164 | { |
---|
1064 | 1165 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1065 | 1166 | animationItem.addItemListener(this); |
---|
1066 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1167 | + animationItem.setState(Globals.ANIMATION); |
---|
1067 | 1168 | |
---|
1068 | 1169 | menu.add("-"); |
---|
1069 | 1170 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1070 | 1171 | parseverticesItem.addActionListener(this); |
---|
1071 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1172 | + textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
| 1173 | + textureFieldItem.addActionListener(this); |
---|
| 1174 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1072 | 1175 | alignItem.addActionListener(this); |
---|
1073 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1074 | | - mirrorItem.addActionListener(this); |
---|
1075 | 1176 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1076 | 1177 | reduceMorphItem.addActionListener(this); |
---|
1077 | 1178 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1078 | 1179 | reduce34MorphItem.addActionListener(this); |
---|
1079 | | - |
---|
| 1180 | + menu.add("-"); |
---|
1080 | 1181 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1081 | 1182 | computeAOItem.addActionListener(this); |
---|
1082 | | - menu.add("-"); |
---|
1083 | 1183 | |
---|
| 1184 | + if (Globals.ADVANCED) |
---|
| 1185 | + { |
---|
| 1186 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1187 | + mirrorItem.addActionListener(this); |
---|
| 1188 | + menu.add("-"); |
---|
1084 | 1189 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1085 | 1190 | memoryItem.addActionListener(this); |
---|
1086 | 1191 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1094 | 1199 | resetParentItem.addActionListener(this); |
---|
1095 | 1200 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1096 | 1201 | repairParentItem.addActionListener(this); |
---|
| 1202 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1203 | + repairShadowItem.addActionListener(this); |
---|
1097 | 1204 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1098 | 1205 | invariantsItem.addActionListener(this); |
---|
1099 | 1206 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1101 | 1208 | menu.add("-"); |
---|
1102 | 1209 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1103 | 1210 | editScriptItem.addActionListener(this); |
---|
| 1211 | + } |
---|
1104 | 1212 | } |
---|
1105 | 1213 | |
---|
1106 | 1214 | void ScreenFit() |
---|
.. | .. |
---|
1429 | 1537 | |
---|
1430 | 1538 | void Overwrite(int mask) |
---|
1431 | 1539 | { |
---|
1432 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1540 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1433 | 1541 | { |
---|
1434 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1542 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
1435 | 1543 | |
---|
1436 | 1544 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1437 | 1545 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1454 | 1562 | // |
---|
1455 | 1563 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1456 | 1564 | { |
---|
| 1565 | + Object source = event.getSource(); |
---|
1457 | 1566 | /* |
---|
1458 | 1567 | if (event.getSource() == nameField) |
---|
1459 | 1568 | { |
---|
.. | .. |
---|
1465 | 1574 | } |
---|
1466 | 1575 | else |
---|
1467 | 1576 | */ |
---|
1468 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1577 | + if (source == lookAtItem || source == lookFromItem) |
---|
1469 | 1578 | { |
---|
1470 | 1579 | ScreenFit(); |
---|
1471 | 1580 | } else |
---|
1472 | | - if (event.getSource() == switchItem) |
---|
| 1581 | + if (source == switchItem) |
---|
1473 | 1582 | { |
---|
1474 | 1583 | cVector v1 = new cVector(); |
---|
1475 | 1584 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1478 | 1587 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1479 | 1588 | objEditor.cameraView.repaint(); |
---|
1480 | 1589 | } else |
---|
1481 | | - if (event.getSource() == rectoidItem) |
---|
| 1590 | + if (source == rectoidItem) |
---|
1482 | 1591 | { |
---|
1483 | 1592 | makeSomething(new Box()); |
---|
1484 | 1593 | } else |
---|
1485 | | - if (event.getSource() == particleItem) |
---|
| 1594 | + if (source == particleItem) |
---|
1486 | 1595 | { |
---|
1487 | 1596 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1488 | 1597 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1503 | 1612 | applyExample(particleGeom, "SMOKE"); |
---|
1504 | 1613 | makeSomething(particleGeom); |
---|
1505 | 1614 | } else |
---|
1506 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1615 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1507 | 1616 | { |
---|
1508 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1617 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1509 | 1618 | |
---|
1510 | 1619 | ragdoll.toParent = LA.newMatrix(); |
---|
1511 | 1620 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1521 | 1630 | makeSomething(ragdoll); |
---|
1522 | 1631 | //makeSomething(new VehicleDemo()); |
---|
1523 | 1632 | } else |
---|
1524 | | - if (event.getSource() == gridItem) |
---|
| 1633 | + /* |
---|
| 1634 | + */ |
---|
| 1635 | + if (source == heightFieldItem) |
---|
| 1636 | + { |
---|
| 1637 | + Object3D obj = new Object3D(); |
---|
| 1638 | + |
---|
| 1639 | + obj.CreateMaterial(); |
---|
| 1640 | + obj.bRep = new BoundaryRep(); |
---|
| 1641 | + |
---|
| 1642 | + obj.bRep.CreateMesh(new iHeightField() |
---|
| 1643 | + { |
---|
| 1644 | + public double f(double x, double y) |
---|
| 1645 | + { |
---|
| 1646 | + // The Mandelbrot set is represented by coloring |
---|
| 1647 | + // each point (x,y) according to the number of |
---|
| 1648 | + // iterations it takes before the while loop in |
---|
| 1649 | + // this method ends. For points that are actually |
---|
| 1650 | + // in the Mandelbrot set, or very close to it, the |
---|
| 1651 | + // count will reach the maximum value, 80. These |
---|
| 1652 | + // points will be colored purple. All other colors |
---|
| 1653 | + // represent points that are definitely NOT in the set. |
---|
| 1654 | + x -= 600; |
---|
| 1655 | + y -= 500; |
---|
| 1656 | + x /= 200; |
---|
| 1657 | + y /= 200; |
---|
| 1658 | + int count = 0; |
---|
| 1659 | + double zx = x; |
---|
| 1660 | + double zy = y; |
---|
| 1661 | + while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) { |
---|
| 1662 | + double new_zx = zx*zx - zy*zy + x; |
---|
| 1663 | + zy = 2*zx*zy + y; |
---|
| 1664 | + zx = new_zx; |
---|
| 1665 | + count++; |
---|
| 1666 | + } |
---|
| 1667 | + return count; // Math.sqrt(count); |
---|
| 1668 | + } |
---|
| 1669 | + }, 1000,1000); |
---|
| 1670 | + |
---|
| 1671 | + makeSomething(obj); |
---|
| 1672 | + } else |
---|
| 1673 | + if (source == gridItem) |
---|
1525 | 1674 | { |
---|
1526 | 1675 | makeSomething(new Grid()); |
---|
1527 | 1676 | } else |
---|
1528 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1677 | + if (source == ellipsoidItem) |
---|
1529 | 1678 | { |
---|
1530 | 1679 | makeSomething(new Sphere()); |
---|
1531 | 1680 | } else |
---|
1532 | | - if (event.getSource() == coneItem) |
---|
| 1681 | + if (source == coneItem) |
---|
1533 | 1682 | { |
---|
1534 | 1683 | makeSomething(new Cone()); |
---|
1535 | 1684 | } else |
---|
1536 | | - if (event.getSource() == torusItem) |
---|
| 1685 | + if (source == torusItem) |
---|
1537 | 1686 | { |
---|
1538 | 1687 | makeSomething(new Torus()); |
---|
1539 | 1688 | } else |
---|
1540 | | - if (event.getSource() == superItem) |
---|
| 1689 | + if (source == superItem) |
---|
1541 | 1690 | { |
---|
1542 | 1691 | makeSomething(new Superellipsoid()); |
---|
1543 | 1692 | } else |
---|
1544 | | - if (event.getSource() == blobItem) |
---|
| 1693 | + if (source == kleinItem) |
---|
| 1694 | + { |
---|
| 1695 | + makeSomething(new Klein()); |
---|
| 1696 | + } else |
---|
| 1697 | + if (source == blobItem) |
---|
1545 | 1698 | { |
---|
1546 | 1699 | Blob blob = new Blob(); |
---|
1547 | 1700 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1549 | 1702 | //blob.retile(); |
---|
1550 | 1703 | makeSomething(blob); |
---|
1551 | 1704 | } else |
---|
1552 | | - if (event.getSource() == latheItem) |
---|
| 1705 | + if (source == latheItem) |
---|
1553 | 1706 | { |
---|
1554 | 1707 | makeSomething(new Lathe()); |
---|
1555 | 1708 | } else |
---|
1556 | | - if (event.getSource() == bezierItem) |
---|
| 1709 | + if (source == bezierItem) |
---|
1557 | 1710 | { |
---|
1558 | 1711 | makeSomething(new BezierSurface()); |
---|
1559 | 1712 | } else |
---|
1560 | | - if (event.getSource() == checkerItem) |
---|
| 1713 | + if (source == overlayItem) |
---|
1561 | 1714 | { |
---|
1562 | 1715 | /* |
---|
1563 | 1716 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1570 | 1723 | LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent); |
---|
1571 | 1724 | LA.matInvert(obj.toParent, obj.fromParent); |
---|
1572 | 1725 | */ |
---|
1573 | | - makeSomething(new CheckerIG()); |
---|
| 1726 | + makeSomething(new Checker()); |
---|
1574 | 1727 | } else |
---|
1575 | | - if (event.getSource() == meshItem) |
---|
| 1728 | + if (source == meshItem) |
---|
1576 | 1729 | { |
---|
1577 | 1730 | Object3D itemtomake = new Object3D(); |
---|
1578 | 1731 | Object3D child; |
---|
.. | .. |
---|
1593 | 1746 | makeSomething(child); |
---|
1594 | 1747 | } |
---|
1595 | 1748 | } else |
---|
1596 | | - if (event.getSource() == springItem) |
---|
| 1749 | + if (source == springItem) |
---|
1597 | 1750 | { |
---|
1598 | 1751 | cSpring s = new cSpring(); |
---|
1599 | 1752 | s.setup(); |
---|
1600 | 1753 | makeSomething(s); |
---|
1601 | 1754 | } else |
---|
1602 | | - if (event.getSource() == flagItem) |
---|
| 1755 | + if (source == flagItem) |
---|
1603 | 1756 | { |
---|
1604 | 1757 | cSpring s = new cFlag(); |
---|
1605 | 1758 | s.setup(); |
---|
1606 | 1759 | makeSomething(s); |
---|
1607 | 1760 | } else |
---|
1608 | | - if (event.getSource() == lightItem) |
---|
| 1761 | + if (source == lightItem) |
---|
1609 | 1762 | { |
---|
1610 | 1763 | makeSomething(new Light()); |
---|
1611 | 1764 | } else |
---|
1612 | | - if (event.getSource() == csgItem) |
---|
| 1765 | + if (source == csgItem) |
---|
1613 | 1766 | { |
---|
1614 | 1767 | group(new CSG()); |
---|
1615 | 1768 | } else |
---|
1616 | | - if (event.getSource() == templateItem) |
---|
| 1769 | + if (source == templateItem) |
---|
1617 | 1770 | { |
---|
1618 | 1771 | group(new cTemplate()); |
---|
1619 | 1772 | } else |
---|
1620 | | - if (event.getSource() == attributeItem) |
---|
| 1773 | + if (source == attributeItem) |
---|
1621 | 1774 | { |
---|
1622 | 1775 | makeSomething(new Attribute()); |
---|
1623 | 1776 | } else |
---|
1624 | | - if (event.getSource() == pointflowItem) |
---|
| 1777 | + if (source == pointflowItem) |
---|
1625 | 1778 | { |
---|
1626 | 1779 | makeSomething(new PointFlow()); |
---|
1627 | 1780 | } else |
---|
.. | .. |
---|
1633 | 1786 | } else |
---|
1634 | 1787 | */ |
---|
1635 | 1788 | |
---|
1636 | | - if (event.getSource() == superLoopItem) |
---|
| 1789 | + if (source == superLoopItem) |
---|
1637 | 1790 | { |
---|
1638 | 1791 | Composite g = new cGroup(); |
---|
1639 | 1792 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1655 | 1808 | |
---|
1656 | 1809 | group(g); |
---|
1657 | 1810 | } else |
---|
1658 | | - if (event.getSource() == loopItem) |
---|
| 1811 | + if (source == loopItem) |
---|
1659 | 1812 | { |
---|
1660 | 1813 | Composite csg = new GroupLeaf(); |
---|
1661 | 1814 | csg.count = 5; |
---|
.. | .. |
---|
1664 | 1817 | csg.addChild(child); |
---|
1665 | 1818 | child.addChild(csg); |
---|
1666 | 1819 | } else |
---|
1667 | | - if (event.getSource() == doubleItem) |
---|
| 1820 | + if (source == doubleItem) |
---|
1668 | 1821 | { |
---|
1669 | 1822 | Composite csg = new GroupLeaf(); |
---|
1670 | 1823 | csg.count = 5; |
---|
.. | .. |
---|
1676 | 1829 | csg.addChild(child); |
---|
1677 | 1830 | child.addChild(csg); |
---|
1678 | 1831 | } else |
---|
1679 | | - if (event.getSource() == tripleItem) |
---|
| 1832 | + if (source == tripleItem) |
---|
1680 | 1833 | { |
---|
1681 | 1834 | Composite csg = new GroupLeaf(); |
---|
1682 | 1835 | csg.count = 4; |
---|
.. | .. |
---|
1692 | 1845 | child.addChild(csg); |
---|
1693 | 1846 | } else |
---|
1694 | 1847 | |
---|
1695 | | - if (event.getSource() == importGFDItem) |
---|
| 1848 | + if (source == importGFDItem) |
---|
1696 | 1849 | { |
---|
1697 | 1850 | ImportGFD(); |
---|
1698 | 1851 | } else |
---|
1699 | | - if (event.getSource() == importVRMLX3DItem) |
---|
| 1852 | + if (source == importVRMLX3DItem) |
---|
1700 | 1853 | { |
---|
1701 | 1854 | ImportVRMLX3D(); |
---|
1702 | 1855 | } else |
---|
1703 | | - if (event.getSource() == import3DSItem) |
---|
| 1856 | + if (source == import3DSItem) |
---|
1704 | 1857 | { |
---|
1705 | 1858 | objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1706 | 1859 | } else |
---|
1707 | | - if (event.getSource() == importOBJItem) |
---|
| 1860 | + if (source == importOBJItem) |
---|
1708 | 1861 | { |
---|
1709 | 1862 | objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1710 | 1863 | } else |
---|
1711 | | - if (event.getSource() == computeAOItem) |
---|
| 1864 | + if (source == computeAOItem) |
---|
1712 | 1865 | { |
---|
1713 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1714 | | - CameraPane.theRenderer.repaint(); |
---|
| 1866 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1867 | + Globals.theRenderer.repaint(); |
---|
1715 | 1868 | } else |
---|
1716 | | - if (event.getSource() == recompileItem) |
---|
| 1869 | + if (source == recompileItem) |
---|
1717 | 1870 | { |
---|
1718 | 1871 | Recompile(); |
---|
1719 | 1872 | refreshContents(); |
---|
1720 | 1873 | } else |
---|
1721 | | - if (event.getSource() == editScriptItem) |
---|
| 1874 | + if (source == editScriptItem) |
---|
1722 | 1875 | { |
---|
1723 | 1876 | OpenDialog(); |
---|
1724 | 1877 | refreshContents(); |
---|
1725 | 1878 | } else |
---|
1726 | | - if (event.getSource() == invariantsItem) |
---|
| 1879 | + if (source == invariantsItem) |
---|
1727 | 1880 | { |
---|
1728 | 1881 | System.out.println("Invariants:"); |
---|
1729 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 1882 | + GrafreeD.grafreeD.universe.invariants(); |
---|
1730 | 1883 | } else |
---|
1731 | | - if (event.getSource() == memoryItem) |
---|
| 1884 | + if (source == memoryItem) |
---|
1732 | 1885 | { |
---|
1733 | 1886 | //System.out.println("Invariants:"); |
---|
1734 | 1887 | PrintMemory(); |
---|
1735 | 1888 | } else |
---|
1736 | | - if (event.getSource() == pathItem) |
---|
| 1889 | + if (source == pathItem) |
---|
1737 | 1890 | { |
---|
1738 | 1891 | PrintPath(); |
---|
1739 | 1892 | } else |
---|
1740 | | - if (event.getSource() == analyzeItem) |
---|
| 1893 | + if (source == analyzeItem) |
---|
1741 | 1894 | { |
---|
1742 | 1895 | AnalyzeObject(); |
---|
1743 | 1896 | } else |
---|
1744 | | - if (event.getSource() == dumpItem) |
---|
| 1897 | + if (source == dumpItem) |
---|
1745 | 1898 | { |
---|
1746 | 1899 | DumpObject(); |
---|
1747 | 1900 | } else |
---|
1748 | | - if (event.getSource() == screenfitButton) |
---|
| 1901 | + if (source == oneStepButton) |
---|
| 1902 | + { |
---|
| 1903 | + Globals.ONESTEP = true; |
---|
| 1904 | + cameraView.repaint(); |
---|
| 1905 | + } else |
---|
| 1906 | + if (source == screenfitButton) |
---|
1749 | 1907 | { |
---|
1750 | 1908 | //Reload(lastConverter, lastFilename, true); |
---|
1751 | 1909 | ScreenFit(); |
---|
1752 | 1910 | } else |
---|
1753 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1911 | + if (source == screenfitpointButton) |
---|
1754 | 1912 | { |
---|
1755 | 1913 | //Reload(lastConverter, lastFilename, true); |
---|
1756 | 1914 | ScreenFitPoint(); |
---|
1757 | 1915 | } else |
---|
1758 | | - if (event.getSource() == snapobjectButton) |
---|
| 1916 | + if (source == snapobjectButton) |
---|
1759 | 1917 | { |
---|
1760 | 1918 | //Reload(lastConverter, lastFilename, true); |
---|
1761 | 1919 | SnapObject(); |
---|
.. | .. |
---|
1766 | 1924 | // Recompile(); |
---|
1767 | 1925 | // refreshContents(); |
---|
1768 | 1926 | // } else |
---|
1769 | | - if (event.getSource() == gcButton) |
---|
| 1927 | + if (source == gcButton) |
---|
1770 | 1928 | { |
---|
1771 | 1929 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1772 | 1930 | System.gc(); |
---|
1773 | 1931 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1774 | 1932 | } else |
---|
1775 | | - if (event.getSource() == editLeafItem) |
---|
| 1933 | + if (source == editLeafItem) |
---|
1776 | 1934 | { |
---|
1777 | 1935 | Object3D obj; |
---|
1778 | 1936 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1786 | 1944 | } |
---|
1787 | 1945 | refreshContents(true); |
---|
1788 | 1946 | } else |
---|
1789 | | - if (event.getSource() == openWindowItem) |
---|
| 1947 | + if (source == openWindowItem) |
---|
1790 | 1948 | { |
---|
1791 | 1949 | EditSelection(true); |
---|
1792 | 1950 | } else |
---|
1793 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 1951 | + if (source == cutItem || source == clearButton) |
---|
1794 | 1952 | { |
---|
1795 | 1953 | loadClipboard(true); |
---|
1796 | 1954 | } else |
---|
1797 | | - if (event.getSource() == duplicateItem) |
---|
| 1955 | + if (source == duplicateItem) |
---|
1798 | 1956 | { |
---|
1799 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 1957 | + Object3D keep = GrafreeD.clipboard; |
---|
1800 | 1958 | loadClipboard(false); |
---|
1801 | 1959 | paste(false); |
---|
1802 | | - GraphreeD.clipboard = keep; |
---|
| 1960 | + GrafreeD.clipboard = keep; |
---|
1803 | 1961 | } else |
---|
1804 | | - if (event.getSource() == cloneItem) |
---|
| 1962 | + if (source == cloneItem) |
---|
1805 | 1963 | { |
---|
1806 | 1964 | CloneSelection(false); |
---|
1807 | 1965 | } else |
---|
1808 | | - if (event.getSource() == cloneSupportItem) |
---|
| 1966 | + if (source == cloneSupportItem) |
---|
1809 | 1967 | { |
---|
1810 | 1968 | CloneSelection(true); |
---|
1811 | 1969 | } else |
---|
1812 | | - if (event.getSource() == copyItem) |
---|
| 1970 | + if (source == copyItem) |
---|
1813 | 1971 | { |
---|
1814 | 1972 | loadClipboard(false); |
---|
1815 | 1973 | } else |
---|
1816 | | - if (event.getSource() == pasteItem) |
---|
| 1974 | + if (source == pasteItem) |
---|
1817 | 1975 | { |
---|
1818 | 1976 | paste(false); |
---|
1819 | 1977 | } else |
---|
1820 | | - if (event.getSource() == pasteLinkItem) |
---|
| 1978 | + if (source == pasteIntoItem) |
---|
1821 | 1979 | { |
---|
1822 | | - pasteInto(false); |
---|
| 1980 | + pasteInto(true, false); |
---|
1823 | 1981 | } else |
---|
1824 | | - if (event.getSource() == pasteCloneItem) |
---|
| 1982 | + if (source == pasteLinkItem) |
---|
1825 | 1983 | { |
---|
1826 | | - pasteInto(true); |
---|
| 1984 | + pasteInto(false, false); |
---|
1827 | 1985 | } else |
---|
1828 | | - if (event.getSource() == pasteExpandItem) |
---|
| 1986 | + if (source == pasteCloneItem) |
---|
| 1987 | + { |
---|
| 1988 | + pasteInto(true, true); |
---|
| 1989 | + } else |
---|
| 1990 | + if (source == pasteExpandItem) |
---|
1829 | 1991 | { |
---|
1830 | 1992 | paste(true); |
---|
1831 | 1993 | } else |
---|
1832 | | - if (event.getSource() == synchronizeItem) |
---|
| 1994 | + if (source == synchronizeItem) |
---|
1833 | 1995 | { |
---|
1834 | 1996 | Overwrite(Object3D.TRANSFORM); |
---|
1835 | 1997 | } else |
---|
1836 | | - if (event.getSource() == overwriteNameItem) |
---|
| 1998 | + if (source == overwriteNameItem) |
---|
1837 | 1999 | { |
---|
1838 | 2000 | Overwrite(Object3D.NAME); |
---|
1839 | 2001 | } else |
---|
1840 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2002 | + if (source == overwriteUVItem) |
---|
1841 | 2003 | { |
---|
1842 | 2004 | Overwrite(Object3D.UV); |
---|
1843 | 2005 | } else |
---|
1844 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2006 | + if (source == overwriteMatItem) |
---|
1845 | 2007 | { |
---|
| 2008 | + /* july 2015 |
---|
1846 | 2009 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1847 | | - Overwrite(Object3D.MATERIAL); |
---|
| 2010 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1848 | 2011 | else |
---|
1849 | 2012 | { |
---|
1850 | 2013 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1856 | 2019 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1857 | 2020 | } |
---|
1858 | 2021 | } |
---|
| 2022 | + */ |
---|
| 2023 | + |
---|
| 2024 | + Overwrite(dropAttributes); |
---|
1859 | 2025 | } |
---|
1860 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2026 | + if (source == overwriteGeoItem) |
---|
1861 | 2027 | { |
---|
1862 | 2028 | Overwrite(Object3D.GEOMETRY); |
---|
1863 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2029 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1864 | 2030 | // { |
---|
1865 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2031 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1866 | 2032 | // |
---|
1867 | 2033 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1868 | 2034 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1874 | 2040 | // refreshContents(); |
---|
1875 | 2041 | // } |
---|
1876 | 2042 | } else |
---|
1877 | | - if (event.getSource() == generateMeshItem) |
---|
| 2043 | + if (source == generateMeshItem) |
---|
1878 | 2044 | { |
---|
1879 | 2045 | //if (group.selection.size() == 1) |
---|
1880 | 2046 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1885 | 2051 | ResetModel(); |
---|
1886 | 2052 | refreshContents(); |
---|
1887 | 2053 | } else |
---|
1888 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2054 | + if (source == extractGeometriesItem) |
---|
1889 | 2055 | { |
---|
1890 | 2056 | boolean one = false; |
---|
1891 | 2057 | |
---|
.. | .. |
---|
1912 | 2078 | ResetModel(); |
---|
1913 | 2079 | refreshContents(); |
---|
1914 | 2080 | } else |
---|
1915 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2081 | + if (source == cloneGeometriesItem) |
---|
1916 | 2082 | { |
---|
1917 | 2083 | boolean one = false; |
---|
1918 | 2084 | |
---|
.. | .. |
---|
1938 | 2104 | ResetModel(); |
---|
1939 | 2105 | refreshContents(); |
---|
1940 | 2106 | } else |
---|
1941 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2107 | + if (source == shareGeometriesItem) |
---|
1942 | 2108 | { |
---|
1943 | 2109 | boolean one = false; |
---|
1944 | 2110 | |
---|
1945 | 2111 | if (group.selection.size() == 1) |
---|
1946 | 2112 | one = true; |
---|
1947 | 2113 | |
---|
| 2114 | + Object3D merge = null; |
---|
| 2115 | + |
---|
1948 | 2116 | Object3D content = new cGroup(); |
---|
1949 | 2117 | |
---|
1950 | 2118 | for (int i=0; i<group.selection.size(); i++) |
---|
1951 | 2119 | { |
---|
1952 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2120 | + merge = new Merge(group.selection.get(i)); |
---|
1953 | 2121 | |
---|
1954 | 2122 | if (one) |
---|
1955 | | - makeSomething(sel, false); |
---|
| 2123 | + makeSomething(merge, false); |
---|
1956 | 2124 | else |
---|
1957 | | - content.addChild(sel); |
---|
| 2125 | + content.addChild(merge); |
---|
1958 | 2126 | } |
---|
1959 | 2127 | |
---|
1960 | 2128 | if (!one) |
---|
1961 | | - makeSomething(content, false); |
---|
1962 | | - |
---|
1963 | | - ResetModel(); |
---|
1964 | | - refreshContents(); |
---|
| 2129 | + makeSomething(content, true); |
---|
| 2130 | + else |
---|
| 2131 | + { |
---|
| 2132 | + ResetModel(); |
---|
| 2133 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2134 | + refreshContents(); |
---|
| 2135 | + } |
---|
1965 | 2136 | } else |
---|
1966 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2137 | + if (source == mergeGeometriesItem) |
---|
1967 | 2138 | { |
---|
1968 | 2139 | boolean one = false; |
---|
1969 | 2140 | |
---|
.. | .. |
---|
1993 | 2164 | ResetModel(); |
---|
1994 | 2165 | refreshContents(); |
---|
1995 | 2166 | } else |
---|
1996 | | - if (event.getSource() == linkverticesItem) |
---|
| 2167 | + if (source == linkverticesItem) |
---|
1997 | 2168 | { |
---|
1998 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2169 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
1999 | 2170 | // { |
---|
2000 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2171 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2001 | 2172 | // |
---|
2002 | 2173 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2003 | 2174 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2006 | 2177 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2007 | 2178 | // refreshContents(); |
---|
2008 | 2179 | // } |
---|
2009 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2180 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
2010 | 2181 | { |
---|
2011 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2182 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2012 | 2183 | |
---|
2013 | 2184 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2014 | 2185 | content = ((cGroup)content).get(0); |
---|
2015 | 2186 | |
---|
2016 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2187 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2017 | 2188 | for (int i=0; i<group.selection.size(); i++) |
---|
2018 | 2189 | { |
---|
2019 | | - boolean random = CameraPane.RANDOM; |
---|
2020 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2190 | + boolean random = CameraPane.SWITCH; |
---|
| 2191 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2021 | 2192 | group.selection.get(i).linkVerticesThis(content); |
---|
2022 | 2193 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2023 | | - CameraPane.RANDOM = random; |
---|
| 2194 | + CameraPane.SWITCH = random; |
---|
2024 | 2195 | } |
---|
2025 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2196 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2026 | 2197 | refreshContents(); |
---|
2027 | 2198 | } |
---|
2028 | 2199 | } else |
---|
2029 | | - if (event.getSource() == resetsupportItem) |
---|
| 2200 | + if (source == resetsupportItem) |
---|
2030 | 2201 | { |
---|
2031 | 2202 | for (int i=0; i<group.selection.size(); i++) |
---|
2032 | 2203 | { |
---|
2033 | | - boolean random = CameraPane.RANDOM; |
---|
2034 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2204 | + boolean random = CameraPane.SWITCH; |
---|
| 2205 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2035 | 2206 | group.selection.get(i).linkVerticesThis(null); |
---|
2036 | | - CameraPane.RANDOM = random; |
---|
| 2207 | + CameraPane.SWITCH = random; |
---|
2037 | 2208 | } |
---|
2038 | 2209 | |
---|
2039 | 2210 | refreshContents(); |
---|
2040 | 2211 | } else |
---|
2041 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2212 | + if (source == relinkverticesItem) |
---|
| 2213 | + { |
---|
| 2214 | + boolean random = CameraPane.SWITCH; |
---|
| 2215 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2216 | + group.selection.RelinkToSupport(); |
---|
| 2217 | + CameraPane.SWITCH = random; |
---|
| 2218 | + |
---|
| 2219 | + refreshContents(); |
---|
| 2220 | + } else |
---|
| 2221 | + if (source == resetreferencesItem) |
---|
2042 | 2222 | { |
---|
2043 | 2223 | for (int i=0; i<group.selection.size(); i++) |
---|
2044 | 2224 | { |
---|
.. | .. |
---|
2047 | 2227 | |
---|
2048 | 2228 | refreshContents(); |
---|
2049 | 2229 | } else |
---|
2050 | | - if (event.getSource() == setMasterItem) |
---|
| 2230 | + if (source == setMasterItem) |
---|
2051 | 2231 | { |
---|
2052 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2232 | + if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2053 | 2233 | { |
---|
2054 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2234 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2055 | 2235 | |
---|
2056 | 2236 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2057 | 2237 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2060 | 2240 | refreshContents(); |
---|
2061 | 2241 | } |
---|
2062 | 2242 | } else |
---|
2063 | | - if (event.getSource() == poseMeshItem) |
---|
| 2243 | + if (source == poseMeshItem) |
---|
2064 | 2244 | { |
---|
2065 | 2245 | if (group.selection.size() == 1) |
---|
2066 | 2246 | { |
---|
2067 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2247 | + if (GrafreeD.clipboard.size() == 1) |
---|
2068 | 2248 | { |
---|
2069 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2249 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2070 | 2250 | |
---|
2071 | 2251 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2072 | 2252 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2079 | 2259 | } |
---|
2080 | 2260 | |
---|
2081 | 2261 | } else |
---|
2082 | | - if (event.getSource() == revertMeshItem) |
---|
| 2262 | + if (source == revertMeshItem) |
---|
2083 | 2263 | { |
---|
2084 | 2264 | RevertMeshes(); |
---|
2085 | 2265 | } else |
---|
2086 | | - if (event.getSource() == resetMeshItem) |
---|
| 2266 | + if (source == resetMeshItem) |
---|
2087 | 2267 | { |
---|
2088 | 2268 | ResetAll(); |
---|
2089 | 2269 | } else |
---|
2090 | | - if (event.getSource() == stepAllItem) |
---|
| 2270 | + if (source == stepAllItem) |
---|
2091 | 2271 | { |
---|
2092 | 2272 | StepAll(); |
---|
2093 | 2273 | } else |
---|
2094 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2274 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2095 | 2275 | { |
---|
2096 | 2276 | //int indices[] = jList.getSelectedIndices(); |
---|
2097 | 2277 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2099 | 2279 | |
---|
2100 | 2280 | ClearSelection(false); |
---|
2101 | 2281 | } else |
---|
2102 | | - if (event.getSource() == clearAllItem) |
---|
| 2282 | + if (source == clearAllItem) |
---|
2103 | 2283 | { |
---|
2104 | 2284 | ClearSelection(true); |
---|
2105 | 2285 | } else |
---|
2106 | | - if (event.getSource() == grabItem) |
---|
| 2286 | + if (source == grabItem) |
---|
2107 | 2287 | { |
---|
2108 | 2288 | group(new cGroup(), true); |
---|
2109 | 2289 | } else |
---|
2110 | | - if (event.getSource() == frontItem) |
---|
| 2290 | + if (source == hideItem) |
---|
| 2291 | + { |
---|
| 2292 | + group(new HiddenObject()); |
---|
| 2293 | + } else |
---|
| 2294 | + if (source == frontItem) |
---|
2111 | 2295 | { |
---|
2112 | 2296 | front(); |
---|
2113 | 2297 | } else |
---|
2114 | | - if (event.getSource() == backItem) |
---|
| 2298 | + if (source == backItem) |
---|
2115 | 2299 | { |
---|
2116 | 2300 | back(); |
---|
2117 | 2301 | } else |
---|
2118 | | - if (event.getSource() == cameraItem) |
---|
| 2302 | + if (source == cameraItem) |
---|
2119 | 2303 | { |
---|
2120 | 2304 | makeSomething(new Camera()); |
---|
2121 | 2305 | } else |
---|
2122 | | - if (event.getSource() == compositeItem) |
---|
| 2306 | + if (source == compositeItem) |
---|
2123 | 2307 | { |
---|
2124 | 2308 | group(new Composite()); |
---|
2125 | 2309 | } else |
---|
2126 | | - if (event.getSource() == randomItem) |
---|
| 2310 | + if (source == randomItem) |
---|
2127 | 2311 | { |
---|
2128 | 2312 | RandomNode random = new RandomNode(); |
---|
2129 | 2313 | group(random); |
---|
2130 | 2314 | if (random.size() > 0) |
---|
2131 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2315 | + random.name = random.get(0).name + "Switch"; |
---|
2132 | 2316 | } else |
---|
2133 | | - if (event.getSource() == physicsItem) |
---|
| 2317 | + if (source == physicsItem) |
---|
2134 | 2318 | { |
---|
2135 | 2319 | group(new PhysicsNode()); |
---|
2136 | 2320 | } else |
---|
2137 | | - if (event.getSource() == frameselectorItem) |
---|
| 2321 | + if (source == frameselectorItem) |
---|
2138 | 2322 | { |
---|
2139 | 2323 | for (int i=0; i<group.selection.size(); i++) |
---|
2140 | 2324 | { |
---|
.. | .. |
---|
2146 | 2330 | ResetModel(); |
---|
2147 | 2331 | refreshContents(); |
---|
2148 | 2332 | } else |
---|
2149 | | - if (event.getSource() == switchGeoItem) |
---|
| 2333 | + if (source == switchGeoItem) |
---|
2150 | 2334 | { |
---|
2151 | 2335 | for (int i=0; i<group.selection.size(); i++) |
---|
2152 | 2336 | { |
---|
.. | .. |
---|
2158 | 2342 | ResetModel(); |
---|
2159 | 2343 | refreshContents(); |
---|
2160 | 2344 | } else |
---|
2161 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2345 | + if (source == switchTransfoItem) |
---|
2162 | 2346 | { |
---|
2163 | 2347 | for (int i=0; i<group.selection.size(); i++) |
---|
2164 | 2348 | { |
---|
.. | .. |
---|
2170 | 2354 | ResetModel(); |
---|
2171 | 2355 | refreshContents(); |
---|
2172 | 2356 | } else |
---|
2173 | | - if (event.getSource() == morphItem) |
---|
| 2357 | + if (source == morphItem) |
---|
2174 | 2358 | { |
---|
2175 | 2359 | for (int i=0; i<group.selection.size(); i++) |
---|
2176 | 2360 | { |
---|
.. | .. |
---|
2182 | 2366 | ResetModel(); |
---|
2183 | 2367 | refreshContents(); |
---|
2184 | 2368 | } else |
---|
2185 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2369 | + if (source == scriptNodeItem) |
---|
2186 | 2370 | { |
---|
2187 | 2371 | boolean atleastone = false; |
---|
2188 | 2372 | |
---|
.. | .. |
---|
2221 | 2405 | } |
---|
2222 | 2406 | } |
---|
2223 | 2407 | } else |
---|
2224 | | - if (event.getSource() == linkerItem) |
---|
| 2408 | + if (source == linkerItem) |
---|
2225 | 2409 | { |
---|
2226 | 2410 | group(new cLinker()); |
---|
2227 | 2411 | } else |
---|
2228 | | - if (event.getSource() == textureItem) |
---|
| 2412 | + if (source == textureItem) |
---|
2229 | 2413 | { |
---|
2230 | 2414 | group(new TextureNode()); |
---|
2231 | 2415 | } else |
---|
2232 | | - if (event.getSource() == shadowXItem) |
---|
| 2416 | + if (source == billboardItem) |
---|
| 2417 | + { |
---|
| 2418 | + group(new BillboardNode()); |
---|
| 2419 | + } else |
---|
| 2420 | + if (source == shadowXItem) |
---|
2233 | 2421 | { |
---|
2234 | 2422 | CastShadow(0); |
---|
2235 | 2423 | } else |
---|
2236 | | - if (event.getSource() == shadowYItem) |
---|
| 2424 | + if (source == shadowYItem) |
---|
2237 | 2425 | { |
---|
2238 | 2426 | CastShadow(1); |
---|
2239 | 2427 | } else |
---|
2240 | | - if (event.getSource() == shadowZItem) |
---|
| 2428 | + if (source == shadowZItem) |
---|
2241 | 2429 | { |
---|
2242 | 2430 | CastShadow(2); |
---|
2243 | 2431 | } else |
---|
2244 | | - if (event.getSource() == ungroupItem) |
---|
| 2432 | + if (source == ungroupItem) |
---|
2245 | 2433 | { |
---|
2246 | | - ungroup(); |
---|
| 2434 | + //ungroup(); |
---|
| 2435 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2436 | + { |
---|
| 2437 | + Ungroup(group.selection.get(i)); |
---|
| 2438 | + } |
---|
| 2439 | + |
---|
| 2440 | + ClearSelection(false); |
---|
| 2441 | + |
---|
| 2442 | + refreshContents(); |
---|
2247 | 2443 | } else |
---|
2248 | | - if (event.getSource() == genUVItem) |
---|
| 2444 | + if (source == genUVItem) |
---|
2249 | 2445 | { |
---|
2250 | 2446 | GenUV(); |
---|
2251 | 2447 | } else |
---|
2252 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2448 | + if (source == genNormalsCADItem) |
---|
2253 | 2449 | { |
---|
2254 | 2450 | GenNormals(true); |
---|
2255 | 2451 | } else |
---|
2256 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2452 | + if (source == genNormalsMESHItem) |
---|
| 2453 | + { |
---|
| 2454 | + GenNormals(true); // TODO |
---|
| 2455 | + } else |
---|
| 2456 | + if (source == genNormalsORGANItem) |
---|
2257 | 2457 | { |
---|
2258 | 2458 | GenNormals(false); |
---|
2259 | 2459 | } else |
---|
2260 | | - if (event.getSource() == stripifyItem) |
---|
| 2460 | + if (source == genNormalsMINEItem) |
---|
| 2461 | + { |
---|
| 2462 | + GenNormalsMINE(); |
---|
| 2463 | + } else |
---|
| 2464 | + if (source == stripifyItem) |
---|
2261 | 2465 | { |
---|
2262 | 2466 | Stripify(); |
---|
2263 | 2467 | } else |
---|
2264 | | - if (event.getSource() == unstripifyItem) |
---|
| 2468 | + if (source == unstripifyItem) |
---|
2265 | 2469 | { |
---|
2266 | 2470 | Unstripify(); |
---|
2267 | 2471 | } else |
---|
2268 | | - if (event.getSource() == trimItem) |
---|
| 2472 | + if (source == trimItem) |
---|
2269 | 2473 | { |
---|
2270 | 2474 | Trim(); |
---|
2271 | 2475 | } else |
---|
2272 | | - if (event.getSource() == untrimItem) |
---|
| 2476 | + if (source == untrimItem) |
---|
2273 | 2477 | { |
---|
2274 | 2478 | Untrim(); |
---|
2275 | 2479 | } else |
---|
2276 | | - if (event.getSource() == clearColorsItem) |
---|
| 2480 | + if (source == clearColorsItem) |
---|
2277 | 2481 | { |
---|
2278 | 2482 | ClearColors(); |
---|
2279 | 2483 | } else |
---|
2280 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2484 | + if (source == clearMaterialsItem) |
---|
2281 | 2485 | { |
---|
2282 | 2486 | ClearMaterials(); |
---|
2283 | 2487 | } else |
---|
2284 | | - if (event.getSource() == liveleavesItem) |
---|
| 2488 | + if (source == liveleavesItem) |
---|
2285 | 2489 | { |
---|
2286 | 2490 | LiveLeaves(true); |
---|
2287 | 2491 | } else |
---|
2288 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2492 | + if (source == unliveleavesItem) |
---|
2289 | 2493 | { |
---|
2290 | 2494 | LiveLeaves(false); |
---|
2291 | 2495 | } else |
---|
2292 | | - if (event.getSource() == supportleavesItem) |
---|
| 2496 | + if (source == supportleavesItem) |
---|
2293 | 2497 | { |
---|
2294 | 2498 | SupportLeaves(true); |
---|
2295 | 2499 | } else |
---|
2296 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2500 | + if (source == unsupportleavesItem) |
---|
2297 | 2501 | { |
---|
2298 | 2502 | SupportLeaves(false); |
---|
2299 | 2503 | } else |
---|
2300 | | - if (event.getSource() == hideleavesItem) |
---|
| 2504 | + if (source == hideleavesItem) |
---|
2301 | 2505 | { |
---|
2302 | 2506 | HideLeaves(true); |
---|
2303 | 2507 | } else |
---|
2304 | | - if (event.getSource() == showleavesItem) |
---|
| 2508 | + if (source == showleavesItem) |
---|
2305 | 2509 | { |
---|
2306 | 2510 | HideLeaves(false); |
---|
2307 | 2511 | } else |
---|
2308 | | - if (event.getSource() == markleavesItem) |
---|
| 2512 | + if (source == markleavesItem) |
---|
2309 | 2513 | { |
---|
2310 | 2514 | MarkLeaves(true); |
---|
2311 | 2515 | } else |
---|
2312 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2516 | + if (source == unmarkleavesItem) |
---|
2313 | 2517 | { |
---|
2314 | 2518 | MarkLeaves(false); |
---|
2315 | 2519 | } else |
---|
2316 | | - if (event.getSource() == flipVItem) |
---|
| 2520 | + if (source == flipVItem) |
---|
2317 | 2521 | { |
---|
2318 | 2522 | FlipV(true); |
---|
2319 | 2523 | } else |
---|
2320 | | - if (event.getSource() == unflipVItem) |
---|
| 2524 | + if (source == unflipVItem) |
---|
2321 | 2525 | { |
---|
2322 | 2526 | FlipV(false); |
---|
2323 | 2527 | } else |
---|
2324 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2528 | + if (source == lowTexturesItem) |
---|
2325 | 2529 | { |
---|
2326 | 2530 | SetTexRes(0); |
---|
2327 | 2531 | } else |
---|
2328 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2532 | + if (source == normalTexturesItem) |
---|
2329 | 2533 | { |
---|
2330 | 2534 | SetTexRes(1); |
---|
2331 | 2535 | } else |
---|
2332 | | - if (event.getSource() == highTexturesItem) |
---|
| 2536 | + if (source == highTexturesItem) |
---|
2333 | 2537 | { |
---|
2334 | 2538 | SetTexRes(2); |
---|
2335 | 2539 | } else |
---|
2336 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2540 | + if (source == veryhighTexturesItem) |
---|
2337 | 2541 | { |
---|
2338 | 2542 | SetTexRes(3); |
---|
2339 | 2543 | } else |
---|
2340 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2544 | + if (source == maxTexturesItem) |
---|
2341 | 2545 | { |
---|
2342 | 2546 | SetTexRes(4); |
---|
2343 | 2547 | } else |
---|
2344 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2548 | + if (source == panoTexturesItem) |
---|
2345 | 2549 | { |
---|
2346 | 2550 | SetTexRes(5); |
---|
2347 | 2551 | } else |
---|
2348 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2552 | + if (source == reverseNormalsItem) |
---|
2349 | 2553 | { |
---|
2350 | 2554 | ReverseNormals(); |
---|
2351 | 2555 | } else |
---|
2352 | | - if (event.getSource() == parseverticesItem) |
---|
| 2556 | + if (source == parseverticesItem) |
---|
2353 | 2557 | { |
---|
2354 | 2558 | ParseVertices(); |
---|
2355 | 2559 | } else |
---|
2356 | | - if (event.getSource() == alignItem) |
---|
| 2560 | + if (source == textureFieldItem) |
---|
| 2561 | + { |
---|
| 2562 | + TextureVertices(); |
---|
| 2563 | + } else |
---|
| 2564 | + if (source == alignItem) |
---|
2357 | 2565 | { |
---|
2358 | 2566 | Align(); |
---|
2359 | 2567 | } else |
---|
2360 | | - if (event.getSource() == mirrorItem) |
---|
| 2568 | + if (source == mirrorItem) |
---|
2361 | 2569 | { |
---|
2362 | 2570 | MirrorPoses(); |
---|
2363 | 2571 | } else |
---|
2364 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2572 | + if (source == reduceMorphItem) |
---|
2365 | 2573 | { |
---|
2366 | 2574 | MeshReduction(false); |
---|
2367 | 2575 | } else |
---|
2368 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2576 | + if (source == reduce34MorphItem) |
---|
2369 | 2577 | { |
---|
2370 | 2578 | MeshReduction(true); |
---|
2371 | 2579 | } else |
---|
2372 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2580 | + if (source == reverseTrianglesItem) |
---|
2373 | 2581 | { |
---|
2374 | 2582 | ReverseTriangles(); |
---|
2375 | 2583 | } else |
---|
2376 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2584 | + if (source == reduceMeshItem) |
---|
2377 | 2585 | { |
---|
2378 | 2586 | ReduceMesh(false); |
---|
2379 | 2587 | } else |
---|
2380 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2588 | + if (source == reduce34MeshItem) |
---|
2381 | 2589 | { |
---|
2382 | 2590 | ReduceMesh(true); |
---|
2383 | 2591 | } else |
---|
2384 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2592 | + if (source == increaseMeshItem) |
---|
2385 | 2593 | { |
---|
2386 | 2594 | IncreaseMesh(); |
---|
2387 | 2595 | } else |
---|
2388 | | - if (event.getSource() == clipMeshItem) |
---|
| 2596 | + if (source == clipMeshItem) |
---|
2389 | 2597 | { |
---|
2390 | 2598 | ClipMesh(); |
---|
2391 | 2599 | } else |
---|
2392 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2600 | + if (source == smoothMeshItem) |
---|
2393 | 2601 | { |
---|
2394 | 2602 | SmoothMesh(); |
---|
2395 | 2603 | } else |
---|
2396 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2604 | + if (source == transformgeometryItem) |
---|
2397 | 2605 | { |
---|
2398 | 2606 | TransformGeometry(); |
---|
2399 | 2607 | } else |
---|
2400 | | - if (event.getSource() == resetTransformItem) |
---|
| 2608 | + if (source == resetTransformItem) |
---|
2401 | 2609 | { |
---|
2402 | 2610 | ResetTransform(); |
---|
2403 | 2611 | } else |
---|
2404 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2612 | + if (source == resetCentroidItem) |
---|
2405 | 2613 | { |
---|
2406 | 2614 | ResetCentroid(); |
---|
2407 | 2615 | } else |
---|
2408 | | - if (event.getSource() == resetParentItem) |
---|
| 2616 | + if (source == resetParentItem) |
---|
2409 | 2617 | { |
---|
2410 | 2618 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2411 | 2619 | { |
---|
.. | .. |
---|
2415 | 2623 | |
---|
2416 | 2624 | refreshContents(); |
---|
2417 | 2625 | } else |
---|
2418 | | - if (event.getSource() == repairParentItem) |
---|
| 2626 | + if (source == repairParentItem) |
---|
2419 | 2627 | { |
---|
2420 | 2628 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2421 | 2629 | { |
---|
.. | .. |
---|
2429 | 2637 | |
---|
2430 | 2638 | refreshContents(); |
---|
2431 | 2639 | } else |
---|
2432 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2640 | + if (source == repairShadowItem) |
---|
| 2641 | + { |
---|
| 2642 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2643 | + { |
---|
| 2644 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2645 | + obj.RepairShadow(); |
---|
| 2646 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2647 | +// { |
---|
| 2648 | +// obj.get(i).parent = obj; |
---|
| 2649 | +// } |
---|
| 2650 | + } |
---|
| 2651 | + |
---|
| 2652 | + refreshContents(); |
---|
| 2653 | + } else |
---|
| 2654 | + if (source == sortbysizeItem) |
---|
2433 | 2655 | { |
---|
2434 | 2656 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2435 | 2657 | { |
---|
.. | .. |
---|
2441 | 2663 | ResetModel(); |
---|
2442 | 2664 | refreshContents(); |
---|
2443 | 2665 | } else |
---|
2444 | | - if (event.getSource() == sortbynameItem) |
---|
| 2666 | + if (source == sortbynameItem) |
---|
2445 | 2667 | { |
---|
2446 | 2668 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2447 | 2669 | { |
---|
.. | .. |
---|
2453 | 2675 | ResetModel(); |
---|
2454 | 2676 | refreshContents(); |
---|
2455 | 2677 | } else |
---|
2456 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2678 | + if (source == attachPigmentItem) |
---|
2457 | 2679 | { |
---|
2458 | 2680 | String texture = GetFile("Attach pigment"); |
---|
2459 | 2681 | Object3D obj; |
---|
.. | .. |
---|
2465 | 2687 | |
---|
2466 | 2688 | refreshContents(); |
---|
2467 | 2689 | } else |
---|
2468 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2690 | + if (source == detachPigmentItem) |
---|
2469 | 2691 | { |
---|
2470 | 2692 | Object3D obj; |
---|
2471 | 2693 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2476 | 2698 | |
---|
2477 | 2699 | refreshContents(); |
---|
2478 | 2700 | } else |
---|
2479 | | - if (event.getSource() == attachBumpItem) |
---|
| 2701 | + if (source == attachBumpItem) |
---|
2480 | 2702 | { |
---|
2481 | 2703 | String texture = GetFile("Attach bump"); |
---|
2482 | 2704 | Object3D obj; |
---|
.. | .. |
---|
2488 | 2710 | |
---|
2489 | 2711 | refreshContents(); |
---|
2490 | 2712 | } else |
---|
2491 | | - if (event.getSource() == detachBumpItem) |
---|
| 2713 | + if (source == detachBumpItem) |
---|
2492 | 2714 | { |
---|
2493 | 2715 | Object3D obj; |
---|
2494 | 2716 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2499 | 2721 | |
---|
2500 | 2722 | refreshContents(); |
---|
2501 | 2723 | } else |
---|
2502 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2724 | + if (source == pigmentBumpItem) |
---|
2503 | 2725 | { |
---|
2504 | 2726 | Object3D obj; |
---|
2505 | 2727 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2510 | 2732 | |
---|
2511 | 2733 | refreshContents(); |
---|
2512 | 2734 | } else |
---|
2513 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2735 | + if (source == flashSelectionButton) |
---|
2514 | 2736 | { |
---|
2515 | 2737 | CameraPane.flash = true; |
---|
2516 | 2738 | refreshContents(); |
---|
2517 | 2739 | } else |
---|
2518 | | - if (event.getSource() == oneButton) |
---|
| 2740 | + if (source == oneButton) |
---|
2519 | 2741 | { |
---|
2520 | 2742 | } else |
---|
2521 | | - if (event.getSource() == twoButton) |
---|
| 2743 | + if (source == twoButton) |
---|
2522 | 2744 | { |
---|
2523 | 2745 | radio.layout = twoButton; |
---|
2524 | 2746 | // bug |
---|
2525 | 2747 | //gridPanel.setDividerLocation(1.0); |
---|
2526 | 2748 | //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(); |
---|
| 2749 | +// bigThree.remove(scenePanel); |
---|
| 2750 | +// bigThree.remove(centralPanel); |
---|
| 2751 | +// bigThree.remove(XYZPanel); |
---|
| 2752 | +// aWindowConstraints.gridx = 0; |
---|
| 2753 | +// aWindowConstraints.gridy = 0; |
---|
| 2754 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2755 | +// // aConstraints.gridheight = 3; |
---|
| 2756 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2757 | +// aWindowConstraints.weightx = 0; |
---|
| 2758 | +// aWindowConstraints.weighty = 1; |
---|
| 2759 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2760 | +// aWindowConstraints.weightx = 1; |
---|
| 2761 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2762 | +// // aConstraints.gridheight = 3; |
---|
| 2763 | +// aWindowConstraints.gridx = 1; |
---|
| 2764 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2765 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2766 | +// aWindowConstraints.weightx = 0; |
---|
| 2767 | +// aWindowConstraints.gridx = 4; |
---|
| 2768 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2769 | +// // aConstraints.gridheight = 3; |
---|
| 2770 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2771 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2772 | +// scenePanel.setVisible(false); |
---|
| 2773 | +// centralPanel.setVisible(true); |
---|
| 2774 | +// XYZPanel.setVisible(false); |
---|
| 2775 | + bigThree.ClearUI(); |
---|
| 2776 | + bigThree.add(centralPanel); |
---|
| 2777 | + bigThree.FlushUI(); |
---|
2551 | 2778 | } else |
---|
2552 | | - if (event.getSource() == threeButton) |
---|
| 2779 | + if (source == threeButton) |
---|
2553 | 2780 | { |
---|
2554 | 2781 | 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(); |
---|
| 2782 | + |
---|
| 2783 | +// bigThree.remove(scenePanel); |
---|
| 2784 | +// bigThree.remove(centralPanel); |
---|
| 2785 | +// bigThree.remove(XYZPanel); |
---|
| 2786 | +// aWindowConstraints.gridx = 0; |
---|
| 2787 | +// aWindowConstraints.gridy = 0; |
---|
| 2788 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2789 | +// // aConstraints.gridheight = 3; |
---|
| 2790 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2791 | +// aWindowConstraints.weightx = 0; |
---|
| 2792 | +// aWindowConstraints.weighty = 1; |
---|
| 2793 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2794 | +// aWindowConstraints.weightx = 1; |
---|
| 2795 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2796 | +// // aConstraints.gridheight = 3; |
---|
| 2797 | +// aWindowConstraints.gridx = 1; |
---|
| 2798 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2799 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2800 | +// aWindowConstraints.weightx = 0; |
---|
| 2801 | +// aWindowConstraints.gridx = 4; |
---|
| 2802 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2803 | +// // aConstraints.gridheight = 3; |
---|
| 2804 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2805 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2806 | +// bigThree.validate(); |
---|
| 2807 | +// scenePanel.setVisible(false); |
---|
| 2808 | +// centralPanel.setVisible(true); |
---|
| 2809 | +// XYZPanel.setVisible(true); |
---|
| 2810 | + bigThree.ClearUI(); |
---|
| 2811 | + bigThree.add(centralPanel); |
---|
| 2812 | + bigThree.add(XYZPanel); |
---|
| 2813 | + bigThree.FlushUI(); |
---|
2579 | 2814 | } else |
---|
2580 | | - if (event.getSource() == fourButton) |
---|
| 2815 | + if (source == fourButton) |
---|
2581 | 2816 | { |
---|
2582 | 2817 | 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(); |
---|
| 2818 | + |
---|
| 2819 | +// bigThree.remove(scenePanel); |
---|
| 2820 | +// bigThree.remove(centralPanel); |
---|
| 2821 | +// bigThree.remove(XYZPanel); |
---|
| 2822 | +// aWindowConstraints.gridx = 0; |
---|
| 2823 | +// aWindowConstraints.gridy = 0; |
---|
| 2824 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2825 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2826 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2827 | +// aWindowConstraints.weightx = 1; |
---|
| 2828 | +// aWindowConstraints.weighty = 1; |
---|
| 2829 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2830 | +// aWindowConstraints.weightx = 1; |
---|
| 2831 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2832 | +// // aConstraints.gridheight = 3; |
---|
| 2833 | +// aWindowConstraints.gridx = 1; |
---|
| 2834 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2835 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2836 | +// aWindowConstraints.weightx = 0; |
---|
| 2837 | +// aWindowConstraints.gridx = 4; |
---|
| 2838 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2839 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2840 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2841 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2842 | +// bigThree.validate(); |
---|
| 2843 | +// scenePanel.setVisible(true); |
---|
| 2844 | +// centralPanel.setVisible(false); |
---|
| 2845 | +// XYZPanel.setVisible(false); |
---|
| 2846 | + bigThree.ClearUI(); |
---|
| 2847 | + bigThree.add(scenePanel); |
---|
| 2848 | + bigThree.FlushUI(); |
---|
2607 | 2849 | } else |
---|
2608 | | - if (event.getSource() == sixButton) |
---|
| 2850 | + if (source == sixButton) |
---|
2609 | 2851 | { |
---|
2610 | 2852 | 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(); |
---|
| 2853 | + |
---|
| 2854 | +// bigThree.remove(scenePanel); |
---|
| 2855 | +// bigThree.remove(centralPanel); |
---|
| 2856 | +// bigThree.remove(XYZPanel); |
---|
| 2857 | +// aWindowConstraints.gridx = 0; |
---|
| 2858 | +// aWindowConstraints.gridy = 0; |
---|
| 2859 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2860 | +// // aConstraints.gridheight = 3; |
---|
| 2861 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2862 | +// aWindowConstraints.weightx = 0; |
---|
| 2863 | +// aWindowConstraints.weighty = 1; |
---|
| 2864 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2865 | +// aWindowConstraints.weightx = 1; |
---|
| 2866 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2867 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2868 | +// aWindowConstraints.gridx = 1; |
---|
| 2869 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2870 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2871 | +// aWindowConstraints.weightx = 0; |
---|
| 2872 | +// aWindowConstraints.gridx = 4; |
---|
| 2873 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2874 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2875 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2876 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2877 | +// bigThree.validate(); |
---|
| 2878 | +// scenePanel.setVisible(true); |
---|
| 2879 | +// centralPanel.setVisible(true); |
---|
| 2880 | +// XYZPanel.setVisible(false); |
---|
| 2881 | + bigThree.ClearUI(); |
---|
| 2882 | + bigThree.add(scenePanel); |
---|
| 2883 | + bigThree.add(centralPanel); |
---|
| 2884 | + bigThree.FlushUI(); |
---|
2635 | 2885 | } else |
---|
2636 | | - if (event.getSource() == sevenButton) |
---|
| 2886 | + if (source == sevenButton) |
---|
2637 | 2887 | { |
---|
2638 | 2888 | 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(); |
---|
| 2889 | + |
---|
| 2890 | +// bigThree.remove(scenePanel); |
---|
| 2891 | +// bigThree.remove(centralPanel); |
---|
| 2892 | +// bigThree.remove(XYZPanel); |
---|
| 2893 | +// aWindowConstraints.gridx = 0; |
---|
| 2894 | +// aWindowConstraints.gridy = 0; |
---|
| 2895 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2896 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2897 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2898 | +// aWindowConstraints.weightx = 0; |
---|
| 2899 | +// aWindowConstraints.weighty = 1; |
---|
| 2900 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2901 | +// aWindowConstraints.weightx = 1; |
---|
| 2902 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2903 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2904 | +// aWindowConstraints.gridx = 1; |
---|
| 2905 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2906 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2907 | +// aWindowConstraints.weightx = 0; |
---|
| 2908 | +// aWindowConstraints.gridx = 4; |
---|
| 2909 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2910 | +// // aConstraints.gridheight = 3; |
---|
| 2911 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2912 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2913 | +// bigThree.validate(); |
---|
| 2914 | +// scenePanel.setVisible(true); |
---|
| 2915 | +// centralPanel.setVisible(true); |
---|
| 2916 | +// XYZPanel.setVisible(true); |
---|
| 2917 | + bigThree.ClearUI(); |
---|
| 2918 | + bigThree.add(scenePanel); |
---|
| 2919 | + bigThree.add(centralPanel); |
---|
| 2920 | + bigThree.add(XYZPanel); |
---|
| 2921 | + bigThree.FlushUI(); |
---|
2663 | 2922 | } else |
---|
2664 | | - if (event.getSource() == rootButton) |
---|
| 2923 | + if (source == rootButton) |
---|
2665 | 2924 | { |
---|
2666 | 2925 | Object3D obj; |
---|
2667 | 2926 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2673 | 2932 | |
---|
2674 | 2933 | refreshContents(true); |
---|
2675 | 2934 | } else |
---|
2676 | | - if (event.getSource() == closeButton) |
---|
| 2935 | + if (source == closeButton) |
---|
2677 | 2936 | { |
---|
2678 | 2937 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2679 | 2938 | cRadio ab; |
---|
.. | .. |
---|
2694 | 2953 | } |
---|
2695 | 2954 | refreshContents(true); |
---|
2696 | 2955 | } else |
---|
2697 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 2956 | + if (source == editItem || source == editButton) |
---|
2698 | 2957 | { |
---|
2699 | 2958 | EditSelection(false); |
---|
2700 | 2959 | } else |
---|
2701 | | - if (event.getSource() == uneditButton) |
---|
| 2960 | + if (source == uneditButton) |
---|
2702 | 2961 | { |
---|
2703 | 2962 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2704 | 2963 | { |
---|
.. | .. |
---|
2710 | 2969 | |
---|
2711 | 2970 | child.editWindow = null; // ??????????? |
---|
2712 | 2971 | } |
---|
2713 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 2972 | + objEditor.ctrlPanel.FlushUI(); |
---|
2714 | 2973 | //objEditor.jTree.clearSelection(); |
---|
2715 | 2974 | //objEditor.ResetSliders(); |
---|
2716 | 2975 | refreshContents(true); |
---|
2717 | 2976 | } else |
---|
2718 | | - if (event.getSource() == clearPanelButton) |
---|
| 2977 | + if (source == clearPanelButton) |
---|
2719 | 2978 | { |
---|
2720 | 2979 | assert(copy == group); |
---|
2721 | 2980 | //copy.ClearUI(); |
---|
.. | .. |
---|
2726 | 2985 | listUI.clear(); |
---|
2727 | 2986 | refreshContents(true); |
---|
2728 | 2987 | } else |
---|
2729 | | - if (event.getSource() == allParamsButton) |
---|
| 2988 | + if (source == allParamsButton) |
---|
2730 | 2989 | { |
---|
2731 | 2990 | assert(copy == group); |
---|
2732 | 2991 | |
---|
.. | .. |
---|
2747 | 3006 | |
---|
2748 | 3007 | refreshContents(true); |
---|
2749 | 3008 | } else |
---|
2750 | | - if (event.getSource() == unselectButton) |
---|
| 3009 | + if (source == unselectButton) |
---|
2751 | 3010 | { |
---|
2752 | 3011 | objEditor.jTree.clearSelection(); |
---|
2753 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 3012 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2754 | 3013 | objEditor.ResetSliders(); |
---|
2755 | 3014 | refreshContents(true); |
---|
2756 | 3015 | } else |
---|
2757 | | - if(event.getSource() instanceof cRadio) |
---|
| 3016 | + if(source instanceof cRadio) |
---|
2758 | 3017 | { |
---|
2759 | 3018 | group.parent = keepparent; |
---|
2760 | 3019 | group.attributes = 0; |
---|
2761 | 3020 | //group.editWindow = null; |
---|
2762 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3021 | + /*cRadio*/ radio = (cRadio)source; |
---|
2763 | 3022 | Object3D obj = radio.GetObject(); |
---|
2764 | 3023 | System.out.println("Edit " + obj); |
---|
2765 | 3024 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2779 | 3038 | } |
---|
2780 | 3039 | |
---|
2781 | 3040 | copy = group; |
---|
2782 | | - //CameraPane.theRenderer.object = group; |
---|
| 3041 | + //Globals.theRenderer.object = group; |
---|
2783 | 3042 | if(!useclient) |
---|
2784 | 3043 | { |
---|
2785 | 3044 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2788 | 3047 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2789 | 3048 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2790 | 3049 | cameraView.object = group; |
---|
2791 | | - cameraView.lighttouched = true; |
---|
| 3050 | + //cameraView.lighttouched = true; |
---|
| 3051 | + Globals.lighttouched = true; |
---|
2792 | 3052 | topView.object = group; |
---|
2793 | 3053 | frontView.object = group; |
---|
2794 | 3054 | sideView.object = group; |
---|
.. | .. |
---|
2824 | 3084 | if (useclient) |
---|
2825 | 3085 | { |
---|
2826 | 3086 | cameraView.object = client; |
---|
2827 | | - cameraView.lighttouched = true; |
---|
| 3087 | + Globals.lighttouched = true; |
---|
2828 | 3088 | //topView.object = client; |
---|
2829 | 3089 | //frontView.object = client; |
---|
2830 | 3090 | //sideView.object = client; |
---|
.. | .. |
---|
2832 | 3092 | else |
---|
2833 | 3093 | { |
---|
2834 | 3094 | cameraView.object = group; |
---|
2835 | | - cameraView.lighttouched = true; |
---|
| 3095 | + Globals.lighttouched = true; |
---|
2836 | 3096 | //topView.object = group; |
---|
2837 | 3097 | //frontView.object = group; |
---|
2838 | 3098 | //sideView.object = group; |
---|
.. | .. |
---|
3065 | 3325 | obj = (Object3D)e.nextElement(); |
---|
3066 | 3326 | |
---|
3067 | 3327 | System.out.println("Object is: " + obj); |
---|
3068 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3328 | + GrafreeD.AnalyzeObject(obj); |
---|
3069 | 3329 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3070 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3330 | + GrafreeD.AnalyzeObject(obj.bRep); |
---|
3071 | 3331 | |
---|
3072 | 3332 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3073 | 3333 | } |
---|
.. | .. |
---|
3109 | 3369 | void GenNormals(boolean crease) |
---|
3110 | 3370 | { |
---|
3111 | 3371 | group.GenNormalsS(crease); |
---|
| 3372 | + |
---|
| 3373 | + refreshContents(); |
---|
| 3374 | + } |
---|
| 3375 | + |
---|
| 3376 | + void GenNormalsMINE() |
---|
| 3377 | + { |
---|
| 3378 | + group.selection.GenNormalsMINE(); |
---|
3112 | 3379 | |
---|
3113 | 3380 | refreshContents(); |
---|
3114 | 3381 | } |
---|
.. | .. |
---|
3157 | 3424 | |
---|
3158 | 3425 | //Object3D buffer; |
---|
3159 | 3426 | 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 | | - |
---|
| 3427 | +// BoundaryRep temprep; |
---|
| 3428 | +// Object3D nodes; |
---|
| 3429 | +// Vector<Vertex> vertices; |
---|
| 3430 | +// |
---|
| 3431 | +// cGroup buffer; |
---|
| 3432 | +// |
---|
| 3433 | +// public void Vertex(Object3D node, Vertex v) |
---|
| 3434 | +// { |
---|
| 3435 | +//// vertices.add(v); |
---|
| 3436 | +//// nodes.addElement(node); |
---|
| 3437 | +//// |
---|
| 3438 | +//// if (temprep.GetCache(v) != null) |
---|
| 3439 | +//// { |
---|
| 3440 | +//// temprep.Remove(v); |
---|
| 3441 | +//// } else |
---|
| 3442 | +//// { |
---|
| 3443 | +//// temprep.Remember(v); |
---|
| 3444 | +//// } |
---|
| 3445 | +// |
---|
| 3446 | +// //Object3D node = nodes.get(index); |
---|
| 3447 | +// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3448 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3449 | +// |
---|
| 3450 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3451 | +// |
---|
| 3452 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3453 | +// |
---|
| 3454 | +// cGroup g = new cGroup(); |
---|
| 3455 | +// |
---|
| 3456 | +// if (g.toParent == null) |
---|
| 3457 | +// { |
---|
| 3458 | +// g.toParent = LA.newMatrix(); |
---|
| 3459 | +// g.fromParent = LA.newMatrix(); |
---|
| 3460 | +// } |
---|
| 3461 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3462 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3463 | +// |
---|
| 3464 | +// g.add(GrafreeD.clipboard); |
---|
| 3465 | +// |
---|
| 3466 | +// buffer.add(g); |
---|
| 3467 | +// } |
---|
| 3468 | +// |
---|
| 3469 | +// public void Face(Object3D node, Face f) |
---|
| 3470 | +// { |
---|
| 3471 | +// |
---|
| 3472 | +// } |
---|
| 3473 | +// |
---|
| 3474 | +// void ParseVerticesOld() // ?? |
---|
| 3475 | +// { |
---|
| 3476 | +// //if (group.selection.size() != 1) |
---|
| 3477 | +// // return; |
---|
| 3478 | +// |
---|
| 3479 | +// temprep = new BoundaryRep(); |
---|
| 3480 | +// nodes = new Object3D(); |
---|
| 3481 | +// vertices = new Vector<Vertex>(); |
---|
| 3482 | +// |
---|
| 3483 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3484 | +// GrafreeD.epsequal = true; |
---|
| 3485 | +// |
---|
| 3486 | +// for (int i=0; i<group.selection.size(); i++) |
---|
| 3487 | +// { |
---|
| 3488 | +// Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3489 | +// |
---|
| 3490 | +// group.selection.get(i).Parse( |
---|
| 3491 | +//this ); |
---|
| 3492 | +// |
---|
| 3493 | +// int repsize = temprep.VertexCount(); |
---|
| 3494 | +// int tablesize = temprep.vertextable.size(); |
---|
| 3495 | +// int nodesize = nodes.size(); |
---|
| 3496 | +// |
---|
| 3497 | +// assert(vertices.size() == nodes.size()); |
---|
| 3498 | +// |
---|
| 3499 | +// temprep.vertextable.elements(); |
---|
| 3500 | +// |
---|
| 3501 | +// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet(); |
---|
| 3502 | +// |
---|
| 3503 | +// for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
| 3504 | +// { |
---|
| 3505 | +// cGroup g = new cGroup(); |
---|
| 3506 | +// |
---|
| 3507 | +// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k)); |
---|
| 3508 | +// |
---|
| 3509 | +// Object3D node = nodes.get(index); |
---|
| 3510 | +// temp.set(vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3511 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3512 | +// |
---|
| 3513 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3514 | +// |
---|
| 3515 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3516 | +// |
---|
| 3517 | +// if (g.toParent == null) |
---|
| 3518 | +// { |
---|
| 3519 | +// g.toParent = LA.newMatrix(); |
---|
| 3520 | +// g.fromParent = LA.newMatrix(); |
---|
| 3521 | +// } |
---|
| 3522 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3523 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3524 | +// |
---|
| 3525 | +// g.add(GrafreeD.clipboard); |
---|
| 3526 | +// |
---|
| 3527 | +// buffer.add(g); |
---|
| 3528 | +// } |
---|
| 3529 | +// |
---|
| 3530 | +// makeSomething(buffer, i==group.selection.size()-1); |
---|
| 3531 | +// } |
---|
| 3532 | +// |
---|
| 3533 | +// GrafreeD.epsequal = epsequal; |
---|
| 3534 | +// |
---|
| 3535 | +// //buffer = null; |
---|
| 3536 | +// temprep = null; |
---|
| 3537 | +// nodes = null; |
---|
| 3538 | +// |
---|
| 3539 | +// refreshContents(); |
---|
| 3540 | +// } |
---|
| 3541 | + |
---|
3184 | 3542 | void ParseVertices() |
---|
3185 | 3543 | { |
---|
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; |
---|
| 3544 | + boolean epsequal = GrafreeD.epsequal; |
---|
| 3545 | + GrafreeD.epsequal = true; |
---|
3195 | 3546 | |
---|
3196 | 3547 | for (int i=0; i<group.selection.size(); i++) |
---|
3197 | 3548 | { |
---|
3198 | | - Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3549 | + final cGroup buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
3199 | 3550 | |
---|
3200 | | - group.selection.get(i).Parse(this); |
---|
3201 | | - |
---|
3202 | | - int repsize = temprep.VertexCount(); |
---|
3203 | | - int tablesize = temprep.vertextable.size(); |
---|
3204 | | - int nodesize = nodes.size(); |
---|
| 3551 | + group.selection.get(i).Parse( |
---|
| 3552 | + |
---|
| 3553 | + new iParse() |
---|
| 3554 | + { |
---|
| 3555 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3556 | + { |
---|
| 3557 | + temp.set(v); |
---|
| 3558 | + LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
3205 | 3559 | |
---|
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(); |
---|
| 3560 | + cGroup g = new cGroup(); |
---|
3211 | 3561 | |
---|
3212 | | - for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
3213 | | - { |
---|
3214 | | - cGroup g = new cGroup(); |
---|
| 3562 | + if (g.toParent == null) |
---|
| 3563 | + { |
---|
| 3564 | + g.toParent = LA.newMatrix(); |
---|
| 3565 | + g.fromParent = LA.newMatrix(); |
---|
| 3566 | + } |
---|
| 3567 | + LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3568 | + LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3215 | 3569 | |
---|
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); |
---|
| 3570 | + g.add(GrafreeD.clipboard); |
---|
3220 | 3571 | |
---|
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); |
---|
| 3572 | + buffer.add(g); |
---|
| 3573 | + } |
---|
3232 | 3574 | |
---|
3233 | | - g.add(GraphreeD.clipboard); |
---|
| 3575 | + public void Face(Object3D node, Face f) |
---|
| 3576 | + { |
---|
3234 | 3577 | |
---|
3235 | | - buffer.add(g); |
---|
3236 | | - } |
---|
| 3578 | + } |
---|
| 3579 | + } |
---|
| 3580 | + ); |
---|
3237 | 3581 | |
---|
3238 | 3582 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3239 | 3583 | } |
---|
3240 | 3584 | |
---|
3241 | | - GraphreeD.epsequal = epsequal; |
---|
3242 | | - |
---|
3243 | | - //buffer = null; |
---|
3244 | | - temprep = null; |
---|
3245 | | - nodes = null; |
---|
| 3585 | + GrafreeD.epsequal = epsequal; |
---|
3246 | 3586 | |
---|
3247 | 3587 | refreshContents(); |
---|
3248 | 3588 | } |
---|
3249 | | - |
---|
| 3589 | + |
---|
| 3590 | + void TextureVertices() |
---|
| 3591 | + { |
---|
| 3592 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3593 | + { |
---|
| 3594 | + group.selection.get(i).Parse( |
---|
| 3595 | + new iParse() |
---|
| 3596 | + { |
---|
| 3597 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3598 | + { |
---|
| 3599 | + cTexture tex = node.GetTextures(); |
---|
| 3600 | + String pigment = Object3D.GetPigment(tex); |
---|
| 3601 | + //String bump = Object3D.GetBump(tex); |
---|
| 3602 | + |
---|
| 3603 | + com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3604 | + |
---|
| 3605 | + double s = v.s; |
---|
| 3606 | + |
---|
| 3607 | + if (s == 1) |
---|
| 3608 | + s = 0; |
---|
| 3609 | + |
---|
| 3610 | + double t = v.t; |
---|
| 3611 | + |
---|
| 3612 | + if (t == 1) |
---|
| 3613 | + t = 0; |
---|
| 3614 | + |
---|
| 3615 | + int indexs = (int) (texturedata.getWidth() * s); |
---|
| 3616 | + int indext = (int) (texturedata.getHeight() * t); |
---|
| 3617 | + |
---|
| 3618 | + int index = indext * texturedata.getWidth() + indexs; |
---|
| 3619 | + |
---|
| 3620 | + java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer(); |
---|
| 3621 | + |
---|
| 3622 | + int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight(); |
---|
| 3623 | + |
---|
| 3624 | + float scale = bytebuf.get(index*slide) & 0xFF; |
---|
| 3625 | + scale += bytebuf.get(index*slide+1) & 0xFF; |
---|
| 3626 | + scale += bytebuf.get(index*slide+2) & 0xFF; |
---|
| 3627 | + scale /= 3; |
---|
| 3628 | + |
---|
| 3629 | + scale /= 0xFF; |
---|
| 3630 | + // c'est quoi ca? scale /= 4; |
---|
| 3631 | + |
---|
| 3632 | + //v.AO = scale; |
---|
| 3633 | + |
---|
| 3634 | + v.x += v.norm.x * scale; |
---|
| 3635 | + v.y += v.norm.y * scale; |
---|
| 3636 | + v.z += v.norm.z * scale; |
---|
| 3637 | + } |
---|
| 3638 | + |
---|
| 3639 | + public void Face(Object3D node, Face f) |
---|
| 3640 | + { |
---|
| 3641 | + } |
---|
| 3642 | + } |
---|
| 3643 | + ); |
---|
| 3644 | + } |
---|
| 3645 | + |
---|
| 3646 | + refreshContents(); |
---|
| 3647 | + } |
---|
| 3648 | + |
---|
3250 | 3649 | void Align() |
---|
3251 | 3650 | { |
---|
| 3651 | + if (group.selection.size() == 0) |
---|
| 3652 | + return; |
---|
| 3653 | + |
---|
| 3654 | + cVector bbmin = new cVector(); |
---|
| 3655 | + cVector bbmax = new cVector(); |
---|
| 3656 | + |
---|
| 3657 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3658 | + |
---|
| 3659 | + double dx = bbmax.x - bbmin.x; |
---|
| 3660 | + double dy = bbmax.y - bbmin.y; |
---|
| 3661 | + double dz = bbmax.z - bbmin.z; |
---|
| 3662 | + |
---|
| 3663 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3664 | + |
---|
3252 | 3665 | for (int i=0; i<group.selection.size(); i++) |
---|
3253 | 3666 | { |
---|
3254 | 3667 | Object3D obj = group.selection.get(i); |
---|
3255 | 3668 | |
---|
3256 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3257 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3669 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3670 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3258 | 3671 | } |
---|
3259 | 3672 | |
---|
3260 | 3673 | refreshContents(); |
---|
.. | .. |
---|
3267 | 3680 | // ref.SaveSupports(); |
---|
3268 | 3681 | // Object3D par = ref.parent; |
---|
3269 | 3682 | // ref.parent = null; |
---|
3270 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 3683 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3271 | 3684 | // ref.parent = par; |
---|
3272 | 3685 | // ref.RestoreSupports(); |
---|
3273 | 3686 | |
---|
.. | .. |
---|
3275 | 3688 | |
---|
3276 | 3689 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3277 | 3690 | |
---|
3278 | | - boolean random = CameraPane.RANDOM; |
---|
3279 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3691 | + boolean random = CameraPane.SWITCH; |
---|
| 3692 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3280 | 3693 | lowres.linkVerticesThis(null); |
---|
3281 | 3694 | lowres.linkVerticesThis(sn); |
---|
3282 | | - CameraPane.RANDOM = random; |
---|
| 3695 | + CameraPane.SWITCH = random; |
---|
3283 | 3696 | |
---|
3284 | 3697 | System.err.flush(); |
---|
3285 | 3698 | |
---|
.. | .. |
---|
3297 | 3710 | // lowres.SaveSupports(); |
---|
3298 | 3711 | // par = lowres.parent; |
---|
3299 | 3712 | // lowres.parent = null; |
---|
3300 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 3713 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3301 | 3714 | Object3D newlow = CloneObject(lowres, false); |
---|
3302 | 3715 | newlow.name = sn.switchobject.get(i).name; |
---|
3303 | 3716 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3319 | 3732 | return; |
---|
3320 | 3733 | |
---|
3321 | 3734 | Object3D poses = group.selection.get(0); |
---|
3322 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 3735 | + Object3D ref = GrafreeD.clipboard.get(0); |
---|
3323 | 3736 | |
---|
3324 | 3737 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3325 | 3738 | |
---|
.. | .. |
---|
3488 | 3901 | group.selection.RelinkToSupport(); // july 2014 |
---|
3489 | 3902 | System.out.println("DONE."); |
---|
3490 | 3903 | refreshContents(); |
---|
3491 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 3904 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3492 | 3905 | } |
---|
3493 | 3906 | |
---|
3494 | 3907 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3513 | 3926 | |
---|
3514 | 3927 | void ClipMesh() |
---|
3515 | 3928 | { |
---|
3516 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 3929 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
3517 | 3930 | { |
---|
3518 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 3931 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
3519 | 3932 | |
---|
3520 | 3933 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3521 | 3934 | content = ((cGroup)content).get(0); |
---|
3522 | 3935 | |
---|
3523 | 3936 | // for (int i=0; i<group.selection.size(); i++) |
---|
3524 | 3937 | // { |
---|
3525 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 3938 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3526 | 3939 | // } |
---|
3527 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 3940 | + group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3528 | 3941 | } |
---|
3529 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 3942 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3530 | 3943 | System.out.println("DONE."); |
---|
3531 | 3944 | refreshContents(); |
---|
3532 | 3945 | } |
---|
.. | .. |
---|
3764 | 4177 | System.err.println("info : " + child.GetPath()); |
---|
3765 | 4178 | } |
---|
3766 | 4179 | } |
---|
3767 | | - else |
---|
3768 | | - { |
---|
3769 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3770 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3771 | | - System.err.println("info : " + group.GetPath()); |
---|
3772 | | - } |
---|
| 4180 | +// else |
---|
| 4181 | +// { |
---|
| 4182 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4183 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4184 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4185 | +// } |
---|
3773 | 4186 | |
---|
3774 | 4187 | objEditor.SetText(); // jan 2014 |
---|
3775 | 4188 | |
---|
3776 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4189 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
3777 | 4190 | CameraPane.flash = true; |
---|
3778 | 4191 | |
---|
3779 | 4192 | if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
3780 | 4193 | // a camera |
---|
3781 | 4194 | { |
---|
3782 | 4195 | 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; |
---|
| 4196 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4197 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4198 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3786 | 4199 | } |
---|
3787 | 4200 | |
---|
3788 | 4201 | refreshContents(); |
---|
.. | .. |
---|
3864 | 4277 | { |
---|
3865 | 4278 | if (group.selection.isEmpty()) |
---|
3866 | 4279 | return; |
---|
3867 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4280 | + GrafreeD.clipboardIsTempGroup = false; |
---|
3868 | 4281 | Composite tGroup = null; |
---|
3869 | 4282 | if (group.selection.size() > 0) // 1) |
---|
3870 | 4283 | { |
---|
3871 | 4284 | tGroup = new cGroup(); |
---|
3872 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4285 | + GrafreeD.clipboardIsTempGroup = true; |
---|
3873 | 4286 | } |
---|
3874 | 4287 | |
---|
3875 | 4288 | if (cut) |
---|
.. | .. |
---|
3909 | 4322 | //System.out.println("cut " + child); |
---|
3910 | 4323 | //System.out.println("parent = " + child.parent); |
---|
3911 | 4324 | // tmp.addChild(child); |
---|
3912 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4325 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3913 | 4326 | tGroup.add/*Child*/(tmp); |
---|
3914 | 4327 | else |
---|
3915 | | - GraphreeD.clipboard = tmp; |
---|
| 4328 | + GrafreeD.clipboard = tmp; |
---|
3916 | 4329 | } |
---|
3917 | 4330 | else |
---|
3918 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4331 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3919 | 4332 | tGroup.add/*Child*/(child); |
---|
3920 | 4333 | else |
---|
3921 | | - GraphreeD.clipboard = child; |
---|
| 4334 | + GrafreeD.clipboard = child; |
---|
3922 | 4335 | } |
---|
3923 | 4336 | |
---|
3924 | 4337 | //ResetModel(); |
---|
.. | .. |
---|
3950 | 4363 | //System.out.println("cut " + elem); |
---|
3951 | 4364 | //System.out.println("parent = " + elem.parent); |
---|
3952 | 4365 | // tmp.addChild(elem); |
---|
3953 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4366 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3954 | 4367 | tGroup.add/*Child*/(tmp); |
---|
3955 | 4368 | else |
---|
3956 | | - GraphreeD.clipboard = tmp; |
---|
| 4369 | + GrafreeD.clipboard = tmp; |
---|
3957 | 4370 | } |
---|
3958 | 4371 | else |
---|
3959 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4372 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3960 | 4373 | tGroup.add/*Child*/(child); |
---|
3961 | 4374 | else |
---|
3962 | | - GraphreeD.clipboard = child; |
---|
| 4375 | + GrafreeD.clipboard = child; |
---|
3963 | 4376 | } |
---|
3964 | 4377 | |
---|
3965 | 4378 | } |
---|
3966 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
3967 | | - GraphreeD.clipboard = tGroup; |
---|
| 4379 | + if (GrafreeD.clipboardIsTempGroup) |
---|
| 4380 | + GrafreeD.clipboard = tGroup; |
---|
3968 | 4381 | if (cut) |
---|
3969 | 4382 | { |
---|
3970 | 4383 | ResetModel(); |
---|
.. | .. |
---|
3974 | 4387 | |
---|
3975 | 4388 | void paste(boolean expand) |
---|
3976 | 4389 | { |
---|
3977 | | - // if (GraphreeD.clipboard == null) |
---|
| 4390 | + // if (GrafreeD.clipboard == null) |
---|
3978 | 4391 | // return; |
---|
3979 | 4392 | boolean first = true; |
---|
3980 | 4393 | |
---|
3981 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4394 | + if (GrafreeD.clipboardIsTempGroup) |
---|
3982 | 4395 | { |
---|
3983 | 4396 | Composite temp; |
---|
3984 | 4397 | |
---|
.. | .. |
---|
3989 | 4402 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
3990 | 4403 | */ |
---|
3991 | 4404 | Object3D elem; |
---|
3992 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4405 | + for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
3993 | 4406 | { |
---|
3994 | 4407 | Object3D child = (Object3D)e.nextElement(); |
---|
3995 | 4408 | |
---|
.. | .. |
---|
4003 | 4416 | else |
---|
4004 | 4417 | elem = child.deepCopy(); // ? |
---|
4005 | 4418 | child.parent = keepparent; |
---|
4006 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4419 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4007 | 4420 | // elem = elem.get(0); |
---|
4008 | 4421 | makeSomething(elem, true); // ?? first); |
---|
4009 | 4422 | //group.addChild(elem); |
---|
.. | .. |
---|
4023 | 4436 | //Object3D cb = Applet3D.clipboard; |
---|
4024 | 4437 | //temp.addChild(cb); |
---|
4025 | 4438 | //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()); |
---|
| 4439 | + assert(GrafreeD.clipboard.parent == null); |
---|
| 4440 | + Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
| 4441 | + GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4442 | + if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
| 4443 | + makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
4031 | 4444 | else |
---|
4032 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4033 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4445 | + makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
| 4446 | + GrafreeD.clipboard.get(0).parent = keepparent; |
---|
4034 | 4447 | } |
---|
4035 | 4448 | |
---|
4036 | 4449 | ResetModel(); |
---|
4037 | 4450 | refreshContents(); |
---|
4038 | 4451 | } |
---|
4039 | 4452 | |
---|
4040 | | - void pasteInto(boolean copyit) |
---|
| 4453 | + void pasteInto(boolean copyit, boolean clone) |
---|
4041 | 4454 | { |
---|
4042 | | -// if (GraphreeD.clipboard == null) |
---|
| 4455 | +// if (GrafreeD.clipboard == null) |
---|
4043 | 4456 | // return; |
---|
4044 | 4457 | |
---|
4045 | 4458 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4066 | 4479 | if (copyit) |
---|
4067 | 4480 | { |
---|
4068 | 4481 | // paste(false); |
---|
4069 | | - CloneClipboard(false); // sept 2014 |
---|
| 4482 | + if (clone) |
---|
| 4483 | + { |
---|
| 4484 | + CloneClipboard(false); // sept 2014 |
---|
| 4485 | + } |
---|
| 4486 | + else |
---|
| 4487 | + { |
---|
| 4488 | + paste(false); |
---|
| 4489 | + } |
---|
4070 | 4490 | } |
---|
4071 | 4491 | else |
---|
4072 | 4492 | { |
---|
4073 | 4493 | boolean first = true; |
---|
4074 | 4494 | |
---|
4075 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4495 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4076 | 4496 | { |
---|
4077 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4497 | + Composite temp = (Composite)GrafreeD.clipboard; |
---|
4078 | 4498 | Object3D copy; |
---|
4079 | 4499 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4080 | 4500 | { |
---|
.. | .. |
---|
4084 | 4504 | } |
---|
4085 | 4505 | } else |
---|
4086 | 4506 | { |
---|
4087 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4507 | + linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
4088 | 4508 | } |
---|
4089 | 4509 | } |
---|
4090 | 4510 | } |
---|
.. | .. |
---|
4276 | 4696 | makeSomething(csg); |
---|
4277 | 4697 | } |
---|
4278 | 4698 | |
---|
| 4699 | + void Ungroup(Object3D g) |
---|
| 4700 | + { |
---|
| 4701 | + if (g instanceof HiddenObject) |
---|
| 4702 | + { |
---|
| 4703 | + HiddenObject h = (HiddenObject) g; |
---|
| 4704 | + |
---|
| 4705 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4706 | + { |
---|
| 4707 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4708 | + } |
---|
| 4709 | + } |
---|
| 4710 | + else |
---|
| 4711 | + { |
---|
| 4712 | + for (int i=0; i<g.Size(); i++) |
---|
| 4713 | + { |
---|
| 4714 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4715 | + } |
---|
| 4716 | + } |
---|
| 4717 | + } |
---|
| 4718 | + |
---|
4279 | 4719 | void ungroup() |
---|
4280 | 4720 | { |
---|
4281 | 4721 | /* |
---|
.. | .. |
---|
4471 | 4911 | |
---|
4472 | 4912 | void ImportGFD() |
---|
4473 | 4913 | { |
---|
4474 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD); |
---|
| 4914 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4475 | 4915 | browser.show(); |
---|
4476 | 4916 | String filename = browser.getFile(); |
---|
4477 | 4917 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4509 | 4949 | |
---|
4510 | 4950 | void ImportVRMLX3D() |
---|
4511 | 4951 | { |
---|
4512 | | - if (GraphreeD.standAlone) |
---|
| 4952 | + if (GrafreeD.standAlone) |
---|
4513 | 4953 | { |
---|
4514 | 4954 | /**/ |
---|
4515 | 4955 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4526 | 4966 | |
---|
4527 | 4967 | String GetFile(String dialogName) |
---|
4528 | 4968 | { |
---|
4529 | | - if (GraphreeD.standAlone) |
---|
| 4969 | + if (GrafreeD.standAlone) |
---|
4530 | 4970 | { |
---|
4531 | 4971 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4532 | 4972 | browser.show(); |
---|
.. | .. |
---|
4590 | 5030 | cButton flashSelectionButton; |
---|
4591 | 5031 | cButton editButton; |
---|
4592 | 5032 | cButton uneditButton; |
---|
| 5033 | + JCheckBox allParamsButton; |
---|
4593 | 5034 | cButton clearpanelButton; |
---|
4594 | | - cButton allParamsButton; |
---|
4595 | 5035 | cButton unselectButton; |
---|
4596 | 5036 | |
---|
| 5037 | + cButton oneStepButton; |
---|
| 5038 | + |
---|
4597 | 5039 | cButton screenfitButton; |
---|
4598 | 5040 | cButton screenfitpointButton; |
---|
4599 | 5041 | cButton snapobjectButton; |
---|
.. | .. |
---|
4635 | 5077 | private MenuItem resetsupportItem; |
---|
4636 | 5078 | private MenuItem resetreferencesItem; |
---|
4637 | 5079 | private MenuItem linkverticesItem; |
---|
| 5080 | + private MenuItem relinkverticesItem; |
---|
4638 | 5081 | private MenuItem setMasterItem; |
---|
4639 | 5082 | private MenuItem resetMeshItem; |
---|
4640 | 5083 | private MenuItem stepAllItem; |
---|
.. | .. |
---|
4647 | 5090 | private MenuItem mergeGeometriesItem; |
---|
4648 | 5091 | private MenuItem copyItem; |
---|
4649 | 5092 | private MenuItem pasteItem; |
---|
| 5093 | + private MenuItem pasteIntoItem; |
---|
4650 | 5094 | private MenuItem pasteLinkItem; |
---|
4651 | 5095 | private MenuItem pasteCloneItem; |
---|
4652 | 5096 | private MenuItem pasteExpandItem; |
---|
4653 | 5097 | private MenuItem clearItem; |
---|
4654 | 5098 | private MenuItem clearAllItem; |
---|
4655 | 5099 | private MenuItem genUVItem; |
---|
| 5100 | + private MenuItem genNormalsMESHItem; |
---|
4656 | 5101 | private MenuItem genNormalsCADItem; |
---|
4657 | 5102 | private MenuItem genNormalsORGANItem; |
---|
| 5103 | + private MenuItem genNormalsMINEItem; |
---|
4658 | 5104 | private MenuItem stripifyItem; |
---|
4659 | 5105 | private MenuItem unstripifyItem; |
---|
4660 | 5106 | private MenuItem trimItem; |
---|
.. | .. |
---|
4696 | 5142 | private MenuItem resetCentroidItem; |
---|
4697 | 5143 | private MenuItem transformgeometryItem; |
---|
4698 | 5144 | private MenuItem resetTransformItem; |
---|
| 5145 | + private MenuItem hideItem; |
---|
4699 | 5146 | private MenuItem grabItem; |
---|
4700 | 5147 | private MenuItem backItem; |
---|
4701 | 5148 | private MenuItem frontItem; |
---|
.. | .. |
---|
4716 | 5163 | |
---|
4717 | 5164 | private MenuItem resetParentItem; |
---|
4718 | 5165 | private MenuItem repairParentItem; |
---|
| 5166 | + private MenuItem repairShadowItem; |
---|
4719 | 5167 | private MenuItem sortbysizeItem; |
---|
4720 | 5168 | private MenuItem sortbynameItem; |
---|
4721 | 5169 | |
---|
.. | .. |
---|
4728 | 5176 | private MenuItem particleItem; |
---|
4729 | 5177 | private MenuItem ragdollItem; |
---|
4730 | 5178 | private MenuItem ragdoll2Item; |
---|
| 5179 | + private MenuItem heightFieldItem; |
---|
| 5180 | + private MenuItem textureFieldItem; |
---|
4731 | 5181 | private MenuItem gridItem; |
---|
4732 | 5182 | private MenuItem rectoidItem; |
---|
4733 | 5183 | private MenuItem ellipsoidItem; |
---|
4734 | 5184 | private MenuItem coneItem; |
---|
4735 | 5185 | private MenuItem torusItem; |
---|
4736 | 5186 | private MenuItem superItem; |
---|
| 5187 | + private MenuItem kleinItem; |
---|
4737 | 5188 | private MenuItem blobItem; |
---|
4738 | 5189 | private MenuItem latheItem; |
---|
4739 | 5190 | private MenuItem bezierItem; |
---|
4740 | | - private MenuItem checkerItem; |
---|
| 5191 | + private MenuItem overlayItem; |
---|
4741 | 5192 | private MenuItem meshItem; |
---|
4742 | 5193 | // private MenuItem meshGroupItem; |
---|
4743 | 5194 | private MenuItem springItem; |
---|
.. | .. |
---|
4746 | 5197 | private MenuItem csgItem; |
---|
4747 | 5198 | private MenuItem templateItem; |
---|
4748 | 5199 | private MenuItem textureItem; |
---|
| 5200 | + private MenuItem billboardItem; |
---|
4749 | 5201 | private MenuItem shadowXItem; |
---|
4750 | 5202 | private MenuItem shadowYItem; |
---|
4751 | 5203 | private MenuItem shadowZItem; |
---|