.. | .. |
---|
74 | 74 | this.copy = this.group = copy; |
---|
75 | 75 | //selectees = this.group.selectees; |
---|
76 | 76 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 77 | + SetupMenu2(this); //objEditor); |
---|
78 | 78 | SetupUI2(objEditor); |
---|
79 | 79 | objEditor.SetupUI(true); |
---|
80 | 80 | SetupViews(objEditor); |
---|
.. | .. |
---|
98 | 98 | |
---|
99 | 99 | void CloneClipboard(boolean supports) |
---|
100 | 100 | { |
---|
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)); |
---|
| 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)); |
---|
106 | 106 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 109 | } |
---|
110 | 110 | |
---|
111 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 119 | // obj.support = null; |
---|
120 | 120 | if (!supports) |
---|
121 | 121 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 123 | obj.parent = parent; |
---|
124 | 124 | // obj.support = support; |
---|
125 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 148 | |
---|
149 | 149 | //JTextField nameField; |
---|
150 | 150 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 152 | { |
---|
| 153 | + Menu menu; |
---|
| 154 | + oe.menuBar.add(menu = new Menu("Edit")); |
---|
| 155 | + //editItem = menu.add(new MenuItem("Edit")); |
---|
| 156 | + //editItem.addActionListener(this); |
---|
| 157 | + |
---|
| 158 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 159 | +// undoItem.addActionListener(this); |
---|
| 160 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 161 | +// redoItem.addActionListener(this); |
---|
| 162 | +// menu.add("-"); |
---|
| 163 | + duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 164 | + duplicateItem.addActionListener(this); |
---|
| 165 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 166 | + cloneItem.addActionListener(this); |
---|
| 167 | + if (Globals.ADVANCED) |
---|
| 168 | + { |
---|
| 169 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 170 | + cloneSupportItem.addActionListener(this); |
---|
| 171 | + } |
---|
| 172 | + menu.add("-"); |
---|
| 173 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 174 | + cutItem.addActionListener(this); |
---|
| 175 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 176 | + copyItem.addActionListener(this); |
---|
| 177 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 178 | + pasteItem.addActionListener(this); |
---|
| 179 | + menu.add("-"); |
---|
| 180 | + |
---|
| 181 | + menu.add("-"); |
---|
| 182 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 183 | + pasteIntoItem.addActionListener(this); |
---|
| 184 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 185 | + pasteLinkItem.addActionListener(this); |
---|
| 186 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 187 | + pasteCloneItem.addActionListener(this); |
---|
| 188 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 189 | +// pasteExpandItem.addActionListener(this); |
---|
| 190 | + menu.add("-"); |
---|
| 191 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 192 | + clearItem.addActionListener(this); |
---|
| 193 | + |
---|
| 194 | + if (Globals.ADVANCED) |
---|
| 195 | + { |
---|
| 196 | + // Deletes the cameras... |
---|
| 197 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 198 | + clearAllItem.addActionListener(this); |
---|
| 199 | + } |
---|
| 200 | + |
---|
| 201 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 202 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 203 | + //zBufferItem.addActionListener(this); |
---|
| 204 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 205 | + //normalLensItem.addActionListener(this); |
---|
| 206 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 207 | + revertCameraItem.addActionListener(this); |
---|
| 208 | + |
---|
| 209 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 210 | + toggleFullScreenItem.addItemListener(this); |
---|
| 211 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 212 | + cameraMenu.add("-"); |
---|
| 213 | + |
---|
| 214 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 215 | + toggleTextureItem.addItemListener(this); |
---|
| 216 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 217 | + |
---|
| 218 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 219 | + toggleSwitchItem.addItemListener(this); |
---|
| 220 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 221 | + |
---|
| 222 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 223 | + toggleHandleItem.addItemListener(this); |
---|
| 224 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 225 | + |
---|
| 226 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 227 | + togglePaintItem.addItemListener(this); |
---|
| 228 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 229 | + |
---|
| 230 | + if (Globals.ADVANCED) |
---|
| 231 | + { |
---|
| 232 | + cameraMenu.add("-"); |
---|
| 233 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 234 | + toggleLiveItem.addItemListener(this); |
---|
| 235 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 236 | + |
---|
| 237 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 238 | + stepItem.addActionListener(this); |
---|
| 239 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 240 | + // toggleDLItem.addItemListener(this); |
---|
| 241 | + // toggleDLItem.setState(false); |
---|
| 242 | + |
---|
| 243 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 244 | + toggleRenderItem.addItemListener(this); |
---|
| 245 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 246 | + |
---|
| 247 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 248 | + toggleDebugItem.addItemListener(this); |
---|
| 249 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 250 | + |
---|
| 251 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 252 | + toggleFrustumItem.addItemListener(this); |
---|
| 253 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 254 | + |
---|
| 255 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 256 | + toggleFootContactItem.addItemListener(this); |
---|
| 257 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 258 | + |
---|
| 259 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 260 | + toggleTimelineItem.addItemListener(this); |
---|
| 261 | + } |
---|
| 262 | + |
---|
| 263 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 264 | +// toggleRootItem.addItemListener(this); |
---|
| 265 | +// toggleRootItem.setState(false); |
---|
| 266 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 267 | +// animationItem.addItemListener(this); |
---|
| 268 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 269 | + cameraMenu.add("-"); |
---|
| 270 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 271 | + editCameraItem.addActionListener(this); |
---|
| 272 | + |
---|
| 273 | + if (Globals.ADVANCED) |
---|
| 274 | + { |
---|
153 | 275 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
154 | 276 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
155 | 277 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
161 | 283 | lookAtItem.addActionListener(this); |
---|
162 | 284 | //lookFromItem.addActinoListener(this); |
---|
163 | 285 | //switchItem.addActionListener(this); |
---|
164 | | - Menu menu; |
---|
165 | | - oe.menuBar.add(menu = new Menu("Edit")); |
---|
166 | | - //editItem = menu.add(new MenuItem("Edit")); |
---|
167 | | - //editItem.addActionListener(this); |
---|
168 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
169 | | - duplicateItem.addActionListener(this); |
---|
170 | | - menu.add("-"); |
---|
171 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
172 | | - cloneItem.addActionListener(this); |
---|
173 | | - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
174 | | - cloneSupportItem.addActionListener(this); |
---|
175 | | - menu.add("-"); |
---|
176 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
177 | | - cutItem.addActionListener(this); |
---|
178 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
179 | | - copyItem.addActionListener(this); |
---|
180 | | - pasteItem = menu.add(new MenuItem("Paste")); |
---|
181 | | - pasteItem.addActionListener(this); |
---|
182 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
183 | | - pasteLinkItem.addActionListener(this); |
---|
184 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
185 | | - pasteCloneItem.addActionListener(this); |
---|
186 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
187 | | -// pasteExpandItem.addActionListener(this); |
---|
188 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
189 | | - clearItem.addActionListener(this); |
---|
190 | | - clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
191 | | - clearAllItem.addActionListener(this); |
---|
192 | | - |
---|
| 286 | + } |
---|
| 287 | + |
---|
193 | 288 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
194 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
195 | | - resetMeshItem.addActionListener(this); |
---|
196 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
197 | | - stepAllItem.addActionListener(this); |
---|
| 289 | + if (Globals.ADVANCED) |
---|
| 290 | + { |
---|
198 | 291 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
199 | 292 | revertMeshItem.addActionListener(this); |
---|
200 | 293 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
201 | 294 | resetreferencesItem.addActionListener(this); |
---|
202 | 295 | menu.add("-"); |
---|
| 296 | + } |
---|
203 | 297 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
204 | 298 | overwriteGeoItem.addActionListener(this); |
---|
205 | 299 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
211 | 305 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
212 | 306 | overwriteUVItem.addActionListener(this); |
---|
213 | 307 | menu.add("-"); |
---|
| 308 | + if (Globals.ADVANCED) |
---|
| 309 | + { |
---|
214 | 310 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
215 | 311 | generateMeshItem.addActionListener(this); |
---|
216 | 312 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
217 | 313 | poseMeshItem.addActionListener(this); |
---|
218 | 314 | menu.add("-"); |
---|
| 315 | + } |
---|
219 | 316 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
220 | 317 | resetsupportItem.addActionListener(this); |
---|
221 | 318 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
222 | 319 | linkverticesItem.addActionListener(this); |
---|
223 | 320 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
224 | 321 | relinkverticesItem.addActionListener(this); |
---|
| 322 | + |
---|
| 323 | + if (Globals.ADVANCED) |
---|
| 324 | + { |
---|
225 | 325 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
226 | 326 | setMasterItem.addActionListener(this); |
---|
| 327 | + } |
---|
227 | 328 | |
---|
228 | 329 | oe.menuBar.add(menu = new Menu("Group")); |
---|
229 | 330 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
234 | 335 | frontItem.addActionListener(this); |
---|
235 | 336 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
236 | 337 | compositeItem.addActionListener(this); |
---|
237 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 338 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
238 | 339 | hideItem.addActionListener(this); |
---|
239 | 340 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
240 | 341 | ungroupItem.addActionListener(this); |
---|
241 | 342 | menu.add("-"); |
---|
242 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 343 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
243 | 344 | randomItem.addActionListener(this); |
---|
244 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
245 | | - physicsItem.addActionListener(this); |
---|
246 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
247 | | - frameselectorItem.addActionListener(this); |
---|
248 | 345 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
249 | 346 | switchGeoItem.addActionListener(this); |
---|
250 | 347 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
251 | 348 | switchTransfoItem.addActionListener(this); |
---|
252 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 349 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
253 | 350 | morphItem.addActionListener(this); |
---|
| 351 | + |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
| 354 | + menu.add("-"); |
---|
| 355 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 356 | + physicsItem.addActionListener(this); |
---|
| 357 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 358 | + frameselectorItem.addActionListener(this); |
---|
254 | 359 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
255 | 360 | scriptNodeItem.addActionListener(this); |
---|
256 | 361 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
257 | 362 | cameraItem.addActionListener(this); |
---|
| 363 | + } |
---|
258 | 364 | |
---|
259 | 365 | oe.menuBar.add(menu = new Menu("Object")); |
---|
260 | 366 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
269 | 375 | shadowYItem.addActionListener(this); |
---|
270 | 376 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
271 | 377 | shadowZItem.addActionListener(this); |
---|
| 378 | + if (Globals.ADVANCED) |
---|
| 379 | + { |
---|
| 380 | + menu.add("-"); |
---|
272 | 381 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
273 | 382 | linkerItem.addActionListener(this); |
---|
274 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
275 | | - templateItem.addActionListener(this); |
---|
276 | 383 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
277 | 384 | attributeItem.addActionListener(this); |
---|
| 385 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 386 | + templateItem.addActionListener(this); |
---|
278 | 387 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
279 | 388 | pointflowItem.addActionListener(this); |
---|
| 389 | + } |
---|
280 | 390 | menu.add("-"); |
---|
281 | 391 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
282 | 392 | resetTransformItem.addActionListener(this); |
---|
283 | 393 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
284 | 394 | resetCentroidItem.addActionListener(this); |
---|
285 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
286 | | - transformgeometryItem.addActionListener(this); |
---|
| 395 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 396 | + resetCentroidXZItem.addActionListener(this); |
---|
| 397 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 398 | + transformGeometryItem.addActionListener(this); |
---|
| 399 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 400 | + transformChildrenItem.addActionListener(this); |
---|
287 | 401 | |
---|
288 | 402 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
289 | 403 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
294 | 408 | genNormalsCADItem.addActionListener(this); |
---|
295 | 409 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
296 | 410 | genNormalsMESHItem.addActionListener(this); |
---|
| 411 | + if (Globals.ADVANCED) |
---|
| 412 | + { |
---|
297 | 413 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
298 | 414 | genNormalsMINEItem.addActionListener(this); |
---|
| 415 | + } |
---|
299 | 416 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
300 | 417 | stripifyItem.addActionListener(this); |
---|
301 | 418 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
317 | 434 | reduce34MeshItem.addActionListener(this); |
---|
318 | 435 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
319 | 436 | increaseMeshItem.addActionListener(this); |
---|
320 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
321 | | - smoothMeshItem.addActionListener(this); |
---|
322 | 437 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
323 | 438 | clipMeshItem.addActionListener(this); |
---|
| 439 | + |
---|
| 440 | + if (Globals.ADVANCED) |
---|
| 441 | + { |
---|
| 442 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 443 | + smoothMeshItem.addActionListener(this); |
---|
| 444 | + } |
---|
324 | 445 | |
---|
325 | 446 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
326 | 447 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
327 | 448 | clearMaterialsItem.addActionListener(this); |
---|
| 449 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 450 | + resetAllItem.addActionListener(this); |
---|
| 451 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 452 | + stepAllItem.addActionListener(this); |
---|
328 | 453 | menu.add("-"); |
---|
329 | 454 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
330 | 455 | liveleavesItem.addActionListener(this); |
---|
331 | 456 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
332 | 457 | unliveleavesItem.addActionListener(this); |
---|
| 458 | + if (Globals.ADVANCED) |
---|
| 459 | + { |
---|
333 | 460 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
334 | 461 | supportleavesItem.addActionListener(this); |
---|
335 | 462 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
336 | 463 | unsupportleavesItem.addActionListener(this); |
---|
| 464 | + } |
---|
337 | 465 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
338 | 466 | hideleavesItem.addActionListener(this); |
---|
339 | 467 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
377 | 505 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
378 | 506 | sortbynameItem.addActionListener(this); |
---|
379 | 507 | menu.add("-"); |
---|
| 508 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 509 | + shareGeometriesItem.addActionListener(this); |
---|
| 510 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 511 | + mergeGeometriesItem.addActionListener(this); |
---|
| 512 | + if (Globals.ADVANCED) |
---|
| 513 | + { |
---|
| 514 | + // Pretty much the same as duplicate and clone. |
---|
380 | 515 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
381 | 516 | extractGeometriesItem.addActionListener(this); |
---|
382 | 517 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
383 | 518 | cloneGeometriesItem.addActionListener(this); |
---|
384 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
385 | | - shareGeometriesItem.addActionListener(this); |
---|
386 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
387 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 519 | + } |
---|
388 | 520 | |
---|
389 | 521 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
390 | 522 | buildCreateMenu(menu); |
---|
391 | 523 | |
---|
392 | | - |
---|
393 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
394 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
395 | | - importGFDItem.addActionListener(this); |
---|
396 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
397 | | - importVRMLX3DItem.addActionListener(this); |
---|
398 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
399 | | - importOBJItem.addActionListener(this); |
---|
400 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
401 | | - import3DSItem.addActionListener(this); |
---|
402 | | - |
---|
403 | 524 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
404 | 525 | buildToolsMenu(menu); |
---|
405 | 526 | } |
---|
.. | .. |
---|
436 | 557 | */ |
---|
437 | 558 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
438 | 559 | |
---|
| 560 | + oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 561 | + undoButton.setToolTipText("Undo changes"); |
---|
| 562 | + undoButton.addActionListener(this); |
---|
| 563 | + |
---|
| 564 | + oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 565 | + redoButton.setToolTipText("Redo changes"); |
---|
| 566 | + redoButton.addActionListener(this); |
---|
| 567 | + |
---|
| 568 | + oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 569 | + saveButton.setToolTipText("Save changes"); |
---|
| 570 | + saveButton.addActionListener(this); |
---|
| 571 | + |
---|
439 | 572 | oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
440 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 573 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 574 | liveCB.addItemListener(this); |
---|
442 | 575 | |
---|
| 576 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 577 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 578 | + oneStepButton.addActionListener(this); |
---|
| 579 | + |
---|
443 | 580 | oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
444 | 581 | fastCB.setToolTipText("Fast mode"); |
---|
445 | 582 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
448 | 585 | trackCB.setToolTipText("Enable tracking"); |
---|
449 | 586 | trackCB.addItemListener(this); |
---|
450 | 587 | |
---|
451 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
452 | 589 | screenfitButton.setToolTipText("Screen fit"); |
---|
453 | 590 | screenfitButton.addActionListener(this); |
---|
454 | 591 | |
---|
455 | 592 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
456 | 593 | // screenfitpointButton.addActionListener(this); |
---|
457 | | -// oe.aConstraints.gridx += 1; |
---|
458 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
459 | | - snapobjectButton.addActionListener(this); |
---|
460 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
461 | | - oe.aConstraints.gridx += 1; |
---|
462 | 594 | |
---|
463 | | - //aConstraints.gridx = 0; |
---|
464 | | - //aConstraints.gridy += 1; |
---|
465 | | - oe.aConstraints.weighty = 0; |
---|
466 | | - oe.aConstraints.gridwidth = 1; |
---|
467 | | - |
---|
468 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 595 | + if (Globals.ADVANCED) |
---|
| 596 | + { |
---|
| 597 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 598 | + snapobjectButton.addActionListener(this); |
---|
| 599 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 600 | + } |
---|
| 601 | + |
---|
| 602 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
469 | 603 | flashSelectionButton.setToolTipText("Show selection"); |
---|
470 | 604 | flashSelectionButton.addActionListener(this); |
---|
471 | 605 | |
---|
472 | 606 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
473 | 607 | |
---|
474 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
475 | 609 | twoButton.setToolTipText("Show center view only"); |
---|
476 | 610 | twoButton.addActionListener(this); |
---|
477 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
478 | 612 | fourButton.addActionListener(this); |
---|
479 | 613 | fourButton.setToolTipText("Show left panel only"); |
---|
480 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 614 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
481 | 615 | sixButton.setToolTipText("2-column layout left"); |
---|
482 | 616 | sixButton.addActionListener(this); |
---|
483 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 617 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
484 | 618 | threeButton.setToolTipText("2-column layout right"); |
---|
485 | 619 | threeButton.addActionListener(this); |
---|
486 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
487 | 621 | sevenButton.setToolTipText("3-column layout"); |
---|
488 | 622 | sevenButton.addActionListener(this); |
---|
489 | 623 | // |
---|
490 | 624 | |
---|
491 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 625 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | 626 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
493 | 627 | rootButton.addActionListener(this); |
---|
494 | 628 | |
---|
495 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
496 | 630 | closeButton.setToolTipText("Close tab"); |
---|
497 | 631 | closeButton.addActionListener(this); |
---|
498 | 632 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
500 | 634 | |
---|
501 | 635 | cGridBag commandsPanel = new cGridBag(); |
---|
502 | 636 | |
---|
503 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 637 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 638 | editButton.setToolTipText("Edit selection"); |
---|
505 | 639 | editButton.addActionListener(this); |
---|
506 | 640 | |
---|
507 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 641 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
508 | 642 | uneditButton.setToolTipText("Unedit selection"); |
---|
509 | 643 | uneditButton.addActionListener(this); |
---|
510 | 644 | |
---|
511 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 645 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 646 | + allParamsButton.setToolTipText("Edit all params"); |
---|
| 647 | + allParamsButton.addActionListener(this); |
---|
| 648 | + |
---|
| 649 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
512 | 650 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
513 | 651 | clearPanelButton.addActionListener(this); |
---|
514 | 652 | |
---|
515 | | - commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | | - allParamsButton.setToolTipText("All params??"); |
---|
517 | | - allParamsButton.addActionListener(this); |
---|
518 | | - |
---|
519 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 653 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
520 | 654 | unselectButton.setToolTipText("Unselect"); |
---|
521 | 655 | unselectButton.addActionListener(this); |
---|
522 | 656 | |
---|
.. | .. |
---|
591 | 725 | |
---|
592 | 726 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
593 | 727 | { |
---|
| 728 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 729 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 730 | + boxCB.addItemListener(this); |
---|
| 731 | + |
---|
| 732 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 733 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 734 | + zoomBoxCB.addItemListener(this); |
---|
| 735 | + |
---|
| 736 | + if (true) // Globals.ADVANCED) |
---|
| 737 | + { |
---|
594 | 738 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
595 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
| 739 | + supportCB.setToolTipText("Enable rigging"); |
---|
596 | 740 | supportCB.addItemListener(this); |
---|
597 | 741 | |
---|
598 | 742 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
.. | .. |
---|
610 | 754 | slowCB.setToolTipText("Smooth interpolation"); |
---|
611 | 755 | slowCB.addItemListener(this); |
---|
612 | 756 | |
---|
613 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
614 | | - boxCB.setToolTipText("Display bounding boxes"); |
---|
615 | | - boxCB.addItemListener(this); |
---|
616 | | - |
---|
617 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
618 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
619 | | - zoomBoxCB.addItemListener(this); |
---|
620 | | - |
---|
621 | 757 | // constraints.gridy += 1; |
---|
622 | 758 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
623 | 759 | // speakerMocapCB.addItemListener(this); |
---|
.. | .. |
---|
648 | 784 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
649 | 785 | lookAtCB.setToolTipText("Look-at target"); |
---|
650 | 786 | lookAtCB.addItemListener(this); |
---|
| 787 | + |
---|
| 788 | + } |
---|
651 | 789 | |
---|
652 | 790 | cGridBag fill = new cGridBag(); |
---|
653 | 791 | |
---|
.. | .. |
---|
668 | 806 | buttonGroup.add(radioButton); |
---|
669 | 807 | radioButton.doClick(); |
---|
670 | 808 | } |
---|
| 809 | + |
---|
671 | 810 | void SetupViews(ObjEditor oe) |
---|
672 | 811 | { |
---|
673 | 812 | oe.SetupViews(); |
---|
.. | .. |
---|
732 | 871 | } else if(e.getSource() == liveCB) |
---|
733 | 872 | { |
---|
734 | 873 | cameraView.ToggleLive(); |
---|
| 874 | + refreshContents(false); |
---|
735 | 875 | } |
---|
736 | 876 | else if(e.getSource() == supportCB) |
---|
737 | 877 | { |
---|
.. | .. |
---|
884 | 1024 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
885 | 1025 | // return; |
---|
886 | 1026 | // } |
---|
887 | | - if (string.charAt(0) == '/') |
---|
| 1027 | + |
---|
| 1028 | + // File path for Mac and Windows |
---|
| 1029 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
888 | 1030 | { |
---|
889 | 1031 | // file(s) |
---|
890 | 1032 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
911 | 1053 | |
---|
912 | 1054 | flashIt = false; |
---|
913 | 1055 | CameraPane pane = (CameraPane) target; |
---|
914 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1056 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
915 | 1057 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
916 | 1058 | |
---|
917 | 1059 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
938 | 1080 | { |
---|
939 | 1081 | loadClipboard(true); |
---|
940 | 1082 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
941 | | - pasteInto(false); |
---|
| 1083 | + pasteInto(false, false); |
---|
942 | 1084 | } else { |
---|
943 | 1085 | loadClipboard(false); |
---|
944 | 1086 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
945 | | - pasteInto(false); // true); // ??? |
---|
| 1087 | + pasteInto(false, false); // true); // ??? |
---|
946 | 1088 | } |
---|
947 | 1089 | } |
---|
948 | 1090 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1064 | 1206 | kleinItem.addActionListener(this); |
---|
1065 | 1207 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1066 | 1208 | particleItem.addActionListener(this); |
---|
| 1209 | + if (Globals.ADVANCED) |
---|
| 1210 | + { |
---|
1067 | 1211 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1068 | 1212 | ragdollItem.addActionListener(this); |
---|
1069 | 1213 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1070 | 1214 | ragdoll2Item.addActionListener(this); |
---|
| 1215 | + } |
---|
1071 | 1216 | menu.add("-"); |
---|
1072 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1217 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1073 | 1218 | meshItem.addActionListener(this); |
---|
1074 | 1219 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1075 | 1220 | // meshGroupItem.addActionListener(this); |
---|
| 1221 | + if (Globals.ADVANCED) |
---|
| 1222 | + { |
---|
1076 | 1223 | springItem = menu.add(new MenuItem("Spring")); |
---|
1077 | 1224 | springItem.addActionListener(this); |
---|
1078 | 1225 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1079 | 1226 | flagItem.addActionListener(this); |
---|
1080 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1081 | | - bezierItem.addActionListener(this); |
---|
1082 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1083 | | - checkerItem.addActionListener(this); |
---|
1084 | 1227 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1085 | 1228 | blobItem.addActionListener(this); |
---|
1086 | 1229 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1087 | 1230 | latheItem.addActionListener(this); |
---|
| 1231 | + } |
---|
| 1232 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1233 | + bezierItem.addActionListener(this); |
---|
| 1234 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1235 | + overlayItem.addActionListener(this); |
---|
1088 | 1236 | lightItem = menu.add(new MenuItem("Light")); |
---|
1089 | 1237 | lightItem.addActionListener(this); |
---|
1090 | 1238 | menu.add("-"); |
---|
.. | .. |
---|
1094 | 1242 | loopItem.addActionListener(this); |
---|
1095 | 1243 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1096 | 1244 | doubleItem.addActionListener(this); |
---|
| 1245 | + if (Globals.ADVANCED) |
---|
| 1246 | + { |
---|
1097 | 1247 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1098 | 1248 | tripleItem.addActionListener(this); |
---|
| 1249 | + } |
---|
1099 | 1250 | } |
---|
1100 | 1251 | |
---|
1101 | 1252 | void buildToolsMenu(Menu menu) |
---|
.. | .. |
---|
1109 | 1260 | parseverticesItem.addActionListener(this); |
---|
1110 | 1261 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1111 | 1262 | textureFieldItem.addActionListener(this); |
---|
1112 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1263 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1113 | 1264 | alignItem.addActionListener(this); |
---|
1114 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1115 | | - mirrorItem.addActionListener(this); |
---|
1116 | 1265 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1117 | 1266 | reduceMorphItem.addActionListener(this); |
---|
1118 | 1267 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1119 | 1268 | reduce34MorphItem.addActionListener(this); |
---|
1120 | | - |
---|
| 1269 | + menu.add("-"); |
---|
1121 | 1270 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1122 | 1271 | computeAOItem.addActionListener(this); |
---|
1123 | | - menu.add("-"); |
---|
1124 | 1272 | |
---|
| 1273 | + if (Globals.ADVANCED) |
---|
| 1274 | + { |
---|
| 1275 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1276 | + mirrorItem.addActionListener(this); |
---|
| 1277 | + menu.add("-"); |
---|
1125 | 1278 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1126 | 1279 | memoryItem.addActionListener(this); |
---|
1127 | 1280 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1128 | 1281 | analyzeItem.addActionListener(this); |
---|
1129 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1282 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1130 | 1283 | dumpItem.addActionListener(this); |
---|
1131 | 1284 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1132 | 1285 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1144 | 1297 | menu.add("-"); |
---|
1145 | 1298 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1146 | 1299 | editScriptItem.addActionListener(this); |
---|
| 1300 | + } |
---|
1147 | 1301 | } |
---|
1148 | 1302 | |
---|
1149 | 1303 | void ScreenFit() |
---|
.. | .. |
---|
1472 | 1626 | |
---|
1473 | 1627 | void Overwrite(int mask) |
---|
1474 | 1628 | { |
---|
1475 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1629 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1476 | 1630 | { |
---|
1477 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1631 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1478 | 1632 | |
---|
1479 | 1633 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1480 | 1634 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1645 | 1799 | { |
---|
1646 | 1800 | makeSomething(new BezierSurface()); |
---|
1647 | 1801 | } else |
---|
1648 | | - if (source == checkerItem) |
---|
| 1802 | + if (source == overlayItem) |
---|
1649 | 1803 | { |
---|
1650 | 1804 | /* |
---|
1651 | 1805 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1779 | 1933 | csg.addChild(child); |
---|
1780 | 1934 | child.addChild(csg); |
---|
1781 | 1935 | } else |
---|
1782 | | - |
---|
1783 | | - if (source == importGFDItem) |
---|
1784 | | - { |
---|
1785 | | - ImportGFD(); |
---|
1786 | | - } else |
---|
1787 | | - if (source == importVRMLX3DItem) |
---|
1788 | | - { |
---|
1789 | | - ImportVRMLX3D(); |
---|
1790 | | - } else |
---|
1791 | | - if (source == import3DSItem) |
---|
1792 | | - { |
---|
1793 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1794 | | - } else |
---|
1795 | | - if (source == importOBJItem) |
---|
1796 | | - { |
---|
1797 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1798 | | - } else |
---|
1799 | 1936 | if (source == computeAOItem) |
---|
1800 | 1937 | { |
---|
1801 | 1938 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1814 | 1951 | if (source == invariantsItem) |
---|
1815 | 1952 | { |
---|
1816 | 1953 | System.out.println("Invariants:"); |
---|
1817 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1954 | + Grafreed.grafreeD.universe.invariants(); |
---|
1818 | 1955 | } else |
---|
1819 | 1956 | if (source == memoryItem) |
---|
1820 | 1957 | { |
---|
.. | .. |
---|
1832 | 1969 | if (source == dumpItem) |
---|
1833 | 1970 | { |
---|
1834 | 1971 | DumpObject(); |
---|
| 1972 | + } else |
---|
| 1973 | + if (source == undoButton) |
---|
| 1974 | + { |
---|
| 1975 | + Undo(); |
---|
| 1976 | + } else |
---|
| 1977 | + if (source == redoButton) |
---|
| 1978 | + { |
---|
| 1979 | + Redo(); |
---|
| 1980 | + } else |
---|
| 1981 | + if (source == saveButton) |
---|
| 1982 | + { |
---|
| 1983 | + Save(); |
---|
| 1984 | + } else |
---|
| 1985 | + if (source == oneStepButton) |
---|
| 1986 | + { |
---|
| 1987 | + Globals.ONESTEP = true; |
---|
| 1988 | + cameraView.repaint(); |
---|
1835 | 1989 | } else |
---|
1836 | 1990 | if (source == screenfitButton) |
---|
1837 | 1991 | { |
---|
.. | .. |
---|
1882 | 2036 | { |
---|
1883 | 2037 | loadClipboard(true); |
---|
1884 | 2038 | } else |
---|
| 2039 | + if (source == undoItem) |
---|
| 2040 | + { |
---|
| 2041 | + Undo(); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == redoItem) |
---|
| 2044 | + { |
---|
| 2045 | + Redo(); |
---|
| 2046 | + } else |
---|
1885 | 2047 | if (source == duplicateItem) |
---|
1886 | 2048 | { |
---|
1887 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2049 | + Object3D keep = Grafreed.clipboard; |
---|
1888 | 2050 | loadClipboard(false); |
---|
1889 | 2051 | paste(false); |
---|
1890 | | - GrafreeD.clipboard = keep; |
---|
| 2052 | + Grafreed.clipboard = keep; |
---|
1891 | 2053 | } else |
---|
1892 | 2054 | if (source == cloneItem) |
---|
1893 | 2055 | { |
---|
.. | .. |
---|
1905 | 2067 | { |
---|
1906 | 2068 | paste(false); |
---|
1907 | 2069 | } else |
---|
| 2070 | + if (source == pasteIntoItem) |
---|
| 2071 | + { |
---|
| 2072 | + pasteInto(true, false); |
---|
| 2073 | + } else |
---|
1908 | 2074 | if (source == pasteLinkItem) |
---|
1909 | 2075 | { |
---|
1910 | | - pasteInto(false); |
---|
| 2076 | + pasteInto(false, false); |
---|
1911 | 2077 | } else |
---|
1912 | 2078 | if (source == pasteCloneItem) |
---|
1913 | 2079 | { |
---|
1914 | | - pasteInto(true); |
---|
| 2080 | + pasteInto(true, true); |
---|
1915 | 2081 | } else |
---|
1916 | 2082 | if (source == pasteExpandItem) |
---|
1917 | 2083 | { |
---|
.. | .. |
---|
2103 | 2269 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2104 | 2270 | // refreshContents(); |
---|
2105 | 2271 | // } |
---|
2106 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2272 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2107 | 2273 | { |
---|
2108 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2274 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2109 | 2275 | |
---|
2110 | 2276 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2111 | 2277 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2113 | 2279 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2114 | 2280 | for (int i=0; i<group.selection.size(); i++) |
---|
2115 | 2281 | { |
---|
2116 | | - boolean random = CameraPane.RANDOM; |
---|
2117 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2282 | + boolean random = CameraPane.SWITCH; |
---|
| 2283 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2118 | 2284 | group.selection.get(i).linkVerticesThis(content); |
---|
2119 | 2285 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2120 | | - CameraPane.RANDOM = random; |
---|
| 2286 | + CameraPane.SWITCH = random; |
---|
2121 | 2287 | } |
---|
2122 | 2288 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2123 | 2289 | refreshContents(); |
---|
.. | .. |
---|
2127 | 2293 | { |
---|
2128 | 2294 | for (int i=0; i<group.selection.size(); i++) |
---|
2129 | 2295 | { |
---|
2130 | | - boolean random = CameraPane.RANDOM; |
---|
2131 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2296 | + boolean random = CameraPane.SWITCH; |
---|
| 2297 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2132 | 2298 | group.selection.get(i).linkVerticesThis(null); |
---|
2133 | | - CameraPane.RANDOM = random; |
---|
| 2299 | + CameraPane.SWITCH = random; |
---|
2134 | 2300 | } |
---|
2135 | 2301 | |
---|
2136 | 2302 | refreshContents(); |
---|
2137 | 2303 | } else |
---|
2138 | 2304 | if (source == relinkverticesItem) |
---|
2139 | 2305 | { |
---|
2140 | | - boolean random = CameraPane.RANDOM; |
---|
2141 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2306 | + boolean random = CameraPane.SWITCH; |
---|
| 2307 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2142 | 2308 | group.selection.RelinkToSupport(); |
---|
2143 | | - CameraPane.RANDOM = random; |
---|
| 2309 | + CameraPane.SWITCH = random; |
---|
2144 | 2310 | |
---|
2145 | 2311 | refreshContents(); |
---|
2146 | 2312 | } else |
---|
.. | .. |
---|
2155 | 2321 | } else |
---|
2156 | 2322 | if (source == setMasterItem) |
---|
2157 | 2323 | { |
---|
2158 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2324 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2159 | 2325 | { |
---|
2160 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2326 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2161 | 2327 | |
---|
2162 | 2328 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2163 | 2329 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2170 | 2336 | { |
---|
2171 | 2337 | if (group.selection.size() == 1) |
---|
2172 | 2338 | { |
---|
2173 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2339 | + if (Grafreed.clipboard.size() == 1) |
---|
2174 | 2340 | { |
---|
2175 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2341 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2176 | 2342 | |
---|
2177 | 2343 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2178 | 2344 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2189 | 2355 | { |
---|
2190 | 2356 | RevertMeshes(); |
---|
2191 | 2357 | } else |
---|
2192 | | - if (source == resetMeshItem) |
---|
| 2358 | + if (source == resetAllItem) |
---|
2193 | 2359 | { |
---|
2194 | 2360 | ResetAll(); |
---|
2195 | 2361 | } else |
---|
.. | .. |
---|
2238 | 2404 | RandomNode random = new RandomNode(); |
---|
2239 | 2405 | group(random); |
---|
2240 | 2406 | if (random.size() > 0) |
---|
2241 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2407 | + random.name = random.get(0).name + "Switch"; |
---|
2242 | 2408 | } else |
---|
2243 | 2409 | if (source == physicsItem) |
---|
2244 | 2410 | { |
---|
.. | .. |
---|
2377 | 2543 | } else |
---|
2378 | 2544 | if (source == genNormalsMESHItem) |
---|
2379 | 2545 | { |
---|
2380 | | - GenNormals(true); // TODO |
---|
| 2546 | + GenNormalsMESH(); |
---|
2381 | 2547 | } else |
---|
2382 | 2548 | if (source == genNormalsORGANItem) |
---|
2383 | 2549 | { |
---|
.. | .. |
---|
2527 | 2693 | { |
---|
2528 | 2694 | SmoothMesh(); |
---|
2529 | 2695 | } else |
---|
2530 | | - if (source == transformgeometryItem) |
---|
| 2696 | + if (source == transformGeometryItem) |
---|
2531 | 2697 | { |
---|
2532 | 2698 | TransformGeometry(); |
---|
| 2699 | + } else |
---|
| 2700 | + if (source == transformChildrenItem) |
---|
| 2701 | + { |
---|
| 2702 | + TransformChildren(); |
---|
2533 | 2703 | } else |
---|
2534 | 2704 | if (source == resetTransformItem) |
---|
2535 | 2705 | { |
---|
.. | .. |
---|
2537 | 2707 | } else |
---|
2538 | 2708 | if (source == resetCentroidItem) |
---|
2539 | 2709 | { |
---|
2540 | | - ResetCentroid(); |
---|
| 2710 | + ResetCentroid(true); |
---|
| 2711 | + } else |
---|
| 2712 | + if (source == resetCentroidXZItem) |
---|
| 2713 | + { |
---|
| 2714 | + ResetCentroid(false); |
---|
2541 | 2715 | } else |
---|
2542 | 2716 | if (source == resetParentItem) |
---|
2543 | 2717 | { |
---|
.. | .. |
---|
2893 | 3067 | child.CloseUI(); |
---|
2894 | 3068 | listUI.remove(child); |
---|
2895 | 3069 | |
---|
2896 | | - child.editWindow = null; // ??????????? |
---|
| 3070 | + //child.editWindow = null; // ??????????? |
---|
2897 | 3071 | } |
---|
2898 | | - objEditor.ctrlPanel.validate(); |
---|
| 3072 | + objEditor.ctrlPanel.FlushUI(); |
---|
2899 | 3073 | //objEditor.jTree.clearSelection(); |
---|
2900 | 3074 | //objEditor.ResetSliders(); |
---|
2901 | 3075 | refreshContents(true); |
---|
.. | .. |
---|
2979 | 3153 | frontView.object = group; |
---|
2980 | 3154 | sideView.object = group; |
---|
2981 | 3155 | } |
---|
| 3156 | + |
---|
| 3157 | +// fix "+" issue |
---|
2982 | 3158 | group.editWindow = this; |
---|
| 3159 | + |
---|
2983 | 3160 | /* |
---|
2984 | 3161 | currentLayout = radio.layout; |
---|
2985 | 3162 | if (currentLayout == null) |
---|
.. | .. |
---|
2992 | 3169 | //group.attributes = -1; |
---|
2993 | 3170 | ResetModel(); |
---|
2994 | 3171 | refreshContents(true); |
---|
2995 | | - } |
---|
| 3172 | + } else if (event.getSource() == editCameraItem) |
---|
| 3173 | + { |
---|
| 3174 | + cameraView.ProtectCamera(); |
---|
| 3175 | + cameraView.repaint(); |
---|
| 3176 | + return; |
---|
| 3177 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3178 | + { |
---|
| 3179 | + cameraView.RevertCamera(); |
---|
| 3180 | + cameraView.repaint(); |
---|
| 3181 | + return; |
---|
| 3182 | + // } else if (event.getSource() == textureButton) |
---|
| 3183 | + // { |
---|
| 3184 | + // return; // true; |
---|
| 3185 | + } |
---|
2996 | 3186 | else |
---|
2997 | 3187 | { |
---|
2998 | 3188 | //return super.action(event, arg); |
---|
.. | .. |
---|
3053 | 3243 | refreshContents(); |
---|
3054 | 3244 | } |
---|
3055 | 3245 | |
---|
| 3246 | + void TransformChildren() |
---|
| 3247 | + { |
---|
| 3248 | + Object3D obj; |
---|
| 3249 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3250 | + { |
---|
| 3251 | + obj = (Object3D)e.nextElement(); |
---|
| 3252 | + obj.KeepTextureMatrices(); |
---|
| 3253 | + obj.TransformChildren(); |
---|
| 3254 | + obj.RestoreTextureMatrices(); |
---|
| 3255 | + |
---|
| 3256 | +// if (obj.parent == null) |
---|
| 3257 | +// { |
---|
| 3258 | +// System.out.println("NULL PARENT!"); |
---|
| 3259 | +// new Exception().printStackTrace(); |
---|
| 3260 | +// } |
---|
| 3261 | +// else |
---|
| 3262 | +// TouchTransform(obj); |
---|
| 3263 | +// //obj.parent.Touch(); |
---|
| 3264 | + } |
---|
| 3265 | + |
---|
| 3266 | + refreshContents(); |
---|
| 3267 | + } |
---|
3056 | 3268 | |
---|
3057 | 3269 | void ResetTransform() |
---|
3058 | 3270 | { |
---|
.. | .. |
---|
3165 | 3377 | refreshContents(); |
---|
3166 | 3378 | } |
---|
3167 | 3379 | |
---|
3168 | | - void ResetCentroid() |
---|
| 3380 | + void ResetCentroid(boolean full) |
---|
3169 | 3381 | { |
---|
3170 | 3382 | Object3D obj; |
---|
3171 | 3383 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3180 | 3392 | LA.matIdentity(Object3D.mat); |
---|
3181 | 3393 | obj.getBounds(minima, maxima, false); |
---|
3182 | 3394 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3183 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3395 | + if (full) |
---|
| 3396 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3184 | 3397 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3185 | 3398 | obj.TransformMesh(Object3D.mat); |
---|
| 3399 | + |
---|
3186 | 3400 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3187 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3401 | + if (full) |
---|
| 3402 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3188 | 3403 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3404 | + |
---|
3189 | 3405 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3190 | 3406 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3191 | 3407 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3214 | 3430 | |
---|
3215 | 3431 | int size = obj.MemorySize(); |
---|
3216 | 3432 | |
---|
3217 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3433 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3434 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3218 | 3435 | } |
---|
3219 | 3436 | } |
---|
3220 | 3437 | catch (Exception e) |
---|
.. | .. |
---|
3251 | 3468 | obj = (Object3D)e.nextElement(); |
---|
3252 | 3469 | |
---|
3253 | 3470 | System.out.println("Object is: " + obj); |
---|
3254 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3471 | + Grafreed.AnalyzeObject(obj); |
---|
3255 | 3472 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3256 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3473 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3257 | 3474 | |
---|
3258 | 3475 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3259 | 3476 | } |
---|
.. | .. |
---|
3295 | 3512 | void GenNormals(boolean crease) |
---|
3296 | 3513 | { |
---|
3297 | 3514 | group.GenNormalsS(crease); |
---|
| 3515 | + |
---|
| 3516 | + refreshContents(); |
---|
| 3517 | + } |
---|
| 3518 | + |
---|
| 3519 | + void GenNormalsMESH() |
---|
| 3520 | + { |
---|
| 3521 | + group.GenNormalsMeshS(); |
---|
3298 | 3522 | |
---|
3299 | 3523 | refreshContents(); |
---|
3300 | 3524 | } |
---|
.. | .. |
---|
3467 | 3691 | |
---|
3468 | 3692 | void ParseVertices() |
---|
3469 | 3693 | { |
---|
3470 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3471 | | - GrafreeD.epsequal = true; |
---|
| 3694 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3695 | + Grafreed.epsequal = true; |
---|
3472 | 3696 | |
---|
3473 | 3697 | for (int i=0; i<group.selection.size(); i++) |
---|
3474 | 3698 | { |
---|
.. | .. |
---|
3493 | 3717 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3494 | 3718 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3495 | 3719 | |
---|
3496 | | - g.add(GrafreeD.clipboard); |
---|
| 3720 | + g.add(Grafreed.clipboard); |
---|
3497 | 3721 | |
---|
3498 | 3722 | buffer.add(g); |
---|
3499 | 3723 | } |
---|
.. | .. |
---|
3508 | 3732 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3509 | 3733 | } |
---|
3510 | 3734 | |
---|
3511 | | - GrafreeD.epsequal = epsequal; |
---|
| 3735 | + Grafreed.epsequal = epsequal; |
---|
3512 | 3736 | |
---|
3513 | 3737 | refreshContents(); |
---|
3514 | 3738 | } |
---|
.. | .. |
---|
3526 | 3750 | String pigment = Object3D.GetPigment(tex); |
---|
3527 | 3751 | //String bump = Object3D.GetBump(tex); |
---|
3528 | 3752 | |
---|
3529 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3753 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3754 | + |
---|
| 3755 | + try |
---|
| 3756 | + { |
---|
| 3757 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3758 | + } |
---|
| 3759 | + catch (Exception e) |
---|
| 3760 | + { |
---|
| 3761 | + System.err.println("FAIL: " + node); |
---|
| 3762 | + } |
---|
3530 | 3763 | |
---|
3531 | 3764 | double s = v.s; |
---|
3532 | 3765 | |
---|
.. | .. |
---|
3614 | 3847 | |
---|
3615 | 3848 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3616 | 3849 | |
---|
3617 | | - boolean random = CameraPane.RANDOM; |
---|
3618 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3850 | + boolean random = CameraPane.SWITCH; |
---|
| 3851 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3619 | 3852 | lowres.linkVerticesThis(null); |
---|
3620 | 3853 | lowres.linkVerticesThis(sn); |
---|
3621 | | - CameraPane.RANDOM = random; |
---|
| 3854 | + CameraPane.SWITCH = random; |
---|
3622 | 3855 | |
---|
3623 | 3856 | System.err.flush(); |
---|
3624 | 3857 | |
---|
.. | .. |
---|
3658 | 3891 | return; |
---|
3659 | 3892 | |
---|
3660 | 3893 | Object3D poses = group.selection.get(0); |
---|
3661 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3894 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3662 | 3895 | |
---|
3663 | 3896 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3664 | 3897 | |
---|
.. | .. |
---|
3852 | 4085 | |
---|
3853 | 4086 | void ClipMesh() |
---|
3854 | 4087 | { |
---|
3855 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4088 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3856 | 4089 | { |
---|
3857 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4090 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3858 | 4091 | |
---|
3859 | 4092 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3860 | 4093 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3863 | 4096 | // { |
---|
3864 | 4097 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3865 | 4098 | // } |
---|
3866 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4099 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3867 | 4100 | } |
---|
3868 | 4101 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3869 | 4102 | System.out.println("DONE."); |
---|
.. | .. |
---|
3998 | 4231 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3999 | 4232 | |
---|
4000 | 4233 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4001 | | - if(elem != group) |
---|
| 4234 | + if(elem != group || !newWindow) |
---|
4002 | 4235 | { |
---|
4003 | 4236 | // if (!(elem instanceof Composite)) |
---|
4004 | 4237 | // newWindow = false; |
---|
.. | .. |
---|
4088 | 4321 | //case 702: // Event.LIST_DESELECT |
---|
4089 | 4322 | group.deselectAll(); |
---|
4090 | 4323 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4091 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4092 | 4324 | if (tps != null) |
---|
4093 | 4325 | { |
---|
4094 | 4326 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4097 | 4329 | |
---|
4098 | 4330 | //if (child.parent != null) |
---|
4099 | 4331 | //child.parent.addSelectee(child); |
---|
| 4332 | + objEditor.SetMaterial(child); |
---|
4100 | 4333 | group.addSelectee(child); |
---|
4101 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4102 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4103 | | - System.err.println("info : " + child.GetPath()); |
---|
4104 | 4334 | } |
---|
4105 | 4335 | } |
---|
4106 | 4336 | // else |
---|
.. | .. |
---|
4110 | 4340 | // System.err.println("info : " + group.GetPath()); |
---|
4111 | 4341 | // } |
---|
4112 | 4342 | |
---|
4113 | | - objEditor.SetText(); // jan 2014 |
---|
4114 | | - |
---|
4115 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4343 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4116 | 4344 | CameraPane.flash = true; |
---|
4117 | 4345 | |
---|
4118 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4346 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4119 | 4347 | // a camera |
---|
4120 | 4348 | { |
---|
4121 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4122 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4349 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4350 | + { |
---|
| 4351 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4352 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4353 | + } |
---|
4123 | 4354 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4124 | 4355 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4125 | 4356 | } |
---|
.. | .. |
---|
4132 | 4363 | |
---|
4133 | 4364 | freezemodel = false; |
---|
4134 | 4365 | } |
---|
| 4366 | + |
---|
| 4367 | + void refreshContents(boolean cp) |
---|
| 4368 | + { |
---|
| 4369 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4370 | + { |
---|
| 4371 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4372 | + |
---|
| 4373 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4374 | + { |
---|
| 4375 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4376 | + |
---|
| 4377 | + objEditor.AddInfo(child, this, true); |
---|
| 4378 | + System.err.println("info : " + child.GetPath()); |
---|
| 4379 | + } |
---|
| 4380 | + |
---|
| 4381 | + objEditor.SetText(); // jan 2014 |
---|
| 4382 | + } |
---|
| 4383 | + |
---|
| 4384 | + super.refreshContents(cp); |
---|
| 4385 | + } |
---|
4135 | 4386 | |
---|
4136 | 4387 | void linkSomething(Object3D thing) |
---|
4137 | 4388 | { |
---|
.. | .. |
---|
4203 | 4454 | { |
---|
4204 | 4455 | if (group.selection.isEmpty()) |
---|
4205 | 4456 | return; |
---|
4206 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4457 | + |
---|
| 4458 | + Grafreed.clipboardIsTempGroup = false; |
---|
4207 | 4459 | Composite tGroup = null; |
---|
4208 | 4460 | if (group.selection.size() > 0) // 1) |
---|
4209 | 4461 | { |
---|
4210 | 4462 | tGroup = new cGroup(); |
---|
4211 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4463 | + Grafreed.clipboardIsTempGroup = true; |
---|
4212 | 4464 | } |
---|
4213 | 4465 | |
---|
4214 | 4466 | if (cut) |
---|
4215 | 4467 | { |
---|
| 4468 | + Save(); |
---|
4216 | 4469 | //int indices[] = jList.getSelectedIndices(); |
---|
4217 | 4470 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4218 | 4471 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4248 | 4501 | //System.out.println("cut " + child); |
---|
4249 | 4502 | //System.out.println("parent = " + child.parent); |
---|
4250 | 4503 | // tmp.addChild(child); |
---|
4251 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4504 | + if (Grafreed.clipboardIsTempGroup) |
---|
4252 | 4505 | tGroup.add/*Child*/(tmp); |
---|
4253 | 4506 | else |
---|
4254 | | - GrafreeD.clipboard = tmp; |
---|
| 4507 | + Grafreed.clipboard = tmp; |
---|
4255 | 4508 | } |
---|
4256 | 4509 | else |
---|
4257 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4510 | + if (Grafreed.clipboardIsTempGroup) |
---|
4258 | 4511 | tGroup.add/*Child*/(child); |
---|
4259 | 4512 | else |
---|
4260 | | - GrafreeD.clipboard = child; |
---|
| 4513 | + Grafreed.clipboard = child; |
---|
4261 | 4514 | } |
---|
4262 | 4515 | |
---|
4263 | 4516 | //ResetModel(); |
---|
.. | .. |
---|
4289 | 4542 | //System.out.println("cut " + elem); |
---|
4290 | 4543 | //System.out.println("parent = " + elem.parent); |
---|
4291 | 4544 | // tmp.addChild(elem); |
---|
4292 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4545 | + if (Grafreed.clipboardIsTempGroup) |
---|
4293 | 4546 | tGroup.add/*Child*/(tmp); |
---|
4294 | 4547 | else |
---|
4295 | | - GrafreeD.clipboard = tmp; |
---|
| 4548 | + Grafreed.clipboard = tmp; |
---|
4296 | 4549 | } |
---|
4297 | 4550 | else |
---|
4298 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4551 | + if (Grafreed.clipboardIsTempGroup) |
---|
4299 | 4552 | tGroup.add/*Child*/(child); |
---|
4300 | 4553 | else |
---|
4301 | | - GrafreeD.clipboard = child; |
---|
| 4554 | + Grafreed.clipboard = child; |
---|
4302 | 4555 | } |
---|
4303 | 4556 | |
---|
4304 | 4557 | } |
---|
4305 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4306 | | - GrafreeD.clipboard = tGroup; |
---|
| 4558 | + |
---|
| 4559 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4560 | + Grafreed.clipboard = tGroup; |
---|
| 4561 | + |
---|
4307 | 4562 | if (cut) |
---|
4308 | 4563 | { |
---|
4309 | 4564 | ResetModel(); |
---|
.. | .. |
---|
4317 | 4572 | // return; |
---|
4318 | 4573 | boolean first = true; |
---|
4319 | 4574 | |
---|
4320 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4575 | + if (Grafreed.clipboardIsTempGroup) |
---|
4321 | 4576 | { |
---|
4322 | 4577 | Composite temp; |
---|
4323 | 4578 | |
---|
.. | .. |
---|
4328 | 4583 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4329 | 4584 | */ |
---|
4330 | 4585 | Object3D elem; |
---|
4331 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4586 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4332 | 4587 | { |
---|
4333 | 4588 | Object3D child = (Object3D)e.nextElement(); |
---|
4334 | 4589 | |
---|
.. | .. |
---|
4362 | 4617 | //Object3D cb = Applet3D.clipboard; |
---|
4363 | 4618 | //temp.addChild(cb); |
---|
4364 | 4619 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4365 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4366 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4367 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4368 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4369 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4620 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4621 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4622 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4623 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4624 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4370 | 4625 | else |
---|
4371 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4372 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4626 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4627 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4373 | 4628 | } |
---|
4374 | 4629 | |
---|
4375 | 4630 | ResetModel(); |
---|
4376 | 4631 | refreshContents(); |
---|
4377 | 4632 | } |
---|
4378 | 4633 | |
---|
4379 | | - void pasteInto(boolean copyit) |
---|
| 4634 | + void pasteInto(boolean copyit, boolean clone) |
---|
4380 | 4635 | { |
---|
4381 | 4636 | // if (GrafreeD.clipboard == null) |
---|
4382 | 4637 | // return; |
---|
.. | .. |
---|
4405 | 4660 | if (copyit) |
---|
4406 | 4661 | { |
---|
4407 | 4662 | // paste(false); |
---|
4408 | | - CloneClipboard(false); // sept 2014 |
---|
| 4663 | + if (clone) |
---|
| 4664 | + { |
---|
| 4665 | + CloneClipboard(false); // sept 2014 |
---|
| 4666 | + } |
---|
| 4667 | + else |
---|
| 4668 | + { |
---|
| 4669 | + paste(false); |
---|
| 4670 | + } |
---|
4409 | 4671 | } |
---|
4410 | 4672 | else |
---|
4411 | 4673 | { |
---|
4412 | 4674 | boolean first = true; |
---|
4413 | 4675 | |
---|
4414 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4676 | + if (Grafreed.clipboardIsTempGroup) |
---|
4415 | 4677 | { |
---|
4416 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4678 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4417 | 4679 | Object3D copy; |
---|
4418 | 4680 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4419 | 4681 | { |
---|
.. | .. |
---|
4423 | 4685 | } |
---|
4424 | 4686 | } else |
---|
4425 | 4687 | { |
---|
4426 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4688 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4427 | 4689 | } |
---|
4428 | 4690 | } |
---|
4429 | 4691 | } |
---|
.. | .. |
---|
4828 | 5090 | } |
---|
4829 | 5091 | */ |
---|
4830 | 5092 | |
---|
4831 | | - void ImportGFD() |
---|
4832 | | - { |
---|
4833 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4834 | | - browser.show(); |
---|
4835 | | - String filename = browser.getFile(); |
---|
4836 | | - if (filename != null && filename.length() > 0) |
---|
4837 | | - { |
---|
4838 | | - String fullname = browser.getDirectory() + filename; |
---|
4839 | | - |
---|
4840 | | - //Object3D readobj = |
---|
4841 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4842 | | - //makeSomething(readobj); |
---|
4843 | | - } |
---|
4844 | | - } |
---|
4845 | | - |
---|
4846 | 5093 | /* |
---|
4847 | 5094 | public void Callback(Object obj) |
---|
4848 | 5095 | { |
---|
.. | .. |
---|
4866 | 5113 | } |
---|
4867 | 5114 | */ |
---|
4868 | 5115 | |
---|
4869 | | - void ImportVRMLX3D() |
---|
4870 | | - { |
---|
4871 | | - if (GrafreeD.standAlone) |
---|
4872 | | - { |
---|
4873 | | - /**/ |
---|
4874 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4875 | | - browser.show(); |
---|
4876 | | - String filename = browser.getFile(); |
---|
4877 | | - if (filename != null && filename.length() > 0) |
---|
4878 | | - { |
---|
4879 | | - String fullname = browser.getDirectory() + filename; |
---|
4880 | | - LoadVRMLX3D(fullname); |
---|
4881 | | - } |
---|
4882 | | - /**/ |
---|
4883 | | - } |
---|
4884 | | - } |
---|
4885 | | - |
---|
4886 | 5116 | String GetFile(String dialogName) |
---|
4887 | 5117 | { |
---|
4888 | | - if (GrafreeD.standAlone) |
---|
| 5118 | + if (Grafreed.standAlone) |
---|
4889 | 5119 | { |
---|
4890 | 5120 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4891 | 5121 | browser.show(); |
---|
.. | .. |
---|
4949 | 5179 | cButton flashSelectionButton; |
---|
4950 | 5180 | cButton editButton; |
---|
4951 | 5181 | cButton uneditButton; |
---|
| 5182 | + JCheckBox allParamsButton; |
---|
4952 | 5183 | cButton clearpanelButton; |
---|
4953 | | - cButton allParamsButton; |
---|
4954 | 5184 | cButton unselectButton; |
---|
4955 | 5185 | |
---|
| 5186 | + cButton saveButton; |
---|
| 5187 | + cButton undoButton; |
---|
| 5188 | + cButton redoButton; |
---|
| 5189 | + cButton oneStepButton; |
---|
| 5190 | + |
---|
4956 | 5191 | cButton screenfitButton; |
---|
4957 | 5192 | cButton screenfitpointButton; |
---|
4958 | 5193 | cButton snapobjectButton; |
---|
.. | .. |
---|
4983 | 5218 | private MenuItem lookFromItem; |
---|
4984 | 5219 | private MenuItem switchItem; |
---|
4985 | 5220 | private MenuItem cutItem; |
---|
| 5221 | + private MenuItem undoItem; |
---|
| 5222 | + private MenuItem redoItem; |
---|
4986 | 5223 | private MenuItem duplicateItem; |
---|
4987 | 5224 | private MenuItem cloneItem; |
---|
4988 | 5225 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4996 | 5233 | private MenuItem linkverticesItem; |
---|
4997 | 5234 | private MenuItem relinkverticesItem; |
---|
4998 | 5235 | private MenuItem setMasterItem; |
---|
4999 | | - private MenuItem resetMeshItem; |
---|
| 5236 | + private MenuItem resetAllItem; |
---|
5000 | 5237 | private MenuItem stepAllItem; |
---|
5001 | 5238 | private MenuItem revertMeshItem; |
---|
5002 | 5239 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5007 | 5244 | private MenuItem mergeGeometriesItem; |
---|
5008 | 5245 | private MenuItem copyItem; |
---|
5009 | 5246 | private MenuItem pasteItem; |
---|
| 5247 | + private MenuItem pasteIntoItem; |
---|
5010 | 5248 | private MenuItem pasteLinkItem; |
---|
5011 | 5249 | private MenuItem pasteCloneItem; |
---|
5012 | 5250 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5056 | 5294 | private MenuItem panoTexturesItem; |
---|
5057 | 5295 | |
---|
5058 | 5296 | private MenuItem resetCentroidItem; |
---|
5059 | | - private MenuItem transformgeometryItem; |
---|
| 5297 | + private MenuItem resetCentroidXZItem; |
---|
5060 | 5298 | private MenuItem resetTransformItem; |
---|
| 5299 | + private MenuItem transformGeometryItem; |
---|
| 5300 | + private MenuItem transformChildrenItem; |
---|
5061 | 5301 | private MenuItem hideItem; |
---|
5062 | 5302 | private MenuItem grabItem; |
---|
5063 | 5303 | private MenuItem backItem; |
---|
.. | .. |
---|
5104 | 5344 | private MenuItem blobItem; |
---|
5105 | 5345 | private MenuItem latheItem; |
---|
5106 | 5346 | private MenuItem bezierItem; |
---|
5107 | | - private MenuItem checkerItem; |
---|
| 5347 | + private MenuItem overlayItem; |
---|
5108 | 5348 | private MenuItem meshItem; |
---|
5109 | 5349 | // private MenuItem meshGroupItem; |
---|
5110 | 5350 | private MenuItem springItem; |
---|
.. | .. |
---|
5126 | 5366 | private MenuItem doubleItem; |
---|
5127 | 5367 | private MenuItem tripleItem; |
---|
5128 | 5368 | |
---|
5129 | | - private MenuItem importGFDItem; |
---|
5130 | | - private MenuItem importVRMLX3DItem; |
---|
5131 | | - private MenuItem import3DSItem; |
---|
5132 | | - private MenuItem importOBJItem; |
---|
5133 | | - |
---|
5134 | 5369 | private MenuItem computeAOItem; |
---|
5135 | 5370 | private MenuItem recompileItem; |
---|
5136 | 5371 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5140 | 5375 | private MenuItem analyzeItem; |
---|
5141 | 5376 | private MenuItem dumpItem; |
---|
5142 | 5377 | //boolean freezemodel = false; |
---|
| 5378 | + |
---|
| 5379 | + Menu cameraMenu; |
---|
| 5380 | + MenuItem editCameraItem; |
---|
| 5381 | + MenuItem revertCameraItem; |
---|
5143 | 5382 | } |
---|