.. | .. |
---|
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 | + |
---|
| 180 | + menu.add("-"); |
---|
| 181 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 182 | + pasteIntoItem.addActionListener(this); |
---|
| 183 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 184 | + pasteLinkItem.addActionListener(this); |
---|
| 185 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 186 | + pasteCloneItem.addActionListener(this); |
---|
| 187 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 188 | +// pasteExpandItem.addActionListener(this); |
---|
| 189 | + menu.add("-"); |
---|
| 190 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 191 | + clearItem.addActionListener(this); |
---|
| 192 | + |
---|
| 193 | + if (Globals.ADVANCED) |
---|
| 194 | + { |
---|
| 195 | + // Deletes the cameras... |
---|
| 196 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 197 | + clearAllItem.addActionListener(this); |
---|
| 198 | + } |
---|
| 199 | + |
---|
| 200 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 201 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 202 | + //zBufferItem.addActionListener(this); |
---|
| 203 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 204 | + //normalLensItem.addActionListener(this); |
---|
| 205 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 206 | + revertCameraItem.addActionListener(this); |
---|
| 207 | + |
---|
| 208 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 209 | + toggleFullScreenItem.addItemListener(this); |
---|
| 210 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 211 | + cameraMenu.add("-"); |
---|
| 212 | + |
---|
| 213 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 214 | + toggleTextureItem.addItemListener(this); |
---|
| 215 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 216 | + |
---|
| 217 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 218 | + toggleSwitchItem.addItemListener(this); |
---|
| 219 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 220 | + |
---|
| 221 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 222 | + toggleHandleItem.addItemListener(this); |
---|
| 223 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 224 | + |
---|
| 225 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 226 | + togglePaintItem.addItemListener(this); |
---|
| 227 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 228 | + |
---|
| 229 | + if (Globals.ADVANCED) |
---|
| 230 | + { |
---|
| 231 | + cameraMenu.add("-"); |
---|
| 232 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 233 | + toggleLiveItem.addItemListener(this); |
---|
| 234 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 235 | + |
---|
| 236 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 237 | + stepItem.addActionListener(this); |
---|
| 238 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 239 | + // toggleDLItem.addItemListener(this); |
---|
| 240 | + // toggleDLItem.setState(false); |
---|
| 241 | + |
---|
| 242 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 243 | + toggleRenderItem.addItemListener(this); |
---|
| 244 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 245 | + |
---|
| 246 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 247 | + toggleDebugItem.addItemListener(this); |
---|
| 248 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 249 | + |
---|
| 250 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 251 | + toggleFrustumItem.addItemListener(this); |
---|
| 252 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 253 | + |
---|
| 254 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 255 | + toggleFootContactItem.addItemListener(this); |
---|
| 256 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 257 | + |
---|
| 258 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 259 | + toggleTimelineItem.addItemListener(this); |
---|
| 260 | + } |
---|
| 261 | + |
---|
| 262 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 263 | +// toggleRootItem.addItemListener(this); |
---|
| 264 | +// toggleRootItem.setState(false); |
---|
| 265 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 266 | +// animationItem.addItemListener(this); |
---|
| 267 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 268 | + cameraMenu.add("-"); |
---|
| 269 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 270 | + editCameraItem.addActionListener(this); |
---|
| 271 | + |
---|
| 272 | + if (Globals.ADVANCED) |
---|
| 273 | + { |
---|
153 | 274 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
154 | 275 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
155 | 276 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
161 | 282 | lookAtItem.addActionListener(this); |
---|
162 | 283 | //lookFromItem.addActinoListener(this); |
---|
163 | 284 | //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 | | - |
---|
| 285 | + } |
---|
| 286 | + |
---|
193 | 287 | 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); |
---|
| 288 | + if (Globals.ADVANCED) |
---|
| 289 | + { |
---|
198 | 290 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
199 | 291 | revertMeshItem.addActionListener(this); |
---|
200 | 292 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
201 | 293 | resetreferencesItem.addActionListener(this); |
---|
202 | 294 | menu.add("-"); |
---|
| 295 | + } |
---|
203 | 296 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
204 | 297 | overwriteGeoItem.addActionListener(this); |
---|
205 | 298 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
211 | 304 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
212 | 305 | overwriteUVItem.addActionListener(this); |
---|
213 | 306 | menu.add("-"); |
---|
| 307 | + if (Globals.ADVANCED) |
---|
| 308 | + { |
---|
214 | 309 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
215 | 310 | generateMeshItem.addActionListener(this); |
---|
216 | 311 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
217 | 312 | poseMeshItem.addActionListener(this); |
---|
218 | 313 | menu.add("-"); |
---|
| 314 | + } |
---|
219 | 315 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
220 | 316 | resetsupportItem.addActionListener(this); |
---|
221 | 317 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
222 | 318 | linkverticesItem.addActionListener(this); |
---|
223 | 319 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
224 | 320 | relinkverticesItem.addActionListener(this); |
---|
| 321 | + |
---|
| 322 | + if (Globals.ADVANCED) |
---|
| 323 | + { |
---|
225 | 324 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
226 | 325 | setMasterItem.addActionListener(this); |
---|
| 326 | + } |
---|
227 | 327 | |
---|
228 | 328 | oe.menuBar.add(menu = new Menu("Group")); |
---|
229 | 329 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
234 | 334 | frontItem.addActionListener(this); |
---|
235 | 335 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
236 | 336 | compositeItem.addActionListener(this); |
---|
237 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 337 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
238 | 338 | hideItem.addActionListener(this); |
---|
239 | 339 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
240 | 340 | ungroupItem.addActionListener(this); |
---|
241 | 341 | menu.add("-"); |
---|
242 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 342 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
243 | 343 | 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 | 344 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
249 | 345 | switchGeoItem.addActionListener(this); |
---|
250 | 346 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
251 | 347 | switchTransfoItem.addActionListener(this); |
---|
252 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 348 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
253 | 349 | morphItem.addActionListener(this); |
---|
| 350 | + |
---|
| 351 | + if (Globals.ADVANCED) |
---|
| 352 | + { |
---|
| 353 | + menu.add("-"); |
---|
| 354 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 355 | + physicsItem.addActionListener(this); |
---|
| 356 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 357 | + frameselectorItem.addActionListener(this); |
---|
254 | 358 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
255 | 359 | scriptNodeItem.addActionListener(this); |
---|
256 | 360 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
257 | 361 | cameraItem.addActionListener(this); |
---|
| 362 | + } |
---|
258 | 363 | |
---|
259 | 364 | oe.menuBar.add(menu = new Menu("Object")); |
---|
260 | 365 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
263 | 368 | billboardItem.addActionListener(this); |
---|
264 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
265 | 370 | csgItem.addActionListener(this); |
---|
266 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
267 | 372 | shadowXItem.addActionListener(this); |
---|
268 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
269 | 374 | shadowYItem.addActionListener(this); |
---|
270 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
271 | 376 | shadowZItem.addActionListener(this); |
---|
| 377 | + if (Globals.ADVANCED) |
---|
| 378 | + { |
---|
| 379 | + menu.add("-"); |
---|
272 | 380 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
273 | 381 | linkerItem.addActionListener(this); |
---|
274 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
275 | | - templateItem.addActionListener(this); |
---|
276 | 382 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
277 | 383 | attributeItem.addActionListener(this); |
---|
| 384 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 385 | + templateItem.addActionListener(this); |
---|
278 | 386 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
279 | 387 | pointflowItem.addActionListener(this); |
---|
| 388 | + } |
---|
280 | 389 | menu.add("-"); |
---|
281 | 390 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
282 | 391 | resetTransformItem.addActionListener(this); |
---|
283 | 392 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
284 | 393 | resetCentroidItem.addActionListener(this); |
---|
285 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
286 | | - transformgeometryItem.addActionListener(this); |
---|
| 394 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 395 | + resetCentroidXZItem.addActionListener(this); |
---|
| 396 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 397 | + transformGeometryItem.addActionListener(this); |
---|
| 398 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 399 | + transformChildrenItem.addActionListener(this); |
---|
287 | 400 | |
---|
288 | 401 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
289 | 402 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
294 | 407 | genNormalsCADItem.addActionListener(this); |
---|
295 | 408 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
296 | 409 | genNormalsMESHItem.addActionListener(this); |
---|
| 410 | + if (Globals.ADVANCED) |
---|
| 411 | + { |
---|
297 | 412 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
298 | 413 | genNormalsMINEItem.addActionListener(this); |
---|
| 414 | + } |
---|
299 | 415 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
300 | 416 | stripifyItem.addActionListener(this); |
---|
301 | 417 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
317 | 433 | reduce34MeshItem.addActionListener(this); |
---|
318 | 434 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
319 | 435 | increaseMeshItem.addActionListener(this); |
---|
320 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
321 | | - smoothMeshItem.addActionListener(this); |
---|
322 | 436 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
323 | 437 | clipMeshItem.addActionListener(this); |
---|
| 438 | + |
---|
| 439 | + if (Globals.ADVANCED) |
---|
| 440 | + { |
---|
| 441 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 442 | + smoothMeshItem.addActionListener(this); |
---|
| 443 | + } |
---|
324 | 444 | |
---|
325 | 445 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
326 | 446 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
327 | 447 | clearMaterialsItem.addActionListener(this); |
---|
| 448 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 449 | + resetAllItem.addActionListener(this); |
---|
| 450 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 451 | + stepAllItem.addActionListener(this); |
---|
328 | 452 | menu.add("-"); |
---|
329 | 453 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
330 | 454 | liveleavesItem.addActionListener(this); |
---|
331 | 455 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
332 | 456 | unliveleavesItem.addActionListener(this); |
---|
| 457 | + if (Globals.ADVANCED) |
---|
| 458 | + { |
---|
333 | 459 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
334 | 460 | supportleavesItem.addActionListener(this); |
---|
335 | 461 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
336 | 462 | unsupportleavesItem.addActionListener(this); |
---|
| 463 | + } |
---|
337 | 464 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
338 | 465 | hideleavesItem.addActionListener(this); |
---|
339 | 466 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
342 | 469 | markleavesItem.addActionListener(this); |
---|
343 | 470 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
344 | 471 | unmarkleavesItem.addActionListener(this); |
---|
| 472 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 473 | + rewindleavesItem.addActionListener(this); |
---|
| 474 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 475 | + unrewindleavesItem.addActionListener(this); |
---|
| 476 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 477 | + randomleavesItem.addActionListener(this); |
---|
| 478 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 479 | + unrandomleavesItem.addActionListener(this); |
---|
345 | 480 | menu.add("-"); |
---|
346 | 481 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
347 | 482 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
377 | 512 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
378 | 513 | sortbynameItem.addActionListener(this); |
---|
379 | 514 | menu.add("-"); |
---|
| 515 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 516 | + shareGeometriesItem.addActionListener(this); |
---|
| 517 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 518 | + mergeGeometriesItem.addActionListener(this); |
---|
| 519 | + if (Globals.ADVANCED) |
---|
| 520 | + { |
---|
| 521 | + // Pretty much the same as duplicate and clone. |
---|
380 | 522 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
381 | 523 | extractGeometriesItem.addActionListener(this); |
---|
382 | 524 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
383 | 525 | 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); |
---|
| 526 | + } |
---|
388 | 527 | |
---|
389 | 528 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
390 | 529 | buildCreateMenu(menu); |
---|
391 | 530 | |
---|
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 | 531 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
404 | 532 | buildToolsMenu(menu); |
---|
405 | 533 | } |
---|
406 | 534 | |
---|
407 | 535 | void SetupUI2(ObjEditor oe) |
---|
408 | 536 | { |
---|
| 537 | + // June 2019 |
---|
| 538 | + if (oe == null) |
---|
| 539 | + { |
---|
| 540 | + //super.SetupUI2(this); |
---|
| 541 | + //return; |
---|
| 542 | + } |
---|
| 543 | + |
---|
| 544 | + if (copy != group) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + } |
---|
| 548 | + |
---|
409 | 549 | //new Exception().printStackTrace(); |
---|
410 | 550 | |
---|
411 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
434 | 574 | oe.radioPanel.add(dummyButton); |
---|
435 | 575 | oe.buttonGroup.add(dummyButton); |
---|
436 | 576 | */ |
---|
437 | | - aConstraints.gridy += 1; |
---|
438 | | - |
---|
439 | 577 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
440 | 578 | |
---|
441 | | - oe.aConstraints.gridwidth = 1; |
---|
442 | | - oe.aConstraints.gridx = 0; |
---|
| 579 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 580 | + //minButton.setToolTipText("Minimize window"); |
---|
| 581 | + //minButton.addActionListener(this); |
---|
443 | 582 | |
---|
444 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
445 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 583 | + oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + redoButton.setToolTipText("Redo changes"); |
---|
| 597 | + redoButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + saveButton.setToolTipText("Save changes"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 604 | + liveCB.setToolTipText("Enable animation"); |
---|
446 | 605 | liveCB.addItemListener(this); |
---|
447 | 606 | |
---|
448 | | - oe.aConstraints.gridx += 1; |
---|
449 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 609 | + oneStepButton.addActionListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 612 | + fastCB.setToolTipText("Fast mode"); |
---|
| 613 | + fastCB.addItemListener(this); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
450 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
451 | 617 | trackCB.addItemListener(this); |
---|
452 | 618 | |
---|
453 | | - oe.aConstraints.gridx += 1; |
---|
454 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
455 | 620 | screenfitButton.setToolTipText("Screen fit"); |
---|
456 | 621 | screenfitButton.addActionListener(this); |
---|
457 | | - oe.aConstraints.gridx += 1; |
---|
| 622 | + |
---|
458 | 623 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
459 | 624 | // screenfitpointButton.addActionListener(this); |
---|
460 | | -// oe.aConstraints.gridx += 1; |
---|
461 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
462 | | - snapobjectButton.addActionListener(this); |
---|
463 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
464 | | - oe.aConstraints.gridx += 1; |
---|
465 | 625 | |
---|
466 | | - //aConstraints.gridx = 0; |
---|
467 | | - //aConstraints.gridy += 1; |
---|
468 | | - oe.aConstraints.weighty = 0; |
---|
469 | | - oe.aConstraints.gridwidth = 1; |
---|
470 | | - |
---|
471 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 626 | + if (Globals.ADVANCED) |
---|
| 627 | + { |
---|
| 628 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + snapobjectButton.addActionListener(this); |
---|
| 630 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 631 | + } |
---|
| 632 | + |
---|
| 633 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
472 | 634 | flashSelectionButton.setToolTipText("Show selection"); |
---|
473 | 635 | flashSelectionButton.addActionListener(this); |
---|
474 | 636 | |
---|
475 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 637 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
476 | 638 | |
---|
477 | | - oe.aConstraints.gridx += 1; |
---|
478 | | - oe.aConstraints.weighty = 0; |
---|
479 | | - oe.aConstraints.gridwidth = 1; |
---|
480 | | - |
---|
481 | | - // |
---|
482 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
483 | 640 | twoButton.setToolTipText("Show center view only"); |
---|
484 | 641 | twoButton.addActionListener(this); |
---|
485 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
486 | 643 | fourButton.addActionListener(this); |
---|
487 | 644 | fourButton.setToolTipText("Show left panel only"); |
---|
488 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
489 | 646 | sixButton.setToolTipText("2-column layout left"); |
---|
490 | 647 | sixButton.addActionListener(this); |
---|
491 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | 649 | threeButton.setToolTipText("2-column layout right"); |
---|
493 | 650 | threeButton.addActionListener(this); |
---|
494 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 652 | sevenButton.setToolTipText("3-column layout"); |
---|
496 | 653 | sevenButton.addActionListener(this); |
---|
497 | 654 | // |
---|
498 | 655 | |
---|
499 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); |
---|
500 | | - rootButton.setToolTipText("Edit object in new tab"); |
---|
| 656 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 657 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
501 | 658 | rootButton.addActionListener(this); |
---|
502 | | - oe.aConstraints.gridx += 1; |
---|
503 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 659 | + |
---|
| 660 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 661 | closeButton.setToolTipText("Close tab"); |
---|
505 | 662 | closeButton.addActionListener(this); |
---|
506 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
507 | 664 | //clearButton.addActionListener(this); |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
509 | 665 | |
---|
510 | | - oe.aConstraints.gridx = 1; // |
---|
511 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 667 | + editButton.setToolTipText("Edit selection"); |
---|
512 | 668 | editButton.addActionListener(this); |
---|
513 | | - oe.aConstraints.gridx += 1; |
---|
514 | | - oe.aConstraints.weighty = 0; |
---|
515 | | - oe.aConstraints.gridwidth = 1; |
---|
516 | 669 | |
---|
517 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 671 | + uneditButton.setToolTipText("Unedit selection"); |
---|
518 | 672 | uneditButton.addActionListener(this); |
---|
519 | 673 | |
---|
520 | | - oe.aConstraints.gridx += 1; |
---|
521 | | - oe.aConstraints.weighty = 0; |
---|
522 | | - oe.aConstraints.gridwidth = 1; |
---|
523 | | - |
---|
524 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
525 | | - clearPanelButton.addActionListener(this); |
---|
526 | | - |
---|
527 | | - oe.aConstraints.gridx += 1; |
---|
528 | | - oe.aConstraints.weighty = 0; |
---|
529 | | - oe.aConstraints.gridwidth = 1; |
---|
530 | | - |
---|
531 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 675 | + allParamsButton.setToolTipText("Edit all params"); |
---|
532 | 676 | allParamsButton.addActionListener(this); |
---|
533 | 677 | |
---|
534 | | - oe.aConstraints.gridx += 1; |
---|
535 | | - oe.aConstraints.weighty = 0; |
---|
536 | | - oe.aConstraints.gridwidth = 1; |
---|
537 | | - |
---|
538 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 680 | + clearPanelButton.addActionListener(this); |
---|
| 681 | + |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 683 | + unselectButton.setToolTipText("Unselect"); |
---|
539 | 684 | unselectButton.addActionListener(this); |
---|
540 | 685 | |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
| 687 | + |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
| 690 | + |
---|
541 | 691 | // oe.aConstraints.gridx += 1; |
---|
542 | 692 | // oe.aConstraints.weighty = 0; |
---|
543 | 693 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
549 | 699 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
550 | 700 | // gcButton.addActionListener(this); |
---|
551 | 701 | |
---|
552 | | - oe.aConstraints.gridx = 0; |
---|
553 | | - oe.aConstraints.gridy += 1; |
---|
554 | | - |
---|
555 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
556 | | - oe.aConstraints.gridwidth = 100; |
---|
557 | | - // oe.aConstraints.gridheight = 100; |
---|
558 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
559 | | - oe.aConstraints.gridheight = 1; |
---|
560 | | - oe.aConstraints.weighty = 0.5; |
---|
561 | | - oe.aConstraints.gridx = 0; |
---|
562 | | - JScrollPane jSP; |
---|
| 702 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 703 | + |
---|
| 704 | + JScrollPane jSP; |
---|
563 | 705 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
564 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 706 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
565 | 707 | ResetModel(); |
---|
566 | | - oe.aConstraints.weighty = 0.5; |
---|
567 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
568 | | - oe.aConstraints.gridy += 1; |
---|
569 | | - oe.aConstraints.gridwidth = 1; |
---|
| 708 | + |
---|
| 709 | + oe.treePanel.add(jSPPanel); |
---|
| 710 | + oe.treePanel.Return(); |
---|
570 | 711 | |
---|
571 | | - oe.aConstraints.weighty = 0; |
---|
572 | | - oe.aConstraints.gridwidth = 2; |
---|
573 | | - |
---|
574 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 712 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 713 | + |
---|
| 714 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 715 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
575 | 716 | colorCB.addItemListener(this); |
---|
576 | | - oe.aConstraints.gridx += 2; |
---|
577 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 717 | + |
---|
| 718 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 719 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
578 | 720 | materialCB.addItemListener(this); |
---|
579 | | - oe.aConstraints.gridx += 2; |
---|
580 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 721 | + |
---|
| 722 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 723 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
581 | 724 | textureCB.addItemListener(this); |
---|
582 | 725 | |
---|
583 | | - oe.aConstraints.gridx = 0; |
---|
584 | | - oe.aConstraints.gridy += 1; |
---|
| 726 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 727 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 728 | + oe.treePanel.Return(); |
---|
585 | 729 | |
---|
| 730 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 731 | +// mainPanel.setResizeWeight(0.5); |
---|
| 732 | + |
---|
586 | 733 | //jList.addListSelectionListener(this); |
---|
587 | 734 | oe.jTree.addTreeSelectionListener(this); |
---|
588 | 735 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
607 | 754 | |
---|
608 | 755 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
609 | 756 | { |
---|
610 | | - //constraints.gridx = 0; |
---|
611 | | - //constraints.gridy = 0; |
---|
612 | | - panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
613 | | - fastCB.setToolTipText("Fast mode"); |
---|
614 | | - fastCB.addItemListener(this); |
---|
615 | | - //constraints.gridy += 1; |
---|
616 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
617 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
618 | | - supportCB.addItemListener(this); |
---|
619 | | - |
---|
620 | | - // constraints.gridy += 1; |
---|
621 | | - // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
622 | | - // localCB.addItemListener(this); |
---|
623 | | - |
---|
624 | | - //constraints.gridy += 1; |
---|
625 | | - panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
626 | | - crowdCB.setToolTipText("Used for crowds"); |
---|
627 | | - crowdCB.addItemListener(this); |
---|
628 | | - |
---|
629 | | - //constraints.gridy += 1; |
---|
630 | | - panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
631 | | - smoothCB.setToolTipText("Snapping delay"); |
---|
632 | | - smoothCB.addItemListener(this); |
---|
633 | | - |
---|
634 | | - //constraints.gridy += 1; |
---|
635 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
636 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
637 | | - slowCB.addItemListener(this); |
---|
638 | | - //constraints.gridy += 1; |
---|
639 | 757 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
640 | 758 | boxCB.setToolTipText("Display bounding boxes"); |
---|
641 | 759 | boxCB.addItemListener(this); |
---|
642 | | - //constraints.gridy += 1; |
---|
| 760 | + |
---|
643 | 761 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
644 | 762 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
645 | 763 | zoomBoxCB.addItemListener(this); |
---|
646 | 764 | |
---|
| 765 | + if (true) // Globals.ADVANCED) |
---|
| 766 | + { |
---|
| 767 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 768 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 769 | + supportCB.addItemListener(this); |
---|
| 770 | + |
---|
| 771 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 772 | + // localCB.addItemListener(this); |
---|
| 773 | + |
---|
| 774 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 775 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 776 | + crowdCB.addItemListener(this); |
---|
| 777 | + |
---|
| 778 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 779 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 780 | + smoothCB.addItemListener(this); |
---|
| 781 | + |
---|
| 782 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 783 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 784 | + slowCB.addItemListener(this); |
---|
| 785 | + |
---|
647 | 786 | // constraints.gridy += 1; |
---|
648 | 787 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
649 | 788 | // speakerMocapCB.addItemListener(this); |
---|
.. | .. |
---|
668 | 807 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
669 | 808 | // debugCB.addItemListener(this); |
---|
670 | 809 | |
---|
671 | | - //constraints.gridy += 1; |
---|
672 | 810 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
673 | 811 | oeilCB.addItemListener(this); |
---|
674 | 812 | |
---|
675 | | - //constraints.gridy += 1; |
---|
676 | 813 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
677 | 814 | lookAtCB.setToolTipText("Look-at target"); |
---|
678 | 815 | lookAtCB.addItemListener(this); |
---|
| 816 | + |
---|
| 817 | + } |
---|
| 818 | + |
---|
| 819 | + cGridBag fill = new cGridBag(); |
---|
| 820 | + |
---|
| 821 | + fill.preferredHeight = 200; |
---|
| 822 | + |
---|
| 823 | + panel.add(fill); |
---|
679 | 824 | |
---|
680 | 825 | } |
---|
681 | 826 | |
---|
.. | .. |
---|
690 | 835 | buttonGroup.add(radioButton); |
---|
691 | 836 | radioButton.doClick(); |
---|
692 | 837 | } |
---|
| 838 | + |
---|
693 | 839 | void SetupViews(ObjEditor oe) |
---|
694 | 840 | { |
---|
| 841 | + theFrame = this; |
---|
| 842 | + |
---|
695 | 843 | oe.SetupViews(); |
---|
696 | 844 | |
---|
697 | 845 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
754 | 902 | } else if(e.getSource() == liveCB) |
---|
755 | 903 | { |
---|
756 | 904 | cameraView.ToggleLive(); |
---|
| 905 | + refreshContents(false); |
---|
757 | 906 | } |
---|
758 | 907 | else if(e.getSource() == supportCB) |
---|
759 | 908 | { |
---|
.. | .. |
---|
906 | 1055 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
907 | 1056 | // return; |
---|
908 | 1057 | // } |
---|
909 | | - if (string.charAt(0) == '/') |
---|
| 1058 | + |
---|
| 1059 | + // File path for Mac and Windows |
---|
| 1060 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
910 | 1061 | { |
---|
911 | 1062 | // file(s) |
---|
912 | 1063 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
933 | 1084 | |
---|
934 | 1085 | flashIt = false; |
---|
935 | 1086 | CameraPane pane = (CameraPane) target; |
---|
936 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1087 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
937 | 1088 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
938 | 1089 | |
---|
939 | 1090 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
960 | 1111 | { |
---|
961 | 1112 | loadClipboard(true); |
---|
962 | 1113 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
963 | | - pasteInto(false); |
---|
| 1114 | + pasteInto(false, false); |
---|
964 | 1115 | } else { |
---|
965 | 1116 | loadClipboard(false); |
---|
966 | 1117 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
967 | | - pasteInto(false); // true); // ??? |
---|
| 1118 | + pasteInto(false, false); // true); // ??? |
---|
968 | 1119 | } |
---|
969 | 1120 | } |
---|
970 | 1121 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1086 | 1237 | kleinItem.addActionListener(this); |
---|
1087 | 1238 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1088 | 1239 | particleItem.addActionListener(this); |
---|
| 1240 | + if (Globals.ADVANCED) |
---|
| 1241 | + { |
---|
1089 | 1242 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1090 | 1243 | ragdollItem.addActionListener(this); |
---|
1091 | 1244 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1092 | 1245 | ragdoll2Item.addActionListener(this); |
---|
| 1246 | + } |
---|
1093 | 1247 | menu.add("-"); |
---|
1094 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1248 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1095 | 1249 | meshItem.addActionListener(this); |
---|
1096 | 1250 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1097 | 1251 | // meshGroupItem.addActionListener(this); |
---|
| 1252 | + if (Globals.ADVANCED) |
---|
| 1253 | + { |
---|
1098 | 1254 | springItem = menu.add(new MenuItem("Spring")); |
---|
1099 | 1255 | springItem.addActionListener(this); |
---|
1100 | 1256 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1101 | 1257 | flagItem.addActionListener(this); |
---|
1102 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1103 | | - bezierItem.addActionListener(this); |
---|
1104 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1105 | | - checkerItem.addActionListener(this); |
---|
1106 | 1258 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1107 | 1259 | blobItem.addActionListener(this); |
---|
1108 | 1260 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1109 | 1261 | latheItem.addActionListener(this); |
---|
| 1262 | + } |
---|
| 1263 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1264 | + bezierItem.addActionListener(this); |
---|
| 1265 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1266 | + overlayItem.addActionListener(this); |
---|
1110 | 1267 | lightItem = menu.add(new MenuItem("Light")); |
---|
1111 | 1268 | lightItem.addActionListener(this); |
---|
1112 | 1269 | menu.add("-"); |
---|
.. | .. |
---|
1116 | 1273 | loopItem.addActionListener(this); |
---|
1117 | 1274 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1118 | 1275 | doubleItem.addActionListener(this); |
---|
| 1276 | + if (Globals.ADVANCED) |
---|
| 1277 | + { |
---|
1119 | 1278 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1120 | 1279 | tripleItem.addActionListener(this); |
---|
| 1280 | + } |
---|
1121 | 1281 | } |
---|
1122 | 1282 | |
---|
1123 | 1283 | void buildToolsMenu(Menu menu) |
---|
1124 | 1284 | { |
---|
1125 | 1285 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1126 | 1286 | animationItem.addItemListener(this); |
---|
1127 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1287 | + animationItem.setState(Globals.ANIMATION); |
---|
1128 | 1288 | |
---|
1129 | 1289 | menu.add("-"); |
---|
1130 | 1290 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1131 | 1291 | parseverticesItem.addActionListener(this); |
---|
1132 | 1292 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1133 | 1293 | textureFieldItem.addActionListener(this); |
---|
1134 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1294 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1135 | 1295 | alignItem.addActionListener(this); |
---|
1136 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1137 | | - mirrorItem.addActionListener(this); |
---|
1138 | 1296 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1139 | 1297 | reduceMorphItem.addActionListener(this); |
---|
1140 | 1298 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1141 | 1299 | reduce34MorphItem.addActionListener(this); |
---|
1142 | | - |
---|
| 1300 | + menu.add("-"); |
---|
1143 | 1301 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1144 | 1302 | computeAOItem.addActionListener(this); |
---|
1145 | | - menu.add("-"); |
---|
1146 | 1303 | |
---|
| 1304 | + if (Globals.ADVANCED) |
---|
| 1305 | + { |
---|
| 1306 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1307 | + mirrorItem.addActionListener(this); |
---|
| 1308 | + menu.add("-"); |
---|
1147 | 1309 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1148 | 1310 | memoryItem.addActionListener(this); |
---|
1149 | 1311 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1150 | 1312 | analyzeItem.addActionListener(this); |
---|
1151 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1313 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1152 | 1314 | dumpItem.addActionListener(this); |
---|
1153 | 1315 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1154 | 1316 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1166 | 1328 | menu.add("-"); |
---|
1167 | 1329 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1168 | 1330 | editScriptItem.addActionListener(this); |
---|
| 1331 | + } |
---|
1169 | 1332 | } |
---|
1170 | 1333 | |
---|
1171 | 1334 | void ScreenFit() |
---|
.. | .. |
---|
1288 | 1451 | shadow.material = new cMaterial(obj.material); |
---|
1289 | 1452 | shadow.material.diffuse = 0.0001f; |
---|
1290 | 1453 | shadow.material.specular = 0.0001f; |
---|
| 1454 | + //shadow.projectedVertices[1].x = 300; |
---|
1291 | 1455 | |
---|
1292 | 1456 | makeSomething(shadow); |
---|
1293 | 1457 | } |
---|
.. | .. |
---|
1494 | 1658 | |
---|
1495 | 1659 | void Overwrite(int mask) |
---|
1496 | 1660 | { |
---|
1497 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1661 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1498 | 1662 | { |
---|
1499 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1663 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1500 | 1664 | |
---|
1501 | 1665 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1502 | 1666 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1667 | 1831 | { |
---|
1668 | 1832 | makeSomething(new BezierSurface()); |
---|
1669 | 1833 | } else |
---|
1670 | | - if (source == checkerItem) |
---|
| 1834 | + if (source == overlayItem) |
---|
1671 | 1835 | { |
---|
1672 | 1836 | /* |
---|
1673 | 1837 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1801 | 1965 | csg.addChild(child); |
---|
1802 | 1966 | child.addChild(csg); |
---|
1803 | 1967 | } else |
---|
1804 | | - |
---|
1805 | | - if (source == importGFDItem) |
---|
1806 | | - { |
---|
1807 | | - ImportGFD(); |
---|
1808 | | - } else |
---|
1809 | | - if (source == importVRMLX3DItem) |
---|
1810 | | - { |
---|
1811 | | - ImportVRMLX3D(); |
---|
1812 | | - } else |
---|
1813 | | - if (source == import3DSItem) |
---|
1814 | | - { |
---|
1815 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1816 | | - } else |
---|
1817 | | - if (source == importOBJItem) |
---|
1818 | | - { |
---|
1819 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1820 | | - } else |
---|
1821 | 1968 | if (source == computeAOItem) |
---|
1822 | 1969 | { |
---|
1823 | 1970 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1836 | 1983 | if (source == invariantsItem) |
---|
1837 | 1984 | { |
---|
1838 | 1985 | System.out.println("Invariants:"); |
---|
1839 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1986 | + Grafreed.grafreeD.universe.invariants(); |
---|
1840 | 1987 | } else |
---|
1841 | 1988 | if (source == memoryItem) |
---|
1842 | 1989 | { |
---|
.. | .. |
---|
1854 | 2001 | if (source == dumpItem) |
---|
1855 | 2002 | { |
---|
1856 | 2003 | DumpObject(); |
---|
| 2004 | + } else |
---|
| 2005 | + if (source == minButton) |
---|
| 2006 | + { |
---|
| 2007 | + Minimize(); |
---|
| 2008 | + } else |
---|
| 2009 | + if (source == maxButton) |
---|
| 2010 | + { |
---|
| 2011 | + Maximize(); |
---|
| 2012 | + } else |
---|
| 2013 | + if (source == fullButton) |
---|
| 2014 | + { |
---|
| 2015 | + ToggleFullScreen(); |
---|
| 2016 | + } else |
---|
| 2017 | + if (source == undoButton) |
---|
| 2018 | + { |
---|
| 2019 | + Undo(); |
---|
| 2020 | + } else |
---|
| 2021 | + if (source == redoButton) |
---|
| 2022 | + { |
---|
| 2023 | + Redo(); |
---|
| 2024 | + } else |
---|
| 2025 | + if (source == saveButton) |
---|
| 2026 | + { |
---|
| 2027 | + Save(); |
---|
| 2028 | + } else |
---|
| 2029 | + if (source == oneStepButton) |
---|
| 2030 | + { |
---|
| 2031 | + Globals.ONESTEP = true; |
---|
| 2032 | + cameraView.repaint(); |
---|
1857 | 2033 | } else |
---|
1858 | 2034 | if (source == screenfitButton) |
---|
1859 | 2035 | { |
---|
.. | .. |
---|
1904 | 2080 | { |
---|
1905 | 2081 | loadClipboard(true); |
---|
1906 | 2082 | } else |
---|
| 2083 | + if (source == undoItem) |
---|
| 2084 | + { |
---|
| 2085 | + Undo(); |
---|
| 2086 | + } else |
---|
| 2087 | + if (source == redoItem) |
---|
| 2088 | + { |
---|
| 2089 | + Redo(); |
---|
| 2090 | + } else |
---|
1907 | 2091 | if (source == duplicateItem) |
---|
1908 | 2092 | { |
---|
1909 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2093 | + Object3D keep = Grafreed.clipboard; |
---|
1910 | 2094 | loadClipboard(false); |
---|
1911 | 2095 | paste(false); |
---|
1912 | | - GrafreeD.clipboard = keep; |
---|
| 2096 | + Grafreed.clipboard = keep; |
---|
1913 | 2097 | } else |
---|
1914 | 2098 | if (source == cloneItem) |
---|
1915 | 2099 | { |
---|
.. | .. |
---|
1927 | 2111 | { |
---|
1928 | 2112 | paste(false); |
---|
1929 | 2113 | } else |
---|
| 2114 | + if (source == pasteIntoItem) |
---|
| 2115 | + { |
---|
| 2116 | + pasteInto(true, false); |
---|
| 2117 | + } else |
---|
1930 | 2118 | if (source == pasteLinkItem) |
---|
1931 | 2119 | { |
---|
1932 | | - pasteInto(false); |
---|
| 2120 | + pasteInto(false, false); |
---|
1933 | 2121 | } else |
---|
1934 | 2122 | if (source == pasteCloneItem) |
---|
1935 | 2123 | { |
---|
1936 | | - pasteInto(true); |
---|
| 2124 | + pasteInto(true, true); |
---|
1937 | 2125 | } else |
---|
1938 | 2126 | if (source == pasteExpandItem) |
---|
1939 | 2127 | { |
---|
.. | .. |
---|
2125 | 2313 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2126 | 2314 | // refreshContents(); |
---|
2127 | 2315 | // } |
---|
2128 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2316 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2129 | 2317 | { |
---|
2130 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2318 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2131 | 2319 | |
---|
2132 | 2320 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2133 | 2321 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2135 | 2323 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2136 | 2324 | for (int i=0; i<group.selection.size(); i++) |
---|
2137 | 2325 | { |
---|
2138 | | - boolean random = CameraPane.RANDOM; |
---|
2139 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2326 | + boolean random = CameraPane.SWITCH; |
---|
| 2327 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2140 | 2328 | group.selection.get(i).linkVerticesThis(content); |
---|
2141 | 2329 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2142 | | - CameraPane.RANDOM = random; |
---|
| 2330 | + CameraPane.SWITCH = random; |
---|
2143 | 2331 | } |
---|
2144 | 2332 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2145 | 2333 | refreshContents(); |
---|
.. | .. |
---|
2149 | 2337 | { |
---|
2150 | 2338 | for (int i=0; i<group.selection.size(); i++) |
---|
2151 | 2339 | { |
---|
2152 | | - boolean random = CameraPane.RANDOM; |
---|
2153 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2340 | + boolean random = CameraPane.SWITCH; |
---|
| 2341 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2154 | 2342 | group.selection.get(i).linkVerticesThis(null); |
---|
2155 | | - CameraPane.RANDOM = random; |
---|
| 2343 | + CameraPane.SWITCH = random; |
---|
2156 | 2344 | } |
---|
2157 | 2345 | |
---|
2158 | 2346 | refreshContents(); |
---|
2159 | 2347 | } else |
---|
2160 | 2348 | if (source == relinkverticesItem) |
---|
2161 | 2349 | { |
---|
2162 | | - boolean random = CameraPane.RANDOM; |
---|
2163 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2350 | + boolean random = CameraPane.SWITCH; |
---|
| 2351 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2164 | 2352 | group.selection.RelinkToSupport(); |
---|
2165 | | - CameraPane.RANDOM = random; |
---|
| 2353 | + CameraPane.SWITCH = random; |
---|
2166 | 2354 | |
---|
2167 | 2355 | refreshContents(); |
---|
2168 | 2356 | } else |
---|
.. | .. |
---|
2177 | 2365 | } else |
---|
2178 | 2366 | if (source == setMasterItem) |
---|
2179 | 2367 | { |
---|
2180 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2368 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2181 | 2369 | { |
---|
2182 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2370 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2183 | 2371 | |
---|
2184 | 2372 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2185 | 2373 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2192 | 2380 | { |
---|
2193 | 2381 | if (group.selection.size() == 1) |
---|
2194 | 2382 | { |
---|
2195 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2383 | + if (Grafreed.clipboard.size() == 1) |
---|
2196 | 2384 | { |
---|
2197 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2385 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2198 | 2386 | |
---|
2199 | 2387 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2200 | 2388 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2211 | 2399 | { |
---|
2212 | 2400 | RevertMeshes(); |
---|
2213 | 2401 | } else |
---|
2214 | | - if (source == resetMeshItem) |
---|
| 2402 | + if (source == resetAllItem) |
---|
2215 | 2403 | { |
---|
2216 | 2404 | ResetAll(); |
---|
2217 | 2405 | } else |
---|
.. | .. |
---|
2260 | 2448 | RandomNode random = new RandomNode(); |
---|
2261 | 2449 | group(random); |
---|
2262 | 2450 | if (random.size() > 0) |
---|
2263 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2451 | + random.name = random.get(0).name + "Switch"; |
---|
2264 | 2452 | } else |
---|
2265 | 2453 | if (source == physicsItem) |
---|
2266 | 2454 | { |
---|
.. | .. |
---|
2399 | 2587 | } else |
---|
2400 | 2588 | if (source == genNormalsMESHItem) |
---|
2401 | 2589 | { |
---|
2402 | | - GenNormals(true); // TODO |
---|
| 2590 | + GenNormalsMESH(); |
---|
2403 | 2591 | } else |
---|
2404 | 2592 | if (source == genNormalsORGANItem) |
---|
2405 | 2593 | { |
---|
.. | .. |
---|
2464 | 2652 | if (source == unmarkleavesItem) |
---|
2465 | 2653 | { |
---|
2466 | 2654 | MarkLeaves(false); |
---|
| 2655 | + } else |
---|
| 2656 | + if (source == rewindleavesItem) |
---|
| 2657 | + { |
---|
| 2658 | + RewindLeaves(true); |
---|
| 2659 | + } else |
---|
| 2660 | + if (source == unrewindleavesItem) |
---|
| 2661 | + { |
---|
| 2662 | + RewindLeaves(false); |
---|
| 2663 | + } else |
---|
| 2664 | + if (source == randomleavesItem) |
---|
| 2665 | + { |
---|
| 2666 | + RandomLeaves(true); |
---|
| 2667 | + } else |
---|
| 2668 | + if (source == unrandomleavesItem) |
---|
| 2669 | + { |
---|
| 2670 | + RandomLeaves(false); |
---|
2467 | 2671 | } else |
---|
2468 | 2672 | if (source == flipVItem) |
---|
2469 | 2673 | { |
---|
.. | .. |
---|
2549 | 2753 | { |
---|
2550 | 2754 | SmoothMesh(); |
---|
2551 | 2755 | } else |
---|
2552 | | - if (source == transformgeometryItem) |
---|
| 2756 | + if (source == transformGeometryItem) |
---|
2553 | 2757 | { |
---|
2554 | 2758 | TransformGeometry(); |
---|
| 2759 | + } else |
---|
| 2760 | + if (source == transformChildrenItem) |
---|
| 2761 | + { |
---|
| 2762 | + TransformChildren(); |
---|
2555 | 2763 | } else |
---|
2556 | 2764 | if (source == resetTransformItem) |
---|
2557 | 2765 | { |
---|
.. | .. |
---|
2559 | 2767 | } else |
---|
2560 | 2768 | if (source == resetCentroidItem) |
---|
2561 | 2769 | { |
---|
2562 | | - ResetCentroid(); |
---|
| 2770 | + ResetCentroid(true); |
---|
| 2771 | + } else |
---|
| 2772 | + if (source == resetCentroidXZItem) |
---|
| 2773 | + { |
---|
| 2774 | + ResetCentroid(false); |
---|
2563 | 2775 | } else |
---|
2564 | 2776 | if (source == resetParentItem) |
---|
2565 | 2777 | { |
---|
.. | .. |
---|
2723 | 2935 | bigThree.ClearUI(); |
---|
2724 | 2936 | bigThree.add(centralPanel); |
---|
2725 | 2937 | bigThree.FlushUI(); |
---|
| 2938 | + |
---|
| 2939 | + cameraView.requestFocusInWindow(); |
---|
| 2940 | + |
---|
| 2941 | +// refreshContents(true); |
---|
| 2942 | +// |
---|
| 2943 | +// try |
---|
| 2944 | +// { |
---|
| 2945 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2946 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2947 | +// bot.mouseMove(100, 100); |
---|
| 2948 | +// bot.mousePress(mask); |
---|
| 2949 | +// bot.mouseRelease(mask); |
---|
| 2950 | +// } |
---|
| 2951 | +// catch (Exception e) |
---|
| 2952 | +// { |
---|
| 2953 | +// |
---|
| 2954 | +// } |
---|
| 2955 | + |
---|
2726 | 2956 | } else |
---|
2727 | 2957 | if (source == threeButton) |
---|
2728 | 2958 | { |
---|
.. | .. |
---|
2759 | 2989 | bigThree.add(centralPanel); |
---|
2760 | 2990 | bigThree.add(XYZPanel); |
---|
2761 | 2991 | bigThree.FlushUI(); |
---|
| 2992 | + |
---|
| 2993 | + cameraView.requestFocusInWindow(); |
---|
2762 | 2994 | } else |
---|
2763 | 2995 | if (source == fourButton) |
---|
2764 | 2996 | { |
---|
.. | .. |
---|
2794 | 3026 | bigThree.ClearUI(); |
---|
2795 | 3027 | bigThree.add(scenePanel); |
---|
2796 | 3028 | bigThree.FlushUI(); |
---|
| 3029 | + |
---|
| 3030 | + cameraView.requestFocusInWindow(); |
---|
2797 | 3031 | } else |
---|
2798 | 3032 | if (source == sixButton) |
---|
2799 | 3033 | { |
---|
.. | .. |
---|
2830 | 3064 | bigThree.add(scenePanel); |
---|
2831 | 3065 | bigThree.add(centralPanel); |
---|
2832 | 3066 | bigThree.FlushUI(); |
---|
| 3067 | + |
---|
| 3068 | + cameraView.requestFocusInWindow(); |
---|
2833 | 3069 | } else |
---|
2834 | 3070 | if (source == sevenButton) |
---|
2835 | 3071 | { |
---|
.. | .. |
---|
2867 | 3103 | bigThree.add(centralPanel); |
---|
2868 | 3104 | bigThree.add(XYZPanel); |
---|
2869 | 3105 | bigThree.FlushUI(); |
---|
| 3106 | + |
---|
| 3107 | + cameraView.requestFocusInWindow(); |
---|
2870 | 3108 | } else |
---|
2871 | 3109 | if (source == rootButton) |
---|
2872 | 3110 | { |
---|
.. | .. |
---|
2878 | 3116 | EditObject(obj); |
---|
2879 | 3117 | } |
---|
2880 | 3118 | |
---|
| 3119 | + cameraView.requestFocusInWindow(); |
---|
2881 | 3120 | refreshContents(true); |
---|
2882 | 3121 | } else |
---|
2883 | 3122 | if (source == closeButton) |
---|
.. | .. |
---|
2899 | 3138 | break; |
---|
2900 | 3139 | } |
---|
2901 | 3140 | } |
---|
| 3141 | + |
---|
| 3142 | + cameraView.requestFocusInWindow(); |
---|
2902 | 3143 | refreshContents(true); |
---|
2903 | 3144 | } else |
---|
2904 | 3145 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
2915 | 3156 | child.CloseUI(); |
---|
2916 | 3157 | listUI.remove(child); |
---|
2917 | 3158 | |
---|
2918 | | - child.editWindow = null; // ??????????? |
---|
| 3159 | + //child.editWindow = null; // ??????????? |
---|
2919 | 3160 | } |
---|
2920 | | - objEditor.ctrlPanel.validate(); |
---|
| 3161 | + objEditor.ctrlPanel.FlushUI(); |
---|
2921 | 3162 | //objEditor.jTree.clearSelection(); |
---|
2922 | 3163 | //objEditor.ResetSliders(); |
---|
2923 | 3164 | refreshContents(true); |
---|
.. | .. |
---|
3001 | 3242 | frontView.object = group; |
---|
3002 | 3243 | sideView.object = group; |
---|
3003 | 3244 | } |
---|
3004 | | - group.editWindow = this; |
---|
| 3245 | + |
---|
| 3246 | +// fix "+" issue |
---|
| 3247 | + //group.editWindow = this; |
---|
| 3248 | + |
---|
3005 | 3249 | /* |
---|
3006 | 3250 | currentLayout = radio.layout; |
---|
3007 | 3251 | if (currentLayout == null) |
---|
.. | .. |
---|
3013 | 3257 | //group.parent = null; // ROOT |
---|
3014 | 3258 | //group.attributes = -1; |
---|
3015 | 3259 | ResetModel(); |
---|
| 3260 | + |
---|
| 3261 | + cameraView.requestFocusInWindow(); |
---|
3016 | 3262 | refreshContents(true); |
---|
3017 | | - } |
---|
| 3263 | + } else if (event.getSource() == editCameraItem) |
---|
| 3264 | + { |
---|
| 3265 | + cameraView.ProtectCamera(); |
---|
| 3266 | + cameraView.repaint(); |
---|
| 3267 | + return; |
---|
| 3268 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3269 | + { |
---|
| 3270 | + cameraView.RevertCamera(); |
---|
| 3271 | + cameraView.repaint(); |
---|
| 3272 | + return; |
---|
| 3273 | + // } else if (event.getSource() == textureButton) |
---|
| 3274 | + // { |
---|
| 3275 | + // return; // true; |
---|
| 3276 | + } |
---|
3018 | 3277 | else |
---|
3019 | 3278 | { |
---|
3020 | 3279 | //return super.action(event, arg); |
---|
.. | .. |
---|
3023 | 3282 | } |
---|
3024 | 3283 | |
---|
3025 | 3284 | boolean useclient = false; |
---|
3026 | | - cRadio radio; |
---|
3027 | 3285 | |
---|
3028 | 3286 | void ToggleRoot() |
---|
3029 | 3287 | { |
---|
.. | .. |
---|
3075 | 3333 | refreshContents(); |
---|
3076 | 3334 | } |
---|
3077 | 3335 | |
---|
| 3336 | + void TransformChildren() |
---|
| 3337 | + { |
---|
| 3338 | + Object3D obj; |
---|
| 3339 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3340 | + { |
---|
| 3341 | + obj = (Object3D)e.nextElement(); |
---|
| 3342 | + obj.KeepTextureMatrices(); |
---|
| 3343 | + obj.TransformChildren(); |
---|
| 3344 | + obj.RestoreTextureMatrices(); |
---|
| 3345 | + |
---|
| 3346 | +// if (obj.parent == null) |
---|
| 3347 | +// { |
---|
| 3348 | +// System.out.println("NULL PARENT!"); |
---|
| 3349 | +// new Exception().printStackTrace(); |
---|
| 3350 | +// } |
---|
| 3351 | +// else |
---|
| 3352 | +// TouchTransform(obj); |
---|
| 3353 | +// //obj.parent.Touch(); |
---|
| 3354 | + } |
---|
| 3355 | + |
---|
| 3356 | + refreshContents(); |
---|
| 3357 | + } |
---|
3078 | 3358 | |
---|
3079 | 3359 | void ResetTransform() |
---|
3080 | 3360 | { |
---|
.. | .. |
---|
3187 | 3467 | refreshContents(); |
---|
3188 | 3468 | } |
---|
3189 | 3469 | |
---|
3190 | | - void ResetCentroid() |
---|
| 3470 | + void ResetCentroid(boolean full) |
---|
3191 | 3471 | { |
---|
3192 | 3472 | Object3D obj; |
---|
3193 | 3473 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3202 | 3482 | LA.matIdentity(Object3D.mat); |
---|
3203 | 3483 | obj.getBounds(minima, maxima, false); |
---|
3204 | 3484 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3205 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3485 | + if (full) |
---|
| 3486 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3206 | 3487 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3207 | 3488 | obj.TransformMesh(Object3D.mat); |
---|
| 3489 | + |
---|
3208 | 3490 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3209 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3491 | + if (full) |
---|
| 3492 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3210 | 3493 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3494 | + |
---|
3211 | 3495 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3212 | 3496 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3213 | 3497 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3236 | 3520 | |
---|
3237 | 3521 | int size = obj.MemorySize(); |
---|
3238 | 3522 | |
---|
3239 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3523 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3524 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3240 | 3525 | } |
---|
3241 | 3526 | } |
---|
3242 | 3527 | catch (Exception e) |
---|
.. | .. |
---|
3273 | 3558 | obj = (Object3D)e.nextElement(); |
---|
3274 | 3559 | |
---|
3275 | 3560 | System.out.println("Object is: " + obj); |
---|
3276 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3561 | + Grafreed.AnalyzeObject(obj); |
---|
3277 | 3562 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3278 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3563 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3279 | 3564 | |
---|
3280 | 3565 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3281 | 3566 | } |
---|
.. | .. |
---|
3317 | 3602 | void GenNormals(boolean crease) |
---|
3318 | 3603 | { |
---|
3319 | 3604 | group.GenNormalsS(crease); |
---|
| 3605 | + |
---|
| 3606 | + refreshContents(); |
---|
| 3607 | + } |
---|
| 3608 | + |
---|
| 3609 | + void GenNormalsMESH() |
---|
| 3610 | + { |
---|
| 3611 | + group.GenNormalsMeshS(); |
---|
3320 | 3612 | |
---|
3321 | 3613 | refreshContents(); |
---|
3322 | 3614 | } |
---|
.. | .. |
---|
3489 | 3781 | |
---|
3490 | 3782 | void ParseVertices() |
---|
3491 | 3783 | { |
---|
3492 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3493 | | - GrafreeD.epsequal = true; |
---|
| 3784 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3785 | + Grafreed.epsequal = true; |
---|
3494 | 3786 | |
---|
3495 | 3787 | for (int i=0; i<group.selection.size(); i++) |
---|
3496 | 3788 | { |
---|
.. | .. |
---|
3515 | 3807 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3516 | 3808 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3517 | 3809 | |
---|
3518 | | - g.add(GrafreeD.clipboard); |
---|
| 3810 | + g.add(Grafreed.clipboard); |
---|
3519 | 3811 | |
---|
3520 | 3812 | buffer.add(g); |
---|
3521 | 3813 | } |
---|
.. | .. |
---|
3530 | 3822 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3531 | 3823 | } |
---|
3532 | 3824 | |
---|
3533 | | - GrafreeD.epsequal = epsequal; |
---|
| 3825 | + Grafreed.epsequal = epsequal; |
---|
3534 | 3826 | |
---|
3535 | 3827 | refreshContents(); |
---|
3536 | 3828 | } |
---|
.. | .. |
---|
3548 | 3840 | String pigment = Object3D.GetPigment(tex); |
---|
3549 | 3841 | //String bump = Object3D.GetBump(tex); |
---|
3550 | 3842 | |
---|
3551 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3843 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3844 | + |
---|
| 3845 | + try |
---|
| 3846 | + { |
---|
| 3847 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3848 | + } |
---|
| 3849 | + catch (Exception e) |
---|
| 3850 | + { |
---|
| 3851 | + System.err.println("FAIL: " + node); |
---|
| 3852 | + } |
---|
3552 | 3853 | |
---|
3553 | 3854 | double s = v.s; |
---|
3554 | 3855 | |
---|
.. | .. |
---|
3636 | 3937 | |
---|
3637 | 3938 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3638 | 3939 | |
---|
3639 | | - boolean random = CameraPane.RANDOM; |
---|
3640 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3940 | + boolean random = CameraPane.SWITCH; |
---|
| 3941 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3641 | 3942 | lowres.linkVerticesThis(null); |
---|
3642 | 3943 | lowres.linkVerticesThis(sn); |
---|
3643 | | - CameraPane.RANDOM = random; |
---|
| 3944 | + CameraPane.SWITCH = random; |
---|
3644 | 3945 | |
---|
3645 | 3946 | System.err.flush(); |
---|
3646 | 3947 | |
---|
.. | .. |
---|
3680 | 3981 | return; |
---|
3681 | 3982 | |
---|
3682 | 3983 | Object3D poses = group.selection.get(0); |
---|
3683 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3984 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3684 | 3985 | |
---|
3685 | 3986 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3686 | 3987 | |
---|
.. | .. |
---|
3874 | 4175 | |
---|
3875 | 4176 | void ClipMesh() |
---|
3876 | 4177 | { |
---|
3877 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4178 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3878 | 4179 | { |
---|
3879 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4180 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3880 | 4181 | |
---|
3881 | 4182 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3882 | 4183 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3885 | 4186 | // { |
---|
3886 | 4187 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3887 | 4188 | // } |
---|
3888 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4189 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3889 | 4190 | } |
---|
3890 | 4191 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3891 | 4192 | System.out.println("DONE."); |
---|
.. | .. |
---|
3932 | 4233 | void MarkLeaves(boolean hide) |
---|
3933 | 4234 | { |
---|
3934 | 4235 | group.selection.MarkLeaves(hide); |
---|
| 4236 | + refreshContents(); |
---|
| 4237 | + } |
---|
| 4238 | + |
---|
| 4239 | + void RewindLeaves(boolean hide) |
---|
| 4240 | + { |
---|
| 4241 | + group.selection.RewindLeaves(hide); |
---|
| 4242 | + refreshContents(); |
---|
| 4243 | + } |
---|
| 4244 | + |
---|
| 4245 | + void RandomLeaves(boolean hide) |
---|
| 4246 | + { |
---|
| 4247 | + group.selection.RandomLeaves(hide); |
---|
3935 | 4248 | refreshContents(); |
---|
3936 | 4249 | } |
---|
3937 | 4250 | |
---|
.. | .. |
---|
4020 | 4333 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4021 | 4334 | |
---|
4022 | 4335 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4023 | | - if(elem != group) |
---|
| 4336 | + if(elem != group || !newWindow) |
---|
4024 | 4337 | { |
---|
4025 | 4338 | // if (!(elem instanceof Composite)) |
---|
4026 | 4339 | // newWindow = false; |
---|
.. | .. |
---|
4110 | 4423 | //case 702: // Event.LIST_DESELECT |
---|
4111 | 4424 | group.deselectAll(); |
---|
4112 | 4425 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4113 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4114 | 4426 | if (tps != null) |
---|
4115 | 4427 | { |
---|
4116 | 4428 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4119 | 4431 | |
---|
4120 | 4432 | //if (child.parent != null) |
---|
4121 | 4433 | //child.parent.addSelectee(child); |
---|
| 4434 | + objEditor.SetMaterial(child); |
---|
4122 | 4435 | group.addSelectee(child); |
---|
4123 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4124 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4125 | | - System.err.println("info : " + child.GetPath()); |
---|
4126 | 4436 | } |
---|
4127 | 4437 | } |
---|
4128 | | - else |
---|
4129 | | - { |
---|
4130 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4131 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4132 | | - System.err.println("info : " + group.GetPath()); |
---|
4133 | | - } |
---|
| 4438 | +// else |
---|
| 4439 | +// { |
---|
| 4440 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4441 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4442 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4443 | +// } |
---|
4134 | 4444 | |
---|
4135 | | - objEditor.SetText(); // jan 2014 |
---|
4136 | | - |
---|
4137 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4445 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4138 | 4446 | CameraPane.flash = true; |
---|
4139 | 4447 | |
---|
4140 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4448 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4141 | 4449 | // a camera |
---|
4142 | 4450 | { |
---|
4143 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4144 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4451 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4452 | + { |
---|
| 4453 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4454 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4455 | + } |
---|
4145 | 4456 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4146 | 4457 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4147 | 4458 | } |
---|
.. | .. |
---|
4154 | 4465 | |
---|
4155 | 4466 | freezemodel = false; |
---|
4156 | 4467 | } |
---|
| 4468 | + |
---|
| 4469 | + void refreshContents(boolean cp) |
---|
| 4470 | + { |
---|
| 4471 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4472 | + { |
---|
| 4473 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4474 | + |
---|
| 4475 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4476 | + { |
---|
| 4477 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4478 | + |
---|
| 4479 | + objEditor.AddInfo(child, this, true); |
---|
| 4480 | + System.err.println("info : " + child.GetPath()); |
---|
| 4481 | + } |
---|
| 4482 | + |
---|
| 4483 | + objEditor.SetText(); // jan 2014 |
---|
| 4484 | + } |
---|
| 4485 | + |
---|
| 4486 | + super.refreshContents(cp); |
---|
| 4487 | + } |
---|
4157 | 4488 | |
---|
4158 | 4489 | void linkSomething(Object3D thing) |
---|
4159 | 4490 | { |
---|
.. | .. |
---|
4225 | 4556 | { |
---|
4226 | 4557 | if (group.selection.isEmpty()) |
---|
4227 | 4558 | return; |
---|
4228 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4559 | + |
---|
| 4560 | + Grafreed.clipboardIsTempGroup = false; |
---|
4229 | 4561 | Composite tGroup = null; |
---|
4230 | 4562 | if (group.selection.size() > 0) // 1) |
---|
4231 | 4563 | { |
---|
4232 | 4564 | tGroup = new cGroup(); |
---|
4233 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4565 | + Grafreed.clipboardIsTempGroup = true; |
---|
4234 | 4566 | } |
---|
4235 | 4567 | |
---|
4236 | 4568 | if (cut) |
---|
4237 | 4569 | { |
---|
| 4570 | + Save(); |
---|
4238 | 4571 | //int indices[] = jList.getSelectedIndices(); |
---|
4239 | 4572 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4240 | 4573 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4270 | 4603 | //System.out.println("cut " + child); |
---|
4271 | 4604 | //System.out.println("parent = " + child.parent); |
---|
4272 | 4605 | // tmp.addChild(child); |
---|
4273 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4606 | + if (Grafreed.clipboardIsTempGroup) |
---|
4274 | 4607 | tGroup.add/*Child*/(tmp); |
---|
4275 | 4608 | else |
---|
4276 | | - GrafreeD.clipboard = tmp; |
---|
| 4609 | + Grafreed.clipboard = tmp; |
---|
4277 | 4610 | } |
---|
4278 | 4611 | else |
---|
4279 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4612 | + if (Grafreed.clipboardIsTempGroup) |
---|
4280 | 4613 | tGroup.add/*Child*/(child); |
---|
4281 | 4614 | else |
---|
4282 | | - GrafreeD.clipboard = child; |
---|
| 4615 | + Grafreed.clipboard = child; |
---|
4283 | 4616 | } |
---|
4284 | 4617 | |
---|
4285 | 4618 | //ResetModel(); |
---|
.. | .. |
---|
4311 | 4644 | //System.out.println("cut " + elem); |
---|
4312 | 4645 | //System.out.println("parent = " + elem.parent); |
---|
4313 | 4646 | // tmp.addChild(elem); |
---|
4314 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4647 | + if (Grafreed.clipboardIsTempGroup) |
---|
4315 | 4648 | tGroup.add/*Child*/(tmp); |
---|
4316 | 4649 | else |
---|
4317 | | - GrafreeD.clipboard = tmp; |
---|
| 4650 | + Grafreed.clipboard = tmp; |
---|
4318 | 4651 | } |
---|
4319 | 4652 | else |
---|
4320 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4653 | + if (Grafreed.clipboardIsTempGroup) |
---|
4321 | 4654 | tGroup.add/*Child*/(child); |
---|
4322 | 4655 | else |
---|
4323 | | - GrafreeD.clipboard = child; |
---|
| 4656 | + Grafreed.clipboard = child; |
---|
4324 | 4657 | } |
---|
4325 | 4658 | |
---|
4326 | 4659 | } |
---|
4327 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4328 | | - GrafreeD.clipboard = tGroup; |
---|
| 4660 | + |
---|
| 4661 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4662 | + Grafreed.clipboard = tGroup; |
---|
| 4663 | + |
---|
4329 | 4664 | if (cut) |
---|
4330 | 4665 | { |
---|
4331 | 4666 | ResetModel(); |
---|
.. | .. |
---|
4339 | 4674 | // return; |
---|
4340 | 4675 | boolean first = true; |
---|
4341 | 4676 | |
---|
4342 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4677 | + if (Grafreed.clipboardIsTempGroup) |
---|
4343 | 4678 | { |
---|
4344 | 4679 | Composite temp; |
---|
4345 | 4680 | |
---|
.. | .. |
---|
4350 | 4685 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4351 | 4686 | */ |
---|
4352 | 4687 | Object3D elem; |
---|
4353 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4688 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4354 | 4689 | { |
---|
4355 | 4690 | Object3D child = (Object3D)e.nextElement(); |
---|
4356 | 4691 | |
---|
.. | .. |
---|
4384 | 4719 | //Object3D cb = Applet3D.clipboard; |
---|
4385 | 4720 | //temp.addChild(cb); |
---|
4386 | 4721 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4387 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4388 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4389 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4390 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4391 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4722 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4723 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4724 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4725 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4726 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4392 | 4727 | else |
---|
4393 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4394 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4728 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4729 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4395 | 4730 | } |
---|
4396 | 4731 | |
---|
4397 | 4732 | ResetModel(); |
---|
4398 | 4733 | refreshContents(); |
---|
4399 | 4734 | } |
---|
4400 | 4735 | |
---|
4401 | | - void pasteInto(boolean copyit) |
---|
| 4736 | + void pasteInto(boolean copyit, boolean clone) |
---|
4402 | 4737 | { |
---|
4403 | 4738 | // if (GrafreeD.clipboard == null) |
---|
4404 | 4739 | // return; |
---|
.. | .. |
---|
4427 | 4762 | if (copyit) |
---|
4428 | 4763 | { |
---|
4429 | 4764 | // paste(false); |
---|
4430 | | - CloneClipboard(false); // sept 2014 |
---|
| 4765 | + if (clone) |
---|
| 4766 | + { |
---|
| 4767 | + CloneClipboard(false); // sept 2014 |
---|
| 4768 | + } |
---|
| 4769 | + else |
---|
| 4770 | + { |
---|
| 4771 | + paste(false); |
---|
| 4772 | + } |
---|
4431 | 4773 | } |
---|
4432 | 4774 | else |
---|
4433 | 4775 | { |
---|
4434 | 4776 | boolean first = true; |
---|
4435 | 4777 | |
---|
4436 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4778 | + if (Grafreed.clipboardIsTempGroup) |
---|
4437 | 4779 | { |
---|
4438 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4780 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4439 | 4781 | Object3D copy; |
---|
4440 | 4782 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4441 | 4783 | { |
---|
.. | .. |
---|
4445 | 4787 | } |
---|
4446 | 4788 | } else |
---|
4447 | 4789 | { |
---|
4448 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4790 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4449 | 4791 | } |
---|
4450 | 4792 | } |
---|
4451 | 4793 | } |
---|
.. | .. |
---|
4850 | 5192 | } |
---|
4851 | 5193 | */ |
---|
4852 | 5194 | |
---|
4853 | | - void ImportGFD() |
---|
4854 | | - { |
---|
4855 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4856 | | - browser.show(); |
---|
4857 | | - String filename = browser.getFile(); |
---|
4858 | | - if (filename != null && filename.length() > 0) |
---|
4859 | | - { |
---|
4860 | | - String fullname = browser.getDirectory() + filename; |
---|
4861 | | - |
---|
4862 | | - //Object3D readobj = |
---|
4863 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4864 | | - //makeSomething(readobj); |
---|
4865 | | - } |
---|
4866 | | - } |
---|
4867 | | - |
---|
4868 | 5195 | /* |
---|
4869 | 5196 | public void Callback(Object obj) |
---|
4870 | 5197 | { |
---|
.. | .. |
---|
4888 | 5215 | } |
---|
4889 | 5216 | */ |
---|
4890 | 5217 | |
---|
4891 | | - void ImportVRMLX3D() |
---|
4892 | | - { |
---|
4893 | | - if (GrafreeD.standAlone) |
---|
4894 | | - { |
---|
4895 | | - /**/ |
---|
4896 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4897 | | - browser.show(); |
---|
4898 | | - String filename = browser.getFile(); |
---|
4899 | | - if (filename != null && filename.length() > 0) |
---|
4900 | | - { |
---|
4901 | | - String fullname = browser.getDirectory() + filename; |
---|
4902 | | - LoadVRMLX3D(fullname); |
---|
4903 | | - } |
---|
4904 | | - /**/ |
---|
4905 | | - } |
---|
4906 | | - } |
---|
4907 | | - |
---|
4908 | 5218 | String GetFile(String dialogName) |
---|
4909 | 5219 | { |
---|
4910 | | - if (GrafreeD.standAlone) |
---|
| 5220 | + if (Grafreed.standAlone) |
---|
4911 | 5221 | { |
---|
4912 | 5222 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4913 | 5223 | browser.show(); |
---|
.. | .. |
---|
4971 | 5281 | cButton flashSelectionButton; |
---|
4972 | 5282 | cButton editButton; |
---|
4973 | 5283 | cButton uneditButton; |
---|
| 5284 | + JCheckBox allParamsButton; |
---|
4974 | 5285 | cButton clearpanelButton; |
---|
4975 | | - cButton allParamsButton; |
---|
4976 | 5286 | cButton unselectButton; |
---|
4977 | 5287 | |
---|
| 5288 | + cButton minButton; |
---|
| 5289 | + cButton maxButton; |
---|
| 5290 | + cButton fullButton; |
---|
| 5291 | + cButton undoButton; |
---|
| 5292 | + cButton redoButton; |
---|
| 5293 | + cButton saveButton; |
---|
| 5294 | + cButton oneStepButton; |
---|
| 5295 | + |
---|
4978 | 5296 | cButton screenfitButton; |
---|
4979 | 5297 | cButton screenfitpointButton; |
---|
4980 | 5298 | cButton snapobjectButton; |
---|
.. | .. |
---|
4985 | 5303 | cButton closeButton; |
---|
4986 | 5304 | |
---|
4987 | 5305 | cButton setsupportButton; |
---|
4988 | | - |
---|
4989 | | - cButton twoButton; |
---|
4990 | | - cButton sixButton; |
---|
4991 | | - cButton threeButton; |
---|
4992 | | - cButton sevenButton; |
---|
4993 | | - cButton fourButton; // full panel |
---|
4994 | | - cButton oneButton; // full XYZ |
---|
4995 | | - //cButton currentLayout; |
---|
4996 | 5306 | |
---|
4997 | 5307 | // |
---|
4998 | 5308 | //Composite |
---|
.. | .. |
---|
5005 | 5315 | private MenuItem lookFromItem; |
---|
5006 | 5316 | private MenuItem switchItem; |
---|
5007 | 5317 | private MenuItem cutItem; |
---|
| 5318 | + private MenuItem undoItem; |
---|
| 5319 | + private MenuItem redoItem; |
---|
5008 | 5320 | private MenuItem duplicateItem; |
---|
5009 | 5321 | private MenuItem cloneItem; |
---|
5010 | 5322 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5018 | 5330 | private MenuItem linkverticesItem; |
---|
5019 | 5331 | private MenuItem relinkverticesItem; |
---|
5020 | 5332 | private MenuItem setMasterItem; |
---|
5021 | | - private MenuItem resetMeshItem; |
---|
| 5333 | + private MenuItem resetAllItem; |
---|
5022 | 5334 | private MenuItem stepAllItem; |
---|
5023 | 5335 | private MenuItem revertMeshItem; |
---|
5024 | 5336 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5029 | 5341 | private MenuItem mergeGeometriesItem; |
---|
5030 | 5342 | private MenuItem copyItem; |
---|
5031 | 5343 | private MenuItem pasteItem; |
---|
| 5344 | + private MenuItem pasteIntoItem; |
---|
5032 | 5345 | private MenuItem pasteLinkItem; |
---|
5033 | 5346 | private MenuItem pasteCloneItem; |
---|
5034 | 5347 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5067 | 5380 | private MenuItem showleavesItem; |
---|
5068 | 5381 | private MenuItem markleavesItem; |
---|
5069 | 5382 | private MenuItem unmarkleavesItem; |
---|
| 5383 | + private MenuItem rewindleavesItem; |
---|
| 5384 | + private MenuItem unrewindleavesItem; |
---|
| 5385 | + private MenuItem randomleavesItem; |
---|
| 5386 | + private MenuItem unrandomleavesItem; |
---|
5070 | 5387 | |
---|
5071 | 5388 | private MenuItem flipVItem; |
---|
5072 | 5389 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5078 | 5395 | private MenuItem panoTexturesItem; |
---|
5079 | 5396 | |
---|
5080 | 5397 | private MenuItem resetCentroidItem; |
---|
5081 | | - private MenuItem transformgeometryItem; |
---|
| 5398 | + private MenuItem resetCentroidXZItem; |
---|
5082 | 5399 | private MenuItem resetTransformItem; |
---|
| 5400 | + private MenuItem transformGeometryItem; |
---|
| 5401 | + private MenuItem transformChildrenItem; |
---|
5083 | 5402 | private MenuItem hideItem; |
---|
5084 | 5403 | private MenuItem grabItem; |
---|
5085 | 5404 | private MenuItem backItem; |
---|
.. | .. |
---|
5126 | 5445 | private MenuItem blobItem; |
---|
5127 | 5446 | private MenuItem latheItem; |
---|
5128 | 5447 | private MenuItem bezierItem; |
---|
5129 | | - private MenuItem checkerItem; |
---|
| 5448 | + private MenuItem overlayItem; |
---|
5130 | 5449 | private MenuItem meshItem; |
---|
5131 | 5450 | // private MenuItem meshGroupItem; |
---|
5132 | 5451 | private MenuItem springItem; |
---|
.. | .. |
---|
5148 | 5467 | private MenuItem doubleItem; |
---|
5149 | 5468 | private MenuItem tripleItem; |
---|
5150 | 5469 | |
---|
5151 | | - private MenuItem importGFDItem; |
---|
5152 | | - private MenuItem importVRMLX3DItem; |
---|
5153 | | - private MenuItem import3DSItem; |
---|
5154 | | - private MenuItem importOBJItem; |
---|
5155 | | - |
---|
5156 | 5470 | private MenuItem computeAOItem; |
---|
5157 | 5471 | private MenuItem recompileItem; |
---|
5158 | 5472 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5162 | 5476 | private MenuItem analyzeItem; |
---|
5163 | 5477 | private MenuItem dumpItem; |
---|
5164 | 5478 | //boolean freezemodel = false; |
---|
| 5479 | + |
---|
| 5480 | + Menu cameraMenu; |
---|
| 5481 | + MenuItem editCameraItem; |
---|
| 5482 | + MenuItem revertCameraItem; |
---|
5165 | 5483 | } |
---|