.. | .. |
---|
12 | 12 | import com.jme.math.Vector3f; |
---|
13 | 13 | import com.jme.renderer.ColorRGBA; |
---|
14 | 14 | |
---|
| 15 | +import grafeme.ui.*; |
---|
15 | 16 | //import buoy.widget.BFileChooser; |
---|
16 | 17 | |
---|
17 | | -class GroupEditor extends ObjEditor implements iParse, //iCallBack, |
---|
| 18 | +class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
18 | 19 | ObjectUI, |
---|
19 | 20 | Runnable, |
---|
20 | 21 | ActionListener, |
---|
.. | .. |
---|
73 | 74 | this.copy = this.group = copy; |
---|
74 | 75 | //selectees = this.group.selectees; |
---|
75 | 76 | |
---|
76 | | - SetupMenu2(objEditor); |
---|
| 77 | + SetupMenu2(this); //objEditor); |
---|
77 | 78 | SetupUI2(objEditor); |
---|
78 | 79 | objEditor.SetupUI(true); |
---|
79 | 80 | SetupViews(objEditor); |
---|
.. | .. |
---|
83 | 84 | |
---|
84 | 85 | void CloneSelection(boolean supports) |
---|
85 | 86 | { |
---|
86 | | - // Object3D keep = GraphreeD.clipboard; |
---|
| 87 | + // Object3D keep = GrafreeD.clipboard; |
---|
87 | 88 | //Object3D obj; |
---|
88 | 89 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
89 | 90 | { |
---|
.. | .. |
---|
97 | 98 | |
---|
98 | 99 | void CloneClipboard(boolean supports) |
---|
99 | 100 | { |
---|
100 | | - assert(GraphreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
102 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GraphreeD.clipboard.get(0), false)); |
---|
| 101 | + assert(Grafreed.clipboard.parent == null); |
---|
| 102 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 103 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 104 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 105 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
105 | 106 | else |
---|
106 | | - makeSomething(CloneObject(GraphreeD.clipboard, false)); |
---|
107 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 109 | } |
---|
109 | 110 | |
---|
110 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 119 | // obj.support = null; |
---|
119 | 120 | if (!supports) |
---|
120 | 121 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GraphreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 123 | obj.parent = parent; |
---|
123 | 124 | // obj.support = support; |
---|
124 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 148 | |
---|
148 | 149 | //JTextField nameField; |
---|
149 | 150 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 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 | + { |
---|
152 | 274 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 275 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 276 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 282 | lookAtItem.addActionListener(this); |
---|
161 | 283 | //lookFromItem.addActinoListener(this); |
---|
162 | 284 | //switchItem.addActionListener(this); |
---|
163 | | - Menu menu; |
---|
164 | | - oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | | - //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | | - //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
168 | | - duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | | - cloneItem.addActionListener(this); |
---|
172 | | - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | | - cloneSupportItem.addActionListener(this); |
---|
174 | | - menu.add("-"); |
---|
175 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | | - cutItem.addActionListener(this); |
---|
177 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
178 | | - copyItem.addActionListener(this); |
---|
179 | | - pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | | - pasteItem.addActionListener(this); |
---|
181 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | | - pasteLinkItem.addActionListener(this); |
---|
183 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | | - pasteCloneItem.addActionListener(this); |
---|
185 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | | -// pasteExpandItem.addActionListener(this); |
---|
187 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | | - clearItem.addActionListener(this); |
---|
189 | | - clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | | - clearAllItem.addActionListener(this); |
---|
191 | | - menu.add("-"); |
---|
192 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
193 | | - resetMeshItem.addActionListener(this); |
---|
194 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
195 | | - stepAllItem.addActionListener(this); |
---|
| 285 | + } |
---|
| 286 | + |
---|
| 287 | + oe.menuBar.add(menu = new Menu("Setting")); |
---|
| 288 | + if (Globals.ADVANCED) |
---|
| 289 | + { |
---|
196 | 290 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
197 | 291 | revertMeshItem.addActionListener(this); |
---|
198 | 292 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
199 | 293 | resetreferencesItem.addActionListener(this); |
---|
200 | 294 | menu.add("-"); |
---|
| 295 | + } |
---|
201 | 296 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
202 | 297 | overwriteGeoItem.addActionListener(this); |
---|
203 | 298 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
209 | 304 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
210 | 305 | overwriteUVItem.addActionListener(this); |
---|
211 | 306 | menu.add("-"); |
---|
| 307 | + if (Globals.ADVANCED) |
---|
| 308 | + { |
---|
212 | 309 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
213 | 310 | generateMeshItem.addActionListener(this); |
---|
214 | 311 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
215 | 312 | poseMeshItem.addActionListener(this); |
---|
216 | 313 | menu.add("-"); |
---|
| 314 | + } |
---|
217 | 315 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
218 | 316 | resetsupportItem.addActionListener(this); |
---|
219 | 317 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
220 | 318 | linkverticesItem.addActionListener(this); |
---|
| 319 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 320 | + relinkverticesItem.addActionListener(this); |
---|
| 321 | + |
---|
| 322 | + if (Globals.ADVANCED) |
---|
| 323 | + { |
---|
221 | 324 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
222 | 325 | setMasterItem.addActionListener(this); |
---|
| 326 | + } |
---|
223 | 327 | |
---|
224 | | - oe.menuBar.add(menu = new Menu("Object")); |
---|
| 328 | + oe.menuBar.add(menu = new Menu("Group")); |
---|
225 | 329 | grabItem = menu.add(new MenuItem("Grab")); |
---|
226 | 330 | grabItem.addActionListener(this); |
---|
227 | | - frontItem = menu.add(new MenuItem("Front")); |
---|
228 | | - frontItem.addActionListener(this); |
---|
229 | 331 | backItem = menu.add(new MenuItem("Back")); |
---|
230 | 332 | backItem.addActionListener(this); |
---|
| 333 | + frontItem = menu.add(new MenuItem("Front")); |
---|
| 334 | + frontItem.addActionListener(this); |
---|
231 | 335 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
232 | 336 | compositeItem.addActionListener(this); |
---|
| 337 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
| 338 | + hideItem.addActionListener(this); |
---|
| 339 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 340 | + ungroupItem.addActionListener(this); |
---|
233 | 341 | menu.add("-"); |
---|
234 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 342 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
235 | 343 | randomItem.addActionListener(this); |
---|
236 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
237 | | - physicsItem.addActionListener(this); |
---|
238 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
239 | | - frameselectorItem.addActionListener(this); |
---|
240 | 344 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
241 | 345 | switchGeoItem.addActionListener(this); |
---|
242 | 346 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
243 | 347 | switchTransfoItem.addActionListener(this); |
---|
244 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 348 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
245 | 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); |
---|
246 | 358 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
247 | 359 | scriptNodeItem.addActionListener(this); |
---|
248 | 360 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
249 | 361 | cameraItem.addActionListener(this); |
---|
250 | | - menu.add("-"); |
---|
| 362 | + } |
---|
| 363 | + |
---|
| 364 | + oe.menuBar.add(menu = new Menu("Object")); |
---|
251 | 365 | textureItem = menu.add(new MenuItem("Texture")); |
---|
252 | 366 | textureItem.addActionListener(this); |
---|
| 367 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 368 | + billboardItem.addActionListener(this); |
---|
253 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
254 | 370 | csgItem.addActionListener(this); |
---|
255 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
256 | 372 | shadowXItem.addActionListener(this); |
---|
257 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
258 | 374 | shadowYItem.addActionListener(this); |
---|
259 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
260 | 376 | shadowZItem.addActionListener(this); |
---|
| 377 | + if (Globals.ADVANCED) |
---|
| 378 | + { |
---|
| 379 | + menu.add("-"); |
---|
261 | 380 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
262 | 381 | linkerItem.addActionListener(this); |
---|
263 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
264 | | - templateItem.addActionListener(this); |
---|
265 | 382 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
266 | 383 | attributeItem.addActionListener(this); |
---|
| 384 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 385 | + templateItem.addActionListener(this); |
---|
267 | 386 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
268 | 387 | pointflowItem.addActionListener(this); |
---|
| 388 | + } |
---|
269 | 389 | menu.add("-"); |
---|
270 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
271 | | - transformgeometryItem.addActionListener(this); |
---|
272 | 390 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
273 | 391 | resetTransformItem.addActionListener(this); |
---|
274 | 392 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
275 | 393 | resetCentroidItem.addActionListener(this); |
---|
276 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
277 | | - ungroupItem.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); |
---|
278 | 400 | |
---|
279 | 401 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
280 | 402 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
283 | 405 | genNormalsORGANItem.addActionListener(this); |
---|
284 | 406 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
285 | 407 | genNormalsCADItem.addActionListener(this); |
---|
| 408 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 409 | + genNormalsMESHItem.addActionListener(this); |
---|
| 410 | + if (Globals.ADVANCED) |
---|
| 411 | + { |
---|
| 412 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 413 | + genNormalsMINEItem.addActionListener(this); |
---|
| 414 | + } |
---|
286 | 415 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
287 | 416 | stripifyItem.addActionListener(this); |
---|
288 | 417 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
292 | 421 | untrimItem = menu.add(new MenuItem("Untrim")); |
---|
293 | 422 | untrimItem.addActionListener(this); |
---|
294 | 423 | menu.add("-"); |
---|
295 | | - clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
296 | | - clearMaterialsItem.addActionListener(this); |
---|
297 | 424 | clearColorsItem = menu.add(new MenuItem("Clear AO")); |
---|
298 | 425 | clearColorsItem.addActionListener(this); |
---|
299 | 426 | reverseNormalsItem = menu.add(new MenuItem("Reverse Normals")); |
---|
.. | .. |
---|
306 | 433 | reduce34MeshItem.addActionListener(this); |
---|
307 | 434 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
308 | 435 | increaseMeshItem.addActionListener(this); |
---|
309 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
310 | | - smoothMeshItem.addActionListener(this); |
---|
311 | 436 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
312 | 437 | clipMeshItem.addActionListener(this); |
---|
| 438 | + |
---|
| 439 | + if (Globals.ADVANCED) |
---|
| 440 | + { |
---|
| 441 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 442 | + smoothMeshItem.addActionListener(this); |
---|
| 443 | + } |
---|
| 444 | + |
---|
| 445 | + oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 446 | + clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
| 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); |
---|
313 | 452 | menu.add("-"); |
---|
314 | 453 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
315 | 454 | liveleavesItem.addActionListener(this); |
---|
316 | 455 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
317 | 456 | unliveleavesItem.addActionListener(this); |
---|
| 457 | + if (Globals.ADVANCED) |
---|
| 458 | + { |
---|
318 | 459 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
319 | 460 | supportleavesItem.addActionListener(this); |
---|
320 | 461 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
321 | 462 | unsupportleavesItem.addActionListener(this); |
---|
| 463 | + } |
---|
322 | 464 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
323 | 465 | hideleavesItem.addActionListener(this); |
---|
324 | 466 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
327 | 469 | markleavesItem.addActionListener(this); |
---|
328 | 470 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
329 | 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); |
---|
330 | 480 | menu.add("-"); |
---|
331 | 481 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
332 | 482 | flipVItem.addActionListener(this); |
---|
333 | 483 | unflipVItem = menu.add(new MenuItem("Unflip V")); |
---|
334 | 484 | unflipVItem.addActionListener(this); |
---|
335 | | - lowTexturesItem = menu.add(new MenuItem("Low Texture")); |
---|
| 485 | + lowTexturesItem = menu.add(new MenuItem("Low Texture (256)")); |
---|
336 | 486 | lowTexturesItem.addActionListener(this); |
---|
337 | | - normalTexturesItem = menu.add(new MenuItem("Normal Texture")); |
---|
| 487 | + normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)")); |
---|
338 | 488 | normalTexturesItem.addActionListener(this); |
---|
339 | | - highTexturesItem = menu.add(new MenuItem("High Texture")); |
---|
| 489 | + highTexturesItem = menu.add(new MenuItem("High Texture (1024)")); |
---|
340 | 490 | highTexturesItem.addActionListener(this); |
---|
341 | | - veryhighTexturesItem = menu.add(new MenuItem("Very high Texture")); |
---|
| 491 | + veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)")); |
---|
342 | 492 | veryhighTexturesItem.addActionListener(this); |
---|
343 | | - maxTexturesItem = menu.add(new MenuItem("Max Texture")); |
---|
| 493 | + maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)")); |
---|
344 | 494 | maxTexturesItem.addActionListener(this); |
---|
345 | | - panoTexturesItem = menu.add(new MenuItem("Panoramic Texture")); |
---|
| 495 | + panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)")); |
---|
346 | 496 | panoTexturesItem.addActionListener(this); |
---|
347 | | - menu.add("-"); |
---|
348 | | - extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
349 | | - extractGeometriesItem.addActionListener(this); |
---|
350 | | - cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
351 | | - cloneGeometriesItem.addActionListener(this); |
---|
352 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
353 | | - shareGeometriesItem.addActionListener(this); |
---|
354 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
355 | | - mergeGeometriesItem.addActionListener(this); |
---|
356 | 497 | |
---|
357 | 498 | oe.menuBar.add(menu = new Menu("Selection")); |
---|
358 | 499 | attachPigmentItem = menu.add(new MenuItem("Attach Pigment...")); |
---|
.. | .. |
---|
370 | 511 | sortbysizeItem.addActionListener(this); |
---|
371 | 512 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
372 | 513 | sortbynameItem.addActionListener(this); |
---|
| 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. |
---|
| 522 | + extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
| 523 | + extractGeometriesItem.addActionListener(this); |
---|
| 524 | + cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
| 525 | + cloneGeometriesItem.addActionListener(this); |
---|
| 526 | + } |
---|
| 527 | + |
---|
373 | 528 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
374 | 529 | buildCreateMenu(menu); |
---|
375 | | - oe.menuBar.add(menu = new Menu("Tools")); |
---|
| 530 | + |
---|
| 531 | + oe.menuBar.add(menu = new Menu("Tools")); |
---|
376 | 532 | buildToolsMenu(menu); |
---|
377 | 533 | } |
---|
378 | 534 | |
---|
379 | 535 | void SetupUI2(ObjEditor oe) |
---|
380 | 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 | + |
---|
381 | 549 | //new Exception().printStackTrace(); |
---|
382 | 550 | |
---|
383 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
406 | 574 | oe.radioPanel.add(dummyButton); |
---|
407 | 575 | oe.buttonGroup.add(dummyButton); |
---|
408 | 576 | */ |
---|
409 | | - aConstraints.gridy += 1; |
---|
410 | | - oe.aConstraints.gridwidth = 1; |
---|
411 | | - oe.aConstraints.gridx = 0; |
---|
| 577 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
412 | 578 | |
---|
413 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 579 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 580 | + //minButton.setToolTipText("Minimize window"); |
---|
| 581 | + //minButton.addActionListener(this); |
---|
| 582 | + |
---|
| 583 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + redoButton.setToolTipText("Redo changes"); |
---|
| 597 | + redoButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + saveButton.setToolTipText("Save changes"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 604 | + liveCB.setToolTipText("Enable animation"); |
---|
414 | 605 | liveCB.addItemListener(this); |
---|
415 | 606 | |
---|
416 | | - oe.aConstraints.gridx += 1; |
---|
417 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
418 | | - supportCB.addItemListener(this); |
---|
419 | | - |
---|
420 | | - // oe.aConstraints.gridx += 1; |
---|
421 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
422 | | - // localCB.addItemListener(this); |
---|
423 | | - |
---|
424 | | - oe.aConstraints.gridx += 1; |
---|
425 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
426 | | - crowdCB.addItemListener(this); |
---|
427 | | - |
---|
428 | | - oe.aConstraints.gridx += 1; |
---|
429 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
430 | | - smoothCB.addItemListener(this); |
---|
431 | | - |
---|
432 | | - oe.aConstraints.gridx += 1; |
---|
433 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 608 | + fastCB.setToolTipText("Fast mode"); |
---|
434 | 609 | fastCB.addItemListener(this); |
---|
435 | | - oe.aConstraints.gridx += 1; |
---|
436 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
437 | | - slowCB.addItemListener(this); |
---|
438 | | - oe.aConstraints.gridx += 1; |
---|
439 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
440 | | - boxCB.addItemListener(this); |
---|
441 | | - |
---|
442 | | -// oe.aConstraints.gridx += 1; |
---|
443 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
444 | | -// speakerMocapCB.addItemListener(this); |
---|
445 | | - |
---|
446 | | - if (false) |
---|
447 | | - { |
---|
448 | | - // handled in scripts |
---|
449 | | - oe.aConstraints.gridx += 1; |
---|
450 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
451 | | - speakerCameraCB.addItemListener(this); |
---|
452 | | - |
---|
453 | | - oe.aConstraints.gridx += 1; |
---|
454 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
455 | | - speakerFocusCB.addItemListener(this); |
---|
456 | | - |
---|
457 | | - oe.aConstraints.gridx += 1; |
---|
458 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
459 | | - smoothfocusCB.addItemListener(this); |
---|
460 | | - } |
---|
461 | | - |
---|
462 | | -//oe.aConstraints.gridx += 1; |
---|
463 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
464 | | -// debugCB.addItemListener(this); |
---|
465 | | - |
---|
466 | | - oe.aConstraints.gridx += 1; |
---|
467 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
468 | | - oeilCB.addItemListener(this); |
---|
469 | | - |
---|
470 | | - oe.aConstraints.gridx += 1; |
---|
471 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
472 | | - lookAtCB.addItemListener(this); |
---|
473 | | - |
---|
474 | | - oe.aConstraints.gridx += 1; |
---|
475 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 610 | + |
---|
| 611 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 613 | + oneStepButton.addActionListener(this); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 616 | + trackCB.setToolTipText("Enable tracking"); |
---|
476 | 617 | trackCB.addItemListener(this); |
---|
477 | 618 | |
---|
478 | | - oe.aConstraints.gridx += 1; |
---|
479 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + screenfitButton.setToolTipText("Screen fit"); |
---|
480 | 621 | screenfitButton.addActionListener(this); |
---|
481 | | - oe.aConstraints.gridx += 1; |
---|
| 622 | + |
---|
482 | 623 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
483 | 624 | // screenfitpointButton.addActionListener(this); |
---|
484 | | -// oe.aConstraints.gridx += 1; |
---|
485 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
486 | | - snapobjectButton.addActionListener(this); |
---|
487 | | - oe.aConstraints.gridx += 1; |
---|
488 | 625 | |
---|
489 | | - //aConstraints.gridx = 0; |
---|
490 | | - //aConstraints.gridy += 1; |
---|
491 | | - oe.aConstraints.weighty = 0; |
---|
492 | | - oe.aConstraints.gridwidth = 1; |
---|
493 | | - |
---|
494 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 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 = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
495 | 635 | flashSelectionButton.addActionListener(this); |
---|
496 | | - oe.aConstraints.gridx += 1; |
---|
497 | | - oe.aConstraints.weighty = 0; |
---|
498 | | - oe.aConstraints.gridwidth = 1; |
---|
499 | 636 | |
---|
500 | | - // |
---|
501 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 637 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 638 | + |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 640 | + twoButton.setToolTipText("Show center view only"); |
---|
502 | 641 | twoButton.addActionListener(this); |
---|
503 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 643 | fourButton.addActionListener(this); |
---|
505 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 644 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 646 | + sixButton.setToolTipText("2-column layout left"); |
---|
506 | 647 | sixButton.addActionListener(this); |
---|
507 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + threeButton.setToolTipText("2-column layout right"); |
---|
508 | 650 | threeButton.addActionListener(this); |
---|
509 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 652 | + sevenButton.setToolTipText("3-column layout"); |
---|
510 | 653 | sevenButton.addActionListener(this); |
---|
511 | 654 | // |
---|
512 | 655 | |
---|
513 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 656 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 657 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
514 | 658 | rootButton.addActionListener(this); |
---|
515 | | - oe.aConstraints.gridx += 1; |
---|
516 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 659 | + |
---|
| 660 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + closeButton.setToolTipText("Close tab"); |
---|
517 | 662 | closeButton.addActionListener(this); |
---|
518 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
519 | 664 | //clearButton.addActionListener(this); |
---|
520 | | - oe.aConstraints.gridx += 1; |
---|
521 | 665 | |
---|
522 | | - oe.aConstraints.gridx = 1; // |
---|
523 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 667 | + editButton.setToolTipText("Edit selection"); |
---|
524 | 668 | editButton.addActionListener(this); |
---|
525 | | - oe.aConstraints.gridx += 1; |
---|
526 | | - oe.aConstraints.weighty = 0; |
---|
527 | | - oe.aConstraints.gridwidth = 1; |
---|
528 | 669 | |
---|
529 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 671 | + uneditButton.setToolTipText("Unedit selection"); |
---|
530 | 672 | uneditButton.addActionListener(this); |
---|
531 | 673 | |
---|
532 | | - oe.aConstraints.gridx += 1; |
---|
533 | | - oe.aConstraints.weighty = 0; |
---|
534 | | - oe.aConstraints.gridwidth = 1; |
---|
535 | | - |
---|
536 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
537 | | - clearPanelButton.addActionListener(this); |
---|
538 | | - |
---|
539 | | - oe.aConstraints.gridx += 1; |
---|
540 | | - oe.aConstraints.weighty = 0; |
---|
541 | | - oe.aConstraints.gridwidth = 1; |
---|
542 | | - |
---|
543 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 675 | + allParamsButton.setToolTipText("Edit all params"); |
---|
544 | 676 | allParamsButton.addActionListener(this); |
---|
545 | 677 | |
---|
546 | | - oe.aConstraints.gridx += 1; |
---|
547 | | - oe.aConstraints.weighty = 0; |
---|
548 | | - oe.aConstraints.gridwidth = 1; |
---|
549 | | - |
---|
550 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 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"); |
---|
551 | 684 | unselectButton.addActionListener(this); |
---|
552 | 685 | |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
| 687 | + |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
| 690 | + |
---|
553 | 691 | // oe.aConstraints.gridx += 1; |
---|
554 | 692 | // oe.aConstraints.weighty = 0; |
---|
555 | 693 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
561 | 699 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
562 | 700 | // gcButton.addActionListener(this); |
---|
563 | 701 | |
---|
564 | | - oe.aConstraints.gridx = 0; |
---|
565 | | - oe.aConstraints.gridy += 1; |
---|
566 | | - |
---|
567 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
568 | | - oe.aConstraints.gridwidth = 100; |
---|
569 | | - // oe.aConstraints.gridheight = 100; |
---|
570 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
571 | | - oe.aConstraints.gridheight = 1; |
---|
572 | | - oe.aConstraints.weighty = 0.5; |
---|
573 | | - oe.aConstraints.gridx = 0; |
---|
574 | | - JScrollPane jSP; |
---|
| 702 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 703 | + |
---|
| 704 | + JScrollPane jSP; |
---|
575 | 705 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
576 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 706 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
577 | 707 | ResetModel(); |
---|
578 | | - oe.aConstraints.weighty = 0.5; |
---|
579 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
580 | | - oe.aConstraints.gridy += 1; |
---|
581 | | - oe.aConstraints.gridwidth = 1; |
---|
| 708 | + |
---|
| 709 | + oe.treePanel.add(jSPPanel); |
---|
| 710 | + oe.treePanel.Return(); |
---|
582 | 711 | |
---|
583 | | - oe.aConstraints.weighty = 0; |
---|
584 | | - oe.aConstraints.gridwidth = 2; |
---|
585 | | - |
---|
586 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 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"); |
---|
587 | 716 | colorCB.addItemListener(this); |
---|
588 | | - oe.aConstraints.gridx += 2; |
---|
589 | | - 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"); |
---|
590 | 720 | materialCB.addItemListener(this); |
---|
591 | | - oe.aConstraints.gridx += 2; |
---|
592 | | - 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"); |
---|
593 | 724 | textureCB.addItemListener(this); |
---|
594 | 725 | |
---|
595 | | - oe.aConstraints.gridx = 0; |
---|
596 | | - oe.aConstraints.gridy += 1; |
---|
| 726 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 727 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 728 | + oe.treePanel.Return(); |
---|
597 | 729 | |
---|
| 730 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 731 | +// mainPanel.setResizeWeight(0.5); |
---|
| 732 | + |
---|
598 | 733 | //jList.addListSelectionListener(this); |
---|
599 | 734 | oe.jTree.addTreeSelectionListener(this); |
---|
600 | 735 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
616 | 751 | radio.layout = sevenButton; |
---|
617 | 752 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
618 | 753 | } |
---|
| 754 | + |
---|
| 755 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 756 | + { |
---|
| 757 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 758 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 759 | + boxCB.addItemListener(this); |
---|
| 760 | + |
---|
| 761 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 762 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 763 | + zoomBoxCB.addItemListener(this); |
---|
| 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 | + |
---|
| 786 | +// constraints.gridy += 1; |
---|
| 787 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 788 | +// speakerMocapCB.addItemListener(this); |
---|
| 789 | + |
---|
| 790 | + if (false) |
---|
| 791 | + { |
---|
| 792 | + // handled in scripts |
---|
| 793 | + //constraints.gridy += 1; |
---|
| 794 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 795 | + speakerCameraCB.addItemListener(this); |
---|
| 796 | + |
---|
| 797 | + //constraints.gridy += 1; |
---|
| 798 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 799 | + speakerFocusCB.addItemListener(this); |
---|
| 800 | + |
---|
| 801 | + //constraints.gridy += 1; |
---|
| 802 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 803 | + smoothfocusCB.addItemListener(this); |
---|
| 804 | + } |
---|
| 805 | + |
---|
| 806 | +//constraints.gridx += 1; |
---|
| 807 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 808 | +// debugCB.addItemListener(this); |
---|
| 809 | + |
---|
| 810 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 811 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 812 | + oeilCB.addItemListener(this); |
---|
| 813 | + |
---|
| 814 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 815 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 816 | + shadowCB.addItemListener(this); |
---|
| 817 | + |
---|
| 818 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 819 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 820 | + autosaveCB.addItemListener(this); |
---|
| 821 | + |
---|
| 822 | + if (Globals.ADVANCED) |
---|
| 823 | + { |
---|
| 824 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 825 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 826 | + lookAtCB.addItemListener(this); |
---|
| 827 | + } |
---|
| 828 | + |
---|
| 829 | + } |
---|
| 830 | + |
---|
| 831 | + cGridBag fill = new cGridBag(); |
---|
| 832 | + |
---|
| 833 | + fill.preferredHeight = 200; |
---|
| 834 | + |
---|
| 835 | + panel.add(fill); |
---|
| 836 | + |
---|
| 837 | + } |
---|
619 | 838 | |
---|
620 | 839 | void EditObject(Object3D obj) |
---|
621 | 840 | { |
---|
622 | | - cRadio dummyButton = new cRadio(obj.name); |
---|
623 | | - dummyButton.SetObject(obj); |
---|
624 | | - dummyButton.layout = sevenButton; |
---|
625 | | - dummyButton.SetCamera(cameraView.renderCamera, false); |
---|
626 | | - dummyButton.addActionListener(this); |
---|
627 | | - radioPanel.add(dummyButton); |
---|
628 | | - buttonGroup.add(dummyButton); |
---|
629 | | - dummyButton.doClick(); |
---|
| 841 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 842 | + |
---|
| 843 | + // Patch to avoid bug with transparency. |
---|
| 844 | + radioButton.hadMaterial = obj.material != null; |
---|
| 845 | + if (!radioButton.hadMaterial) |
---|
| 846 | + { |
---|
| 847 | + obj.material = new cMaterial(); |
---|
| 848 | + } |
---|
| 849 | + |
---|
| 850 | + radioButton.SetObject(obj); |
---|
| 851 | + radioButton.layout = sevenButton; |
---|
| 852 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 853 | + radioButton.addActionListener(this); |
---|
| 854 | + radioPanel.add(radioButton); |
---|
| 855 | + buttonGroup.add(radioButton); |
---|
| 856 | + radioButton.doClick(); |
---|
630 | 857 | } |
---|
| 858 | + |
---|
631 | 859 | void SetupViews(ObjEditor oe) |
---|
632 | 860 | { |
---|
| 861 | + theFrame = this; |
---|
| 862 | + |
---|
633 | 863 | oe.SetupViews(); |
---|
634 | 864 | |
---|
635 | 865 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
638 | 868 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
639 | 869 | } |
---|
640 | 870 | |
---|
641 | | - JCheckBox liveCB; |
---|
642 | | - JCheckBox supportCB; |
---|
643 | | - JCheckBox localCB; |
---|
644 | | - JCheckBox crowdCB; |
---|
645 | | - JCheckBox smoothCB; |
---|
646 | | - JCheckBox fastCB; |
---|
647 | | - JCheckBox slowCB; |
---|
648 | | - JCheckBox boxCB; |
---|
649 | | - JCheckBox trackCB; |
---|
650 | | - JCheckBox smoothfocusCB; |
---|
| 871 | + cCheckBox liveCB; |
---|
| 872 | + cCheckBox supportCB; |
---|
| 873 | + cCheckBox localCB; |
---|
| 874 | + cCheckBox crowdCB; |
---|
| 875 | + cCheckBox smoothCB; |
---|
| 876 | + cCheckBox fastCB; |
---|
| 877 | + cCheckBox slowCB; |
---|
| 878 | + cCheckBox boxCB; |
---|
| 879 | + cCheckBox zoomBoxCB; |
---|
| 880 | + cCheckBox trackCB; |
---|
| 881 | + cCheckBox smoothfocusCB; |
---|
651 | 882 | // JCheckBox speakerMocapCB; |
---|
652 | | - JCheckBox speakerCameraCB; |
---|
653 | | - JCheckBox speakerFocusCB; |
---|
654 | | - JCheckBox debugCB; |
---|
655 | | - JCheckBox oeilCB; |
---|
656 | | - JCheckBox lookAtCB; |
---|
| 883 | + cCheckBox speakerCameraCB; |
---|
| 884 | + cCheckBox speakerFocusCB; |
---|
| 885 | + cCheckBox debugCB; |
---|
| 886 | + |
---|
| 887 | + cCheckBox oeilCB; |
---|
| 888 | + cCheckBox shadowCB; |
---|
| 889 | + cCheckBox autosaveCB; |
---|
| 890 | + cCheckBox lookAtCB; |
---|
657 | 891 | |
---|
658 | 892 | // static int COLOR = 1; |
---|
659 | 893 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
661 | 895 | |
---|
662 | 896 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
663 | 897 | |
---|
664 | | - JCheckBox colorCB; |
---|
665 | | - JCheckBox materialCB; |
---|
666 | | - JCheckBox textureCB; |
---|
| 898 | + cCheckBox colorCB; |
---|
| 899 | + cCheckBox materialCB; |
---|
| 900 | + cCheckBox textureCB; |
---|
667 | 901 | |
---|
668 | 902 | public void itemStateChanged(ItemEvent e) |
---|
669 | 903 | { |
---|
.. | .. |
---|
688 | 922 | dropAttributes |= Object3D.TEXTURE; |
---|
689 | 923 | else |
---|
690 | 924 | dropAttributes &= ~Object3D.TEXTURE; |
---|
691 | | - } |
---|
692 | | - else if(e.getSource() == liveCB) |
---|
| 925 | + } else if(e.getSource() == liveCB) |
---|
693 | 926 | { |
---|
694 | 927 | cameraView.ToggleLive(); |
---|
| 928 | + refreshContents(false); |
---|
695 | 929 | } |
---|
696 | 930 | else if(e.getSource() == supportCB) |
---|
697 | 931 | { |
---|
.. | .. |
---|
727 | 961 | cameraView.repaint(); |
---|
728 | 962 | // refreshContents(); |
---|
729 | 963 | } |
---|
| 964 | + else if(e.getSource() == zoomBoxCB) |
---|
| 965 | + { |
---|
| 966 | + cameraView.ToggleZoomBoxMode(); |
---|
| 967 | + } |
---|
730 | 968 | else if(e.getSource() == smoothfocusCB) |
---|
731 | 969 | { |
---|
732 | 970 | cameraView.ToggleSmoothFocus(); |
---|
.. | .. |
---|
751 | 989 | else if(e.getSource() == oeilCB) |
---|
752 | 990 | { |
---|
753 | 991 | cameraView.ToggleOeil(); |
---|
| 992 | + } |
---|
| 993 | + else if(e.getSource() == shadowCB) |
---|
| 994 | + { |
---|
| 995 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 996 | + } |
---|
| 997 | + else if(e.getSource() == autosaveCB) |
---|
| 998 | + { |
---|
| 999 | + Globals.SAVEONMAKE ^= true; |
---|
754 | 1000 | } |
---|
755 | 1001 | else if(e.getSource() == lookAtCB) |
---|
756 | 1002 | { |
---|
.. | .. |
---|
840 | 1086 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
841 | 1087 | // return; |
---|
842 | 1088 | // } |
---|
843 | | - if (string.charAt(0) == '/') |
---|
| 1089 | + |
---|
| 1090 | + // File path for Mac and Windows |
---|
| 1091 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
844 | 1092 | { |
---|
845 | 1093 | // file(s) |
---|
846 | 1094 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
867 | 1115 | |
---|
868 | 1116 | flashIt = false; |
---|
869 | 1117 | CameraPane pane = (CameraPane) target; |
---|
870 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1118 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
871 | 1119 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
872 | 1120 | |
---|
873 | 1121 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
894 | 1142 | { |
---|
895 | 1143 | loadClipboard(true); |
---|
896 | 1144 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
897 | | - pasteInto(false); |
---|
| 1145 | + pasteInto(false, false); |
---|
898 | 1146 | } else { |
---|
899 | 1147 | loadClipboard(false); |
---|
900 | 1148 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
901 | | - pasteInto(false); // true); // ??? |
---|
| 1149 | + pasteInto(false, false); // true); // ??? |
---|
902 | 1150 | } |
---|
903 | 1151 | } |
---|
904 | 1152 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1002 | 1250 | |
---|
1003 | 1251 | void buildCreateMenu(Menu menu) |
---|
1004 | 1252 | { |
---|
| 1253 | + //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
| 1254 | + //heightFieldItem.addActionListener(this); |
---|
1005 | 1255 | gridItem = menu.add(new MenuItem("Grid")); |
---|
1006 | 1256 | gridItem.addActionListener(this); |
---|
1007 | 1257 | rectoidItem = menu.add(new MenuItem("Box")); |
---|
.. | .. |
---|
1014 | 1264 | torusItem.addActionListener(this); |
---|
1015 | 1265 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1016 | 1266 | superItem.addActionListener(this); |
---|
| 1267 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1268 | + kleinItem.addActionListener(this); |
---|
1017 | 1269 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1018 | 1270 | particleItem.addActionListener(this); |
---|
| 1271 | + if (Globals.ADVANCED) |
---|
| 1272 | + { |
---|
1019 | 1273 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1020 | 1274 | ragdollItem.addActionListener(this); |
---|
1021 | 1275 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1022 | 1276 | ragdoll2Item.addActionListener(this); |
---|
| 1277 | + } |
---|
1023 | 1278 | menu.add("-"); |
---|
1024 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1279 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1025 | 1280 | meshItem.addActionListener(this); |
---|
1026 | 1281 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1027 | 1282 | // meshGroupItem.addActionListener(this); |
---|
| 1283 | + if (Globals.ADVANCED) |
---|
| 1284 | + { |
---|
1028 | 1285 | springItem = menu.add(new MenuItem("Spring")); |
---|
1029 | 1286 | springItem.addActionListener(this); |
---|
1030 | 1287 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1031 | 1288 | flagItem.addActionListener(this); |
---|
1032 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1033 | | - bezierItem.addActionListener(this); |
---|
1034 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1035 | | - checkerItem.addActionListener(this); |
---|
1036 | 1289 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1037 | 1290 | blobItem.addActionListener(this); |
---|
1038 | 1291 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1039 | 1292 | latheItem.addActionListener(this); |
---|
| 1293 | + } |
---|
| 1294 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1295 | + bezierItem.addActionListener(this); |
---|
| 1296 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1297 | + overlayItem.addActionListener(this); |
---|
1040 | 1298 | lightItem = menu.add(new MenuItem("Light")); |
---|
1041 | 1299 | lightItem.addActionListener(this); |
---|
1042 | 1300 | menu.add("-"); |
---|
.. | .. |
---|
1046 | 1304 | loopItem.addActionListener(this); |
---|
1047 | 1305 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1048 | 1306 | doubleItem.addActionListener(this); |
---|
| 1307 | + if (Globals.ADVANCED) |
---|
| 1308 | + { |
---|
1049 | 1309 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1050 | 1310 | tripleItem.addActionListener(this); |
---|
1051 | | - menu.add("-"); |
---|
1052 | | - importGFDItem = menu.add(new MenuItem("GraphreeD Object...")); |
---|
1053 | | - importGFDItem.addActionListener(this); |
---|
1054 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
1055 | | - importVRMLX3DItem.addActionListener(this); |
---|
1056 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
1057 | | - importOBJItem.addActionListener(this); |
---|
1058 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
1059 | | - import3DSItem.addActionListener(this); |
---|
| 1311 | + } |
---|
1060 | 1312 | } |
---|
1061 | 1313 | |
---|
1062 | 1314 | void buildToolsMenu(Menu menu) |
---|
1063 | 1315 | { |
---|
1064 | 1316 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1065 | 1317 | animationItem.addItemListener(this); |
---|
1066 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1318 | + animationItem.setState(Globals.ANIMATION); |
---|
1067 | 1319 | |
---|
1068 | 1320 | menu.add("-"); |
---|
1069 | 1321 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1070 | 1322 | parseverticesItem.addActionListener(this); |
---|
1071 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1323 | + textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
| 1324 | + textureFieldItem.addActionListener(this); |
---|
| 1325 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1072 | 1326 | alignItem.addActionListener(this); |
---|
1073 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1074 | | - mirrorItem.addActionListener(this); |
---|
1075 | 1327 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1076 | 1328 | reduceMorphItem.addActionListener(this); |
---|
1077 | 1329 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1078 | 1330 | reduce34MorphItem.addActionListener(this); |
---|
1079 | | - |
---|
| 1331 | + menu.add("-"); |
---|
1080 | 1332 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1081 | 1333 | computeAOItem.addActionListener(this); |
---|
1082 | | - menu.add("-"); |
---|
1083 | 1334 | |
---|
| 1335 | + if (Globals.ADVANCED) |
---|
| 1336 | + { |
---|
| 1337 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1338 | + mirrorItem.addActionListener(this); |
---|
| 1339 | + menu.add("-"); |
---|
1084 | 1340 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1085 | 1341 | memoryItem.addActionListener(this); |
---|
1086 | 1342 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1087 | 1343 | analyzeItem.addActionListener(this); |
---|
1088 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1344 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1089 | 1345 | dumpItem.addActionListener(this); |
---|
1090 | 1346 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1091 | 1347 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1094 | 1350 | resetParentItem.addActionListener(this); |
---|
1095 | 1351 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1096 | 1352 | repairParentItem.addActionListener(this); |
---|
| 1353 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1354 | + repairShadowItem.addActionListener(this); |
---|
1097 | 1355 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1098 | 1356 | invariantsItem.addActionListener(this); |
---|
1099 | 1357 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1101 | 1359 | menu.add("-"); |
---|
1102 | 1360 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1103 | 1361 | editScriptItem.addActionListener(this); |
---|
| 1362 | + } |
---|
1104 | 1363 | } |
---|
1105 | 1364 | |
---|
1106 | 1365 | void ScreenFit() |
---|
.. | .. |
---|
1223 | 1482 | shadow.material = new cMaterial(obj.material); |
---|
1224 | 1483 | shadow.material.diffuse = 0.0001f; |
---|
1225 | 1484 | shadow.material.specular = 0.0001f; |
---|
| 1485 | + //shadow.projectedVertices[1].x = 300; |
---|
1226 | 1486 | |
---|
1227 | 1487 | makeSomething(shadow); |
---|
1228 | 1488 | } |
---|
.. | .. |
---|
1429 | 1689 | |
---|
1430 | 1690 | void Overwrite(int mask) |
---|
1431 | 1691 | { |
---|
1432 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1692 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1433 | 1693 | { |
---|
1434 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1694 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1435 | 1695 | |
---|
1436 | 1696 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1437 | 1697 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1454 | 1714 | // |
---|
1455 | 1715 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1456 | 1716 | { |
---|
| 1717 | + Object source = event.getSource(); |
---|
1457 | 1718 | /* |
---|
1458 | 1719 | if (event.getSource() == nameField) |
---|
1459 | 1720 | { |
---|
.. | .. |
---|
1465 | 1726 | } |
---|
1466 | 1727 | else |
---|
1467 | 1728 | */ |
---|
1468 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1729 | + if (source == lookAtItem || source == lookFromItem) |
---|
1469 | 1730 | { |
---|
1470 | 1731 | ScreenFit(); |
---|
1471 | 1732 | } else |
---|
1472 | | - if (event.getSource() == switchItem) |
---|
| 1733 | + if (source == switchItem) |
---|
1473 | 1734 | { |
---|
1474 | 1735 | cVector v1 = new cVector(); |
---|
1475 | 1736 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1478 | 1739 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1479 | 1740 | objEditor.cameraView.repaint(); |
---|
1480 | 1741 | } else |
---|
1481 | | - if (event.getSource() == rectoidItem) |
---|
| 1742 | + if (source == rectoidItem) |
---|
1482 | 1743 | { |
---|
1483 | 1744 | makeSomething(new Box()); |
---|
1484 | 1745 | } else |
---|
1485 | | - if (event.getSource() == particleItem) |
---|
| 1746 | + if (source == particleItem) |
---|
1486 | 1747 | { |
---|
1487 | 1748 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1488 | 1749 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1503 | 1764 | applyExample(particleGeom, "SMOKE"); |
---|
1504 | 1765 | makeSomething(particleGeom); |
---|
1505 | 1766 | } else |
---|
1506 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1767 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1507 | 1768 | { |
---|
1508 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1769 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1509 | 1770 | |
---|
1510 | 1771 | ragdoll.toParent = LA.newMatrix(); |
---|
1511 | 1772 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1521 | 1782 | makeSomething(ragdoll); |
---|
1522 | 1783 | //makeSomething(new VehicleDemo()); |
---|
1523 | 1784 | } else |
---|
1524 | | - if (event.getSource() == gridItem) |
---|
| 1785 | + /* |
---|
| 1786 | + */ |
---|
| 1787 | + if (source == heightFieldItem) |
---|
| 1788 | + { |
---|
| 1789 | + Object3D obj = new Object3D(); |
---|
| 1790 | + |
---|
| 1791 | + obj.CreateMaterial(); |
---|
| 1792 | + obj.bRep = new BoundaryRep(); |
---|
| 1793 | + |
---|
| 1794 | + obj.bRep.CreateMesh(new iHeightField() |
---|
| 1795 | + { |
---|
| 1796 | + public double f(double x, double y) |
---|
| 1797 | + { |
---|
| 1798 | + // The Mandelbrot set is represented by coloring |
---|
| 1799 | + // each point (x,y) according to the number of |
---|
| 1800 | + // iterations it takes before the while loop in |
---|
| 1801 | + // this method ends. For points that are actually |
---|
| 1802 | + // in the Mandelbrot set, or very close to it, the |
---|
| 1803 | + // count will reach the maximum value, 80. These |
---|
| 1804 | + // points will be colored purple. All other colors |
---|
| 1805 | + // represent points that are definitely NOT in the set. |
---|
| 1806 | + x -= 600; |
---|
| 1807 | + y -= 500; |
---|
| 1808 | + x /= 200; |
---|
| 1809 | + y /= 200; |
---|
| 1810 | + int count = 0; |
---|
| 1811 | + double zx = x; |
---|
| 1812 | + double zy = y; |
---|
| 1813 | + while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) { |
---|
| 1814 | + double new_zx = zx*zx - zy*zy + x; |
---|
| 1815 | + zy = 2*zx*zy + y; |
---|
| 1816 | + zx = new_zx; |
---|
| 1817 | + count++; |
---|
| 1818 | + } |
---|
| 1819 | + return count; // Math.sqrt(count); |
---|
| 1820 | + } |
---|
| 1821 | + }, 1000,1000); |
---|
| 1822 | + |
---|
| 1823 | + makeSomething(obj); |
---|
| 1824 | + } else |
---|
| 1825 | + if (source == gridItem) |
---|
1525 | 1826 | { |
---|
1526 | 1827 | makeSomething(new Grid()); |
---|
1527 | 1828 | } else |
---|
1528 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1829 | + if (source == ellipsoidItem) |
---|
1529 | 1830 | { |
---|
1530 | 1831 | makeSomething(new Sphere()); |
---|
1531 | 1832 | } else |
---|
1532 | | - if (event.getSource() == coneItem) |
---|
| 1833 | + if (source == coneItem) |
---|
1533 | 1834 | { |
---|
1534 | 1835 | makeSomething(new Cone()); |
---|
1535 | 1836 | } else |
---|
1536 | | - if (event.getSource() == torusItem) |
---|
| 1837 | + if (source == torusItem) |
---|
1537 | 1838 | { |
---|
1538 | 1839 | makeSomething(new Torus()); |
---|
1539 | 1840 | } else |
---|
1540 | | - if (event.getSource() == superItem) |
---|
| 1841 | + if (source == superItem) |
---|
1541 | 1842 | { |
---|
1542 | 1843 | makeSomething(new Superellipsoid()); |
---|
1543 | 1844 | } else |
---|
1544 | | - if (event.getSource() == blobItem) |
---|
| 1845 | + if (source == kleinItem) |
---|
| 1846 | + { |
---|
| 1847 | + makeSomething(new Klein()); |
---|
| 1848 | + } else |
---|
| 1849 | + if (source == blobItem) |
---|
1545 | 1850 | { |
---|
1546 | 1851 | Blob blob = new Blob(); |
---|
1547 | 1852 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1549 | 1854 | //blob.retile(); |
---|
1550 | 1855 | makeSomething(blob); |
---|
1551 | 1856 | } else |
---|
1552 | | - if (event.getSource() == latheItem) |
---|
| 1857 | + if (source == latheItem) |
---|
1553 | 1858 | { |
---|
1554 | 1859 | makeSomething(new Lathe()); |
---|
1555 | 1860 | } else |
---|
1556 | | - if (event.getSource() == bezierItem) |
---|
| 1861 | + if (source == bezierItem) |
---|
1557 | 1862 | { |
---|
1558 | 1863 | makeSomething(new BezierSurface()); |
---|
1559 | 1864 | } else |
---|
1560 | | - if (event.getSource() == checkerItem) |
---|
| 1865 | + if (source == overlayItem) |
---|
1561 | 1866 | { |
---|
1562 | 1867 | /* |
---|
1563 | 1868 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1570 | 1875 | LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent); |
---|
1571 | 1876 | LA.matInvert(obj.toParent, obj.fromParent); |
---|
1572 | 1877 | */ |
---|
1573 | | - makeSomething(new CheckerIG()); |
---|
| 1878 | + makeSomething(new Checker()); |
---|
1574 | 1879 | } else |
---|
1575 | | - if (event.getSource() == meshItem) |
---|
| 1880 | + if (source == meshItem) |
---|
1576 | 1881 | { |
---|
1577 | 1882 | Object3D itemtomake = new Object3D(); |
---|
1578 | 1883 | Object3D child; |
---|
.. | .. |
---|
1593 | 1898 | makeSomething(child); |
---|
1594 | 1899 | } |
---|
1595 | 1900 | } else |
---|
1596 | | - if (event.getSource() == springItem) |
---|
| 1901 | + if (source == springItem) |
---|
1597 | 1902 | { |
---|
1598 | 1903 | cSpring s = new cSpring(); |
---|
1599 | 1904 | s.setup(); |
---|
1600 | 1905 | makeSomething(s); |
---|
1601 | 1906 | } else |
---|
1602 | | - if (event.getSource() == flagItem) |
---|
| 1907 | + if (source == flagItem) |
---|
1603 | 1908 | { |
---|
1604 | 1909 | cSpring s = new cFlag(); |
---|
1605 | 1910 | s.setup(); |
---|
1606 | 1911 | makeSomething(s); |
---|
1607 | 1912 | } else |
---|
1608 | | - if (event.getSource() == lightItem) |
---|
| 1913 | + if (source == lightItem) |
---|
1609 | 1914 | { |
---|
1610 | 1915 | makeSomething(new Light()); |
---|
1611 | 1916 | } else |
---|
1612 | | - if (event.getSource() == csgItem) |
---|
| 1917 | + if (source == csgItem) |
---|
1613 | 1918 | { |
---|
1614 | 1919 | group(new CSG()); |
---|
1615 | 1920 | } else |
---|
1616 | | - if (event.getSource() == templateItem) |
---|
| 1921 | + if (source == templateItem) |
---|
1617 | 1922 | { |
---|
1618 | 1923 | group(new cTemplate()); |
---|
1619 | 1924 | } else |
---|
1620 | | - if (event.getSource() == attributeItem) |
---|
| 1925 | + if (source == attributeItem) |
---|
1621 | 1926 | { |
---|
1622 | 1927 | makeSomething(new Attribute()); |
---|
1623 | 1928 | } else |
---|
1624 | | - if (event.getSource() == pointflowItem) |
---|
| 1929 | + if (source == pointflowItem) |
---|
1625 | 1930 | { |
---|
1626 | 1931 | makeSomething(new PointFlow()); |
---|
1627 | 1932 | } else |
---|
.. | .. |
---|
1633 | 1938 | } else |
---|
1634 | 1939 | */ |
---|
1635 | 1940 | |
---|
1636 | | - if (event.getSource() == superLoopItem) |
---|
| 1941 | + if (source == superLoopItem) |
---|
1637 | 1942 | { |
---|
1638 | 1943 | Composite g = new cGroup(); |
---|
1639 | 1944 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1655 | 1960 | |
---|
1656 | 1961 | group(g); |
---|
1657 | 1962 | } else |
---|
1658 | | - if (event.getSource() == loopItem) |
---|
| 1963 | + if (source == loopItem) |
---|
1659 | 1964 | { |
---|
1660 | 1965 | Composite csg = new GroupLeaf(); |
---|
1661 | 1966 | csg.count = 5; |
---|
.. | .. |
---|
1664 | 1969 | csg.addChild(child); |
---|
1665 | 1970 | child.addChild(csg); |
---|
1666 | 1971 | } else |
---|
1667 | | - if (event.getSource() == doubleItem) |
---|
| 1972 | + if (source == doubleItem) |
---|
1668 | 1973 | { |
---|
1669 | 1974 | Composite csg = new GroupLeaf(); |
---|
1670 | 1975 | csg.count = 5; |
---|
.. | .. |
---|
1676 | 1981 | csg.addChild(child); |
---|
1677 | 1982 | child.addChild(csg); |
---|
1678 | 1983 | } else |
---|
1679 | | - if (event.getSource() == tripleItem) |
---|
| 1984 | + if (source == tripleItem) |
---|
1680 | 1985 | { |
---|
1681 | 1986 | Composite csg = new GroupLeaf(); |
---|
1682 | 1987 | csg.count = 4; |
---|
.. | .. |
---|
1691 | 1996 | csg.addChild(child); |
---|
1692 | 1997 | child.addChild(csg); |
---|
1693 | 1998 | } else |
---|
1694 | | - |
---|
1695 | | - if (event.getSource() == importGFDItem) |
---|
| 1999 | + if (source == computeAOItem) |
---|
1696 | 2000 | { |
---|
1697 | | - ImportGFD(); |
---|
| 2001 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 2002 | + Globals.theRenderer.repaint(); |
---|
1698 | 2003 | } else |
---|
1699 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1700 | | - { |
---|
1701 | | - ImportVRMLX3D(); |
---|
1702 | | - } else |
---|
1703 | | - if (event.getSource() == import3DSItem) |
---|
1704 | | - { |
---|
1705 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1706 | | - } else |
---|
1707 | | - if (event.getSource() == importOBJItem) |
---|
1708 | | - { |
---|
1709 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1710 | | - } else |
---|
1711 | | - if (event.getSource() == computeAOItem) |
---|
1712 | | - { |
---|
1713 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1714 | | - CameraPane.theRenderer.repaint(); |
---|
1715 | | - } else |
---|
1716 | | - if (event.getSource() == recompileItem) |
---|
| 2004 | + if (source == recompileItem) |
---|
1717 | 2005 | { |
---|
1718 | 2006 | Recompile(); |
---|
1719 | 2007 | refreshContents(); |
---|
1720 | 2008 | } else |
---|
1721 | | - if (event.getSource() == editScriptItem) |
---|
| 2009 | + if (source == editScriptItem) |
---|
1722 | 2010 | { |
---|
1723 | 2011 | OpenDialog(); |
---|
1724 | 2012 | refreshContents(); |
---|
1725 | 2013 | } else |
---|
1726 | | - if (event.getSource() == invariantsItem) |
---|
| 2014 | + if (source == invariantsItem) |
---|
1727 | 2015 | { |
---|
1728 | 2016 | System.out.println("Invariants:"); |
---|
1729 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 2017 | + Grafreed.grafreeD.universe.invariants(); |
---|
1730 | 2018 | } else |
---|
1731 | | - if (event.getSource() == memoryItem) |
---|
| 2019 | + if (source == memoryItem) |
---|
1732 | 2020 | { |
---|
1733 | 2021 | //System.out.println("Invariants:"); |
---|
1734 | 2022 | PrintMemory(); |
---|
1735 | 2023 | } else |
---|
1736 | | - if (event.getSource() == pathItem) |
---|
| 2024 | + if (source == pathItem) |
---|
1737 | 2025 | { |
---|
1738 | 2026 | PrintPath(); |
---|
1739 | 2027 | } else |
---|
1740 | | - if (event.getSource() == analyzeItem) |
---|
| 2028 | + if (source == analyzeItem) |
---|
1741 | 2029 | { |
---|
1742 | 2030 | AnalyzeObject(); |
---|
1743 | 2031 | } else |
---|
1744 | | - if (event.getSource() == dumpItem) |
---|
| 2032 | + if (source == dumpItem) |
---|
1745 | 2033 | { |
---|
1746 | 2034 | DumpObject(); |
---|
1747 | 2035 | } else |
---|
1748 | | - if (event.getSource() == screenfitButton) |
---|
| 2036 | + if (source == minButton) |
---|
| 2037 | + { |
---|
| 2038 | + Minimize(); |
---|
| 2039 | + } else |
---|
| 2040 | + if (source == maxButton) |
---|
| 2041 | + { |
---|
| 2042 | + Maximize(); |
---|
| 2043 | + } else |
---|
| 2044 | + if (source == fullButton) |
---|
| 2045 | + { |
---|
| 2046 | + ToggleFullScreen(); |
---|
| 2047 | + } else |
---|
| 2048 | + if (source == undoButton) |
---|
| 2049 | + { |
---|
| 2050 | + Undo(); |
---|
| 2051 | + } else |
---|
| 2052 | + if (source == redoButton) |
---|
| 2053 | + { |
---|
| 2054 | + Redo(); |
---|
| 2055 | + } else |
---|
| 2056 | + if (source == saveButton) |
---|
| 2057 | + { |
---|
| 2058 | + Save(); |
---|
| 2059 | + } else |
---|
| 2060 | + if (source == oneStepButton) |
---|
| 2061 | + { |
---|
| 2062 | + Globals.ONESTEP = true; |
---|
| 2063 | + cameraView.repaint(); |
---|
| 2064 | + } else |
---|
| 2065 | + if (source == screenfitButton) |
---|
1749 | 2066 | { |
---|
1750 | 2067 | //Reload(lastConverter, lastFilename, true); |
---|
1751 | 2068 | ScreenFit(); |
---|
1752 | 2069 | } else |
---|
1753 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2070 | + if (source == screenfitpointButton) |
---|
1754 | 2071 | { |
---|
1755 | 2072 | //Reload(lastConverter, lastFilename, true); |
---|
1756 | 2073 | ScreenFitPoint(); |
---|
1757 | 2074 | } else |
---|
1758 | | - if (event.getSource() == snapobjectButton) |
---|
| 2075 | + if (source == snapobjectButton) |
---|
1759 | 2076 | { |
---|
1760 | 2077 | //Reload(lastConverter, lastFilename, true); |
---|
1761 | 2078 | SnapObject(); |
---|
.. | .. |
---|
1766 | 2083 | // Recompile(); |
---|
1767 | 2084 | // refreshContents(); |
---|
1768 | 2085 | // } else |
---|
1769 | | - if (event.getSource() == gcButton) |
---|
| 2086 | + if (source == gcButton) |
---|
1770 | 2087 | { |
---|
1771 | 2088 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1772 | 2089 | System.gc(); |
---|
1773 | 2090 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1774 | 2091 | } else |
---|
1775 | | - if (event.getSource() == editLeafItem) |
---|
| 2092 | + if (source == editLeafItem) |
---|
1776 | 2093 | { |
---|
1777 | 2094 | Object3D obj; |
---|
1778 | 2095 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1786 | 2103 | } |
---|
1787 | 2104 | refreshContents(true); |
---|
1788 | 2105 | } else |
---|
1789 | | - if (event.getSource() == openWindowItem) |
---|
| 2106 | + if (source == openWindowItem) |
---|
1790 | 2107 | { |
---|
1791 | 2108 | EditSelection(true); |
---|
1792 | 2109 | } else |
---|
1793 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2110 | + if (source == cutItem || source == clearButton) |
---|
1794 | 2111 | { |
---|
1795 | 2112 | loadClipboard(true); |
---|
1796 | 2113 | } else |
---|
1797 | | - if (event.getSource() == duplicateItem) |
---|
| 2114 | + if (source == undoItem) |
---|
1798 | 2115 | { |
---|
1799 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 2116 | + Undo(); |
---|
| 2117 | + } else |
---|
| 2118 | + if (source == redoItem) |
---|
| 2119 | + { |
---|
| 2120 | + Redo(); |
---|
| 2121 | + } else |
---|
| 2122 | + if (source == duplicateItem) |
---|
| 2123 | + { |
---|
| 2124 | + Object3D keep = Grafreed.clipboard; |
---|
1800 | 2125 | loadClipboard(false); |
---|
1801 | 2126 | paste(false); |
---|
1802 | | - GraphreeD.clipboard = keep; |
---|
| 2127 | + Grafreed.clipboard = keep; |
---|
1803 | 2128 | } else |
---|
1804 | | - if (event.getSource() == cloneItem) |
---|
| 2129 | + if (source == cloneItem) |
---|
1805 | 2130 | { |
---|
1806 | 2131 | CloneSelection(false); |
---|
1807 | 2132 | } else |
---|
1808 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2133 | + if (source == cloneSupportItem) |
---|
1809 | 2134 | { |
---|
1810 | 2135 | CloneSelection(true); |
---|
1811 | 2136 | } else |
---|
1812 | | - if (event.getSource() == copyItem) |
---|
| 2137 | + if (source == copyItem) |
---|
1813 | 2138 | { |
---|
1814 | 2139 | loadClipboard(false); |
---|
1815 | 2140 | } else |
---|
1816 | | - if (event.getSource() == pasteItem) |
---|
| 2141 | + if (source == pasteItem) |
---|
1817 | 2142 | { |
---|
1818 | 2143 | paste(false); |
---|
1819 | 2144 | } else |
---|
1820 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2145 | + if (source == pasteIntoItem) |
---|
1821 | 2146 | { |
---|
1822 | | - pasteInto(false); |
---|
| 2147 | + pasteInto(true, false); |
---|
1823 | 2148 | } else |
---|
1824 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2149 | + if (source == pasteLinkItem) |
---|
1825 | 2150 | { |
---|
1826 | | - pasteInto(true); |
---|
| 2151 | + pasteInto(false, false); |
---|
1827 | 2152 | } else |
---|
1828 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2153 | + if (source == pasteCloneItem) |
---|
| 2154 | + { |
---|
| 2155 | + pasteInto(true, true); |
---|
| 2156 | + } else |
---|
| 2157 | + if (source == pasteExpandItem) |
---|
1829 | 2158 | { |
---|
1830 | 2159 | paste(true); |
---|
1831 | 2160 | } else |
---|
1832 | | - if (event.getSource() == synchronizeItem) |
---|
| 2161 | + if (source == synchronizeItem) |
---|
1833 | 2162 | { |
---|
1834 | 2163 | Overwrite(Object3D.TRANSFORM); |
---|
1835 | 2164 | } else |
---|
1836 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2165 | + if (source == overwriteNameItem) |
---|
1837 | 2166 | { |
---|
1838 | 2167 | Overwrite(Object3D.NAME); |
---|
1839 | 2168 | } else |
---|
1840 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2169 | + if (source == overwriteUVItem) |
---|
1841 | 2170 | { |
---|
1842 | 2171 | Overwrite(Object3D.UV); |
---|
1843 | 2172 | } else |
---|
1844 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2173 | + if (source == overwriteMatItem) |
---|
1845 | 2174 | { |
---|
| 2175 | + /* july 2015 |
---|
1846 | 2176 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1847 | | - Overwrite(Object3D.MATERIAL); |
---|
| 2177 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1848 | 2178 | else |
---|
1849 | 2179 | { |
---|
1850 | 2180 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1856 | 2186 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1857 | 2187 | } |
---|
1858 | 2188 | } |
---|
| 2189 | + */ |
---|
| 2190 | + |
---|
| 2191 | + Overwrite(dropAttributes); |
---|
1859 | 2192 | } |
---|
1860 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2193 | + if (source == overwriteGeoItem) |
---|
1861 | 2194 | { |
---|
1862 | 2195 | Overwrite(Object3D.GEOMETRY); |
---|
1863 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2196 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1864 | 2197 | // { |
---|
1865 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2198 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1866 | 2199 | // |
---|
1867 | 2200 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1868 | 2201 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1874 | 2207 | // refreshContents(); |
---|
1875 | 2208 | // } |
---|
1876 | 2209 | } else |
---|
1877 | | - if (event.getSource() == generateMeshItem) |
---|
| 2210 | + if (source == generateMeshItem) |
---|
1878 | 2211 | { |
---|
1879 | 2212 | //if (group.selection.size() == 1) |
---|
1880 | 2213 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1885 | 2218 | ResetModel(); |
---|
1886 | 2219 | refreshContents(); |
---|
1887 | 2220 | } else |
---|
1888 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2221 | + if (source == extractGeometriesItem) |
---|
1889 | 2222 | { |
---|
1890 | 2223 | boolean one = false; |
---|
1891 | 2224 | |
---|
.. | .. |
---|
1912 | 2245 | ResetModel(); |
---|
1913 | 2246 | refreshContents(); |
---|
1914 | 2247 | } else |
---|
1915 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2248 | + if (source == cloneGeometriesItem) |
---|
1916 | 2249 | { |
---|
1917 | 2250 | boolean one = false; |
---|
1918 | 2251 | |
---|
.. | .. |
---|
1938 | 2271 | ResetModel(); |
---|
1939 | 2272 | refreshContents(); |
---|
1940 | 2273 | } else |
---|
1941 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2274 | + if (source == shareGeometriesItem) |
---|
1942 | 2275 | { |
---|
1943 | 2276 | boolean one = false; |
---|
1944 | 2277 | |
---|
1945 | 2278 | if (group.selection.size() == 1) |
---|
1946 | 2279 | one = true; |
---|
1947 | 2280 | |
---|
| 2281 | + Object3D merge = null; |
---|
| 2282 | + |
---|
1948 | 2283 | Object3D content = new cGroup(); |
---|
1949 | 2284 | |
---|
1950 | 2285 | for (int i=0; i<group.selection.size(); i++) |
---|
1951 | 2286 | { |
---|
1952 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2287 | + merge = new Merge(group.selection.get(i)); |
---|
1953 | 2288 | |
---|
1954 | 2289 | if (one) |
---|
1955 | | - makeSomething(sel, false); |
---|
| 2290 | + makeSomething(merge, false); |
---|
1956 | 2291 | else |
---|
1957 | | - content.addChild(sel); |
---|
| 2292 | + content.addChild(merge); |
---|
1958 | 2293 | } |
---|
1959 | 2294 | |
---|
1960 | 2295 | if (!one) |
---|
1961 | | - makeSomething(content, false); |
---|
1962 | | - |
---|
1963 | | - ResetModel(); |
---|
1964 | | - refreshContents(); |
---|
| 2296 | + makeSomething(content, true); |
---|
| 2297 | + else |
---|
| 2298 | + { |
---|
| 2299 | + ResetModel(); |
---|
| 2300 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2301 | + refreshContents(); |
---|
| 2302 | + } |
---|
1965 | 2303 | } else |
---|
1966 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2304 | + if (source == mergeGeometriesItem) |
---|
1967 | 2305 | { |
---|
1968 | 2306 | boolean one = false; |
---|
1969 | 2307 | |
---|
.. | .. |
---|
1993 | 2331 | ResetModel(); |
---|
1994 | 2332 | refreshContents(); |
---|
1995 | 2333 | } else |
---|
1996 | | - if (event.getSource() == linkverticesItem) |
---|
| 2334 | + if (source == linkverticesItem) |
---|
1997 | 2335 | { |
---|
1998 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2336 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
1999 | 2337 | // { |
---|
2000 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2338 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2001 | 2339 | // |
---|
2002 | 2340 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2003 | 2341 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2006 | 2344 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2007 | 2345 | // refreshContents(); |
---|
2008 | 2346 | // } |
---|
2009 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2347 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2010 | 2348 | { |
---|
2011 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2349 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2012 | 2350 | |
---|
2013 | 2351 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2014 | 2352 | content = ((cGroup)content).get(0); |
---|
2015 | 2353 | |
---|
2016 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2354 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2017 | 2355 | for (int i=0; i<group.selection.size(); i++) |
---|
2018 | 2356 | { |
---|
2019 | | - boolean random = CameraPane.RANDOM; |
---|
2020 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2357 | + boolean random = CameraPane.SWITCH; |
---|
| 2358 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2021 | 2359 | group.selection.get(i).linkVerticesThis(content); |
---|
2022 | 2360 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2023 | | - CameraPane.RANDOM = random; |
---|
| 2361 | + CameraPane.SWITCH = random; |
---|
2024 | 2362 | } |
---|
2025 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2363 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2026 | 2364 | refreshContents(); |
---|
2027 | 2365 | } |
---|
2028 | 2366 | } else |
---|
2029 | | - if (event.getSource() == resetsupportItem) |
---|
| 2367 | + if (source == resetsupportItem) |
---|
2030 | 2368 | { |
---|
2031 | 2369 | for (int i=0; i<group.selection.size(); i++) |
---|
2032 | 2370 | { |
---|
2033 | | - boolean random = CameraPane.RANDOM; |
---|
2034 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2371 | + boolean random = CameraPane.SWITCH; |
---|
| 2372 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2035 | 2373 | group.selection.get(i).linkVerticesThis(null); |
---|
2036 | | - CameraPane.RANDOM = random; |
---|
| 2374 | + CameraPane.SWITCH = random; |
---|
2037 | 2375 | } |
---|
2038 | 2376 | |
---|
2039 | 2377 | refreshContents(); |
---|
2040 | 2378 | } else |
---|
2041 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2379 | + if (source == relinkverticesItem) |
---|
| 2380 | + { |
---|
| 2381 | + boolean random = CameraPane.SWITCH; |
---|
| 2382 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2383 | + group.selection.RelinkToSupport(); |
---|
| 2384 | + CameraPane.SWITCH = random; |
---|
| 2385 | + |
---|
| 2386 | + refreshContents(); |
---|
| 2387 | + } else |
---|
| 2388 | + if (source == resetreferencesItem) |
---|
2042 | 2389 | { |
---|
2043 | 2390 | for (int i=0; i<group.selection.size(); i++) |
---|
2044 | 2391 | { |
---|
.. | .. |
---|
2047 | 2394 | |
---|
2048 | 2395 | refreshContents(); |
---|
2049 | 2396 | } else |
---|
2050 | | - if (event.getSource() == setMasterItem) |
---|
| 2397 | + if (source == setMasterItem) |
---|
2051 | 2398 | { |
---|
2052 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2399 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2053 | 2400 | { |
---|
2054 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2401 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2055 | 2402 | |
---|
2056 | 2403 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2057 | 2404 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2060 | 2407 | refreshContents(); |
---|
2061 | 2408 | } |
---|
2062 | 2409 | } else |
---|
2063 | | - if (event.getSource() == poseMeshItem) |
---|
| 2410 | + if (source == poseMeshItem) |
---|
2064 | 2411 | { |
---|
2065 | 2412 | if (group.selection.size() == 1) |
---|
2066 | 2413 | { |
---|
2067 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2414 | + if (Grafreed.clipboard.size() == 1) |
---|
2068 | 2415 | { |
---|
2069 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2416 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2070 | 2417 | |
---|
2071 | 2418 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2072 | 2419 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2079 | 2426 | } |
---|
2080 | 2427 | |
---|
2081 | 2428 | } else |
---|
2082 | | - if (event.getSource() == revertMeshItem) |
---|
| 2429 | + if (source == revertMeshItem) |
---|
2083 | 2430 | { |
---|
2084 | 2431 | RevertMeshes(); |
---|
2085 | 2432 | } else |
---|
2086 | | - if (event.getSource() == resetMeshItem) |
---|
| 2433 | + if (source == resetAllItem) |
---|
2087 | 2434 | { |
---|
2088 | 2435 | ResetAll(); |
---|
2089 | 2436 | } else |
---|
2090 | | - if (event.getSource() == stepAllItem) |
---|
| 2437 | + if (source == stepAllItem) |
---|
2091 | 2438 | { |
---|
2092 | 2439 | StepAll(); |
---|
2093 | 2440 | } else |
---|
2094 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2441 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2095 | 2442 | { |
---|
2096 | 2443 | //int indices[] = jList.getSelectedIndices(); |
---|
2097 | 2444 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2099 | 2446 | |
---|
2100 | 2447 | ClearSelection(false); |
---|
2101 | 2448 | } else |
---|
2102 | | - if (event.getSource() == clearAllItem) |
---|
| 2449 | + if (source == clearAllItem) |
---|
2103 | 2450 | { |
---|
2104 | 2451 | ClearSelection(true); |
---|
2105 | 2452 | } else |
---|
2106 | | - if (event.getSource() == grabItem) |
---|
| 2453 | + if (source == grabItem) |
---|
2107 | 2454 | { |
---|
2108 | 2455 | group(new cGroup(), true); |
---|
2109 | 2456 | } else |
---|
2110 | | - if (event.getSource() == frontItem) |
---|
| 2457 | + if (source == hideItem) |
---|
| 2458 | + { |
---|
| 2459 | + group(new HiddenObject()); |
---|
| 2460 | + } else |
---|
| 2461 | + if (source == frontItem) |
---|
2111 | 2462 | { |
---|
2112 | 2463 | front(); |
---|
2113 | 2464 | } else |
---|
2114 | | - if (event.getSource() == backItem) |
---|
| 2465 | + if (source == backItem) |
---|
2115 | 2466 | { |
---|
2116 | 2467 | back(); |
---|
2117 | 2468 | } else |
---|
2118 | | - if (event.getSource() == cameraItem) |
---|
| 2469 | + if (source == cameraItem) |
---|
2119 | 2470 | { |
---|
2120 | 2471 | makeSomething(new Camera()); |
---|
2121 | 2472 | } else |
---|
2122 | | - if (event.getSource() == compositeItem) |
---|
| 2473 | + if (source == compositeItem) |
---|
2123 | 2474 | { |
---|
2124 | 2475 | group(new Composite()); |
---|
2125 | 2476 | } else |
---|
2126 | | - if (event.getSource() == randomItem) |
---|
| 2477 | + if (source == randomItem) |
---|
2127 | 2478 | { |
---|
2128 | 2479 | RandomNode random = new RandomNode(); |
---|
2129 | 2480 | group(random); |
---|
2130 | 2481 | if (random.size() > 0) |
---|
2131 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2482 | + random.name = random.get(0).name + "Switch"; |
---|
2132 | 2483 | } else |
---|
2133 | | - if (event.getSource() == physicsItem) |
---|
| 2484 | + if (source == physicsItem) |
---|
2134 | 2485 | { |
---|
2135 | 2486 | group(new PhysicsNode()); |
---|
2136 | 2487 | } else |
---|
2137 | | - if (event.getSource() == frameselectorItem) |
---|
| 2488 | + if (source == frameselectorItem) |
---|
2138 | 2489 | { |
---|
2139 | 2490 | for (int i=0; i<group.selection.size(); i++) |
---|
2140 | 2491 | { |
---|
.. | .. |
---|
2146 | 2497 | ResetModel(); |
---|
2147 | 2498 | refreshContents(); |
---|
2148 | 2499 | } else |
---|
2149 | | - if (event.getSource() == switchGeoItem) |
---|
| 2500 | + if (source == switchGeoItem) |
---|
2150 | 2501 | { |
---|
2151 | 2502 | for (int i=0; i<group.selection.size(); i++) |
---|
2152 | 2503 | { |
---|
.. | .. |
---|
2158 | 2509 | ResetModel(); |
---|
2159 | 2510 | refreshContents(); |
---|
2160 | 2511 | } else |
---|
2161 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2512 | + if (source == switchTransfoItem) |
---|
2162 | 2513 | { |
---|
2163 | 2514 | for (int i=0; i<group.selection.size(); i++) |
---|
2164 | 2515 | { |
---|
.. | .. |
---|
2170 | 2521 | ResetModel(); |
---|
2171 | 2522 | refreshContents(); |
---|
2172 | 2523 | } else |
---|
2173 | | - if (event.getSource() == morphItem) |
---|
| 2524 | + if (source == morphItem) |
---|
2174 | 2525 | { |
---|
2175 | 2526 | for (int i=0; i<group.selection.size(); i++) |
---|
2176 | 2527 | { |
---|
.. | .. |
---|
2182 | 2533 | ResetModel(); |
---|
2183 | 2534 | refreshContents(); |
---|
2184 | 2535 | } else |
---|
2185 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2536 | + if (source == scriptNodeItem) |
---|
2186 | 2537 | { |
---|
2187 | 2538 | boolean atleastone = false; |
---|
2188 | 2539 | |
---|
.. | .. |
---|
2221 | 2572 | } |
---|
2222 | 2573 | } |
---|
2223 | 2574 | } else |
---|
2224 | | - if (event.getSource() == linkerItem) |
---|
| 2575 | + if (source == linkerItem) |
---|
2225 | 2576 | { |
---|
2226 | 2577 | group(new cLinker()); |
---|
2227 | 2578 | } else |
---|
2228 | | - if (event.getSource() == textureItem) |
---|
| 2579 | + if (source == textureItem) |
---|
2229 | 2580 | { |
---|
2230 | 2581 | group(new TextureNode()); |
---|
2231 | 2582 | } else |
---|
2232 | | - if (event.getSource() == shadowXItem) |
---|
| 2583 | + if (source == billboardItem) |
---|
| 2584 | + { |
---|
| 2585 | + group(new BillboardNode()); |
---|
| 2586 | + } else |
---|
| 2587 | + if (source == shadowXItem) |
---|
2233 | 2588 | { |
---|
2234 | 2589 | CastShadow(0); |
---|
2235 | 2590 | } else |
---|
2236 | | - if (event.getSource() == shadowYItem) |
---|
| 2591 | + if (source == shadowYItem) |
---|
2237 | 2592 | { |
---|
2238 | 2593 | CastShadow(1); |
---|
2239 | 2594 | } else |
---|
2240 | | - if (event.getSource() == shadowZItem) |
---|
| 2595 | + if (source == shadowZItem) |
---|
2241 | 2596 | { |
---|
2242 | 2597 | CastShadow(2); |
---|
2243 | 2598 | } else |
---|
2244 | | - if (event.getSource() == ungroupItem) |
---|
| 2599 | + if (source == ungroupItem) |
---|
2245 | 2600 | { |
---|
2246 | | - ungroup(); |
---|
| 2601 | + //ungroup(); |
---|
| 2602 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2603 | + { |
---|
| 2604 | + Ungroup(group.selection.get(i)); |
---|
| 2605 | + } |
---|
| 2606 | + |
---|
| 2607 | + ClearSelection(false); |
---|
| 2608 | + |
---|
| 2609 | + refreshContents(); |
---|
2247 | 2610 | } else |
---|
2248 | | - if (event.getSource() == genUVItem) |
---|
| 2611 | + if (source == genUVItem) |
---|
2249 | 2612 | { |
---|
2250 | 2613 | GenUV(); |
---|
2251 | 2614 | } else |
---|
2252 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2615 | + if (source == genNormalsCADItem) |
---|
2253 | 2616 | { |
---|
2254 | 2617 | GenNormals(true); |
---|
2255 | 2618 | } else |
---|
2256 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2619 | + if (source == genNormalsMESHItem) |
---|
| 2620 | + { |
---|
| 2621 | + GenNormalsMESH(); |
---|
| 2622 | + } else |
---|
| 2623 | + if (source == genNormalsORGANItem) |
---|
2257 | 2624 | { |
---|
2258 | 2625 | GenNormals(false); |
---|
2259 | 2626 | } else |
---|
2260 | | - if (event.getSource() == stripifyItem) |
---|
| 2627 | + if (source == genNormalsMINEItem) |
---|
| 2628 | + { |
---|
| 2629 | + GenNormalsMINE(); |
---|
| 2630 | + } else |
---|
| 2631 | + if (source == stripifyItem) |
---|
2261 | 2632 | { |
---|
2262 | 2633 | Stripify(); |
---|
2263 | 2634 | } else |
---|
2264 | | - if (event.getSource() == unstripifyItem) |
---|
| 2635 | + if (source == unstripifyItem) |
---|
2265 | 2636 | { |
---|
2266 | 2637 | Unstripify(); |
---|
2267 | 2638 | } else |
---|
2268 | | - if (event.getSource() == trimItem) |
---|
| 2639 | + if (source == trimItem) |
---|
2269 | 2640 | { |
---|
2270 | 2641 | Trim(); |
---|
2271 | 2642 | } else |
---|
2272 | | - if (event.getSource() == untrimItem) |
---|
| 2643 | + if (source == untrimItem) |
---|
2273 | 2644 | { |
---|
2274 | 2645 | Untrim(); |
---|
2275 | 2646 | } else |
---|
2276 | | - if (event.getSource() == clearColorsItem) |
---|
| 2647 | + if (source == clearColorsItem) |
---|
2277 | 2648 | { |
---|
2278 | 2649 | ClearColors(); |
---|
2279 | 2650 | } else |
---|
2280 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2651 | + if (source == clearMaterialsItem) |
---|
2281 | 2652 | { |
---|
2282 | 2653 | ClearMaterials(); |
---|
2283 | 2654 | } else |
---|
2284 | | - if (event.getSource() == liveleavesItem) |
---|
| 2655 | + if (source == liveleavesItem) |
---|
2285 | 2656 | { |
---|
2286 | 2657 | LiveLeaves(true); |
---|
2287 | 2658 | } else |
---|
2288 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2659 | + if (source == unliveleavesItem) |
---|
2289 | 2660 | { |
---|
2290 | 2661 | LiveLeaves(false); |
---|
2291 | 2662 | } else |
---|
2292 | | - if (event.getSource() == supportleavesItem) |
---|
| 2663 | + if (source == supportleavesItem) |
---|
2293 | 2664 | { |
---|
2294 | 2665 | SupportLeaves(true); |
---|
2295 | 2666 | } else |
---|
2296 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2667 | + if (source == unsupportleavesItem) |
---|
2297 | 2668 | { |
---|
2298 | 2669 | SupportLeaves(false); |
---|
2299 | 2670 | } else |
---|
2300 | | - if (event.getSource() == hideleavesItem) |
---|
| 2671 | + if (source == hideleavesItem) |
---|
2301 | 2672 | { |
---|
2302 | 2673 | HideLeaves(true); |
---|
2303 | 2674 | } else |
---|
2304 | | - if (event.getSource() == showleavesItem) |
---|
| 2675 | + if (source == showleavesItem) |
---|
2305 | 2676 | { |
---|
2306 | 2677 | HideLeaves(false); |
---|
2307 | 2678 | } else |
---|
2308 | | - if (event.getSource() == markleavesItem) |
---|
| 2679 | + if (source == markleavesItem) |
---|
2309 | 2680 | { |
---|
2310 | 2681 | MarkLeaves(true); |
---|
2311 | 2682 | } else |
---|
2312 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2683 | + if (source == unmarkleavesItem) |
---|
2313 | 2684 | { |
---|
2314 | 2685 | MarkLeaves(false); |
---|
2315 | 2686 | } else |
---|
2316 | | - if (event.getSource() == flipVItem) |
---|
| 2687 | + if (source == rewindleavesItem) |
---|
| 2688 | + { |
---|
| 2689 | + RewindLeaves(true); |
---|
| 2690 | + } else |
---|
| 2691 | + if (source == unrewindleavesItem) |
---|
| 2692 | + { |
---|
| 2693 | + RewindLeaves(false); |
---|
| 2694 | + } else |
---|
| 2695 | + if (source == randomleavesItem) |
---|
| 2696 | + { |
---|
| 2697 | + RandomLeaves(true); |
---|
| 2698 | + } else |
---|
| 2699 | + if (source == unrandomleavesItem) |
---|
| 2700 | + { |
---|
| 2701 | + RandomLeaves(false); |
---|
| 2702 | + } else |
---|
| 2703 | + if (source == flipVItem) |
---|
2317 | 2704 | { |
---|
2318 | 2705 | FlipV(true); |
---|
2319 | 2706 | } else |
---|
2320 | | - if (event.getSource() == unflipVItem) |
---|
| 2707 | + if (source == unflipVItem) |
---|
2321 | 2708 | { |
---|
2322 | 2709 | FlipV(false); |
---|
2323 | 2710 | } else |
---|
2324 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2711 | + if (source == lowTexturesItem) |
---|
2325 | 2712 | { |
---|
2326 | 2713 | SetTexRes(0); |
---|
2327 | 2714 | } else |
---|
2328 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2715 | + if (source == normalTexturesItem) |
---|
2329 | 2716 | { |
---|
2330 | 2717 | SetTexRes(1); |
---|
2331 | 2718 | } else |
---|
2332 | | - if (event.getSource() == highTexturesItem) |
---|
| 2719 | + if (source == highTexturesItem) |
---|
2333 | 2720 | { |
---|
2334 | 2721 | SetTexRes(2); |
---|
2335 | 2722 | } else |
---|
2336 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2723 | + if (source == veryhighTexturesItem) |
---|
2337 | 2724 | { |
---|
2338 | 2725 | SetTexRes(3); |
---|
2339 | 2726 | } else |
---|
2340 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2727 | + if (source == maxTexturesItem) |
---|
2341 | 2728 | { |
---|
2342 | 2729 | SetTexRes(4); |
---|
2343 | 2730 | } else |
---|
2344 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2731 | + if (source == panoTexturesItem) |
---|
2345 | 2732 | { |
---|
2346 | 2733 | SetTexRes(5); |
---|
2347 | 2734 | } else |
---|
2348 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2735 | + if (source == reverseNormalsItem) |
---|
2349 | 2736 | { |
---|
2350 | 2737 | ReverseNormals(); |
---|
2351 | 2738 | } else |
---|
2352 | | - if (event.getSource() == parseverticesItem) |
---|
| 2739 | + if (source == parseverticesItem) |
---|
2353 | 2740 | { |
---|
2354 | 2741 | ParseVertices(); |
---|
2355 | 2742 | } else |
---|
2356 | | - if (event.getSource() == alignItem) |
---|
| 2743 | + if (source == textureFieldItem) |
---|
| 2744 | + { |
---|
| 2745 | + TextureVertices(); |
---|
| 2746 | + } else |
---|
| 2747 | + if (source == alignItem) |
---|
2357 | 2748 | { |
---|
2358 | 2749 | Align(); |
---|
2359 | 2750 | } else |
---|
2360 | | - if (event.getSource() == mirrorItem) |
---|
| 2751 | + if (source == mirrorItem) |
---|
2361 | 2752 | { |
---|
2362 | 2753 | MirrorPoses(); |
---|
2363 | 2754 | } else |
---|
2364 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2755 | + if (source == reduceMorphItem) |
---|
2365 | 2756 | { |
---|
2366 | 2757 | MeshReduction(false); |
---|
2367 | 2758 | } else |
---|
2368 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2759 | + if (source == reduce34MorphItem) |
---|
2369 | 2760 | { |
---|
2370 | 2761 | MeshReduction(true); |
---|
2371 | 2762 | } else |
---|
2372 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2763 | + if (source == reverseTrianglesItem) |
---|
2373 | 2764 | { |
---|
2374 | 2765 | ReverseTriangles(); |
---|
2375 | 2766 | } else |
---|
2376 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2767 | + if (source == reduceMeshItem) |
---|
2377 | 2768 | { |
---|
2378 | 2769 | ReduceMesh(false); |
---|
2379 | 2770 | } else |
---|
2380 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2771 | + if (source == reduce34MeshItem) |
---|
2381 | 2772 | { |
---|
2382 | 2773 | ReduceMesh(true); |
---|
2383 | 2774 | } else |
---|
2384 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2775 | + if (source == increaseMeshItem) |
---|
2385 | 2776 | { |
---|
2386 | 2777 | IncreaseMesh(); |
---|
2387 | 2778 | } else |
---|
2388 | | - if (event.getSource() == clipMeshItem) |
---|
| 2779 | + if (source == clipMeshItem) |
---|
2389 | 2780 | { |
---|
2390 | 2781 | ClipMesh(); |
---|
2391 | 2782 | } else |
---|
2392 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2783 | + if (source == smoothMeshItem) |
---|
2393 | 2784 | { |
---|
2394 | 2785 | SmoothMesh(); |
---|
2395 | 2786 | } else |
---|
2396 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2787 | + if (source == transformGeometryItem) |
---|
2397 | 2788 | { |
---|
2398 | 2789 | TransformGeometry(); |
---|
2399 | 2790 | } else |
---|
2400 | | - if (event.getSource() == resetTransformItem) |
---|
| 2791 | + if (source == transformChildrenItem) |
---|
| 2792 | + { |
---|
| 2793 | + TransformChildren(); |
---|
| 2794 | + } else |
---|
| 2795 | + if (source == resetTransformItem) |
---|
2401 | 2796 | { |
---|
2402 | 2797 | ResetTransform(); |
---|
2403 | 2798 | } else |
---|
2404 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2799 | + if (source == resetCentroidItem) |
---|
2405 | 2800 | { |
---|
2406 | | - ResetCentroid(); |
---|
| 2801 | + ResetCentroid(true); |
---|
2407 | 2802 | } else |
---|
2408 | | - if (event.getSource() == resetParentItem) |
---|
| 2803 | + if (source == resetCentroidXZItem) |
---|
| 2804 | + { |
---|
| 2805 | + ResetCentroid(false); |
---|
| 2806 | + } else |
---|
| 2807 | + if (source == resetParentItem) |
---|
2409 | 2808 | { |
---|
2410 | 2809 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2411 | 2810 | { |
---|
.. | .. |
---|
2415 | 2814 | |
---|
2416 | 2815 | refreshContents(); |
---|
2417 | 2816 | } else |
---|
2418 | | - if (event.getSource() == repairParentItem) |
---|
| 2817 | + if (source == repairParentItem) |
---|
2419 | 2818 | { |
---|
2420 | 2819 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2421 | 2820 | { |
---|
.. | .. |
---|
2429 | 2828 | |
---|
2430 | 2829 | refreshContents(); |
---|
2431 | 2830 | } else |
---|
2432 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2831 | + if (source == repairShadowItem) |
---|
| 2832 | + { |
---|
| 2833 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2834 | + { |
---|
| 2835 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2836 | + obj.RepairShadow(); |
---|
| 2837 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2838 | +// { |
---|
| 2839 | +// obj.get(i).parent = obj; |
---|
| 2840 | +// } |
---|
| 2841 | + } |
---|
| 2842 | + |
---|
| 2843 | + refreshContents(); |
---|
| 2844 | + } else |
---|
| 2845 | + if (source == sortbysizeItem) |
---|
2433 | 2846 | { |
---|
2434 | 2847 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2435 | 2848 | { |
---|
.. | .. |
---|
2441 | 2854 | ResetModel(); |
---|
2442 | 2855 | refreshContents(); |
---|
2443 | 2856 | } else |
---|
2444 | | - if (event.getSource() == sortbynameItem) |
---|
| 2857 | + if (source == sortbynameItem) |
---|
2445 | 2858 | { |
---|
2446 | 2859 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2447 | 2860 | { |
---|
.. | .. |
---|
2453 | 2866 | ResetModel(); |
---|
2454 | 2867 | refreshContents(); |
---|
2455 | 2868 | } else |
---|
2456 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2869 | + if (source == attachPigmentItem) |
---|
2457 | 2870 | { |
---|
2458 | 2871 | String texture = GetFile("Attach pigment"); |
---|
2459 | 2872 | Object3D obj; |
---|
.. | .. |
---|
2465 | 2878 | |
---|
2466 | 2879 | refreshContents(); |
---|
2467 | 2880 | } else |
---|
2468 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2881 | + if (source == detachPigmentItem) |
---|
2469 | 2882 | { |
---|
2470 | 2883 | Object3D obj; |
---|
2471 | 2884 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2476 | 2889 | |
---|
2477 | 2890 | refreshContents(); |
---|
2478 | 2891 | } else |
---|
2479 | | - if (event.getSource() == attachBumpItem) |
---|
| 2892 | + if (source == attachBumpItem) |
---|
2480 | 2893 | { |
---|
2481 | 2894 | String texture = GetFile("Attach bump"); |
---|
2482 | 2895 | Object3D obj; |
---|
.. | .. |
---|
2488 | 2901 | |
---|
2489 | 2902 | refreshContents(); |
---|
2490 | 2903 | } else |
---|
2491 | | - if (event.getSource() == detachBumpItem) |
---|
| 2904 | + if (source == detachBumpItem) |
---|
2492 | 2905 | { |
---|
2493 | 2906 | Object3D obj; |
---|
2494 | 2907 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2499 | 2912 | |
---|
2500 | 2913 | refreshContents(); |
---|
2501 | 2914 | } else |
---|
2502 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2915 | + if (source == pigmentBumpItem) |
---|
2503 | 2916 | { |
---|
2504 | 2917 | Object3D obj; |
---|
2505 | 2918 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2510 | 2923 | |
---|
2511 | 2924 | refreshContents(); |
---|
2512 | 2925 | } else |
---|
2513 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2926 | + if (source == flashSelectionButton) |
---|
2514 | 2927 | { |
---|
2515 | 2928 | CameraPane.flash = true; |
---|
2516 | 2929 | refreshContents(); |
---|
2517 | 2930 | } else |
---|
2518 | | - if (event.getSource() == oneButton) |
---|
| 2931 | + if (source == oneButton) |
---|
2519 | 2932 | { |
---|
2520 | 2933 | } else |
---|
2521 | | - if (event.getSource() == twoButton) |
---|
| 2934 | + if (source == twoButton) |
---|
2522 | 2935 | { |
---|
2523 | 2936 | radio.layout = twoButton; |
---|
2524 | 2937 | // bug |
---|
2525 | 2938 | //gridPanel.setDividerLocation(1.0); |
---|
2526 | 2939 | //bigPanel.setDividerLocation(0.0); |
---|
2527 | | - bigThree.remove(jtp); |
---|
2528 | | - bigThree.remove(cameraPanel); |
---|
2529 | | - bigThree.remove(XYZPanel); |
---|
2530 | | - aWindowConstraints.gridx = 0; |
---|
2531 | | - aWindowConstraints.gridy = 0; |
---|
2532 | | - aWindowConstraints.gridwidth = 1; |
---|
2533 | | - // aConstraints.gridheight = 3; |
---|
2534 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2535 | | - aWindowConstraints.weightx = 0; |
---|
2536 | | - aWindowConstraints.weighty = 1; |
---|
2537 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2538 | | - aWindowConstraints.weightx = 1; |
---|
2539 | | - aWindowConstraints.gridwidth = 3; |
---|
2540 | | - // aConstraints.gridheight = 3; |
---|
2541 | | - aWindowConstraints.gridx = 1; |
---|
2542 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2543 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2544 | | - aWindowConstraints.weightx = 0; |
---|
2545 | | - aWindowConstraints.gridx = 4; |
---|
2546 | | - aWindowConstraints.gridwidth = 1; |
---|
2547 | | - // aConstraints.gridheight = 3; |
---|
2548 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2549 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2550 | | - bigThree.revalidate(); |
---|
| 2940 | +// bigThree.remove(scenePanel); |
---|
| 2941 | +// bigThree.remove(centralPanel); |
---|
| 2942 | +// bigThree.remove(XYZPanel); |
---|
| 2943 | +// aWindowConstraints.gridx = 0; |
---|
| 2944 | +// aWindowConstraints.gridy = 0; |
---|
| 2945 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2946 | +// // aConstraints.gridheight = 3; |
---|
| 2947 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2948 | +// aWindowConstraints.weightx = 0; |
---|
| 2949 | +// aWindowConstraints.weighty = 1; |
---|
| 2950 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2951 | +// aWindowConstraints.weightx = 1; |
---|
| 2952 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2953 | +// // aConstraints.gridheight = 3; |
---|
| 2954 | +// aWindowConstraints.gridx = 1; |
---|
| 2955 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2956 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2957 | +// aWindowConstraints.weightx = 0; |
---|
| 2958 | +// aWindowConstraints.gridx = 4; |
---|
| 2959 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2960 | +// // aConstraints.gridheight = 3; |
---|
| 2961 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2962 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2963 | +// scenePanel.setVisible(false); |
---|
| 2964 | +// centralPanel.setVisible(true); |
---|
| 2965 | +// XYZPanel.setVisible(false); |
---|
| 2966 | + bigThree.ClearUI(); |
---|
| 2967 | + bigThree.add(centralPanel); |
---|
| 2968 | + bigThree.FlushUI(); |
---|
| 2969 | + |
---|
| 2970 | + cameraView.requestFocusInWindow(); |
---|
| 2971 | + |
---|
| 2972 | +// refreshContents(true); |
---|
| 2973 | +// |
---|
| 2974 | +// try |
---|
| 2975 | +// { |
---|
| 2976 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2977 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2978 | +// bot.mouseMove(100, 100); |
---|
| 2979 | +// bot.mousePress(mask); |
---|
| 2980 | +// bot.mouseRelease(mask); |
---|
| 2981 | +// } |
---|
| 2982 | +// catch (Exception e) |
---|
| 2983 | +// { |
---|
| 2984 | +// |
---|
| 2985 | +// } |
---|
| 2986 | + |
---|
2551 | 2987 | } else |
---|
2552 | | - if (event.getSource() == threeButton) |
---|
| 2988 | + if (source == threeButton) |
---|
2553 | 2989 | { |
---|
2554 | 2990 | radio.layout = threeButton; |
---|
2555 | | - bigThree.remove(jtp); |
---|
2556 | | - bigThree.remove(cameraPanel); |
---|
2557 | | - bigThree.remove(XYZPanel); |
---|
2558 | | - aWindowConstraints.gridx = 0; |
---|
2559 | | - aWindowConstraints.gridy = 0; |
---|
2560 | | - aWindowConstraints.gridwidth = 1; |
---|
2561 | | - // aConstraints.gridheight = 3; |
---|
2562 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2563 | | - aWindowConstraints.weightx = 0; |
---|
2564 | | - aWindowConstraints.weighty = 1; |
---|
2565 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2566 | | - aWindowConstraints.weightx = 1; |
---|
2567 | | - aWindowConstraints.gridwidth = 3; |
---|
2568 | | - // aConstraints.gridheight = 3; |
---|
2569 | | - aWindowConstraints.gridx = 1; |
---|
2570 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2571 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2572 | | - aWindowConstraints.weightx = 0; |
---|
2573 | | - aWindowConstraints.gridx = 4; |
---|
2574 | | - aWindowConstraints.gridwidth = 1; |
---|
2575 | | - // aConstraints.gridheight = 3; |
---|
2576 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2577 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2578 | | - bigThree.revalidate(); |
---|
| 2991 | + |
---|
| 2992 | +// bigThree.remove(scenePanel); |
---|
| 2993 | +// bigThree.remove(centralPanel); |
---|
| 2994 | +// bigThree.remove(XYZPanel); |
---|
| 2995 | +// aWindowConstraints.gridx = 0; |
---|
| 2996 | +// aWindowConstraints.gridy = 0; |
---|
| 2997 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2998 | +// // aConstraints.gridheight = 3; |
---|
| 2999 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3000 | +// aWindowConstraints.weightx = 0; |
---|
| 3001 | +// aWindowConstraints.weighty = 1; |
---|
| 3002 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3003 | +// aWindowConstraints.weightx = 1; |
---|
| 3004 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3005 | +// // aConstraints.gridheight = 3; |
---|
| 3006 | +// aWindowConstraints.gridx = 1; |
---|
| 3007 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3008 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3009 | +// aWindowConstraints.weightx = 0; |
---|
| 3010 | +// aWindowConstraints.gridx = 4; |
---|
| 3011 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3012 | +// // aConstraints.gridheight = 3; |
---|
| 3013 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3014 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3015 | +// bigThree.validate(); |
---|
| 3016 | +// scenePanel.setVisible(false); |
---|
| 3017 | +// centralPanel.setVisible(true); |
---|
| 3018 | +// XYZPanel.setVisible(true); |
---|
| 3019 | + bigThree.ClearUI(); |
---|
| 3020 | + bigThree.add(centralPanel); |
---|
| 3021 | + bigThree.add(XYZPanel); |
---|
| 3022 | + bigThree.FlushUI(); |
---|
| 3023 | + |
---|
| 3024 | + cameraView.requestFocusInWindow(); |
---|
2579 | 3025 | } else |
---|
2580 | | - if (event.getSource() == fourButton) |
---|
| 3026 | + if (source == fourButton) |
---|
2581 | 3027 | { |
---|
2582 | 3028 | radio.layout = fourButton; |
---|
2583 | | - bigThree.remove(jtp); |
---|
2584 | | - bigThree.remove(cameraPanel); |
---|
2585 | | - bigThree.remove(XYZPanel); |
---|
2586 | | - aWindowConstraints.gridx = 0; |
---|
2587 | | - aWindowConstraints.gridy = 0; |
---|
2588 | | - aWindowConstraints.gridwidth = 1; |
---|
2589 | | - // aWindowConstraints.gridheight = 3; |
---|
2590 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2591 | | - aWindowConstraints.weightx = 1; |
---|
2592 | | - aWindowConstraints.weighty = 1; |
---|
2593 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2594 | | - aWindowConstraints.weightx = 1; |
---|
2595 | | - aWindowConstraints.gridwidth = 3; |
---|
2596 | | - // aConstraints.gridheight = 3; |
---|
2597 | | - aWindowConstraints.gridx = 1; |
---|
2598 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2599 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2600 | | - aWindowConstraints.weightx = 0; |
---|
2601 | | - aWindowConstraints.gridx = 4; |
---|
2602 | | - aWindowConstraints.gridwidth = 1; |
---|
2603 | | - // aWindowConstraints.gridheight = 3; |
---|
2604 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2605 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2606 | | - bigThree.revalidate(); |
---|
| 3029 | + |
---|
| 3030 | +// bigThree.remove(scenePanel); |
---|
| 3031 | +// bigThree.remove(centralPanel); |
---|
| 3032 | +// bigThree.remove(XYZPanel); |
---|
| 3033 | +// aWindowConstraints.gridx = 0; |
---|
| 3034 | +// aWindowConstraints.gridy = 0; |
---|
| 3035 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3036 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3037 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3038 | +// aWindowConstraints.weightx = 1; |
---|
| 3039 | +// aWindowConstraints.weighty = 1; |
---|
| 3040 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3041 | +// aWindowConstraints.weightx = 1; |
---|
| 3042 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3043 | +// // aConstraints.gridheight = 3; |
---|
| 3044 | +// aWindowConstraints.gridx = 1; |
---|
| 3045 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3046 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3047 | +// aWindowConstraints.weightx = 0; |
---|
| 3048 | +// aWindowConstraints.gridx = 4; |
---|
| 3049 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3050 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3051 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3052 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3053 | +// bigThree.validate(); |
---|
| 3054 | +// scenePanel.setVisible(true); |
---|
| 3055 | +// centralPanel.setVisible(false); |
---|
| 3056 | +// XYZPanel.setVisible(false); |
---|
| 3057 | + bigThree.ClearUI(); |
---|
| 3058 | + bigThree.add(scenePanel); |
---|
| 3059 | + bigThree.FlushUI(); |
---|
| 3060 | + |
---|
| 3061 | + cameraView.requestFocusInWindow(); |
---|
2607 | 3062 | } else |
---|
2608 | | - if (event.getSource() == sixButton) |
---|
| 3063 | + if (source == sixButton) |
---|
2609 | 3064 | { |
---|
2610 | 3065 | radio.layout = sixButton; |
---|
2611 | | - bigThree.remove(jtp); |
---|
2612 | | - bigThree.remove(cameraPanel); |
---|
2613 | | - bigThree.remove(XYZPanel); |
---|
2614 | | - aWindowConstraints.gridx = 0; |
---|
2615 | | - aWindowConstraints.gridy = 0; |
---|
2616 | | - aWindowConstraints.gridwidth = 1; |
---|
2617 | | - // aConstraints.gridheight = 3; |
---|
2618 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2619 | | - aWindowConstraints.weightx = 0; |
---|
2620 | | - aWindowConstraints.weighty = 1; |
---|
2621 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2622 | | - aWindowConstraints.weightx = 1; |
---|
2623 | | - aWindowConstraints.gridwidth = 3; |
---|
2624 | | - // aWindowConstraints.gridheight = 3; |
---|
2625 | | - aWindowConstraints.gridx = 1; |
---|
2626 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2627 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2628 | | - aWindowConstraints.weightx = 0; |
---|
2629 | | - aWindowConstraints.gridx = 4; |
---|
2630 | | - aWindowConstraints.gridwidth = 1; |
---|
2631 | | - // aWindowConstraints.gridheight = 3; |
---|
2632 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2633 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2634 | | - bigThree.revalidate(); |
---|
| 3066 | + |
---|
| 3067 | +// bigThree.remove(scenePanel); |
---|
| 3068 | +// bigThree.remove(centralPanel); |
---|
| 3069 | +// bigThree.remove(XYZPanel); |
---|
| 3070 | +// aWindowConstraints.gridx = 0; |
---|
| 3071 | +// aWindowConstraints.gridy = 0; |
---|
| 3072 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3073 | +// // aConstraints.gridheight = 3; |
---|
| 3074 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3075 | +// aWindowConstraints.weightx = 0; |
---|
| 3076 | +// aWindowConstraints.weighty = 1; |
---|
| 3077 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3078 | +// aWindowConstraints.weightx = 1; |
---|
| 3079 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3080 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3081 | +// aWindowConstraints.gridx = 1; |
---|
| 3082 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3083 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3084 | +// aWindowConstraints.weightx = 0; |
---|
| 3085 | +// aWindowConstraints.gridx = 4; |
---|
| 3086 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3087 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3088 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3089 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3090 | +// bigThree.validate(); |
---|
| 3091 | +// scenePanel.setVisible(true); |
---|
| 3092 | +// centralPanel.setVisible(true); |
---|
| 3093 | +// XYZPanel.setVisible(false); |
---|
| 3094 | + bigThree.ClearUI(); |
---|
| 3095 | + bigThree.add(scenePanel); |
---|
| 3096 | + bigThree.add(centralPanel); |
---|
| 3097 | + bigThree.FlushUI(); |
---|
| 3098 | + |
---|
| 3099 | + cameraView.requestFocusInWindow(); |
---|
2635 | 3100 | } else |
---|
2636 | | - if (event.getSource() == sevenButton) |
---|
| 3101 | + if (source == sevenButton) |
---|
2637 | 3102 | { |
---|
2638 | 3103 | radio.layout = sevenButton; |
---|
2639 | | - bigThree.remove(jtp); |
---|
2640 | | - bigThree.remove(cameraPanel); |
---|
2641 | | - bigThree.remove(XYZPanel); |
---|
2642 | | - aWindowConstraints.gridx = 0; |
---|
2643 | | - aWindowConstraints.gridy = 0; |
---|
2644 | | - aWindowConstraints.gridwidth = 1; |
---|
2645 | | - // aWindowConstraints.gridheight = 3; |
---|
2646 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2647 | | - aWindowConstraints.weightx = 0; |
---|
2648 | | - aWindowConstraints.weighty = 1; |
---|
2649 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2650 | | - aWindowConstraints.weightx = 1; |
---|
2651 | | - aWindowConstraints.gridwidth = 3; |
---|
2652 | | - // aWindowConstraints.gridheight = 3; |
---|
2653 | | - aWindowConstraints.gridx = 1; |
---|
2654 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2655 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2656 | | - aWindowConstraints.weightx = 0; |
---|
2657 | | - aWindowConstraints.gridx = 4; |
---|
2658 | | - aWindowConstraints.gridwidth = 1; |
---|
2659 | | - // aConstraints.gridheight = 3; |
---|
2660 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2661 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2662 | | - bigThree.revalidate(); |
---|
| 3104 | + |
---|
| 3105 | +// bigThree.remove(scenePanel); |
---|
| 3106 | +// bigThree.remove(centralPanel); |
---|
| 3107 | +// bigThree.remove(XYZPanel); |
---|
| 3108 | +// aWindowConstraints.gridx = 0; |
---|
| 3109 | +// aWindowConstraints.gridy = 0; |
---|
| 3110 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3111 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3112 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3113 | +// aWindowConstraints.weightx = 0; |
---|
| 3114 | +// aWindowConstraints.weighty = 1; |
---|
| 3115 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3116 | +// aWindowConstraints.weightx = 1; |
---|
| 3117 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3118 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3119 | +// aWindowConstraints.gridx = 1; |
---|
| 3120 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3121 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3122 | +// aWindowConstraints.weightx = 0; |
---|
| 3123 | +// aWindowConstraints.gridx = 4; |
---|
| 3124 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3125 | +// // aConstraints.gridheight = 3; |
---|
| 3126 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3127 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3128 | +// bigThree.validate(); |
---|
| 3129 | +// scenePanel.setVisible(true); |
---|
| 3130 | +// centralPanel.setVisible(true); |
---|
| 3131 | +// XYZPanel.setVisible(true); |
---|
| 3132 | + bigThree.ClearUI(); |
---|
| 3133 | + bigThree.add(scenePanel); |
---|
| 3134 | + bigThree.add(centralPanel); |
---|
| 3135 | + bigThree.add(XYZPanel); |
---|
| 3136 | + bigThree.FlushUI(); |
---|
| 3137 | + |
---|
| 3138 | + cameraView.requestFocusInWindow(); |
---|
2663 | 3139 | } else |
---|
2664 | | - if (event.getSource() == rootButton) |
---|
| 3140 | + if (source == rootButton) |
---|
2665 | 3141 | { |
---|
2666 | 3142 | Object3D obj; |
---|
2667 | 3143 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2671 | 3147 | EditObject(obj); |
---|
2672 | 3148 | } |
---|
2673 | 3149 | |
---|
| 3150 | + cameraView.requestFocusInWindow(); |
---|
2674 | 3151 | refreshContents(true); |
---|
2675 | 3152 | } else |
---|
2676 | | - if (event.getSource() == closeButton) |
---|
| 3153 | + if (source == closeButton) |
---|
2677 | 3154 | { |
---|
2678 | 3155 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2679 | 3156 | cRadio ab; |
---|
2680 | 3157 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2681 | 3158 | { |
---|
2682 | 3159 | ab = (cRadio)e.nextElement(); |
---|
2683 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3160 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2684 | 3161 | { |
---|
| 3162 | + // Patch to avoid bug with transparency. |
---|
| 3163 | + if (!ab.hadMaterial) |
---|
| 3164 | + { |
---|
| 3165 | + ab.object.material = null; |
---|
| 3166 | + } |
---|
| 3167 | + |
---|
2685 | 3168 | buttonGroup.remove(ab); |
---|
2686 | 3169 | radioPanel.remove(ab); |
---|
2687 | 3170 | |
---|
2688 | | - ab.GetObject().editWindow = null; |
---|
| 3171 | + //ab.GetObject().editWindow = null; |
---|
| 3172 | + ab.GetObject().manipWindow = null; |
---|
2689 | 3173 | // ab.GetObject().objectUI = null; // ????????? |
---|
2690 | 3174 | |
---|
2691 | 3175 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2692 | 3176 | break; |
---|
2693 | 3177 | } |
---|
2694 | 3178 | } |
---|
| 3179 | + |
---|
| 3180 | + cameraView.requestFocusInWindow(); |
---|
2695 | 3181 | refreshContents(true); |
---|
2696 | 3182 | } else |
---|
2697 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3183 | + if (source == editItem || source == editButton) |
---|
2698 | 3184 | { |
---|
2699 | 3185 | EditSelection(false); |
---|
2700 | 3186 | } else |
---|
2701 | | - if (event.getSource() == uneditButton) |
---|
| 3187 | + if (source == uneditButton) |
---|
2702 | 3188 | { |
---|
2703 | 3189 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2704 | 3190 | { |
---|
.. | .. |
---|
2708 | 3194 | child.CloseUI(); |
---|
2709 | 3195 | listUI.remove(child); |
---|
2710 | 3196 | |
---|
2711 | | - child.editWindow = null; // ??????????? |
---|
| 3197 | + //child.editWindow = null; // ??????????? |
---|
2712 | 3198 | } |
---|
2713 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3199 | + objEditor.ctrlPanel.FlushUI(); |
---|
2714 | 3200 | //objEditor.jTree.clearSelection(); |
---|
2715 | 3201 | //objEditor.ResetSliders(); |
---|
2716 | 3202 | refreshContents(true); |
---|
2717 | 3203 | } else |
---|
2718 | | - if (event.getSource() == clearPanelButton) |
---|
| 3204 | + if (source == clearPanelButton) |
---|
2719 | 3205 | { |
---|
2720 | 3206 | assert(copy == group); |
---|
2721 | 3207 | //copy.ClearUI(); |
---|
.. | .. |
---|
2726 | 3212 | listUI.clear(); |
---|
2727 | 3213 | refreshContents(true); |
---|
2728 | 3214 | } else |
---|
2729 | | - if (event.getSource() == allParamsButton) |
---|
| 3215 | + if (source == allParamsButton) |
---|
2730 | 3216 | { |
---|
2731 | 3217 | assert(copy == group); |
---|
2732 | 3218 | |
---|
.. | .. |
---|
2747 | 3233 | |
---|
2748 | 3234 | refreshContents(true); |
---|
2749 | 3235 | } else |
---|
2750 | | - if (event.getSource() == unselectButton) |
---|
| 3236 | + if (source == unselectButton) |
---|
2751 | 3237 | { |
---|
2752 | 3238 | objEditor.jTree.clearSelection(); |
---|
2753 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 3239 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2754 | 3240 | objEditor.ResetSliders(); |
---|
2755 | 3241 | refreshContents(true); |
---|
2756 | 3242 | } else |
---|
2757 | | - if(event.getSource() instanceof cRadio) |
---|
| 3243 | + if(source instanceof cRadio) |
---|
2758 | 3244 | { |
---|
2759 | 3245 | group.parent = keepparent; |
---|
2760 | 3246 | group.attributes = 0; |
---|
2761 | 3247 | //group.editWindow = null; |
---|
2762 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3248 | + /*cRadio*/ radio = (cRadio)source; |
---|
2763 | 3249 | Object3D obj = radio.GetObject(); |
---|
2764 | 3250 | System.out.println("Edit " + obj); |
---|
2765 | 3251 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2779 | 3265 | } |
---|
2780 | 3266 | |
---|
2781 | 3267 | copy = group; |
---|
2782 | | - //CameraPane.theRenderer.object = group; |
---|
| 3268 | + //Globals.theRenderer.object = group; |
---|
2783 | 3269 | if(!useclient) |
---|
2784 | 3270 | { |
---|
2785 | 3271 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2788 | 3274 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2789 | 3275 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2790 | 3276 | cameraView.object = group; |
---|
2791 | | - cameraView.lighttouched = true; |
---|
| 3277 | + //cameraView.lighttouched = true; |
---|
| 3278 | + Globals.lighttouched = true; |
---|
2792 | 3279 | topView.object = group; |
---|
2793 | 3280 | frontView.object = group; |
---|
2794 | 3281 | sideView.object = group; |
---|
2795 | 3282 | } |
---|
2796 | | - group.editWindow = this; |
---|
| 3283 | + |
---|
| 3284 | +// fix "+" issue |
---|
| 3285 | + //group.editWindow = this; |
---|
| 3286 | + group.manipWindow = this; |
---|
| 3287 | + |
---|
2797 | 3288 | /* |
---|
2798 | 3289 | currentLayout = radio.layout; |
---|
2799 | 3290 | if (currentLayout == null) |
---|
.. | .. |
---|
2805 | 3296 | //group.parent = null; // ROOT |
---|
2806 | 3297 | //group.attributes = -1; |
---|
2807 | 3298 | ResetModel(); |
---|
| 3299 | + |
---|
| 3300 | + cameraView.requestFocusInWindow(); |
---|
2808 | 3301 | refreshContents(true); |
---|
2809 | | - } |
---|
| 3302 | + } else if (event.getSource() == editCameraItem) |
---|
| 3303 | + { |
---|
| 3304 | + cameraView.ProtectCamera(); |
---|
| 3305 | + cameraView.repaint(); |
---|
| 3306 | + return; |
---|
| 3307 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3308 | + { |
---|
| 3309 | + cameraView.RevertCamera(); |
---|
| 3310 | + cameraView.repaint(); |
---|
| 3311 | + return; |
---|
| 3312 | + // } else if (event.getSource() == textureButton) |
---|
| 3313 | + // { |
---|
| 3314 | + // return; // true; |
---|
| 3315 | + } |
---|
2810 | 3316 | else |
---|
2811 | 3317 | { |
---|
2812 | 3318 | //return super.action(event, arg); |
---|
.. | .. |
---|
2815 | 3321 | } |
---|
2816 | 3322 | |
---|
2817 | 3323 | boolean useclient = false; |
---|
2818 | | - cRadio radio; |
---|
2819 | 3324 | |
---|
2820 | 3325 | void ToggleRoot() |
---|
2821 | 3326 | { |
---|
.. | .. |
---|
2824 | 3329 | if (useclient) |
---|
2825 | 3330 | { |
---|
2826 | 3331 | cameraView.object = client; |
---|
2827 | | - cameraView.lighttouched = true; |
---|
| 3332 | + Globals.lighttouched = true; |
---|
2828 | 3333 | //topView.object = client; |
---|
2829 | 3334 | //frontView.object = client; |
---|
2830 | 3335 | //sideView.object = client; |
---|
.. | .. |
---|
2832 | 3337 | else |
---|
2833 | 3338 | { |
---|
2834 | 3339 | cameraView.object = group; |
---|
2835 | | - cameraView.lighttouched = true; |
---|
| 3340 | + Globals.lighttouched = true; |
---|
2836 | 3341 | //topView.object = group; |
---|
2837 | 3342 | //frontView.object = group; |
---|
2838 | 3343 | //sideView.object = group; |
---|
.. | .. |
---|
2867 | 3372 | refreshContents(); |
---|
2868 | 3373 | } |
---|
2869 | 3374 | |
---|
| 3375 | + void TransformChildren() |
---|
| 3376 | + { |
---|
| 3377 | + Object3D obj; |
---|
| 3378 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3379 | + { |
---|
| 3380 | + obj = (Object3D)e.nextElement(); |
---|
| 3381 | + obj.KeepTextureMatrices(); |
---|
| 3382 | + obj.TransformChildren(); |
---|
| 3383 | + obj.RestoreTextureMatrices(); |
---|
| 3384 | + |
---|
| 3385 | +// if (obj.parent == null) |
---|
| 3386 | +// { |
---|
| 3387 | +// System.out.println("NULL PARENT!"); |
---|
| 3388 | +// new Exception().printStackTrace(); |
---|
| 3389 | +// } |
---|
| 3390 | +// else |
---|
| 3391 | +// TouchTransform(obj); |
---|
| 3392 | +// //obj.parent.Touch(); |
---|
| 3393 | + } |
---|
| 3394 | + |
---|
| 3395 | + refreshContents(); |
---|
| 3396 | + } |
---|
2870 | 3397 | |
---|
2871 | 3398 | void ResetTransform() |
---|
2872 | 3399 | { |
---|
.. | .. |
---|
2979 | 3506 | refreshContents(); |
---|
2980 | 3507 | } |
---|
2981 | 3508 | |
---|
2982 | | - void ResetCentroid() |
---|
| 3509 | + void ResetCentroid(boolean full) |
---|
2983 | 3510 | { |
---|
2984 | 3511 | Object3D obj; |
---|
2985 | 3512 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2994 | 3521 | LA.matIdentity(Object3D.mat); |
---|
2995 | 3522 | obj.getBounds(minima, maxima, false); |
---|
2996 | 3523 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
2997 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3524 | + if (full) |
---|
| 3525 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
2998 | 3526 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
2999 | 3527 | obj.TransformMesh(Object3D.mat); |
---|
| 3528 | + |
---|
3000 | 3529 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3001 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3530 | + if (full) |
---|
| 3531 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3002 | 3532 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3533 | + |
---|
3003 | 3534 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3004 | 3535 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3005 | 3536 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3028 | 3559 | |
---|
3029 | 3560 | int size = obj.MemorySize(); |
---|
3030 | 3561 | |
---|
3031 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3562 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3563 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3032 | 3564 | } |
---|
3033 | 3565 | } |
---|
3034 | 3566 | catch (Exception e) |
---|
.. | .. |
---|
3065 | 3597 | obj = (Object3D)e.nextElement(); |
---|
3066 | 3598 | |
---|
3067 | 3599 | System.out.println("Object is: " + obj); |
---|
3068 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3600 | + Grafreed.AnalyzeObject(obj); |
---|
3069 | 3601 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3070 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3602 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3071 | 3603 | |
---|
3072 | 3604 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3073 | 3605 | } |
---|
.. | .. |
---|
3109 | 3641 | void GenNormals(boolean crease) |
---|
3110 | 3642 | { |
---|
3111 | 3643 | group.GenNormalsS(crease); |
---|
| 3644 | + |
---|
| 3645 | + refreshContents(); |
---|
| 3646 | + } |
---|
| 3647 | + |
---|
| 3648 | + void GenNormalsMESH() |
---|
| 3649 | + { |
---|
| 3650 | + group.GenNormalsMeshS(); |
---|
| 3651 | + |
---|
| 3652 | + refreshContents(); |
---|
| 3653 | + } |
---|
| 3654 | + |
---|
| 3655 | + void GenNormalsMINE() |
---|
| 3656 | + { |
---|
| 3657 | + group.selection.GenNormalsMINE(); |
---|
3112 | 3658 | |
---|
3113 | 3659 | refreshContents(); |
---|
3114 | 3660 | } |
---|
.. | .. |
---|
3157 | 3703 | |
---|
3158 | 3704 | //Object3D buffer; |
---|
3159 | 3705 | cVector temp = new cVector(); |
---|
3160 | | - BoundaryRep temprep; |
---|
3161 | | - Object3D nodes; |
---|
3162 | | - Vector<Vertex> vertices; |
---|
3163 | | - |
---|
3164 | | - public void Vertex(Object3D node, Vertex v) |
---|
3165 | | - { |
---|
3166 | | - vertices.add(v); |
---|
3167 | | - nodes.addElement(node); |
---|
3168 | | - |
---|
3169 | | - if (temprep.GetCache(v) != null) |
---|
3170 | | - { |
---|
3171 | | - temprep.Remove(v); |
---|
3172 | | - } |
---|
3173 | | - else |
---|
3174 | | - { |
---|
3175 | | - temprep.Remember(v); |
---|
3176 | | - } |
---|
3177 | | - } |
---|
3178 | | - |
---|
3179 | | - public void Face(Object3D node, Face f) |
---|
3180 | | - { |
---|
3181 | | - |
---|
3182 | | - } |
---|
3183 | | - |
---|
| 3706 | +// BoundaryRep temprep; |
---|
| 3707 | +// Object3D nodes; |
---|
| 3708 | +// Vector<Vertex> vertices; |
---|
| 3709 | +// |
---|
| 3710 | +// cGroup buffer; |
---|
| 3711 | +// |
---|
| 3712 | +// public void Vertex(Object3D node, Vertex v) |
---|
| 3713 | +// { |
---|
| 3714 | +//// vertices.add(v); |
---|
| 3715 | +//// nodes.addElement(node); |
---|
| 3716 | +//// |
---|
| 3717 | +//// if (temprep.GetCache(v) != null) |
---|
| 3718 | +//// { |
---|
| 3719 | +//// temprep.Remove(v); |
---|
| 3720 | +//// } else |
---|
| 3721 | +//// { |
---|
| 3722 | +//// temprep.Remember(v); |
---|
| 3723 | +//// } |
---|
| 3724 | +// |
---|
| 3725 | +// //Object3D node = nodes.get(index); |
---|
| 3726 | +// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3727 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3728 | +// |
---|
| 3729 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3730 | +// |
---|
| 3731 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3732 | +// |
---|
| 3733 | +// cGroup g = new cGroup(); |
---|
| 3734 | +// |
---|
| 3735 | +// if (g.toParent == null) |
---|
| 3736 | +// { |
---|
| 3737 | +// g.toParent = LA.newMatrix(); |
---|
| 3738 | +// g.fromParent = LA.newMatrix(); |
---|
| 3739 | +// } |
---|
| 3740 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3741 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3742 | +// |
---|
| 3743 | +// g.add(GrafreeD.clipboard); |
---|
| 3744 | +// |
---|
| 3745 | +// buffer.add(g); |
---|
| 3746 | +// } |
---|
| 3747 | +// |
---|
| 3748 | +// public void Face(Object3D node, Face f) |
---|
| 3749 | +// { |
---|
| 3750 | +// |
---|
| 3751 | +// } |
---|
| 3752 | +// |
---|
| 3753 | +// void ParseVerticesOld() // ?? |
---|
| 3754 | +// { |
---|
| 3755 | +// //if (group.selection.size() != 1) |
---|
| 3756 | +// // return; |
---|
| 3757 | +// |
---|
| 3758 | +// temprep = new BoundaryRep(); |
---|
| 3759 | +// nodes = new Object3D(); |
---|
| 3760 | +// vertices = new Vector<Vertex>(); |
---|
| 3761 | +// |
---|
| 3762 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3763 | +// GrafreeD.epsequal = true; |
---|
| 3764 | +// |
---|
| 3765 | +// for (int i=0; i<group.selection.size(); i++) |
---|
| 3766 | +// { |
---|
| 3767 | +// Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3768 | +// |
---|
| 3769 | +// group.selection.get(i).Parse( |
---|
| 3770 | +//this ); |
---|
| 3771 | +// |
---|
| 3772 | +// int repsize = temprep.VertexCount(); |
---|
| 3773 | +// int tablesize = temprep.vertextable.size(); |
---|
| 3774 | +// int nodesize = nodes.size(); |
---|
| 3775 | +// |
---|
| 3776 | +// assert(vertices.size() == nodes.size()); |
---|
| 3777 | +// |
---|
| 3778 | +// temprep.vertextable.elements(); |
---|
| 3779 | +// |
---|
| 3780 | +// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet(); |
---|
| 3781 | +// |
---|
| 3782 | +// for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
| 3783 | +// { |
---|
| 3784 | +// cGroup g = new cGroup(); |
---|
| 3785 | +// |
---|
| 3786 | +// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k)); |
---|
| 3787 | +// |
---|
| 3788 | +// Object3D node = nodes.get(index); |
---|
| 3789 | +// temp.set(vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3790 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3791 | +// |
---|
| 3792 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3793 | +// |
---|
| 3794 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3795 | +// |
---|
| 3796 | +// if (g.toParent == null) |
---|
| 3797 | +// { |
---|
| 3798 | +// g.toParent = LA.newMatrix(); |
---|
| 3799 | +// g.fromParent = LA.newMatrix(); |
---|
| 3800 | +// } |
---|
| 3801 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3802 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3803 | +// |
---|
| 3804 | +// g.add(GrafreeD.clipboard); |
---|
| 3805 | +// |
---|
| 3806 | +// buffer.add(g); |
---|
| 3807 | +// } |
---|
| 3808 | +// |
---|
| 3809 | +// makeSomething(buffer, i==group.selection.size()-1); |
---|
| 3810 | +// } |
---|
| 3811 | +// |
---|
| 3812 | +// GrafreeD.epsequal = epsequal; |
---|
| 3813 | +// |
---|
| 3814 | +// //buffer = null; |
---|
| 3815 | +// temprep = null; |
---|
| 3816 | +// nodes = null; |
---|
| 3817 | +// |
---|
| 3818 | +// refreshContents(); |
---|
| 3819 | +// } |
---|
| 3820 | + |
---|
3184 | 3821 | void ParseVertices() |
---|
3185 | 3822 | { |
---|
3186 | | - //if (group.selection.size() != 1) |
---|
3187 | | - // return; |
---|
3188 | | - |
---|
3189 | | - temprep = new BoundaryRep(); |
---|
3190 | | - nodes = new Object3D(); |
---|
3191 | | - vertices = new Vector<Vertex>(); |
---|
3192 | | - |
---|
3193 | | - boolean epsequal = GraphreeD.epsequal; |
---|
3194 | | - GraphreeD.epsequal = true; |
---|
| 3823 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3824 | + Grafreed.epsequal = true; |
---|
3195 | 3825 | |
---|
3196 | 3826 | for (int i=0; i<group.selection.size(); i++) |
---|
3197 | 3827 | { |
---|
3198 | | - Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3828 | + final cGroup buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
3199 | 3829 | |
---|
3200 | | - group.selection.get(i).Parse(this); |
---|
3201 | | - |
---|
3202 | | - int repsize = temprep.VertexCount(); |
---|
3203 | | - int tablesize = temprep.vertextable.size(); |
---|
3204 | | - int nodesize = nodes.size(); |
---|
| 3830 | + group.selection.get(i).Parse( |
---|
| 3831 | + |
---|
| 3832 | + new iParse() |
---|
| 3833 | + { |
---|
| 3834 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3835 | + { |
---|
| 3836 | + temp.set(v); |
---|
| 3837 | + LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
3205 | 3838 | |
---|
3206 | | - assert(vertices.size() == nodes.size()); |
---|
3207 | | - |
---|
3208 | | - temprep.vertextable.elements(); |
---|
3209 | | - |
---|
3210 | | - java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet(); |
---|
| 3839 | + cGroup g = new cGroup(); |
---|
3211 | 3840 | |
---|
3212 | | - for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
3213 | | - { |
---|
3214 | | - cGroup g = new cGroup(); |
---|
| 3841 | + if (g.toParent == null) |
---|
| 3842 | + { |
---|
| 3843 | + g.toParent = LA.newMatrix(); |
---|
| 3844 | + g.fromParent = LA.newMatrix(); |
---|
| 3845 | + } |
---|
| 3846 | + LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3847 | + LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3215 | 3848 | |
---|
3216 | | - int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k)); |
---|
3217 | | - Object3D node = nodes.get(index); |
---|
3218 | | - temp.set(vertices.get(index)); // temprep.GetVertex(k)); |
---|
3219 | | - // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3849 | + g.add(Grafreed.clipboard); |
---|
3220 | 3850 | |
---|
3221 | | - LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
3222 | | - |
---|
3223 | | - // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
3224 | | - |
---|
3225 | | - if (g.toParent == null) |
---|
3226 | | - { |
---|
3227 | | - g.toParent = LA.newMatrix(); |
---|
3228 | | - g.fromParent = LA.newMatrix(); |
---|
3229 | | - } |
---|
3230 | | - LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3231 | | - LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3851 | + buffer.add(g); |
---|
| 3852 | + } |
---|
3232 | 3853 | |
---|
3233 | | - g.add(GraphreeD.clipboard); |
---|
| 3854 | + public void Face(Object3D node, Face f) |
---|
| 3855 | + { |
---|
3234 | 3856 | |
---|
3235 | | - buffer.add(g); |
---|
3236 | | - } |
---|
| 3857 | + } |
---|
| 3858 | + } |
---|
| 3859 | + ); |
---|
3237 | 3860 | |
---|
3238 | 3861 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3239 | 3862 | } |
---|
3240 | 3863 | |
---|
3241 | | - GraphreeD.epsequal = epsequal; |
---|
3242 | | - |
---|
3243 | | - //buffer = null; |
---|
3244 | | - temprep = null; |
---|
3245 | | - nodes = null; |
---|
| 3864 | + Grafreed.epsequal = epsequal; |
---|
3246 | 3865 | |
---|
3247 | 3866 | refreshContents(); |
---|
3248 | 3867 | } |
---|
3249 | | - |
---|
| 3868 | + |
---|
| 3869 | + void TextureVertices() |
---|
| 3870 | + { |
---|
| 3871 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3872 | + { |
---|
| 3873 | + group.selection.get(i).Parse( |
---|
| 3874 | + new iParse() |
---|
| 3875 | + { |
---|
| 3876 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3877 | + { |
---|
| 3878 | + cTexture tex = node.GetTextures(); |
---|
| 3879 | + String pigment = Object3D.GetPigment(tex); |
---|
| 3880 | + //String bump = Object3D.GetBump(tex); |
---|
| 3881 | + |
---|
| 3882 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3883 | + |
---|
| 3884 | + try |
---|
| 3885 | + { |
---|
| 3886 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3887 | + } |
---|
| 3888 | + catch (Exception e) |
---|
| 3889 | + { |
---|
| 3890 | + System.err.println("FAIL: " + node); |
---|
| 3891 | + } |
---|
| 3892 | + |
---|
| 3893 | + double s = v.s; |
---|
| 3894 | + |
---|
| 3895 | + if (s == 1) |
---|
| 3896 | + s = 0; |
---|
| 3897 | + |
---|
| 3898 | + double t = v.t; |
---|
| 3899 | + |
---|
| 3900 | + if (t == 1) |
---|
| 3901 | + t = 0; |
---|
| 3902 | + |
---|
| 3903 | + int indexs = (int) (texturedata.getWidth() * s); |
---|
| 3904 | + int indext = (int) (texturedata.getHeight() * t); |
---|
| 3905 | + |
---|
| 3906 | + int index = indext * texturedata.getWidth() + indexs; |
---|
| 3907 | + |
---|
| 3908 | + java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer(); |
---|
| 3909 | + |
---|
| 3910 | + int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight(); |
---|
| 3911 | + |
---|
| 3912 | + float scale = bytebuf.get(index*slide) & 0xFF; |
---|
| 3913 | + scale += bytebuf.get(index*slide+1) & 0xFF; |
---|
| 3914 | + scale += bytebuf.get(index*slide+2) & 0xFF; |
---|
| 3915 | + scale /= 3; |
---|
| 3916 | + |
---|
| 3917 | + scale /= 0xFF; |
---|
| 3918 | + // c'est quoi ca? scale /= 4; |
---|
| 3919 | + |
---|
| 3920 | + //v.AO = scale; |
---|
| 3921 | + |
---|
| 3922 | + v.x += v.norm.x * scale; |
---|
| 3923 | + v.y += v.norm.y * scale; |
---|
| 3924 | + v.z += v.norm.z * scale; |
---|
| 3925 | + } |
---|
| 3926 | + |
---|
| 3927 | + public void Face(Object3D node, Face f) |
---|
| 3928 | + { |
---|
| 3929 | + } |
---|
| 3930 | + } |
---|
| 3931 | + ); |
---|
| 3932 | + } |
---|
| 3933 | + |
---|
| 3934 | + refreshContents(); |
---|
| 3935 | + } |
---|
| 3936 | + |
---|
3250 | 3937 | void Align() |
---|
3251 | 3938 | { |
---|
| 3939 | + if (group.selection.size() == 0) |
---|
| 3940 | + return; |
---|
| 3941 | + |
---|
| 3942 | + cVector bbmin = new cVector(); |
---|
| 3943 | + cVector bbmax = new cVector(); |
---|
| 3944 | + |
---|
| 3945 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3946 | + |
---|
| 3947 | + double dx = bbmax.x - bbmin.x; |
---|
| 3948 | + double dy = bbmax.y - bbmin.y; |
---|
| 3949 | + double dz = bbmax.z - bbmin.z; |
---|
| 3950 | + |
---|
| 3951 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3952 | + |
---|
3252 | 3953 | for (int i=0; i<group.selection.size(); i++) |
---|
3253 | 3954 | { |
---|
3254 | 3955 | Object3D obj = group.selection.get(i); |
---|
3255 | 3956 | |
---|
3256 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3257 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3957 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3958 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3258 | 3959 | } |
---|
3259 | 3960 | |
---|
3260 | 3961 | refreshContents(); |
---|
.. | .. |
---|
3267 | 3968 | // ref.SaveSupports(); |
---|
3268 | 3969 | // Object3D par = ref.parent; |
---|
3269 | 3970 | // ref.parent = null; |
---|
3270 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 3971 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3271 | 3972 | // ref.parent = par; |
---|
3272 | 3973 | // ref.RestoreSupports(); |
---|
3273 | 3974 | |
---|
.. | .. |
---|
3275 | 3976 | |
---|
3276 | 3977 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3277 | 3978 | |
---|
3278 | | - boolean random = CameraPane.RANDOM; |
---|
3279 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3979 | + boolean random = CameraPane.SWITCH; |
---|
| 3980 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3280 | 3981 | lowres.linkVerticesThis(null); |
---|
3281 | 3982 | lowres.linkVerticesThis(sn); |
---|
3282 | | - CameraPane.RANDOM = random; |
---|
| 3983 | + CameraPane.SWITCH = random; |
---|
3283 | 3984 | |
---|
3284 | 3985 | System.err.flush(); |
---|
3285 | 3986 | |
---|
.. | .. |
---|
3297 | 3998 | // lowres.SaveSupports(); |
---|
3298 | 3999 | // par = lowres.parent; |
---|
3299 | 4000 | // lowres.parent = null; |
---|
3300 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 4001 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3301 | 4002 | Object3D newlow = CloneObject(lowres, false); |
---|
3302 | 4003 | newlow.name = sn.switchobject.get(i).name; |
---|
3303 | 4004 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3319 | 4020 | return; |
---|
3320 | 4021 | |
---|
3321 | 4022 | Object3D poses = group.selection.get(0); |
---|
3322 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 4023 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3323 | 4024 | |
---|
3324 | 4025 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3325 | 4026 | |
---|
.. | .. |
---|
3488 | 4189 | group.selection.RelinkToSupport(); // july 2014 |
---|
3489 | 4190 | System.out.println("DONE."); |
---|
3490 | 4191 | refreshContents(); |
---|
3491 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4192 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3492 | 4193 | } |
---|
3493 | 4194 | |
---|
3494 | 4195 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3513 | 4214 | |
---|
3514 | 4215 | void ClipMesh() |
---|
3515 | 4216 | { |
---|
3516 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 4217 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3517 | 4218 | { |
---|
3518 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 4219 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3519 | 4220 | |
---|
3520 | 4221 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3521 | 4222 | content = ((cGroup)content).get(0); |
---|
3522 | 4223 | |
---|
3523 | 4224 | // for (int i=0; i<group.selection.size(); i++) |
---|
3524 | 4225 | // { |
---|
3525 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 4226 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3526 | 4227 | // } |
---|
3527 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4228 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3528 | 4229 | } |
---|
3529 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4230 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3530 | 4231 | System.out.println("DONE."); |
---|
3531 | 4232 | refreshContents(); |
---|
3532 | 4233 | } |
---|
.. | .. |
---|
3571 | 4272 | void MarkLeaves(boolean hide) |
---|
3572 | 4273 | { |
---|
3573 | 4274 | group.selection.MarkLeaves(hide); |
---|
| 4275 | + refreshContents(); |
---|
| 4276 | + } |
---|
| 4277 | + |
---|
| 4278 | + void RewindLeaves(boolean hide) |
---|
| 4279 | + { |
---|
| 4280 | + group.selection.RewindLeaves(hide); |
---|
| 4281 | + refreshContents(); |
---|
| 4282 | + } |
---|
| 4283 | + |
---|
| 4284 | + void RandomLeaves(boolean hide) |
---|
| 4285 | + { |
---|
| 4286 | + group.selection.RandomLeaves(hide); |
---|
3574 | 4287 | refreshContents(); |
---|
3575 | 4288 | } |
---|
3576 | 4289 | |
---|
.. | .. |
---|
3659 | 4372 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3660 | 4373 | |
---|
3661 | 4374 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3662 | | - if(elem != group) |
---|
| 4375 | + if(elem != group || !newWindow) |
---|
3663 | 4376 | { |
---|
3664 | 4377 | // if (!(elem instanceof Composite)) |
---|
3665 | 4378 | // newWindow = false; |
---|
.. | .. |
---|
3749 | 4462 | //case 702: // Event.LIST_DESELECT |
---|
3750 | 4463 | group.deselectAll(); |
---|
3751 | 4464 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
3752 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
3753 | 4465 | if (tps != null) |
---|
3754 | 4466 | { |
---|
3755 | 4467 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
3758 | 4470 | |
---|
3759 | 4471 | //if (child.parent != null) |
---|
3760 | 4472 | //child.parent.addSelectee(child); |
---|
| 4473 | + objEditor.SetMaterial(child); |
---|
3761 | 4474 | group.addSelectee(child); |
---|
3762 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
3763 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
3764 | | - System.err.println("info : " + child.GetPath()); |
---|
3765 | 4475 | } |
---|
3766 | 4476 | } |
---|
3767 | | - else |
---|
3768 | | - { |
---|
3769 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3770 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3771 | | - System.err.println("info : " + group.GetPath()); |
---|
3772 | | - } |
---|
| 4477 | +// else |
---|
| 4478 | +// { |
---|
| 4479 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4480 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4481 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4482 | +// } |
---|
3773 | 4483 | |
---|
3774 | | - objEditor.SetText(); // jan 2014 |
---|
3775 | | - |
---|
3776 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4484 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
3777 | 4485 | CameraPane.flash = true; |
---|
3778 | 4486 | |
---|
3779 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4487 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
3780 | 4488 | // a camera |
---|
3781 | 4489 | { |
---|
3782 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
3783 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
3784 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
3785 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4490 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4491 | + { |
---|
| 4492 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4493 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4494 | + } |
---|
| 4495 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4496 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3786 | 4497 | } |
---|
3787 | 4498 | |
---|
3788 | 4499 | refreshContents(); |
---|
.. | .. |
---|
3793 | 4504 | |
---|
3794 | 4505 | freezemodel = false; |
---|
3795 | 4506 | } |
---|
| 4507 | + |
---|
| 4508 | + void refreshContents(boolean cp) |
---|
| 4509 | + { |
---|
| 4510 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4511 | + { |
---|
| 4512 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4513 | + |
---|
| 4514 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4515 | + { |
---|
| 4516 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4517 | + |
---|
| 4518 | + objEditor.AddInfo(child, this, true); |
---|
| 4519 | + System.err.println("info : " + child.GetPath()); |
---|
| 4520 | + } |
---|
| 4521 | + |
---|
| 4522 | + objEditor.SetText(); // jan 2014 |
---|
| 4523 | + } |
---|
| 4524 | + |
---|
| 4525 | + super.refreshContents(cp); |
---|
| 4526 | + } |
---|
3796 | 4527 | |
---|
3797 | 4528 | void linkSomething(Object3D thing) |
---|
3798 | 4529 | { |
---|
.. | .. |
---|
3864 | 4595 | { |
---|
3865 | 4596 | if (group.selection.isEmpty()) |
---|
3866 | 4597 | return; |
---|
3867 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4598 | + |
---|
| 4599 | + Grafreed.clipboardIsTempGroup = false; |
---|
3868 | 4600 | Composite tGroup = null; |
---|
3869 | 4601 | if (group.selection.size() > 0) // 1) |
---|
3870 | 4602 | { |
---|
3871 | 4603 | tGroup = new cGroup(); |
---|
3872 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4604 | + Grafreed.clipboardIsTempGroup = true; |
---|
3873 | 4605 | } |
---|
3874 | 4606 | |
---|
3875 | 4607 | if (cut) |
---|
3876 | 4608 | { |
---|
| 4609 | + if (Globals.SAVEONMAKE) |
---|
| 4610 | + Save(); |
---|
3877 | 4611 | //int indices[] = jList.getSelectedIndices(); |
---|
3878 | 4612 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
3879 | 4613 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
3909 | 4643 | //System.out.println("cut " + child); |
---|
3910 | 4644 | //System.out.println("parent = " + child.parent); |
---|
3911 | 4645 | // tmp.addChild(child); |
---|
3912 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4646 | + if (Grafreed.clipboardIsTempGroup) |
---|
3913 | 4647 | tGroup.add/*Child*/(tmp); |
---|
3914 | 4648 | else |
---|
3915 | | - GraphreeD.clipboard = tmp; |
---|
| 4649 | + Grafreed.clipboard = tmp; |
---|
3916 | 4650 | } |
---|
3917 | 4651 | else |
---|
3918 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4652 | + if (Grafreed.clipboardIsTempGroup) |
---|
3919 | 4653 | tGroup.add/*Child*/(child); |
---|
3920 | 4654 | else |
---|
3921 | | - GraphreeD.clipboard = child; |
---|
| 4655 | + Grafreed.clipboard = child; |
---|
3922 | 4656 | } |
---|
3923 | 4657 | |
---|
3924 | 4658 | //ResetModel(); |
---|
.. | .. |
---|
3950 | 4684 | //System.out.println("cut " + elem); |
---|
3951 | 4685 | //System.out.println("parent = " + elem.parent); |
---|
3952 | 4686 | // tmp.addChild(elem); |
---|
3953 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4687 | + if (Grafreed.clipboardIsTempGroup) |
---|
3954 | 4688 | tGroup.add/*Child*/(tmp); |
---|
3955 | 4689 | else |
---|
3956 | | - GraphreeD.clipboard = tmp; |
---|
| 4690 | + Grafreed.clipboard = tmp; |
---|
3957 | 4691 | } |
---|
3958 | 4692 | else |
---|
3959 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4693 | + if (Grafreed.clipboardIsTempGroup) |
---|
3960 | 4694 | tGroup.add/*Child*/(child); |
---|
3961 | 4695 | else |
---|
3962 | | - GraphreeD.clipboard = child; |
---|
| 4696 | + Grafreed.clipboard = child; |
---|
3963 | 4697 | } |
---|
3964 | 4698 | |
---|
3965 | 4699 | } |
---|
3966 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
3967 | | - GraphreeD.clipboard = tGroup; |
---|
| 4700 | + |
---|
| 4701 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4702 | + Grafreed.clipboard = tGroup; |
---|
| 4703 | + |
---|
3968 | 4704 | if (cut) |
---|
3969 | 4705 | { |
---|
3970 | 4706 | ResetModel(); |
---|
.. | .. |
---|
3974 | 4710 | |
---|
3975 | 4711 | void paste(boolean expand) |
---|
3976 | 4712 | { |
---|
3977 | | - // if (GraphreeD.clipboard == null) |
---|
| 4713 | + // if (GrafreeD.clipboard == null) |
---|
3978 | 4714 | // return; |
---|
3979 | 4715 | boolean first = true; |
---|
3980 | 4716 | |
---|
3981 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4717 | + if (Grafreed.clipboardIsTempGroup) |
---|
3982 | 4718 | { |
---|
3983 | 4719 | Composite temp; |
---|
3984 | 4720 | |
---|
.. | .. |
---|
3989 | 4725 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
3990 | 4726 | */ |
---|
3991 | 4727 | Object3D elem; |
---|
3992 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4728 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
3993 | 4729 | { |
---|
3994 | 4730 | Object3D child = (Object3D)e.nextElement(); |
---|
3995 | 4731 | |
---|
.. | .. |
---|
4003 | 4739 | else |
---|
4004 | 4740 | elem = child.deepCopy(); // ? |
---|
4005 | 4741 | child.parent = keepparent; |
---|
4006 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4742 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4007 | 4743 | // elem = elem.get(0); |
---|
4008 | 4744 | makeSomething(elem, true); // ?? first); |
---|
4009 | 4745 | //group.addChild(elem); |
---|
.. | .. |
---|
4023 | 4759 | //Object3D cb = Applet3D.clipboard; |
---|
4024 | 4760 | //temp.addChild(cb); |
---|
4025 | 4761 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4026 | | - assert(GraphreeD.clipboard.parent == null); |
---|
4027 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
4028 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4029 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
4030 | | - makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy()); |
---|
| 4762 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4763 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4764 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4765 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4766 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4031 | 4767 | else |
---|
4032 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4033 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4768 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4769 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4034 | 4770 | } |
---|
4035 | 4771 | |
---|
4036 | 4772 | ResetModel(); |
---|
4037 | 4773 | refreshContents(); |
---|
4038 | 4774 | } |
---|
4039 | 4775 | |
---|
4040 | | - void pasteInto(boolean copyit) |
---|
| 4776 | + void pasteInto(boolean copyit, boolean clone) |
---|
4041 | 4777 | { |
---|
4042 | | -// if (GraphreeD.clipboard == null) |
---|
| 4778 | +// if (GrafreeD.clipboard == null) |
---|
4043 | 4779 | // return; |
---|
4044 | 4780 | |
---|
4045 | 4781 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4066 | 4802 | if (copyit) |
---|
4067 | 4803 | { |
---|
4068 | 4804 | // paste(false); |
---|
4069 | | - CloneClipboard(false); // sept 2014 |
---|
| 4805 | + if (clone) |
---|
| 4806 | + { |
---|
| 4807 | + CloneClipboard(false); // sept 2014 |
---|
| 4808 | + } |
---|
| 4809 | + else |
---|
| 4810 | + { |
---|
| 4811 | + paste(false); |
---|
| 4812 | + } |
---|
4070 | 4813 | } |
---|
4071 | 4814 | else |
---|
4072 | 4815 | { |
---|
4073 | 4816 | boolean first = true; |
---|
4074 | 4817 | |
---|
4075 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4818 | + if (Grafreed.clipboardIsTempGroup) |
---|
4076 | 4819 | { |
---|
4077 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4820 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4078 | 4821 | Object3D copy; |
---|
4079 | 4822 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4080 | 4823 | { |
---|
.. | .. |
---|
4084 | 4827 | } |
---|
4085 | 4828 | } else |
---|
4086 | 4829 | { |
---|
4087 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4830 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4088 | 4831 | } |
---|
4089 | 4832 | } |
---|
4090 | 4833 | } |
---|
.. | .. |
---|
4276 | 5019 | makeSomething(csg); |
---|
4277 | 5020 | } |
---|
4278 | 5021 | |
---|
| 5022 | + void Ungroup(Object3D g) |
---|
| 5023 | + { |
---|
| 5024 | + if (g instanceof HiddenObject) |
---|
| 5025 | + { |
---|
| 5026 | + HiddenObject h = (HiddenObject) g; |
---|
| 5027 | + |
---|
| 5028 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 5029 | + { |
---|
| 5030 | + objEditor.makeSomething(h.get(i), false); |
---|
| 5031 | + } |
---|
| 5032 | + } |
---|
| 5033 | + else |
---|
| 5034 | + { |
---|
| 5035 | + for (int i=0; i<g.Size(); i++) |
---|
| 5036 | + { |
---|
| 5037 | + objEditor.makeSomething(g.get(i), false); |
---|
| 5038 | + } |
---|
| 5039 | + } |
---|
| 5040 | + } |
---|
| 5041 | + |
---|
4279 | 5042 | void ungroup() |
---|
4280 | 5043 | { |
---|
4281 | 5044 | /* |
---|
.. | .. |
---|
4469 | 5232 | } |
---|
4470 | 5233 | */ |
---|
4471 | 5234 | |
---|
4472 | | - void ImportGFD() |
---|
4473 | | - { |
---|
4474 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD); |
---|
4475 | | - browser.show(); |
---|
4476 | | - String filename = browser.getFile(); |
---|
4477 | | - if (filename != null && filename.length() > 0) |
---|
4478 | | - { |
---|
4479 | | - String fullname = browser.getDirectory() + filename; |
---|
4480 | | - |
---|
4481 | | - //Object3D readobj = |
---|
4482 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4483 | | - //makeSomething(readobj); |
---|
4484 | | - } |
---|
4485 | | - } |
---|
4486 | | - |
---|
4487 | 5235 | /* |
---|
4488 | 5236 | public void Callback(Object obj) |
---|
4489 | 5237 | { |
---|
.. | .. |
---|
4507 | 5255 | } |
---|
4508 | 5256 | */ |
---|
4509 | 5257 | |
---|
4510 | | - void ImportVRMLX3D() |
---|
4511 | | - { |
---|
4512 | | - if (GraphreeD.standAlone) |
---|
4513 | | - { |
---|
4514 | | - /**/ |
---|
4515 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4516 | | - browser.show(); |
---|
4517 | | - String filename = browser.getFile(); |
---|
4518 | | - if (filename != null && filename.length() > 0) |
---|
4519 | | - { |
---|
4520 | | - String fullname = browser.getDirectory() + filename; |
---|
4521 | | - LoadVRMLX3D(fullname); |
---|
4522 | | - } |
---|
4523 | | - /**/ |
---|
4524 | | - } |
---|
4525 | | - } |
---|
4526 | | - |
---|
4527 | 5258 | String GetFile(String dialogName) |
---|
4528 | 5259 | { |
---|
4529 | | - if (GraphreeD.standAlone) |
---|
| 5260 | + if (Grafreed.standAlone) |
---|
4530 | 5261 | { |
---|
4531 | 5262 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4532 | 5263 | browser.show(); |
---|
.. | .. |
---|
4590 | 5321 | cButton flashSelectionButton; |
---|
4591 | 5322 | cButton editButton; |
---|
4592 | 5323 | cButton uneditButton; |
---|
| 5324 | + JCheckBox allParamsButton; |
---|
4593 | 5325 | cButton clearpanelButton; |
---|
4594 | | - cButton allParamsButton; |
---|
4595 | 5326 | cButton unselectButton; |
---|
4596 | 5327 | |
---|
| 5328 | + cButton minButton; |
---|
| 5329 | + cButton maxButton; |
---|
| 5330 | + cButton fullButton; |
---|
| 5331 | + cButton undoButton; |
---|
| 5332 | + cButton redoButton; |
---|
| 5333 | + cButton saveButton; |
---|
| 5334 | + cButton oneStepButton; |
---|
| 5335 | + |
---|
4597 | 5336 | cButton screenfitButton; |
---|
4598 | 5337 | cButton screenfitpointButton; |
---|
4599 | 5338 | cButton snapobjectButton; |
---|
.. | .. |
---|
4604 | 5343 | cButton closeButton; |
---|
4605 | 5344 | |
---|
4606 | 5345 | cButton setsupportButton; |
---|
4607 | | - |
---|
4608 | | - cButton twoButton; |
---|
4609 | | - cButton sixButton; |
---|
4610 | | - cButton threeButton; |
---|
4611 | | - cButton sevenButton; |
---|
4612 | | - cButton fourButton; // full panel |
---|
4613 | | - cButton oneButton; // full XYZ |
---|
4614 | | - //cButton currentLayout; |
---|
4615 | 5346 | |
---|
4616 | 5347 | // |
---|
4617 | 5348 | //Composite |
---|
.. | .. |
---|
4624 | 5355 | private MenuItem lookFromItem; |
---|
4625 | 5356 | private MenuItem switchItem; |
---|
4626 | 5357 | private MenuItem cutItem; |
---|
| 5358 | + private MenuItem undoItem; |
---|
| 5359 | + private MenuItem redoItem; |
---|
4627 | 5360 | private MenuItem duplicateItem; |
---|
4628 | 5361 | private MenuItem cloneItem; |
---|
4629 | 5362 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4635 | 5368 | private MenuItem resetsupportItem; |
---|
4636 | 5369 | private MenuItem resetreferencesItem; |
---|
4637 | 5370 | private MenuItem linkverticesItem; |
---|
| 5371 | + private MenuItem relinkverticesItem; |
---|
4638 | 5372 | private MenuItem setMasterItem; |
---|
4639 | | - private MenuItem resetMeshItem; |
---|
| 5373 | + private MenuItem resetAllItem; |
---|
4640 | 5374 | private MenuItem stepAllItem; |
---|
4641 | 5375 | private MenuItem revertMeshItem; |
---|
4642 | 5376 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4647 | 5381 | private MenuItem mergeGeometriesItem; |
---|
4648 | 5382 | private MenuItem copyItem; |
---|
4649 | 5383 | private MenuItem pasteItem; |
---|
| 5384 | + private MenuItem pasteIntoItem; |
---|
4650 | 5385 | private MenuItem pasteLinkItem; |
---|
4651 | 5386 | private MenuItem pasteCloneItem; |
---|
4652 | 5387 | private MenuItem pasteExpandItem; |
---|
4653 | 5388 | private MenuItem clearItem; |
---|
4654 | 5389 | private MenuItem clearAllItem; |
---|
4655 | 5390 | private MenuItem genUVItem; |
---|
| 5391 | + private MenuItem genNormalsMESHItem; |
---|
4656 | 5392 | private MenuItem genNormalsCADItem; |
---|
4657 | 5393 | private MenuItem genNormalsORGANItem; |
---|
| 5394 | + private MenuItem genNormalsMINEItem; |
---|
4658 | 5395 | private MenuItem stripifyItem; |
---|
4659 | 5396 | private MenuItem unstripifyItem; |
---|
4660 | 5397 | private MenuItem trimItem; |
---|
.. | .. |
---|
4683 | 5420 | private MenuItem showleavesItem; |
---|
4684 | 5421 | private MenuItem markleavesItem; |
---|
4685 | 5422 | private MenuItem unmarkleavesItem; |
---|
| 5423 | + private MenuItem rewindleavesItem; |
---|
| 5424 | + private MenuItem unrewindleavesItem; |
---|
| 5425 | + private MenuItem randomleavesItem; |
---|
| 5426 | + private MenuItem unrandomleavesItem; |
---|
4686 | 5427 | |
---|
4687 | 5428 | private MenuItem flipVItem; |
---|
4688 | 5429 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
4694 | 5435 | private MenuItem panoTexturesItem; |
---|
4695 | 5436 | |
---|
4696 | 5437 | private MenuItem resetCentroidItem; |
---|
4697 | | - private MenuItem transformgeometryItem; |
---|
| 5438 | + private MenuItem resetCentroidXZItem; |
---|
4698 | 5439 | private MenuItem resetTransformItem; |
---|
| 5440 | + private MenuItem transformGeometryItem; |
---|
| 5441 | + private MenuItem transformChildrenItem; |
---|
| 5442 | + private MenuItem hideItem; |
---|
4699 | 5443 | private MenuItem grabItem; |
---|
4700 | 5444 | private MenuItem backItem; |
---|
4701 | 5445 | private MenuItem frontItem; |
---|
.. | .. |
---|
4716 | 5460 | |
---|
4717 | 5461 | private MenuItem resetParentItem; |
---|
4718 | 5462 | private MenuItem repairParentItem; |
---|
| 5463 | + private MenuItem repairShadowItem; |
---|
4719 | 5464 | private MenuItem sortbysizeItem; |
---|
4720 | 5465 | private MenuItem sortbynameItem; |
---|
4721 | 5466 | |
---|
.. | .. |
---|
4728 | 5473 | private MenuItem particleItem; |
---|
4729 | 5474 | private MenuItem ragdollItem; |
---|
4730 | 5475 | private MenuItem ragdoll2Item; |
---|
| 5476 | + private MenuItem heightFieldItem; |
---|
| 5477 | + private MenuItem textureFieldItem; |
---|
4731 | 5478 | private MenuItem gridItem; |
---|
4732 | 5479 | private MenuItem rectoidItem; |
---|
4733 | 5480 | private MenuItem ellipsoidItem; |
---|
4734 | 5481 | private MenuItem coneItem; |
---|
4735 | 5482 | private MenuItem torusItem; |
---|
4736 | 5483 | private MenuItem superItem; |
---|
| 5484 | + private MenuItem kleinItem; |
---|
4737 | 5485 | private MenuItem blobItem; |
---|
4738 | 5486 | private MenuItem latheItem; |
---|
4739 | 5487 | private MenuItem bezierItem; |
---|
4740 | | - private MenuItem checkerItem; |
---|
| 5488 | + private MenuItem overlayItem; |
---|
4741 | 5489 | private MenuItem meshItem; |
---|
4742 | 5490 | // private MenuItem meshGroupItem; |
---|
4743 | 5491 | private MenuItem springItem; |
---|
.. | .. |
---|
4746 | 5494 | private MenuItem csgItem; |
---|
4747 | 5495 | private MenuItem templateItem; |
---|
4748 | 5496 | private MenuItem textureItem; |
---|
| 5497 | + private MenuItem billboardItem; |
---|
4749 | 5498 | private MenuItem shadowXItem; |
---|
4750 | 5499 | private MenuItem shadowYItem; |
---|
4751 | 5500 | private MenuItem shadowZItem; |
---|
.. | .. |
---|
4758 | 5507 | private MenuItem doubleItem; |
---|
4759 | 5508 | private MenuItem tripleItem; |
---|
4760 | 5509 | |
---|
4761 | | - private MenuItem importGFDItem; |
---|
4762 | | - private MenuItem importVRMLX3DItem; |
---|
4763 | | - private MenuItem import3DSItem; |
---|
4764 | | - private MenuItem importOBJItem; |
---|
4765 | | - |
---|
4766 | 5510 | private MenuItem computeAOItem; |
---|
4767 | 5511 | private MenuItem recompileItem; |
---|
4768 | 5512 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
4772 | 5516 | private MenuItem analyzeItem; |
---|
4773 | 5517 | private MenuItem dumpItem; |
---|
4774 | 5518 | //boolean freezemodel = false; |
---|
| 5519 | + |
---|
| 5520 | + Menu cameraMenu; |
---|
| 5521 | + MenuItem editCameraItem; |
---|
| 5522 | + MenuItem revertCameraItem; |
---|
4775 | 5523 | } |
---|