.. | .. |
---|
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(); |
---|
.. | .. |
---|
884 | 1023 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
885 | 1024 | // return; |
---|
886 | 1025 | // } |
---|
887 | | - if (string.charAt(0) == '/') |
---|
| 1026 | + |
---|
| 1027 | + // File path for Mac and Windows |
---|
| 1028 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
888 | 1029 | { |
---|
889 | 1030 | // file(s) |
---|
890 | 1031 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
911 | 1052 | |
---|
912 | 1053 | flashIt = false; |
---|
913 | 1054 | CameraPane pane = (CameraPane) target; |
---|
914 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1055 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
915 | 1056 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
916 | 1057 | |
---|
917 | 1058 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
938 | 1079 | { |
---|
939 | 1080 | loadClipboard(true); |
---|
940 | 1081 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
941 | | - pasteInto(false); |
---|
| 1082 | + pasteInto(false, false); |
---|
942 | 1083 | } else { |
---|
943 | 1084 | loadClipboard(false); |
---|
944 | 1085 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
945 | | - pasteInto(false); // true); // ??? |
---|
| 1086 | + pasteInto(false, false); // true); // ??? |
---|
946 | 1087 | } |
---|
947 | 1088 | } |
---|
948 | 1089 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1064 | 1205 | kleinItem.addActionListener(this); |
---|
1065 | 1206 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1066 | 1207 | particleItem.addActionListener(this); |
---|
| 1208 | + if (Globals.ADVANCED) |
---|
| 1209 | + { |
---|
1067 | 1210 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1068 | 1211 | ragdollItem.addActionListener(this); |
---|
1069 | 1212 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1070 | 1213 | ragdoll2Item.addActionListener(this); |
---|
| 1214 | + } |
---|
1071 | 1215 | menu.add("-"); |
---|
1072 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1216 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1073 | 1217 | meshItem.addActionListener(this); |
---|
1074 | 1218 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1075 | 1219 | // meshGroupItem.addActionListener(this); |
---|
| 1220 | + if (Globals.ADVANCED) |
---|
| 1221 | + { |
---|
1076 | 1222 | springItem = menu.add(new MenuItem("Spring")); |
---|
1077 | 1223 | springItem.addActionListener(this); |
---|
1078 | 1224 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1079 | 1225 | 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 | 1226 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1085 | 1227 | blobItem.addActionListener(this); |
---|
1086 | 1228 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1087 | 1229 | latheItem.addActionListener(this); |
---|
| 1230 | + } |
---|
| 1231 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1232 | + bezierItem.addActionListener(this); |
---|
| 1233 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1234 | + overlayItem.addActionListener(this); |
---|
1088 | 1235 | lightItem = menu.add(new MenuItem("Light")); |
---|
1089 | 1236 | lightItem.addActionListener(this); |
---|
1090 | 1237 | menu.add("-"); |
---|
.. | .. |
---|
1094 | 1241 | loopItem.addActionListener(this); |
---|
1095 | 1242 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1096 | 1243 | doubleItem.addActionListener(this); |
---|
| 1244 | + if (Globals.ADVANCED) |
---|
| 1245 | + { |
---|
1097 | 1246 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1098 | 1247 | tripleItem.addActionListener(this); |
---|
| 1248 | + } |
---|
1099 | 1249 | } |
---|
1100 | 1250 | |
---|
1101 | 1251 | void buildToolsMenu(Menu menu) |
---|
.. | .. |
---|
1109 | 1259 | parseverticesItem.addActionListener(this); |
---|
1110 | 1260 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1111 | 1261 | textureFieldItem.addActionListener(this); |
---|
1112 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1262 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1113 | 1263 | alignItem.addActionListener(this); |
---|
1114 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1115 | | - mirrorItem.addActionListener(this); |
---|
1116 | 1264 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1117 | 1265 | reduceMorphItem.addActionListener(this); |
---|
1118 | 1266 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1119 | 1267 | reduce34MorphItem.addActionListener(this); |
---|
1120 | | - |
---|
| 1268 | + menu.add("-"); |
---|
1121 | 1269 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1122 | 1270 | computeAOItem.addActionListener(this); |
---|
1123 | | - menu.add("-"); |
---|
1124 | 1271 | |
---|
| 1272 | + if (Globals.ADVANCED) |
---|
| 1273 | + { |
---|
| 1274 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1275 | + mirrorItem.addActionListener(this); |
---|
| 1276 | + menu.add("-"); |
---|
1125 | 1277 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1126 | 1278 | memoryItem.addActionListener(this); |
---|
1127 | 1279 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1144 | 1296 | menu.add("-"); |
---|
1145 | 1297 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1146 | 1298 | editScriptItem.addActionListener(this); |
---|
| 1299 | + } |
---|
1147 | 1300 | } |
---|
1148 | 1301 | |
---|
1149 | 1302 | void ScreenFit() |
---|
.. | .. |
---|
1472 | 1625 | |
---|
1473 | 1626 | void Overwrite(int mask) |
---|
1474 | 1627 | { |
---|
1475 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1628 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1476 | 1629 | { |
---|
1477 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1630 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1478 | 1631 | |
---|
1479 | 1632 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1480 | 1633 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1645 | 1798 | { |
---|
1646 | 1799 | makeSomething(new BezierSurface()); |
---|
1647 | 1800 | } else |
---|
1648 | | - if (source == checkerItem) |
---|
| 1801 | + if (source == overlayItem) |
---|
1649 | 1802 | { |
---|
1650 | 1803 | /* |
---|
1651 | 1804 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1779 | 1932 | csg.addChild(child); |
---|
1780 | 1933 | child.addChild(csg); |
---|
1781 | 1934 | } 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 | 1935 | if (source == computeAOItem) |
---|
1800 | 1936 | { |
---|
1801 | 1937 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1814 | 1950 | if (source == invariantsItem) |
---|
1815 | 1951 | { |
---|
1816 | 1952 | System.out.println("Invariants:"); |
---|
1817 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1953 | + Grafreed.grafreeD.universe.invariants(); |
---|
1818 | 1954 | } else |
---|
1819 | 1955 | if (source == memoryItem) |
---|
1820 | 1956 | { |
---|
.. | .. |
---|
1832 | 1968 | if (source == dumpItem) |
---|
1833 | 1969 | { |
---|
1834 | 1970 | DumpObject(); |
---|
| 1971 | + } else |
---|
| 1972 | + if (source == undoButton) |
---|
| 1973 | + { |
---|
| 1974 | + Undo(); |
---|
| 1975 | + } else |
---|
| 1976 | + if (source == redoButton) |
---|
| 1977 | + { |
---|
| 1978 | + Redo(); |
---|
| 1979 | + } else |
---|
| 1980 | + if (source == saveButton) |
---|
| 1981 | + { |
---|
| 1982 | + Save(); |
---|
| 1983 | + } else |
---|
| 1984 | + if (source == oneStepButton) |
---|
| 1985 | + { |
---|
| 1986 | + Globals.ONESTEP = true; |
---|
| 1987 | + cameraView.repaint(); |
---|
1835 | 1988 | } else |
---|
1836 | 1989 | if (source == screenfitButton) |
---|
1837 | 1990 | { |
---|
.. | .. |
---|
1882 | 2035 | { |
---|
1883 | 2036 | loadClipboard(true); |
---|
1884 | 2037 | } else |
---|
| 2038 | + if (source == undoItem) |
---|
| 2039 | + { |
---|
| 2040 | + Undo(); |
---|
| 2041 | + } else |
---|
| 2042 | + if (source == redoItem) |
---|
| 2043 | + { |
---|
| 2044 | + Redo(); |
---|
| 2045 | + } else |
---|
1885 | 2046 | if (source == duplicateItem) |
---|
1886 | 2047 | { |
---|
1887 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2048 | + Object3D keep = Grafreed.clipboard; |
---|
1888 | 2049 | loadClipboard(false); |
---|
1889 | 2050 | paste(false); |
---|
1890 | | - GrafreeD.clipboard = keep; |
---|
| 2051 | + Grafreed.clipboard = keep; |
---|
1891 | 2052 | } else |
---|
1892 | 2053 | if (source == cloneItem) |
---|
1893 | 2054 | { |
---|
.. | .. |
---|
1905 | 2066 | { |
---|
1906 | 2067 | paste(false); |
---|
1907 | 2068 | } else |
---|
| 2069 | + if (source == pasteIntoItem) |
---|
| 2070 | + { |
---|
| 2071 | + pasteInto(true, false); |
---|
| 2072 | + } else |
---|
1908 | 2073 | if (source == pasteLinkItem) |
---|
1909 | 2074 | { |
---|
1910 | | - pasteInto(false); |
---|
| 2075 | + pasteInto(false, false); |
---|
1911 | 2076 | } else |
---|
1912 | 2077 | if (source == pasteCloneItem) |
---|
1913 | 2078 | { |
---|
1914 | | - pasteInto(true); |
---|
| 2079 | + pasteInto(true, true); |
---|
1915 | 2080 | } else |
---|
1916 | 2081 | if (source == pasteExpandItem) |
---|
1917 | 2082 | { |
---|
.. | .. |
---|
2103 | 2268 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2104 | 2269 | // refreshContents(); |
---|
2105 | 2270 | // } |
---|
2106 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2271 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2107 | 2272 | { |
---|
2108 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2273 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2109 | 2274 | |
---|
2110 | 2275 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2111 | 2276 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2113 | 2278 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2114 | 2279 | for (int i=0; i<group.selection.size(); i++) |
---|
2115 | 2280 | { |
---|
2116 | | - boolean random = CameraPane.RANDOM; |
---|
2117 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2281 | + boolean random = CameraPane.SWITCH; |
---|
| 2282 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2118 | 2283 | group.selection.get(i).linkVerticesThis(content); |
---|
2119 | 2284 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2120 | | - CameraPane.RANDOM = random; |
---|
| 2285 | + CameraPane.SWITCH = random; |
---|
2121 | 2286 | } |
---|
2122 | 2287 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2123 | 2288 | refreshContents(); |
---|
.. | .. |
---|
2127 | 2292 | { |
---|
2128 | 2293 | for (int i=0; i<group.selection.size(); i++) |
---|
2129 | 2294 | { |
---|
2130 | | - boolean random = CameraPane.RANDOM; |
---|
2131 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2295 | + boolean random = CameraPane.SWITCH; |
---|
| 2296 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2132 | 2297 | group.selection.get(i).linkVerticesThis(null); |
---|
2133 | | - CameraPane.RANDOM = random; |
---|
| 2298 | + CameraPane.SWITCH = random; |
---|
2134 | 2299 | } |
---|
2135 | 2300 | |
---|
2136 | 2301 | refreshContents(); |
---|
2137 | 2302 | } else |
---|
2138 | 2303 | if (source == relinkverticesItem) |
---|
2139 | 2304 | { |
---|
2140 | | - boolean random = CameraPane.RANDOM; |
---|
2141 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2305 | + boolean random = CameraPane.SWITCH; |
---|
| 2306 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2142 | 2307 | group.selection.RelinkToSupport(); |
---|
2143 | | - CameraPane.RANDOM = random; |
---|
| 2308 | + CameraPane.SWITCH = random; |
---|
2144 | 2309 | |
---|
2145 | 2310 | refreshContents(); |
---|
2146 | 2311 | } else |
---|
.. | .. |
---|
2155 | 2320 | } else |
---|
2156 | 2321 | if (source == setMasterItem) |
---|
2157 | 2322 | { |
---|
2158 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2323 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2159 | 2324 | { |
---|
2160 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2325 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2161 | 2326 | |
---|
2162 | 2327 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2163 | 2328 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2170 | 2335 | { |
---|
2171 | 2336 | if (group.selection.size() == 1) |
---|
2172 | 2337 | { |
---|
2173 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2338 | + if (Grafreed.clipboard.size() == 1) |
---|
2174 | 2339 | { |
---|
2175 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2340 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2176 | 2341 | |
---|
2177 | 2342 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2178 | 2343 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2189 | 2354 | { |
---|
2190 | 2355 | RevertMeshes(); |
---|
2191 | 2356 | } else |
---|
2192 | | - if (source == resetMeshItem) |
---|
| 2357 | + if (source == resetAllItem) |
---|
2193 | 2358 | { |
---|
2194 | 2359 | ResetAll(); |
---|
2195 | 2360 | } else |
---|
.. | .. |
---|
2238 | 2403 | RandomNode random = new RandomNode(); |
---|
2239 | 2404 | group(random); |
---|
2240 | 2405 | if (random.size() > 0) |
---|
2241 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2406 | + random.name = random.get(0).name + "Switch"; |
---|
2242 | 2407 | } else |
---|
2243 | 2408 | if (source == physicsItem) |
---|
2244 | 2409 | { |
---|
.. | .. |
---|
2377 | 2542 | } else |
---|
2378 | 2543 | if (source == genNormalsMESHItem) |
---|
2379 | 2544 | { |
---|
2380 | | - GenNormals(true); // TODO |
---|
| 2545 | + GenNormalsMESH(); |
---|
2381 | 2546 | } else |
---|
2382 | 2547 | if (source == genNormalsORGANItem) |
---|
2383 | 2548 | { |
---|
.. | .. |
---|
2527 | 2692 | { |
---|
2528 | 2693 | SmoothMesh(); |
---|
2529 | 2694 | } else |
---|
2530 | | - if (source == transformgeometryItem) |
---|
| 2695 | + if (source == transformGeometryItem) |
---|
2531 | 2696 | { |
---|
2532 | 2697 | TransformGeometry(); |
---|
| 2698 | + } else |
---|
| 2699 | + if (source == transformChildrenItem) |
---|
| 2700 | + { |
---|
| 2701 | + TransformChildren(); |
---|
2533 | 2702 | } else |
---|
2534 | 2703 | if (source == resetTransformItem) |
---|
2535 | 2704 | { |
---|
.. | .. |
---|
2537 | 2706 | } else |
---|
2538 | 2707 | if (source == resetCentroidItem) |
---|
2539 | 2708 | { |
---|
2540 | | - ResetCentroid(); |
---|
| 2709 | + ResetCentroid(true); |
---|
| 2710 | + } else |
---|
| 2711 | + if (source == resetCentroidXZItem) |
---|
| 2712 | + { |
---|
| 2713 | + ResetCentroid(false); |
---|
2541 | 2714 | } else |
---|
2542 | 2715 | if (source == resetParentItem) |
---|
2543 | 2716 | { |
---|
.. | .. |
---|
2893 | 3066 | child.CloseUI(); |
---|
2894 | 3067 | listUI.remove(child); |
---|
2895 | 3068 | |
---|
2896 | | - child.editWindow = null; // ??????????? |
---|
| 3069 | + //child.editWindow = null; // ??????????? |
---|
2897 | 3070 | } |
---|
2898 | | - objEditor.ctrlPanel.validate(); |
---|
| 3071 | + objEditor.ctrlPanel.FlushUI(); |
---|
2899 | 3072 | //objEditor.jTree.clearSelection(); |
---|
2900 | 3073 | //objEditor.ResetSliders(); |
---|
2901 | 3074 | refreshContents(true); |
---|
.. | .. |
---|
2979 | 3152 | frontView.object = group; |
---|
2980 | 3153 | sideView.object = group; |
---|
2981 | 3154 | } |
---|
| 3155 | + |
---|
| 3156 | +// fix "+" issue |
---|
2982 | 3157 | group.editWindow = this; |
---|
| 3158 | + |
---|
2983 | 3159 | /* |
---|
2984 | 3160 | currentLayout = radio.layout; |
---|
2985 | 3161 | if (currentLayout == null) |
---|
.. | .. |
---|
2992 | 3168 | //group.attributes = -1; |
---|
2993 | 3169 | ResetModel(); |
---|
2994 | 3170 | refreshContents(true); |
---|
2995 | | - } |
---|
| 3171 | + } else if (event.getSource() == editCameraItem) |
---|
| 3172 | + { |
---|
| 3173 | + cameraView.ProtectCamera(); |
---|
| 3174 | + cameraView.repaint(); |
---|
| 3175 | + return; |
---|
| 3176 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3177 | + { |
---|
| 3178 | + cameraView.RevertCamera(); |
---|
| 3179 | + cameraView.repaint(); |
---|
| 3180 | + return; |
---|
| 3181 | + // } else if (event.getSource() == textureButton) |
---|
| 3182 | + // { |
---|
| 3183 | + // return; // true; |
---|
| 3184 | + } |
---|
2996 | 3185 | else |
---|
2997 | 3186 | { |
---|
2998 | 3187 | //return super.action(event, arg); |
---|
.. | .. |
---|
3053 | 3242 | refreshContents(); |
---|
3054 | 3243 | } |
---|
3055 | 3244 | |
---|
| 3245 | + void TransformChildren() |
---|
| 3246 | + { |
---|
| 3247 | + Object3D obj; |
---|
| 3248 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3249 | + { |
---|
| 3250 | + obj = (Object3D)e.nextElement(); |
---|
| 3251 | + obj.KeepTextureMatrices(); |
---|
| 3252 | + obj.TransformChildren(); |
---|
| 3253 | + obj.RestoreTextureMatrices(); |
---|
| 3254 | + |
---|
| 3255 | +// if (obj.parent == null) |
---|
| 3256 | +// { |
---|
| 3257 | +// System.out.println("NULL PARENT!"); |
---|
| 3258 | +// new Exception().printStackTrace(); |
---|
| 3259 | +// } |
---|
| 3260 | +// else |
---|
| 3261 | +// TouchTransform(obj); |
---|
| 3262 | +// //obj.parent.Touch(); |
---|
| 3263 | + } |
---|
| 3264 | + |
---|
| 3265 | + refreshContents(); |
---|
| 3266 | + } |
---|
3056 | 3267 | |
---|
3057 | 3268 | void ResetTransform() |
---|
3058 | 3269 | { |
---|
.. | .. |
---|
3165 | 3376 | refreshContents(); |
---|
3166 | 3377 | } |
---|
3167 | 3378 | |
---|
3168 | | - void ResetCentroid() |
---|
| 3379 | + void ResetCentroid(boolean full) |
---|
3169 | 3380 | { |
---|
3170 | 3381 | Object3D obj; |
---|
3171 | 3382 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3180 | 3391 | LA.matIdentity(Object3D.mat); |
---|
3181 | 3392 | obj.getBounds(minima, maxima, false); |
---|
3182 | 3393 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3183 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3394 | + if (full) |
---|
| 3395 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3184 | 3396 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3185 | 3397 | obj.TransformMesh(Object3D.mat); |
---|
| 3398 | + |
---|
3186 | 3399 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3187 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3400 | + if (full) |
---|
| 3401 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3188 | 3402 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3403 | + |
---|
3189 | 3404 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3190 | 3405 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3191 | 3406 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3214 | 3429 | |
---|
3215 | 3430 | int size = obj.MemorySize(); |
---|
3216 | 3431 | |
---|
3217 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3432 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3433 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3218 | 3434 | } |
---|
3219 | 3435 | } |
---|
3220 | 3436 | catch (Exception e) |
---|
.. | .. |
---|
3251 | 3467 | obj = (Object3D)e.nextElement(); |
---|
3252 | 3468 | |
---|
3253 | 3469 | System.out.println("Object is: " + obj); |
---|
3254 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3470 | + Grafreed.AnalyzeObject(obj); |
---|
3255 | 3471 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3256 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3472 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3257 | 3473 | |
---|
3258 | 3474 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3259 | 3475 | } |
---|
.. | .. |
---|
3295 | 3511 | void GenNormals(boolean crease) |
---|
3296 | 3512 | { |
---|
3297 | 3513 | group.GenNormalsS(crease); |
---|
| 3514 | + |
---|
| 3515 | + refreshContents(); |
---|
| 3516 | + } |
---|
| 3517 | + |
---|
| 3518 | + void GenNormalsMESH() |
---|
| 3519 | + { |
---|
| 3520 | + group.GenNormalsMeshS(); |
---|
3298 | 3521 | |
---|
3299 | 3522 | refreshContents(); |
---|
3300 | 3523 | } |
---|
.. | .. |
---|
3467 | 3690 | |
---|
3468 | 3691 | void ParseVertices() |
---|
3469 | 3692 | { |
---|
3470 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3471 | | - GrafreeD.epsequal = true; |
---|
| 3693 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3694 | + Grafreed.epsequal = true; |
---|
3472 | 3695 | |
---|
3473 | 3696 | for (int i=0; i<group.selection.size(); i++) |
---|
3474 | 3697 | { |
---|
.. | .. |
---|
3493 | 3716 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3494 | 3717 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3495 | 3718 | |
---|
3496 | | - g.add(GrafreeD.clipboard); |
---|
| 3719 | + g.add(Grafreed.clipboard); |
---|
3497 | 3720 | |
---|
3498 | 3721 | buffer.add(g); |
---|
3499 | 3722 | } |
---|
.. | .. |
---|
3508 | 3731 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3509 | 3732 | } |
---|
3510 | 3733 | |
---|
3511 | | - GrafreeD.epsequal = epsequal; |
---|
| 3734 | + Grafreed.epsequal = epsequal; |
---|
3512 | 3735 | |
---|
3513 | 3736 | refreshContents(); |
---|
3514 | 3737 | } |
---|
.. | .. |
---|
3526 | 3749 | String pigment = Object3D.GetPigment(tex); |
---|
3527 | 3750 | //String bump = Object3D.GetBump(tex); |
---|
3528 | 3751 | |
---|
3529 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3752 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3753 | + |
---|
| 3754 | + try |
---|
| 3755 | + { |
---|
| 3756 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3757 | + } |
---|
| 3758 | + catch (Exception e) |
---|
| 3759 | + { |
---|
| 3760 | + System.err.println("FAIL: " + node); |
---|
| 3761 | + } |
---|
3530 | 3762 | |
---|
3531 | 3763 | double s = v.s; |
---|
3532 | 3764 | |
---|
.. | .. |
---|
3614 | 3846 | |
---|
3615 | 3847 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3616 | 3848 | |
---|
3617 | | - boolean random = CameraPane.RANDOM; |
---|
3618 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3849 | + boolean random = CameraPane.SWITCH; |
---|
| 3850 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3619 | 3851 | lowres.linkVerticesThis(null); |
---|
3620 | 3852 | lowres.linkVerticesThis(sn); |
---|
3621 | | - CameraPane.RANDOM = random; |
---|
| 3853 | + CameraPane.SWITCH = random; |
---|
3622 | 3854 | |
---|
3623 | 3855 | System.err.flush(); |
---|
3624 | 3856 | |
---|
.. | .. |
---|
3658 | 3890 | return; |
---|
3659 | 3891 | |
---|
3660 | 3892 | Object3D poses = group.selection.get(0); |
---|
3661 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3893 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3662 | 3894 | |
---|
3663 | 3895 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3664 | 3896 | |
---|
.. | .. |
---|
3852 | 4084 | |
---|
3853 | 4085 | void ClipMesh() |
---|
3854 | 4086 | { |
---|
3855 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4087 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3856 | 4088 | { |
---|
3857 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4089 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3858 | 4090 | |
---|
3859 | 4091 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3860 | 4092 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3863 | 4095 | // { |
---|
3864 | 4096 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3865 | 4097 | // } |
---|
3866 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4098 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3867 | 4099 | } |
---|
3868 | 4100 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3869 | 4101 | System.out.println("DONE."); |
---|
.. | .. |
---|
3998 | 4230 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3999 | 4231 | |
---|
4000 | 4232 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4001 | | - if(elem != group) |
---|
| 4233 | + if(elem != group || !newWindow) |
---|
4002 | 4234 | { |
---|
4003 | 4235 | // if (!(elem instanceof Composite)) |
---|
4004 | 4236 | // newWindow = false; |
---|
.. | .. |
---|
4112 | 4344 | |
---|
4113 | 4345 | objEditor.SetText(); // jan 2014 |
---|
4114 | 4346 | |
---|
4115 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4347 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4116 | 4348 | CameraPane.flash = true; |
---|
4117 | 4349 | |
---|
4118 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4350 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4119 | 4351 | // a camera |
---|
4120 | 4352 | { |
---|
4121 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4122 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4353 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4354 | + { |
---|
| 4355 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4356 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4357 | + } |
---|
4123 | 4358 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4124 | 4359 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4125 | 4360 | } |
---|
.. | .. |
---|
4203 | 4438 | { |
---|
4204 | 4439 | if (group.selection.isEmpty()) |
---|
4205 | 4440 | return; |
---|
4206 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4441 | + |
---|
| 4442 | + Grafreed.clipboardIsTempGroup = false; |
---|
4207 | 4443 | Composite tGroup = null; |
---|
4208 | 4444 | if (group.selection.size() > 0) // 1) |
---|
4209 | 4445 | { |
---|
4210 | 4446 | tGroup = new cGroup(); |
---|
4211 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4447 | + Grafreed.clipboardIsTempGroup = true; |
---|
4212 | 4448 | } |
---|
4213 | 4449 | |
---|
4214 | 4450 | if (cut) |
---|
4215 | 4451 | { |
---|
| 4452 | + Save(); |
---|
4216 | 4453 | //int indices[] = jList.getSelectedIndices(); |
---|
4217 | 4454 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4218 | 4455 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4248 | 4485 | //System.out.println("cut " + child); |
---|
4249 | 4486 | //System.out.println("parent = " + child.parent); |
---|
4250 | 4487 | // tmp.addChild(child); |
---|
4251 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4488 | + if (Grafreed.clipboardIsTempGroup) |
---|
4252 | 4489 | tGroup.add/*Child*/(tmp); |
---|
4253 | 4490 | else |
---|
4254 | | - GrafreeD.clipboard = tmp; |
---|
| 4491 | + Grafreed.clipboard = tmp; |
---|
4255 | 4492 | } |
---|
4256 | 4493 | else |
---|
4257 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4494 | + if (Grafreed.clipboardIsTempGroup) |
---|
4258 | 4495 | tGroup.add/*Child*/(child); |
---|
4259 | 4496 | else |
---|
4260 | | - GrafreeD.clipboard = child; |
---|
| 4497 | + Grafreed.clipboard = child; |
---|
4261 | 4498 | } |
---|
4262 | 4499 | |
---|
4263 | 4500 | //ResetModel(); |
---|
.. | .. |
---|
4289 | 4526 | //System.out.println("cut " + elem); |
---|
4290 | 4527 | //System.out.println("parent = " + elem.parent); |
---|
4291 | 4528 | // tmp.addChild(elem); |
---|
4292 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4529 | + if (Grafreed.clipboardIsTempGroup) |
---|
4293 | 4530 | tGroup.add/*Child*/(tmp); |
---|
4294 | 4531 | else |
---|
4295 | | - GrafreeD.clipboard = tmp; |
---|
| 4532 | + Grafreed.clipboard = tmp; |
---|
4296 | 4533 | } |
---|
4297 | 4534 | else |
---|
4298 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4535 | + if (Grafreed.clipboardIsTempGroup) |
---|
4299 | 4536 | tGroup.add/*Child*/(child); |
---|
4300 | 4537 | else |
---|
4301 | | - GrafreeD.clipboard = child; |
---|
| 4538 | + Grafreed.clipboard = child; |
---|
4302 | 4539 | } |
---|
4303 | 4540 | |
---|
4304 | 4541 | } |
---|
4305 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4306 | | - GrafreeD.clipboard = tGroup; |
---|
| 4542 | + |
---|
| 4543 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4544 | + Grafreed.clipboard = tGroup; |
---|
| 4545 | + |
---|
4307 | 4546 | if (cut) |
---|
4308 | 4547 | { |
---|
4309 | 4548 | ResetModel(); |
---|
.. | .. |
---|
4317 | 4556 | // return; |
---|
4318 | 4557 | boolean first = true; |
---|
4319 | 4558 | |
---|
4320 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4559 | + if (Grafreed.clipboardIsTempGroup) |
---|
4321 | 4560 | { |
---|
4322 | 4561 | Composite temp; |
---|
4323 | 4562 | |
---|
.. | .. |
---|
4328 | 4567 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4329 | 4568 | */ |
---|
4330 | 4569 | Object3D elem; |
---|
4331 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4570 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4332 | 4571 | { |
---|
4333 | 4572 | Object3D child = (Object3D)e.nextElement(); |
---|
4334 | 4573 | |
---|
.. | .. |
---|
4362 | 4601 | //Object3D cb = Applet3D.clipboard; |
---|
4363 | 4602 | //temp.addChild(cb); |
---|
4364 | 4603 | //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()); |
---|
| 4604 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4605 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4606 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4607 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4608 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4370 | 4609 | else |
---|
4371 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4372 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4610 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4611 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4373 | 4612 | } |
---|
4374 | 4613 | |
---|
4375 | 4614 | ResetModel(); |
---|
4376 | 4615 | refreshContents(); |
---|
4377 | 4616 | } |
---|
4378 | 4617 | |
---|
4379 | | - void pasteInto(boolean copyit) |
---|
| 4618 | + void pasteInto(boolean copyit, boolean clone) |
---|
4380 | 4619 | { |
---|
4381 | 4620 | // if (GrafreeD.clipboard == null) |
---|
4382 | 4621 | // return; |
---|
.. | .. |
---|
4405 | 4644 | if (copyit) |
---|
4406 | 4645 | { |
---|
4407 | 4646 | // paste(false); |
---|
4408 | | - CloneClipboard(false); // sept 2014 |
---|
| 4647 | + if (clone) |
---|
| 4648 | + { |
---|
| 4649 | + CloneClipboard(false); // sept 2014 |
---|
| 4650 | + } |
---|
| 4651 | + else |
---|
| 4652 | + { |
---|
| 4653 | + paste(false); |
---|
| 4654 | + } |
---|
4409 | 4655 | } |
---|
4410 | 4656 | else |
---|
4411 | 4657 | { |
---|
4412 | 4658 | boolean first = true; |
---|
4413 | 4659 | |
---|
4414 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4660 | + if (Grafreed.clipboardIsTempGroup) |
---|
4415 | 4661 | { |
---|
4416 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4662 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4417 | 4663 | Object3D copy; |
---|
4418 | 4664 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4419 | 4665 | { |
---|
.. | .. |
---|
4423 | 4669 | } |
---|
4424 | 4670 | } else |
---|
4425 | 4671 | { |
---|
4426 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4672 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4427 | 4673 | } |
---|
4428 | 4674 | } |
---|
4429 | 4675 | } |
---|
.. | .. |
---|
4828 | 5074 | } |
---|
4829 | 5075 | */ |
---|
4830 | 5076 | |
---|
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 | 5077 | /* |
---|
4847 | 5078 | public void Callback(Object obj) |
---|
4848 | 5079 | { |
---|
.. | .. |
---|
4866 | 5097 | } |
---|
4867 | 5098 | */ |
---|
4868 | 5099 | |
---|
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 | 5100 | String GetFile(String dialogName) |
---|
4887 | 5101 | { |
---|
4888 | | - if (GrafreeD.standAlone) |
---|
| 5102 | + if (Grafreed.standAlone) |
---|
4889 | 5103 | { |
---|
4890 | 5104 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4891 | 5105 | browser.show(); |
---|
.. | .. |
---|
4949 | 5163 | cButton flashSelectionButton; |
---|
4950 | 5164 | cButton editButton; |
---|
4951 | 5165 | cButton uneditButton; |
---|
| 5166 | + JCheckBox allParamsButton; |
---|
4952 | 5167 | cButton clearpanelButton; |
---|
4953 | | - cButton allParamsButton; |
---|
4954 | 5168 | cButton unselectButton; |
---|
4955 | 5169 | |
---|
| 5170 | + cButton saveButton; |
---|
| 5171 | + cButton undoButton; |
---|
| 5172 | + cButton redoButton; |
---|
| 5173 | + cButton oneStepButton; |
---|
| 5174 | + |
---|
4956 | 5175 | cButton screenfitButton; |
---|
4957 | 5176 | cButton screenfitpointButton; |
---|
4958 | 5177 | cButton snapobjectButton; |
---|
.. | .. |
---|
4983 | 5202 | private MenuItem lookFromItem; |
---|
4984 | 5203 | private MenuItem switchItem; |
---|
4985 | 5204 | private MenuItem cutItem; |
---|
| 5205 | + private MenuItem undoItem; |
---|
| 5206 | + private MenuItem redoItem; |
---|
4986 | 5207 | private MenuItem duplicateItem; |
---|
4987 | 5208 | private MenuItem cloneItem; |
---|
4988 | 5209 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4996 | 5217 | private MenuItem linkverticesItem; |
---|
4997 | 5218 | private MenuItem relinkverticesItem; |
---|
4998 | 5219 | private MenuItem setMasterItem; |
---|
4999 | | - private MenuItem resetMeshItem; |
---|
| 5220 | + private MenuItem resetAllItem; |
---|
5000 | 5221 | private MenuItem stepAllItem; |
---|
5001 | 5222 | private MenuItem revertMeshItem; |
---|
5002 | 5223 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5007 | 5228 | private MenuItem mergeGeometriesItem; |
---|
5008 | 5229 | private MenuItem copyItem; |
---|
5009 | 5230 | private MenuItem pasteItem; |
---|
| 5231 | + private MenuItem pasteIntoItem; |
---|
5010 | 5232 | private MenuItem pasteLinkItem; |
---|
5011 | 5233 | private MenuItem pasteCloneItem; |
---|
5012 | 5234 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5056 | 5278 | private MenuItem panoTexturesItem; |
---|
5057 | 5279 | |
---|
5058 | 5280 | private MenuItem resetCentroidItem; |
---|
5059 | | - private MenuItem transformgeometryItem; |
---|
| 5281 | + private MenuItem resetCentroidXZItem; |
---|
5060 | 5282 | private MenuItem resetTransformItem; |
---|
| 5283 | + private MenuItem transformGeometryItem; |
---|
| 5284 | + private MenuItem transformChildrenItem; |
---|
5061 | 5285 | private MenuItem hideItem; |
---|
5062 | 5286 | private MenuItem grabItem; |
---|
5063 | 5287 | private MenuItem backItem; |
---|
.. | .. |
---|
5104 | 5328 | private MenuItem blobItem; |
---|
5105 | 5329 | private MenuItem latheItem; |
---|
5106 | 5330 | private MenuItem bezierItem; |
---|
5107 | | - private MenuItem checkerItem; |
---|
| 5331 | + private MenuItem overlayItem; |
---|
5108 | 5332 | private MenuItem meshItem; |
---|
5109 | 5333 | // private MenuItem meshGroupItem; |
---|
5110 | 5334 | private MenuItem springItem; |
---|
.. | .. |
---|
5126 | 5350 | private MenuItem doubleItem; |
---|
5127 | 5351 | private MenuItem tripleItem; |
---|
5128 | 5352 | |
---|
5129 | | - private MenuItem importGFDItem; |
---|
5130 | | - private MenuItem importVRMLX3DItem; |
---|
5131 | | - private MenuItem import3DSItem; |
---|
5132 | | - private MenuItem importOBJItem; |
---|
5133 | | - |
---|
5134 | 5353 | private MenuItem computeAOItem; |
---|
5135 | 5354 | private MenuItem recompileItem; |
---|
5136 | 5355 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5140 | 5359 | private MenuItem analyzeItem; |
---|
5141 | 5360 | private MenuItem dumpItem; |
---|
5142 | 5361 | //boolean freezemodel = false; |
---|
| 5362 | + |
---|
| 5363 | + Menu cameraMenu; |
---|
| 5364 | + MenuItem editCameraItem; |
---|
| 5365 | + MenuItem revertCameraItem; |
---|
5143 | 5366 | } |
---|