.. | .. |
---|
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 = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + redoButton.setToolTipText("Redo changes"); |
---|
| 597 | + redoButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + saveButton.setToolTipText("Save changes"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 604 | + liveCB.setToolTipText("Enable animation"); |
---|
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(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 609 | + oneStepButton.addActionListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 612 | + fastCB.setToolTipText("Fast mode"); |
---|
434 | 613 | 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); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(trackCB = new cCheckBox(":", 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 = new cButton("@", !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 = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + flashSelectionButton.setToolTipText("Show 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.addItemListener(this); |
---|
| 812 | + |
---|
| 813 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 814 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 815 | + lookAtCB.addItemListener(this); |
---|
| 816 | + |
---|
| 817 | + } |
---|
| 818 | + |
---|
| 819 | + cGridBag fill = new cGridBag(); |
---|
| 820 | + |
---|
| 821 | + fill.preferredHeight = 200; |
---|
| 822 | + |
---|
| 823 | + panel.add(fill); |
---|
| 824 | + |
---|
| 825 | + } |
---|
619 | 826 | |
---|
620 | 827 | void EditObject(Object3D obj) |
---|
621 | 828 | { |
---|
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(); |
---|
| 829 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 830 | + radioButton.SetObject(obj); |
---|
| 831 | + radioButton.layout = sevenButton; |
---|
| 832 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 833 | + radioButton.addActionListener(this); |
---|
| 834 | + radioPanel.add(radioButton); |
---|
| 835 | + buttonGroup.add(radioButton); |
---|
| 836 | + radioButton.doClick(); |
---|
630 | 837 | } |
---|
| 838 | + |
---|
631 | 839 | void SetupViews(ObjEditor oe) |
---|
632 | 840 | { |
---|
| 841 | + theFrame = this; |
---|
| 842 | + |
---|
633 | 843 | oe.SetupViews(); |
---|
634 | 844 | |
---|
635 | 845 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
646 | 856 | JCheckBox fastCB; |
---|
647 | 857 | JCheckBox slowCB; |
---|
648 | 858 | JCheckBox boxCB; |
---|
| 859 | + JCheckBox zoomBoxCB; |
---|
649 | 860 | JCheckBox trackCB; |
---|
650 | 861 | JCheckBox smoothfocusCB; |
---|
651 | 862 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
688 | 899 | dropAttributes |= Object3D.TEXTURE; |
---|
689 | 900 | else |
---|
690 | 901 | dropAttributes &= ~Object3D.TEXTURE; |
---|
691 | | - } |
---|
692 | | - else if(e.getSource() == liveCB) |
---|
| 902 | + } else if(e.getSource() == liveCB) |
---|
693 | 903 | { |
---|
694 | 904 | cameraView.ToggleLive(); |
---|
| 905 | + refreshContents(false); |
---|
695 | 906 | } |
---|
696 | 907 | else if(e.getSource() == supportCB) |
---|
697 | 908 | { |
---|
.. | .. |
---|
726 | 937 | Recompile(); |
---|
727 | 938 | cameraView.repaint(); |
---|
728 | 939 | // refreshContents(); |
---|
| 940 | + } |
---|
| 941 | + else if(e.getSource() == zoomBoxCB) |
---|
| 942 | + { |
---|
| 943 | + cameraView.ToggleZoomBoxMode(); |
---|
729 | 944 | } |
---|
730 | 945 | else if(e.getSource() == smoothfocusCB) |
---|
731 | 946 | { |
---|
.. | .. |
---|
840 | 1055 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
841 | 1056 | // return; |
---|
842 | 1057 | // } |
---|
843 | | - if (string.charAt(0) == '/') |
---|
| 1058 | + |
---|
| 1059 | + // File path for Mac and Windows |
---|
| 1060 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
844 | 1061 | { |
---|
845 | 1062 | // file(s) |
---|
846 | 1063 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
867 | 1084 | |
---|
868 | 1085 | flashIt = false; |
---|
869 | 1086 | CameraPane pane = (CameraPane) target; |
---|
870 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1087 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
871 | 1088 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
872 | 1089 | |
---|
873 | 1090 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
894 | 1111 | { |
---|
895 | 1112 | loadClipboard(true); |
---|
896 | 1113 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
897 | | - pasteInto(false); |
---|
| 1114 | + pasteInto(false, false); |
---|
898 | 1115 | } else { |
---|
899 | 1116 | loadClipboard(false); |
---|
900 | 1117 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
901 | | - pasteInto(false); // true); // ??? |
---|
| 1118 | + pasteInto(false, false); // true); // ??? |
---|
902 | 1119 | } |
---|
903 | 1120 | } |
---|
904 | 1121 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1002 | 1219 | |
---|
1003 | 1220 | void buildCreateMenu(Menu menu) |
---|
1004 | 1221 | { |
---|
| 1222 | + //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
| 1223 | + //heightFieldItem.addActionListener(this); |
---|
1005 | 1224 | gridItem = menu.add(new MenuItem("Grid")); |
---|
1006 | 1225 | gridItem.addActionListener(this); |
---|
1007 | 1226 | rectoidItem = menu.add(new MenuItem("Box")); |
---|
.. | .. |
---|
1014 | 1233 | torusItem.addActionListener(this); |
---|
1015 | 1234 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1016 | 1235 | superItem.addActionListener(this); |
---|
| 1236 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1237 | + kleinItem.addActionListener(this); |
---|
1017 | 1238 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1018 | 1239 | particleItem.addActionListener(this); |
---|
| 1240 | + if (Globals.ADVANCED) |
---|
| 1241 | + { |
---|
1019 | 1242 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1020 | 1243 | ragdollItem.addActionListener(this); |
---|
1021 | 1244 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1022 | 1245 | ragdoll2Item.addActionListener(this); |
---|
| 1246 | + } |
---|
1023 | 1247 | menu.add("-"); |
---|
1024 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1248 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1025 | 1249 | meshItem.addActionListener(this); |
---|
1026 | 1250 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1027 | 1251 | // meshGroupItem.addActionListener(this); |
---|
| 1252 | + if (Globals.ADVANCED) |
---|
| 1253 | + { |
---|
1028 | 1254 | springItem = menu.add(new MenuItem("Spring")); |
---|
1029 | 1255 | springItem.addActionListener(this); |
---|
1030 | 1256 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1031 | 1257 | 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 | 1258 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1037 | 1259 | blobItem.addActionListener(this); |
---|
1038 | 1260 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1039 | 1261 | latheItem.addActionListener(this); |
---|
| 1262 | + } |
---|
| 1263 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1264 | + bezierItem.addActionListener(this); |
---|
| 1265 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1266 | + overlayItem.addActionListener(this); |
---|
1040 | 1267 | lightItem = menu.add(new MenuItem("Light")); |
---|
1041 | 1268 | lightItem.addActionListener(this); |
---|
1042 | 1269 | menu.add("-"); |
---|
.. | .. |
---|
1046 | 1273 | loopItem.addActionListener(this); |
---|
1047 | 1274 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1048 | 1275 | doubleItem.addActionListener(this); |
---|
| 1276 | + if (Globals.ADVANCED) |
---|
| 1277 | + { |
---|
1049 | 1278 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1050 | 1279 | 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); |
---|
| 1280 | + } |
---|
1060 | 1281 | } |
---|
1061 | 1282 | |
---|
1062 | 1283 | void buildToolsMenu(Menu menu) |
---|
1063 | 1284 | { |
---|
1064 | 1285 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1065 | 1286 | animationItem.addItemListener(this); |
---|
1066 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1287 | + animationItem.setState(Globals.ANIMATION); |
---|
1067 | 1288 | |
---|
1068 | 1289 | menu.add("-"); |
---|
1069 | 1290 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1070 | 1291 | parseverticesItem.addActionListener(this); |
---|
1071 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1292 | + textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
| 1293 | + textureFieldItem.addActionListener(this); |
---|
| 1294 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1072 | 1295 | alignItem.addActionListener(this); |
---|
1073 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1074 | | - mirrorItem.addActionListener(this); |
---|
1075 | 1296 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1076 | 1297 | reduceMorphItem.addActionListener(this); |
---|
1077 | 1298 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1078 | 1299 | reduce34MorphItem.addActionListener(this); |
---|
1079 | | - |
---|
| 1300 | + menu.add("-"); |
---|
1080 | 1301 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1081 | 1302 | computeAOItem.addActionListener(this); |
---|
1082 | | - menu.add("-"); |
---|
1083 | 1303 | |
---|
| 1304 | + if (Globals.ADVANCED) |
---|
| 1305 | + { |
---|
| 1306 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1307 | + mirrorItem.addActionListener(this); |
---|
| 1308 | + menu.add("-"); |
---|
1084 | 1309 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1085 | 1310 | memoryItem.addActionListener(this); |
---|
1086 | 1311 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1087 | 1312 | analyzeItem.addActionListener(this); |
---|
1088 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1313 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1089 | 1314 | dumpItem.addActionListener(this); |
---|
1090 | 1315 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1091 | 1316 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1094 | 1319 | resetParentItem.addActionListener(this); |
---|
1095 | 1320 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1096 | 1321 | repairParentItem.addActionListener(this); |
---|
| 1322 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1323 | + repairShadowItem.addActionListener(this); |
---|
1097 | 1324 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1098 | 1325 | invariantsItem.addActionListener(this); |
---|
1099 | 1326 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1101 | 1328 | menu.add("-"); |
---|
1102 | 1329 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1103 | 1330 | editScriptItem.addActionListener(this); |
---|
| 1331 | + } |
---|
1104 | 1332 | } |
---|
1105 | 1333 | |
---|
1106 | 1334 | void ScreenFit() |
---|
.. | .. |
---|
1223 | 1451 | shadow.material = new cMaterial(obj.material); |
---|
1224 | 1452 | shadow.material.diffuse = 0.0001f; |
---|
1225 | 1453 | shadow.material.specular = 0.0001f; |
---|
| 1454 | + //shadow.projectedVertices[1].x = 300; |
---|
1226 | 1455 | |
---|
1227 | 1456 | makeSomething(shadow); |
---|
1228 | 1457 | } |
---|
.. | .. |
---|
1429 | 1658 | |
---|
1430 | 1659 | void Overwrite(int mask) |
---|
1431 | 1660 | { |
---|
1432 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1661 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1433 | 1662 | { |
---|
1434 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1663 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1435 | 1664 | |
---|
1436 | 1665 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1437 | 1666 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1454 | 1683 | // |
---|
1455 | 1684 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1456 | 1685 | { |
---|
| 1686 | + Object source = event.getSource(); |
---|
1457 | 1687 | /* |
---|
1458 | 1688 | if (event.getSource() == nameField) |
---|
1459 | 1689 | { |
---|
.. | .. |
---|
1465 | 1695 | } |
---|
1466 | 1696 | else |
---|
1467 | 1697 | */ |
---|
1468 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1698 | + if (source == lookAtItem || source == lookFromItem) |
---|
1469 | 1699 | { |
---|
1470 | 1700 | ScreenFit(); |
---|
1471 | 1701 | } else |
---|
1472 | | - if (event.getSource() == switchItem) |
---|
| 1702 | + if (source == switchItem) |
---|
1473 | 1703 | { |
---|
1474 | 1704 | cVector v1 = new cVector(); |
---|
1475 | 1705 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1478 | 1708 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1479 | 1709 | objEditor.cameraView.repaint(); |
---|
1480 | 1710 | } else |
---|
1481 | | - if (event.getSource() == rectoidItem) |
---|
| 1711 | + if (source == rectoidItem) |
---|
1482 | 1712 | { |
---|
1483 | 1713 | makeSomething(new Box()); |
---|
1484 | 1714 | } else |
---|
1485 | | - if (event.getSource() == particleItem) |
---|
| 1715 | + if (source == particleItem) |
---|
1486 | 1716 | { |
---|
1487 | 1717 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1488 | 1718 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1503 | 1733 | applyExample(particleGeom, "SMOKE"); |
---|
1504 | 1734 | makeSomething(particleGeom); |
---|
1505 | 1735 | } else |
---|
1506 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1736 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1507 | 1737 | { |
---|
1508 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1738 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1509 | 1739 | |
---|
1510 | 1740 | ragdoll.toParent = LA.newMatrix(); |
---|
1511 | 1741 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1521 | 1751 | makeSomething(ragdoll); |
---|
1522 | 1752 | //makeSomething(new VehicleDemo()); |
---|
1523 | 1753 | } else |
---|
1524 | | - if (event.getSource() == gridItem) |
---|
| 1754 | + /* |
---|
| 1755 | + */ |
---|
| 1756 | + if (source == heightFieldItem) |
---|
| 1757 | + { |
---|
| 1758 | + Object3D obj = new Object3D(); |
---|
| 1759 | + |
---|
| 1760 | + obj.CreateMaterial(); |
---|
| 1761 | + obj.bRep = new BoundaryRep(); |
---|
| 1762 | + |
---|
| 1763 | + obj.bRep.CreateMesh(new iHeightField() |
---|
| 1764 | + { |
---|
| 1765 | + public double f(double x, double y) |
---|
| 1766 | + { |
---|
| 1767 | + // The Mandelbrot set is represented by coloring |
---|
| 1768 | + // each point (x,y) according to the number of |
---|
| 1769 | + // iterations it takes before the while loop in |
---|
| 1770 | + // this method ends. For points that are actually |
---|
| 1771 | + // in the Mandelbrot set, or very close to it, the |
---|
| 1772 | + // count will reach the maximum value, 80. These |
---|
| 1773 | + // points will be colored purple. All other colors |
---|
| 1774 | + // represent points that are definitely NOT in the set. |
---|
| 1775 | + x -= 600; |
---|
| 1776 | + y -= 500; |
---|
| 1777 | + x /= 200; |
---|
| 1778 | + y /= 200; |
---|
| 1779 | + int count = 0; |
---|
| 1780 | + double zx = x; |
---|
| 1781 | + double zy = y; |
---|
| 1782 | + while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) { |
---|
| 1783 | + double new_zx = zx*zx - zy*zy + x; |
---|
| 1784 | + zy = 2*zx*zy + y; |
---|
| 1785 | + zx = new_zx; |
---|
| 1786 | + count++; |
---|
| 1787 | + } |
---|
| 1788 | + return count; // Math.sqrt(count); |
---|
| 1789 | + } |
---|
| 1790 | + }, 1000,1000); |
---|
| 1791 | + |
---|
| 1792 | + makeSomething(obj); |
---|
| 1793 | + } else |
---|
| 1794 | + if (source == gridItem) |
---|
1525 | 1795 | { |
---|
1526 | 1796 | makeSomething(new Grid()); |
---|
1527 | 1797 | } else |
---|
1528 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1798 | + if (source == ellipsoidItem) |
---|
1529 | 1799 | { |
---|
1530 | 1800 | makeSomething(new Sphere()); |
---|
1531 | 1801 | } else |
---|
1532 | | - if (event.getSource() == coneItem) |
---|
| 1802 | + if (source == coneItem) |
---|
1533 | 1803 | { |
---|
1534 | 1804 | makeSomething(new Cone()); |
---|
1535 | 1805 | } else |
---|
1536 | | - if (event.getSource() == torusItem) |
---|
| 1806 | + if (source == torusItem) |
---|
1537 | 1807 | { |
---|
1538 | 1808 | makeSomething(new Torus()); |
---|
1539 | 1809 | } else |
---|
1540 | | - if (event.getSource() == superItem) |
---|
| 1810 | + if (source == superItem) |
---|
1541 | 1811 | { |
---|
1542 | 1812 | makeSomething(new Superellipsoid()); |
---|
1543 | 1813 | } else |
---|
1544 | | - if (event.getSource() == blobItem) |
---|
| 1814 | + if (source == kleinItem) |
---|
| 1815 | + { |
---|
| 1816 | + makeSomething(new Klein()); |
---|
| 1817 | + } else |
---|
| 1818 | + if (source == blobItem) |
---|
1545 | 1819 | { |
---|
1546 | 1820 | Blob blob = new Blob(); |
---|
1547 | 1821 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1549 | 1823 | //blob.retile(); |
---|
1550 | 1824 | makeSomething(blob); |
---|
1551 | 1825 | } else |
---|
1552 | | - if (event.getSource() == latheItem) |
---|
| 1826 | + if (source == latheItem) |
---|
1553 | 1827 | { |
---|
1554 | 1828 | makeSomething(new Lathe()); |
---|
1555 | 1829 | } else |
---|
1556 | | - if (event.getSource() == bezierItem) |
---|
| 1830 | + if (source == bezierItem) |
---|
1557 | 1831 | { |
---|
1558 | 1832 | makeSomething(new BezierSurface()); |
---|
1559 | 1833 | } else |
---|
1560 | | - if (event.getSource() == checkerItem) |
---|
| 1834 | + if (source == overlayItem) |
---|
1561 | 1835 | { |
---|
1562 | 1836 | /* |
---|
1563 | 1837 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1570 | 1844 | LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent); |
---|
1571 | 1845 | LA.matInvert(obj.toParent, obj.fromParent); |
---|
1572 | 1846 | */ |
---|
1573 | | - makeSomething(new CheckerIG()); |
---|
| 1847 | + makeSomething(new Checker()); |
---|
1574 | 1848 | } else |
---|
1575 | | - if (event.getSource() == meshItem) |
---|
| 1849 | + if (source == meshItem) |
---|
1576 | 1850 | { |
---|
1577 | 1851 | Object3D itemtomake = new Object3D(); |
---|
1578 | 1852 | Object3D child; |
---|
.. | .. |
---|
1593 | 1867 | makeSomething(child); |
---|
1594 | 1868 | } |
---|
1595 | 1869 | } else |
---|
1596 | | - if (event.getSource() == springItem) |
---|
| 1870 | + if (source == springItem) |
---|
1597 | 1871 | { |
---|
1598 | 1872 | cSpring s = new cSpring(); |
---|
1599 | 1873 | s.setup(); |
---|
1600 | 1874 | makeSomething(s); |
---|
1601 | 1875 | } else |
---|
1602 | | - if (event.getSource() == flagItem) |
---|
| 1876 | + if (source == flagItem) |
---|
1603 | 1877 | { |
---|
1604 | 1878 | cSpring s = new cFlag(); |
---|
1605 | 1879 | s.setup(); |
---|
1606 | 1880 | makeSomething(s); |
---|
1607 | 1881 | } else |
---|
1608 | | - if (event.getSource() == lightItem) |
---|
| 1882 | + if (source == lightItem) |
---|
1609 | 1883 | { |
---|
1610 | 1884 | makeSomething(new Light()); |
---|
1611 | 1885 | } else |
---|
1612 | | - if (event.getSource() == csgItem) |
---|
| 1886 | + if (source == csgItem) |
---|
1613 | 1887 | { |
---|
1614 | 1888 | group(new CSG()); |
---|
1615 | 1889 | } else |
---|
1616 | | - if (event.getSource() == templateItem) |
---|
| 1890 | + if (source == templateItem) |
---|
1617 | 1891 | { |
---|
1618 | 1892 | group(new cTemplate()); |
---|
1619 | 1893 | } else |
---|
1620 | | - if (event.getSource() == attributeItem) |
---|
| 1894 | + if (source == attributeItem) |
---|
1621 | 1895 | { |
---|
1622 | 1896 | makeSomething(new Attribute()); |
---|
1623 | 1897 | } else |
---|
1624 | | - if (event.getSource() == pointflowItem) |
---|
| 1898 | + if (source == pointflowItem) |
---|
1625 | 1899 | { |
---|
1626 | 1900 | makeSomething(new PointFlow()); |
---|
1627 | 1901 | } else |
---|
.. | .. |
---|
1633 | 1907 | } else |
---|
1634 | 1908 | */ |
---|
1635 | 1909 | |
---|
1636 | | - if (event.getSource() == superLoopItem) |
---|
| 1910 | + if (source == superLoopItem) |
---|
1637 | 1911 | { |
---|
1638 | 1912 | Composite g = new cGroup(); |
---|
1639 | 1913 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1655 | 1929 | |
---|
1656 | 1930 | group(g); |
---|
1657 | 1931 | } else |
---|
1658 | | - if (event.getSource() == loopItem) |
---|
| 1932 | + if (source == loopItem) |
---|
1659 | 1933 | { |
---|
1660 | 1934 | Composite csg = new GroupLeaf(); |
---|
1661 | 1935 | csg.count = 5; |
---|
.. | .. |
---|
1664 | 1938 | csg.addChild(child); |
---|
1665 | 1939 | child.addChild(csg); |
---|
1666 | 1940 | } else |
---|
1667 | | - if (event.getSource() == doubleItem) |
---|
| 1941 | + if (source == doubleItem) |
---|
1668 | 1942 | { |
---|
1669 | 1943 | Composite csg = new GroupLeaf(); |
---|
1670 | 1944 | csg.count = 5; |
---|
.. | .. |
---|
1676 | 1950 | csg.addChild(child); |
---|
1677 | 1951 | child.addChild(csg); |
---|
1678 | 1952 | } else |
---|
1679 | | - if (event.getSource() == tripleItem) |
---|
| 1953 | + if (source == tripleItem) |
---|
1680 | 1954 | { |
---|
1681 | 1955 | Composite csg = new GroupLeaf(); |
---|
1682 | 1956 | csg.count = 4; |
---|
.. | .. |
---|
1691 | 1965 | csg.addChild(child); |
---|
1692 | 1966 | child.addChild(csg); |
---|
1693 | 1967 | } else |
---|
1694 | | - |
---|
1695 | | - if (event.getSource() == importGFDItem) |
---|
| 1968 | + if (source == computeAOItem) |
---|
1696 | 1969 | { |
---|
1697 | | - ImportGFD(); |
---|
| 1970 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1971 | + Globals.theRenderer.repaint(); |
---|
1698 | 1972 | } 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) |
---|
| 1973 | + if (source == recompileItem) |
---|
1717 | 1974 | { |
---|
1718 | 1975 | Recompile(); |
---|
1719 | 1976 | refreshContents(); |
---|
1720 | 1977 | } else |
---|
1721 | | - if (event.getSource() == editScriptItem) |
---|
| 1978 | + if (source == editScriptItem) |
---|
1722 | 1979 | { |
---|
1723 | 1980 | OpenDialog(); |
---|
1724 | 1981 | refreshContents(); |
---|
1725 | 1982 | } else |
---|
1726 | | - if (event.getSource() == invariantsItem) |
---|
| 1983 | + if (source == invariantsItem) |
---|
1727 | 1984 | { |
---|
1728 | 1985 | System.out.println("Invariants:"); |
---|
1729 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 1986 | + Grafreed.grafreeD.universe.invariants(); |
---|
1730 | 1987 | } else |
---|
1731 | | - if (event.getSource() == memoryItem) |
---|
| 1988 | + if (source == memoryItem) |
---|
1732 | 1989 | { |
---|
1733 | 1990 | //System.out.println("Invariants:"); |
---|
1734 | 1991 | PrintMemory(); |
---|
1735 | 1992 | } else |
---|
1736 | | - if (event.getSource() == pathItem) |
---|
| 1993 | + if (source == pathItem) |
---|
1737 | 1994 | { |
---|
1738 | 1995 | PrintPath(); |
---|
1739 | 1996 | } else |
---|
1740 | | - if (event.getSource() == analyzeItem) |
---|
| 1997 | + if (source == analyzeItem) |
---|
1741 | 1998 | { |
---|
1742 | 1999 | AnalyzeObject(); |
---|
1743 | 2000 | } else |
---|
1744 | | - if (event.getSource() == dumpItem) |
---|
| 2001 | + if (source == dumpItem) |
---|
1745 | 2002 | { |
---|
1746 | 2003 | DumpObject(); |
---|
1747 | 2004 | } else |
---|
1748 | | - if (event.getSource() == screenfitButton) |
---|
| 2005 | + if (source == minButton) |
---|
| 2006 | + { |
---|
| 2007 | + Minimize(); |
---|
| 2008 | + } else |
---|
| 2009 | + if (source == maxButton) |
---|
| 2010 | + { |
---|
| 2011 | + Maximize(); |
---|
| 2012 | + } else |
---|
| 2013 | + if (source == fullButton) |
---|
| 2014 | + { |
---|
| 2015 | + ToggleFullScreen(); |
---|
| 2016 | + } else |
---|
| 2017 | + if (source == undoButton) |
---|
| 2018 | + { |
---|
| 2019 | + Undo(); |
---|
| 2020 | + } else |
---|
| 2021 | + if (source == redoButton) |
---|
| 2022 | + { |
---|
| 2023 | + Redo(); |
---|
| 2024 | + } else |
---|
| 2025 | + if (source == saveButton) |
---|
| 2026 | + { |
---|
| 2027 | + Save(); |
---|
| 2028 | + } else |
---|
| 2029 | + if (source == oneStepButton) |
---|
| 2030 | + { |
---|
| 2031 | + Globals.ONESTEP = true; |
---|
| 2032 | + cameraView.repaint(); |
---|
| 2033 | + } else |
---|
| 2034 | + if (source == screenfitButton) |
---|
1749 | 2035 | { |
---|
1750 | 2036 | //Reload(lastConverter, lastFilename, true); |
---|
1751 | 2037 | ScreenFit(); |
---|
1752 | 2038 | } else |
---|
1753 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2039 | + if (source == screenfitpointButton) |
---|
1754 | 2040 | { |
---|
1755 | 2041 | //Reload(lastConverter, lastFilename, true); |
---|
1756 | 2042 | ScreenFitPoint(); |
---|
1757 | 2043 | } else |
---|
1758 | | - if (event.getSource() == snapobjectButton) |
---|
| 2044 | + if (source == snapobjectButton) |
---|
1759 | 2045 | { |
---|
1760 | 2046 | //Reload(lastConverter, lastFilename, true); |
---|
1761 | 2047 | SnapObject(); |
---|
.. | .. |
---|
1766 | 2052 | // Recompile(); |
---|
1767 | 2053 | // refreshContents(); |
---|
1768 | 2054 | // } else |
---|
1769 | | - if (event.getSource() == gcButton) |
---|
| 2055 | + if (source == gcButton) |
---|
1770 | 2056 | { |
---|
1771 | 2057 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1772 | 2058 | System.gc(); |
---|
1773 | 2059 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1774 | 2060 | } else |
---|
1775 | | - if (event.getSource() == editLeafItem) |
---|
| 2061 | + if (source == editLeafItem) |
---|
1776 | 2062 | { |
---|
1777 | 2063 | Object3D obj; |
---|
1778 | 2064 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1786 | 2072 | } |
---|
1787 | 2073 | refreshContents(true); |
---|
1788 | 2074 | } else |
---|
1789 | | - if (event.getSource() == openWindowItem) |
---|
| 2075 | + if (source == openWindowItem) |
---|
1790 | 2076 | { |
---|
1791 | 2077 | EditSelection(true); |
---|
1792 | 2078 | } else |
---|
1793 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2079 | + if (source == cutItem || source == clearButton) |
---|
1794 | 2080 | { |
---|
1795 | 2081 | loadClipboard(true); |
---|
1796 | 2082 | } else |
---|
1797 | | - if (event.getSource() == duplicateItem) |
---|
| 2083 | + if (source == undoItem) |
---|
1798 | 2084 | { |
---|
1799 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 2085 | + Undo(); |
---|
| 2086 | + } else |
---|
| 2087 | + if (source == redoItem) |
---|
| 2088 | + { |
---|
| 2089 | + Redo(); |
---|
| 2090 | + } else |
---|
| 2091 | + if (source == duplicateItem) |
---|
| 2092 | + { |
---|
| 2093 | + Object3D keep = Grafreed.clipboard; |
---|
1800 | 2094 | loadClipboard(false); |
---|
1801 | 2095 | paste(false); |
---|
1802 | | - GraphreeD.clipboard = keep; |
---|
| 2096 | + Grafreed.clipboard = keep; |
---|
1803 | 2097 | } else |
---|
1804 | | - if (event.getSource() == cloneItem) |
---|
| 2098 | + if (source == cloneItem) |
---|
1805 | 2099 | { |
---|
1806 | 2100 | CloneSelection(false); |
---|
1807 | 2101 | } else |
---|
1808 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2102 | + if (source == cloneSupportItem) |
---|
1809 | 2103 | { |
---|
1810 | 2104 | CloneSelection(true); |
---|
1811 | 2105 | } else |
---|
1812 | | - if (event.getSource() == copyItem) |
---|
| 2106 | + if (source == copyItem) |
---|
1813 | 2107 | { |
---|
1814 | 2108 | loadClipboard(false); |
---|
1815 | 2109 | } else |
---|
1816 | | - if (event.getSource() == pasteItem) |
---|
| 2110 | + if (source == pasteItem) |
---|
1817 | 2111 | { |
---|
1818 | 2112 | paste(false); |
---|
1819 | 2113 | } else |
---|
1820 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2114 | + if (source == pasteIntoItem) |
---|
1821 | 2115 | { |
---|
1822 | | - pasteInto(false); |
---|
| 2116 | + pasteInto(true, false); |
---|
1823 | 2117 | } else |
---|
1824 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2118 | + if (source == pasteLinkItem) |
---|
1825 | 2119 | { |
---|
1826 | | - pasteInto(true); |
---|
| 2120 | + pasteInto(false, false); |
---|
1827 | 2121 | } else |
---|
1828 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2122 | + if (source == pasteCloneItem) |
---|
| 2123 | + { |
---|
| 2124 | + pasteInto(true, true); |
---|
| 2125 | + } else |
---|
| 2126 | + if (source == pasteExpandItem) |
---|
1829 | 2127 | { |
---|
1830 | 2128 | paste(true); |
---|
1831 | 2129 | } else |
---|
1832 | | - if (event.getSource() == synchronizeItem) |
---|
| 2130 | + if (source == synchronizeItem) |
---|
1833 | 2131 | { |
---|
1834 | 2132 | Overwrite(Object3D.TRANSFORM); |
---|
1835 | 2133 | } else |
---|
1836 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2134 | + if (source == overwriteNameItem) |
---|
1837 | 2135 | { |
---|
1838 | 2136 | Overwrite(Object3D.NAME); |
---|
1839 | 2137 | } else |
---|
1840 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2138 | + if (source == overwriteUVItem) |
---|
1841 | 2139 | { |
---|
1842 | 2140 | Overwrite(Object3D.UV); |
---|
1843 | 2141 | } else |
---|
1844 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2142 | + if (source == overwriteMatItem) |
---|
1845 | 2143 | { |
---|
| 2144 | + /* july 2015 |
---|
1846 | 2145 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1847 | | - Overwrite(Object3D.MATERIAL); |
---|
| 2146 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1848 | 2147 | else |
---|
1849 | 2148 | { |
---|
1850 | 2149 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1856 | 2155 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1857 | 2156 | } |
---|
1858 | 2157 | } |
---|
| 2158 | + */ |
---|
| 2159 | + |
---|
| 2160 | + Overwrite(dropAttributes); |
---|
1859 | 2161 | } |
---|
1860 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2162 | + if (source == overwriteGeoItem) |
---|
1861 | 2163 | { |
---|
1862 | 2164 | Overwrite(Object3D.GEOMETRY); |
---|
1863 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2165 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1864 | 2166 | // { |
---|
1865 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2167 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1866 | 2168 | // |
---|
1867 | 2169 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1868 | 2170 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1874 | 2176 | // refreshContents(); |
---|
1875 | 2177 | // } |
---|
1876 | 2178 | } else |
---|
1877 | | - if (event.getSource() == generateMeshItem) |
---|
| 2179 | + if (source == generateMeshItem) |
---|
1878 | 2180 | { |
---|
1879 | 2181 | //if (group.selection.size() == 1) |
---|
1880 | 2182 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1885 | 2187 | ResetModel(); |
---|
1886 | 2188 | refreshContents(); |
---|
1887 | 2189 | } else |
---|
1888 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2190 | + if (source == extractGeometriesItem) |
---|
1889 | 2191 | { |
---|
1890 | 2192 | boolean one = false; |
---|
1891 | 2193 | |
---|
.. | .. |
---|
1912 | 2214 | ResetModel(); |
---|
1913 | 2215 | refreshContents(); |
---|
1914 | 2216 | } else |
---|
1915 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2217 | + if (source == cloneGeometriesItem) |
---|
1916 | 2218 | { |
---|
1917 | 2219 | boolean one = false; |
---|
1918 | 2220 | |
---|
.. | .. |
---|
1938 | 2240 | ResetModel(); |
---|
1939 | 2241 | refreshContents(); |
---|
1940 | 2242 | } else |
---|
1941 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2243 | + if (source == shareGeometriesItem) |
---|
1942 | 2244 | { |
---|
1943 | 2245 | boolean one = false; |
---|
1944 | 2246 | |
---|
1945 | 2247 | if (group.selection.size() == 1) |
---|
1946 | 2248 | one = true; |
---|
1947 | 2249 | |
---|
| 2250 | + Object3D merge = null; |
---|
| 2251 | + |
---|
1948 | 2252 | Object3D content = new cGroup(); |
---|
1949 | 2253 | |
---|
1950 | 2254 | for (int i=0; i<group.selection.size(); i++) |
---|
1951 | 2255 | { |
---|
1952 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2256 | + merge = new Merge(group.selection.get(i)); |
---|
1953 | 2257 | |
---|
1954 | 2258 | if (one) |
---|
1955 | | - makeSomething(sel, false); |
---|
| 2259 | + makeSomething(merge, false); |
---|
1956 | 2260 | else |
---|
1957 | | - content.addChild(sel); |
---|
| 2261 | + content.addChild(merge); |
---|
1958 | 2262 | } |
---|
1959 | 2263 | |
---|
1960 | 2264 | if (!one) |
---|
1961 | | - makeSomething(content, false); |
---|
1962 | | - |
---|
1963 | | - ResetModel(); |
---|
1964 | | - refreshContents(); |
---|
| 2265 | + makeSomething(content, true); |
---|
| 2266 | + else |
---|
| 2267 | + { |
---|
| 2268 | + ResetModel(); |
---|
| 2269 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2270 | + refreshContents(); |
---|
| 2271 | + } |
---|
1965 | 2272 | } else |
---|
1966 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2273 | + if (source == mergeGeometriesItem) |
---|
1967 | 2274 | { |
---|
1968 | 2275 | boolean one = false; |
---|
1969 | 2276 | |
---|
.. | .. |
---|
1993 | 2300 | ResetModel(); |
---|
1994 | 2301 | refreshContents(); |
---|
1995 | 2302 | } else |
---|
1996 | | - if (event.getSource() == linkverticesItem) |
---|
| 2303 | + if (source == linkverticesItem) |
---|
1997 | 2304 | { |
---|
1998 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2305 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
1999 | 2306 | // { |
---|
2000 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2307 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2001 | 2308 | // |
---|
2002 | 2309 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2003 | 2310 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2006 | 2313 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2007 | 2314 | // refreshContents(); |
---|
2008 | 2315 | // } |
---|
2009 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2316 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2010 | 2317 | { |
---|
2011 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2318 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2012 | 2319 | |
---|
2013 | 2320 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2014 | 2321 | content = ((cGroup)content).get(0); |
---|
2015 | 2322 | |
---|
2016 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2323 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2017 | 2324 | for (int i=0; i<group.selection.size(); i++) |
---|
2018 | 2325 | { |
---|
2019 | | - boolean random = CameraPane.RANDOM; |
---|
2020 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2326 | + boolean random = CameraPane.SWITCH; |
---|
| 2327 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2021 | 2328 | group.selection.get(i).linkVerticesThis(content); |
---|
2022 | 2329 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2023 | | - CameraPane.RANDOM = random; |
---|
| 2330 | + CameraPane.SWITCH = random; |
---|
2024 | 2331 | } |
---|
2025 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2332 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2026 | 2333 | refreshContents(); |
---|
2027 | 2334 | } |
---|
2028 | 2335 | } else |
---|
2029 | | - if (event.getSource() == resetsupportItem) |
---|
| 2336 | + if (source == resetsupportItem) |
---|
2030 | 2337 | { |
---|
2031 | 2338 | for (int i=0; i<group.selection.size(); i++) |
---|
2032 | 2339 | { |
---|
2033 | | - boolean random = CameraPane.RANDOM; |
---|
2034 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2340 | + boolean random = CameraPane.SWITCH; |
---|
| 2341 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2035 | 2342 | group.selection.get(i).linkVerticesThis(null); |
---|
2036 | | - CameraPane.RANDOM = random; |
---|
| 2343 | + CameraPane.SWITCH = random; |
---|
2037 | 2344 | } |
---|
2038 | 2345 | |
---|
2039 | 2346 | refreshContents(); |
---|
2040 | 2347 | } else |
---|
2041 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2348 | + if (source == relinkverticesItem) |
---|
| 2349 | + { |
---|
| 2350 | + boolean random = CameraPane.SWITCH; |
---|
| 2351 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2352 | + group.selection.RelinkToSupport(); |
---|
| 2353 | + CameraPane.SWITCH = random; |
---|
| 2354 | + |
---|
| 2355 | + refreshContents(); |
---|
| 2356 | + } else |
---|
| 2357 | + if (source == resetreferencesItem) |
---|
2042 | 2358 | { |
---|
2043 | 2359 | for (int i=0; i<group.selection.size(); i++) |
---|
2044 | 2360 | { |
---|
.. | .. |
---|
2047 | 2363 | |
---|
2048 | 2364 | refreshContents(); |
---|
2049 | 2365 | } else |
---|
2050 | | - if (event.getSource() == setMasterItem) |
---|
| 2366 | + if (source == setMasterItem) |
---|
2051 | 2367 | { |
---|
2052 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2368 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2053 | 2369 | { |
---|
2054 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2370 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2055 | 2371 | |
---|
2056 | 2372 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2057 | 2373 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2060 | 2376 | refreshContents(); |
---|
2061 | 2377 | } |
---|
2062 | 2378 | } else |
---|
2063 | | - if (event.getSource() == poseMeshItem) |
---|
| 2379 | + if (source == poseMeshItem) |
---|
2064 | 2380 | { |
---|
2065 | 2381 | if (group.selection.size() == 1) |
---|
2066 | 2382 | { |
---|
2067 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2383 | + if (Grafreed.clipboard.size() == 1) |
---|
2068 | 2384 | { |
---|
2069 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2385 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2070 | 2386 | |
---|
2071 | 2387 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2072 | 2388 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2079 | 2395 | } |
---|
2080 | 2396 | |
---|
2081 | 2397 | } else |
---|
2082 | | - if (event.getSource() == revertMeshItem) |
---|
| 2398 | + if (source == revertMeshItem) |
---|
2083 | 2399 | { |
---|
2084 | 2400 | RevertMeshes(); |
---|
2085 | 2401 | } else |
---|
2086 | | - if (event.getSource() == resetMeshItem) |
---|
| 2402 | + if (source == resetAllItem) |
---|
2087 | 2403 | { |
---|
2088 | 2404 | ResetAll(); |
---|
2089 | 2405 | } else |
---|
2090 | | - if (event.getSource() == stepAllItem) |
---|
| 2406 | + if (source == stepAllItem) |
---|
2091 | 2407 | { |
---|
2092 | 2408 | StepAll(); |
---|
2093 | 2409 | } else |
---|
2094 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2410 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2095 | 2411 | { |
---|
2096 | 2412 | //int indices[] = jList.getSelectedIndices(); |
---|
2097 | 2413 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2099 | 2415 | |
---|
2100 | 2416 | ClearSelection(false); |
---|
2101 | 2417 | } else |
---|
2102 | | - if (event.getSource() == clearAllItem) |
---|
| 2418 | + if (source == clearAllItem) |
---|
2103 | 2419 | { |
---|
2104 | 2420 | ClearSelection(true); |
---|
2105 | 2421 | } else |
---|
2106 | | - if (event.getSource() == grabItem) |
---|
| 2422 | + if (source == grabItem) |
---|
2107 | 2423 | { |
---|
2108 | 2424 | group(new cGroup(), true); |
---|
2109 | 2425 | } else |
---|
2110 | | - if (event.getSource() == frontItem) |
---|
| 2426 | + if (source == hideItem) |
---|
| 2427 | + { |
---|
| 2428 | + group(new HiddenObject()); |
---|
| 2429 | + } else |
---|
| 2430 | + if (source == frontItem) |
---|
2111 | 2431 | { |
---|
2112 | 2432 | front(); |
---|
2113 | 2433 | } else |
---|
2114 | | - if (event.getSource() == backItem) |
---|
| 2434 | + if (source == backItem) |
---|
2115 | 2435 | { |
---|
2116 | 2436 | back(); |
---|
2117 | 2437 | } else |
---|
2118 | | - if (event.getSource() == cameraItem) |
---|
| 2438 | + if (source == cameraItem) |
---|
2119 | 2439 | { |
---|
2120 | 2440 | makeSomething(new Camera()); |
---|
2121 | 2441 | } else |
---|
2122 | | - if (event.getSource() == compositeItem) |
---|
| 2442 | + if (source == compositeItem) |
---|
2123 | 2443 | { |
---|
2124 | 2444 | group(new Composite()); |
---|
2125 | 2445 | } else |
---|
2126 | | - if (event.getSource() == randomItem) |
---|
| 2446 | + if (source == randomItem) |
---|
2127 | 2447 | { |
---|
2128 | 2448 | RandomNode random = new RandomNode(); |
---|
2129 | 2449 | group(random); |
---|
2130 | 2450 | if (random.size() > 0) |
---|
2131 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2451 | + random.name = random.get(0).name + "Switch"; |
---|
2132 | 2452 | } else |
---|
2133 | | - if (event.getSource() == physicsItem) |
---|
| 2453 | + if (source == physicsItem) |
---|
2134 | 2454 | { |
---|
2135 | 2455 | group(new PhysicsNode()); |
---|
2136 | 2456 | } else |
---|
2137 | | - if (event.getSource() == frameselectorItem) |
---|
| 2457 | + if (source == frameselectorItem) |
---|
2138 | 2458 | { |
---|
2139 | 2459 | for (int i=0; i<group.selection.size(); i++) |
---|
2140 | 2460 | { |
---|
.. | .. |
---|
2146 | 2466 | ResetModel(); |
---|
2147 | 2467 | refreshContents(); |
---|
2148 | 2468 | } else |
---|
2149 | | - if (event.getSource() == switchGeoItem) |
---|
| 2469 | + if (source == switchGeoItem) |
---|
2150 | 2470 | { |
---|
2151 | 2471 | for (int i=0; i<group.selection.size(); i++) |
---|
2152 | 2472 | { |
---|
.. | .. |
---|
2158 | 2478 | ResetModel(); |
---|
2159 | 2479 | refreshContents(); |
---|
2160 | 2480 | } else |
---|
2161 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2481 | + if (source == switchTransfoItem) |
---|
2162 | 2482 | { |
---|
2163 | 2483 | for (int i=0; i<group.selection.size(); i++) |
---|
2164 | 2484 | { |
---|
.. | .. |
---|
2170 | 2490 | ResetModel(); |
---|
2171 | 2491 | refreshContents(); |
---|
2172 | 2492 | } else |
---|
2173 | | - if (event.getSource() == morphItem) |
---|
| 2493 | + if (source == morphItem) |
---|
2174 | 2494 | { |
---|
2175 | 2495 | for (int i=0; i<group.selection.size(); i++) |
---|
2176 | 2496 | { |
---|
.. | .. |
---|
2182 | 2502 | ResetModel(); |
---|
2183 | 2503 | refreshContents(); |
---|
2184 | 2504 | } else |
---|
2185 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2505 | + if (source == scriptNodeItem) |
---|
2186 | 2506 | { |
---|
2187 | 2507 | boolean atleastone = false; |
---|
2188 | 2508 | |
---|
.. | .. |
---|
2221 | 2541 | } |
---|
2222 | 2542 | } |
---|
2223 | 2543 | } else |
---|
2224 | | - if (event.getSource() == linkerItem) |
---|
| 2544 | + if (source == linkerItem) |
---|
2225 | 2545 | { |
---|
2226 | 2546 | group(new cLinker()); |
---|
2227 | 2547 | } else |
---|
2228 | | - if (event.getSource() == textureItem) |
---|
| 2548 | + if (source == textureItem) |
---|
2229 | 2549 | { |
---|
2230 | 2550 | group(new TextureNode()); |
---|
2231 | 2551 | } else |
---|
2232 | | - if (event.getSource() == shadowXItem) |
---|
| 2552 | + if (source == billboardItem) |
---|
| 2553 | + { |
---|
| 2554 | + group(new BillboardNode()); |
---|
| 2555 | + } else |
---|
| 2556 | + if (source == shadowXItem) |
---|
2233 | 2557 | { |
---|
2234 | 2558 | CastShadow(0); |
---|
2235 | 2559 | } else |
---|
2236 | | - if (event.getSource() == shadowYItem) |
---|
| 2560 | + if (source == shadowYItem) |
---|
2237 | 2561 | { |
---|
2238 | 2562 | CastShadow(1); |
---|
2239 | 2563 | } else |
---|
2240 | | - if (event.getSource() == shadowZItem) |
---|
| 2564 | + if (source == shadowZItem) |
---|
2241 | 2565 | { |
---|
2242 | 2566 | CastShadow(2); |
---|
2243 | 2567 | } else |
---|
2244 | | - if (event.getSource() == ungroupItem) |
---|
| 2568 | + if (source == ungroupItem) |
---|
2245 | 2569 | { |
---|
2246 | | - ungroup(); |
---|
| 2570 | + //ungroup(); |
---|
| 2571 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2572 | + { |
---|
| 2573 | + Ungroup(group.selection.get(i)); |
---|
| 2574 | + } |
---|
| 2575 | + |
---|
| 2576 | + ClearSelection(false); |
---|
| 2577 | + |
---|
| 2578 | + refreshContents(); |
---|
2247 | 2579 | } else |
---|
2248 | | - if (event.getSource() == genUVItem) |
---|
| 2580 | + if (source == genUVItem) |
---|
2249 | 2581 | { |
---|
2250 | 2582 | GenUV(); |
---|
2251 | 2583 | } else |
---|
2252 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2584 | + if (source == genNormalsCADItem) |
---|
2253 | 2585 | { |
---|
2254 | 2586 | GenNormals(true); |
---|
2255 | 2587 | } else |
---|
2256 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2588 | + if (source == genNormalsMESHItem) |
---|
| 2589 | + { |
---|
| 2590 | + GenNormalsMESH(); |
---|
| 2591 | + } else |
---|
| 2592 | + if (source == genNormalsORGANItem) |
---|
2257 | 2593 | { |
---|
2258 | 2594 | GenNormals(false); |
---|
2259 | 2595 | } else |
---|
2260 | | - if (event.getSource() == stripifyItem) |
---|
| 2596 | + if (source == genNormalsMINEItem) |
---|
| 2597 | + { |
---|
| 2598 | + GenNormalsMINE(); |
---|
| 2599 | + } else |
---|
| 2600 | + if (source == stripifyItem) |
---|
2261 | 2601 | { |
---|
2262 | 2602 | Stripify(); |
---|
2263 | 2603 | } else |
---|
2264 | | - if (event.getSource() == unstripifyItem) |
---|
| 2604 | + if (source == unstripifyItem) |
---|
2265 | 2605 | { |
---|
2266 | 2606 | Unstripify(); |
---|
2267 | 2607 | } else |
---|
2268 | | - if (event.getSource() == trimItem) |
---|
| 2608 | + if (source == trimItem) |
---|
2269 | 2609 | { |
---|
2270 | 2610 | Trim(); |
---|
2271 | 2611 | } else |
---|
2272 | | - if (event.getSource() == untrimItem) |
---|
| 2612 | + if (source == untrimItem) |
---|
2273 | 2613 | { |
---|
2274 | 2614 | Untrim(); |
---|
2275 | 2615 | } else |
---|
2276 | | - if (event.getSource() == clearColorsItem) |
---|
| 2616 | + if (source == clearColorsItem) |
---|
2277 | 2617 | { |
---|
2278 | 2618 | ClearColors(); |
---|
2279 | 2619 | } else |
---|
2280 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2620 | + if (source == clearMaterialsItem) |
---|
2281 | 2621 | { |
---|
2282 | 2622 | ClearMaterials(); |
---|
2283 | 2623 | } else |
---|
2284 | | - if (event.getSource() == liveleavesItem) |
---|
| 2624 | + if (source == liveleavesItem) |
---|
2285 | 2625 | { |
---|
2286 | 2626 | LiveLeaves(true); |
---|
2287 | 2627 | } else |
---|
2288 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2628 | + if (source == unliveleavesItem) |
---|
2289 | 2629 | { |
---|
2290 | 2630 | LiveLeaves(false); |
---|
2291 | 2631 | } else |
---|
2292 | | - if (event.getSource() == supportleavesItem) |
---|
| 2632 | + if (source == supportleavesItem) |
---|
2293 | 2633 | { |
---|
2294 | 2634 | SupportLeaves(true); |
---|
2295 | 2635 | } else |
---|
2296 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2636 | + if (source == unsupportleavesItem) |
---|
2297 | 2637 | { |
---|
2298 | 2638 | SupportLeaves(false); |
---|
2299 | 2639 | } else |
---|
2300 | | - if (event.getSource() == hideleavesItem) |
---|
| 2640 | + if (source == hideleavesItem) |
---|
2301 | 2641 | { |
---|
2302 | 2642 | HideLeaves(true); |
---|
2303 | 2643 | } else |
---|
2304 | | - if (event.getSource() == showleavesItem) |
---|
| 2644 | + if (source == showleavesItem) |
---|
2305 | 2645 | { |
---|
2306 | 2646 | HideLeaves(false); |
---|
2307 | 2647 | } else |
---|
2308 | | - if (event.getSource() == markleavesItem) |
---|
| 2648 | + if (source == markleavesItem) |
---|
2309 | 2649 | { |
---|
2310 | 2650 | MarkLeaves(true); |
---|
2311 | 2651 | } else |
---|
2312 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2652 | + if (source == unmarkleavesItem) |
---|
2313 | 2653 | { |
---|
2314 | 2654 | MarkLeaves(false); |
---|
2315 | 2655 | } else |
---|
2316 | | - if (event.getSource() == flipVItem) |
---|
| 2656 | + if (source == rewindleavesItem) |
---|
| 2657 | + { |
---|
| 2658 | + RewindLeaves(true); |
---|
| 2659 | + } else |
---|
| 2660 | + if (source == unrewindleavesItem) |
---|
| 2661 | + { |
---|
| 2662 | + RewindLeaves(false); |
---|
| 2663 | + } else |
---|
| 2664 | + if (source == randomleavesItem) |
---|
| 2665 | + { |
---|
| 2666 | + RandomLeaves(true); |
---|
| 2667 | + } else |
---|
| 2668 | + if (source == unrandomleavesItem) |
---|
| 2669 | + { |
---|
| 2670 | + RandomLeaves(false); |
---|
| 2671 | + } else |
---|
| 2672 | + if (source == flipVItem) |
---|
2317 | 2673 | { |
---|
2318 | 2674 | FlipV(true); |
---|
2319 | 2675 | } else |
---|
2320 | | - if (event.getSource() == unflipVItem) |
---|
| 2676 | + if (source == unflipVItem) |
---|
2321 | 2677 | { |
---|
2322 | 2678 | FlipV(false); |
---|
2323 | 2679 | } else |
---|
2324 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2680 | + if (source == lowTexturesItem) |
---|
2325 | 2681 | { |
---|
2326 | 2682 | SetTexRes(0); |
---|
2327 | 2683 | } else |
---|
2328 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2684 | + if (source == normalTexturesItem) |
---|
2329 | 2685 | { |
---|
2330 | 2686 | SetTexRes(1); |
---|
2331 | 2687 | } else |
---|
2332 | | - if (event.getSource() == highTexturesItem) |
---|
| 2688 | + if (source == highTexturesItem) |
---|
2333 | 2689 | { |
---|
2334 | 2690 | SetTexRes(2); |
---|
2335 | 2691 | } else |
---|
2336 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2692 | + if (source == veryhighTexturesItem) |
---|
2337 | 2693 | { |
---|
2338 | 2694 | SetTexRes(3); |
---|
2339 | 2695 | } else |
---|
2340 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2696 | + if (source == maxTexturesItem) |
---|
2341 | 2697 | { |
---|
2342 | 2698 | SetTexRes(4); |
---|
2343 | 2699 | } else |
---|
2344 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2700 | + if (source == panoTexturesItem) |
---|
2345 | 2701 | { |
---|
2346 | 2702 | SetTexRes(5); |
---|
2347 | 2703 | } else |
---|
2348 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2704 | + if (source == reverseNormalsItem) |
---|
2349 | 2705 | { |
---|
2350 | 2706 | ReverseNormals(); |
---|
2351 | 2707 | } else |
---|
2352 | | - if (event.getSource() == parseverticesItem) |
---|
| 2708 | + if (source == parseverticesItem) |
---|
2353 | 2709 | { |
---|
2354 | 2710 | ParseVertices(); |
---|
2355 | 2711 | } else |
---|
2356 | | - if (event.getSource() == alignItem) |
---|
| 2712 | + if (source == textureFieldItem) |
---|
| 2713 | + { |
---|
| 2714 | + TextureVertices(); |
---|
| 2715 | + } else |
---|
| 2716 | + if (source == alignItem) |
---|
2357 | 2717 | { |
---|
2358 | 2718 | Align(); |
---|
2359 | 2719 | } else |
---|
2360 | | - if (event.getSource() == mirrorItem) |
---|
| 2720 | + if (source == mirrorItem) |
---|
2361 | 2721 | { |
---|
2362 | 2722 | MirrorPoses(); |
---|
2363 | 2723 | } else |
---|
2364 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2724 | + if (source == reduceMorphItem) |
---|
2365 | 2725 | { |
---|
2366 | 2726 | MeshReduction(false); |
---|
2367 | 2727 | } else |
---|
2368 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2728 | + if (source == reduce34MorphItem) |
---|
2369 | 2729 | { |
---|
2370 | 2730 | MeshReduction(true); |
---|
2371 | 2731 | } else |
---|
2372 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2732 | + if (source == reverseTrianglesItem) |
---|
2373 | 2733 | { |
---|
2374 | 2734 | ReverseTriangles(); |
---|
2375 | 2735 | } else |
---|
2376 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2736 | + if (source == reduceMeshItem) |
---|
2377 | 2737 | { |
---|
2378 | 2738 | ReduceMesh(false); |
---|
2379 | 2739 | } else |
---|
2380 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2740 | + if (source == reduce34MeshItem) |
---|
2381 | 2741 | { |
---|
2382 | 2742 | ReduceMesh(true); |
---|
2383 | 2743 | } else |
---|
2384 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2744 | + if (source == increaseMeshItem) |
---|
2385 | 2745 | { |
---|
2386 | 2746 | IncreaseMesh(); |
---|
2387 | 2747 | } else |
---|
2388 | | - if (event.getSource() == clipMeshItem) |
---|
| 2748 | + if (source == clipMeshItem) |
---|
2389 | 2749 | { |
---|
2390 | 2750 | ClipMesh(); |
---|
2391 | 2751 | } else |
---|
2392 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2752 | + if (source == smoothMeshItem) |
---|
2393 | 2753 | { |
---|
2394 | 2754 | SmoothMesh(); |
---|
2395 | 2755 | } else |
---|
2396 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2756 | + if (source == transformGeometryItem) |
---|
2397 | 2757 | { |
---|
2398 | 2758 | TransformGeometry(); |
---|
2399 | 2759 | } else |
---|
2400 | | - if (event.getSource() == resetTransformItem) |
---|
| 2760 | + if (source == transformChildrenItem) |
---|
| 2761 | + { |
---|
| 2762 | + TransformChildren(); |
---|
| 2763 | + } else |
---|
| 2764 | + if (source == resetTransformItem) |
---|
2401 | 2765 | { |
---|
2402 | 2766 | ResetTransform(); |
---|
2403 | 2767 | } else |
---|
2404 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2768 | + if (source == resetCentroidItem) |
---|
2405 | 2769 | { |
---|
2406 | | - ResetCentroid(); |
---|
| 2770 | + ResetCentroid(true); |
---|
2407 | 2771 | } else |
---|
2408 | | - if (event.getSource() == resetParentItem) |
---|
| 2772 | + if (source == resetCentroidXZItem) |
---|
| 2773 | + { |
---|
| 2774 | + ResetCentroid(false); |
---|
| 2775 | + } else |
---|
| 2776 | + if (source == resetParentItem) |
---|
2409 | 2777 | { |
---|
2410 | 2778 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2411 | 2779 | { |
---|
.. | .. |
---|
2415 | 2783 | |
---|
2416 | 2784 | refreshContents(); |
---|
2417 | 2785 | } else |
---|
2418 | | - if (event.getSource() == repairParentItem) |
---|
| 2786 | + if (source == repairParentItem) |
---|
2419 | 2787 | { |
---|
2420 | 2788 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2421 | 2789 | { |
---|
.. | .. |
---|
2429 | 2797 | |
---|
2430 | 2798 | refreshContents(); |
---|
2431 | 2799 | } else |
---|
2432 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2800 | + if (source == repairShadowItem) |
---|
| 2801 | + { |
---|
| 2802 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2803 | + { |
---|
| 2804 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2805 | + obj.RepairShadow(); |
---|
| 2806 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2807 | +// { |
---|
| 2808 | +// obj.get(i).parent = obj; |
---|
| 2809 | +// } |
---|
| 2810 | + } |
---|
| 2811 | + |
---|
| 2812 | + refreshContents(); |
---|
| 2813 | + } else |
---|
| 2814 | + if (source == sortbysizeItem) |
---|
2433 | 2815 | { |
---|
2434 | 2816 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2435 | 2817 | { |
---|
.. | .. |
---|
2441 | 2823 | ResetModel(); |
---|
2442 | 2824 | refreshContents(); |
---|
2443 | 2825 | } else |
---|
2444 | | - if (event.getSource() == sortbynameItem) |
---|
| 2826 | + if (source == sortbynameItem) |
---|
2445 | 2827 | { |
---|
2446 | 2828 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2447 | 2829 | { |
---|
.. | .. |
---|
2453 | 2835 | ResetModel(); |
---|
2454 | 2836 | refreshContents(); |
---|
2455 | 2837 | } else |
---|
2456 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2838 | + if (source == attachPigmentItem) |
---|
2457 | 2839 | { |
---|
2458 | 2840 | String texture = GetFile("Attach pigment"); |
---|
2459 | 2841 | Object3D obj; |
---|
.. | .. |
---|
2465 | 2847 | |
---|
2466 | 2848 | refreshContents(); |
---|
2467 | 2849 | } else |
---|
2468 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2850 | + if (source == detachPigmentItem) |
---|
2469 | 2851 | { |
---|
2470 | 2852 | Object3D obj; |
---|
2471 | 2853 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2476 | 2858 | |
---|
2477 | 2859 | refreshContents(); |
---|
2478 | 2860 | } else |
---|
2479 | | - if (event.getSource() == attachBumpItem) |
---|
| 2861 | + if (source == attachBumpItem) |
---|
2480 | 2862 | { |
---|
2481 | 2863 | String texture = GetFile("Attach bump"); |
---|
2482 | 2864 | Object3D obj; |
---|
.. | .. |
---|
2488 | 2870 | |
---|
2489 | 2871 | refreshContents(); |
---|
2490 | 2872 | } else |
---|
2491 | | - if (event.getSource() == detachBumpItem) |
---|
| 2873 | + if (source == detachBumpItem) |
---|
2492 | 2874 | { |
---|
2493 | 2875 | Object3D obj; |
---|
2494 | 2876 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2499 | 2881 | |
---|
2500 | 2882 | refreshContents(); |
---|
2501 | 2883 | } else |
---|
2502 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2884 | + if (source == pigmentBumpItem) |
---|
2503 | 2885 | { |
---|
2504 | 2886 | Object3D obj; |
---|
2505 | 2887 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2510 | 2892 | |
---|
2511 | 2893 | refreshContents(); |
---|
2512 | 2894 | } else |
---|
2513 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2895 | + if (source == flashSelectionButton) |
---|
2514 | 2896 | { |
---|
2515 | 2897 | CameraPane.flash = true; |
---|
2516 | 2898 | refreshContents(); |
---|
2517 | 2899 | } else |
---|
2518 | | - if (event.getSource() == oneButton) |
---|
| 2900 | + if (source == oneButton) |
---|
2519 | 2901 | { |
---|
2520 | 2902 | } else |
---|
2521 | | - if (event.getSource() == twoButton) |
---|
| 2903 | + if (source == twoButton) |
---|
2522 | 2904 | { |
---|
2523 | 2905 | radio.layout = twoButton; |
---|
2524 | 2906 | // bug |
---|
2525 | 2907 | //gridPanel.setDividerLocation(1.0); |
---|
2526 | 2908 | //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(); |
---|
| 2909 | +// bigThree.remove(scenePanel); |
---|
| 2910 | +// bigThree.remove(centralPanel); |
---|
| 2911 | +// bigThree.remove(XYZPanel); |
---|
| 2912 | +// aWindowConstraints.gridx = 0; |
---|
| 2913 | +// aWindowConstraints.gridy = 0; |
---|
| 2914 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2915 | +// // aConstraints.gridheight = 3; |
---|
| 2916 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2917 | +// aWindowConstraints.weightx = 0; |
---|
| 2918 | +// aWindowConstraints.weighty = 1; |
---|
| 2919 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2920 | +// aWindowConstraints.weightx = 1; |
---|
| 2921 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2922 | +// // aConstraints.gridheight = 3; |
---|
| 2923 | +// aWindowConstraints.gridx = 1; |
---|
| 2924 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2925 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2926 | +// aWindowConstraints.weightx = 0; |
---|
| 2927 | +// aWindowConstraints.gridx = 4; |
---|
| 2928 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2929 | +// // aConstraints.gridheight = 3; |
---|
| 2930 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2931 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2932 | +// scenePanel.setVisible(false); |
---|
| 2933 | +// centralPanel.setVisible(true); |
---|
| 2934 | +// XYZPanel.setVisible(false); |
---|
| 2935 | + bigThree.ClearUI(); |
---|
| 2936 | + bigThree.add(centralPanel); |
---|
| 2937 | + bigThree.FlushUI(); |
---|
| 2938 | + |
---|
| 2939 | + cameraView.requestFocusInWindow(); |
---|
| 2940 | + |
---|
| 2941 | +// refreshContents(true); |
---|
| 2942 | +// |
---|
| 2943 | +// try |
---|
| 2944 | +// { |
---|
| 2945 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2946 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2947 | +// bot.mouseMove(100, 100); |
---|
| 2948 | +// bot.mousePress(mask); |
---|
| 2949 | +// bot.mouseRelease(mask); |
---|
| 2950 | +// } |
---|
| 2951 | +// catch (Exception e) |
---|
| 2952 | +// { |
---|
| 2953 | +// |
---|
| 2954 | +// } |
---|
| 2955 | + |
---|
2551 | 2956 | } else |
---|
2552 | | - if (event.getSource() == threeButton) |
---|
| 2957 | + if (source == threeButton) |
---|
2553 | 2958 | { |
---|
2554 | 2959 | 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(); |
---|
| 2960 | + |
---|
| 2961 | +// bigThree.remove(scenePanel); |
---|
| 2962 | +// bigThree.remove(centralPanel); |
---|
| 2963 | +// bigThree.remove(XYZPanel); |
---|
| 2964 | +// aWindowConstraints.gridx = 0; |
---|
| 2965 | +// aWindowConstraints.gridy = 0; |
---|
| 2966 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2967 | +// // aConstraints.gridheight = 3; |
---|
| 2968 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2969 | +// aWindowConstraints.weightx = 0; |
---|
| 2970 | +// aWindowConstraints.weighty = 1; |
---|
| 2971 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2972 | +// aWindowConstraints.weightx = 1; |
---|
| 2973 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2974 | +// // aConstraints.gridheight = 3; |
---|
| 2975 | +// aWindowConstraints.gridx = 1; |
---|
| 2976 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2977 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2978 | +// aWindowConstraints.weightx = 0; |
---|
| 2979 | +// aWindowConstraints.gridx = 4; |
---|
| 2980 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2981 | +// // aConstraints.gridheight = 3; |
---|
| 2982 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2983 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2984 | +// bigThree.validate(); |
---|
| 2985 | +// scenePanel.setVisible(false); |
---|
| 2986 | +// centralPanel.setVisible(true); |
---|
| 2987 | +// XYZPanel.setVisible(true); |
---|
| 2988 | + bigThree.ClearUI(); |
---|
| 2989 | + bigThree.add(centralPanel); |
---|
| 2990 | + bigThree.add(XYZPanel); |
---|
| 2991 | + bigThree.FlushUI(); |
---|
| 2992 | + |
---|
| 2993 | + cameraView.requestFocusInWindow(); |
---|
2579 | 2994 | } else |
---|
2580 | | - if (event.getSource() == fourButton) |
---|
| 2995 | + if (source == fourButton) |
---|
2581 | 2996 | { |
---|
2582 | 2997 | 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(); |
---|
| 2998 | + |
---|
| 2999 | +// bigThree.remove(scenePanel); |
---|
| 3000 | +// bigThree.remove(centralPanel); |
---|
| 3001 | +// bigThree.remove(XYZPanel); |
---|
| 3002 | +// aWindowConstraints.gridx = 0; |
---|
| 3003 | +// aWindowConstraints.gridy = 0; |
---|
| 3004 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3005 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3006 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3007 | +// aWindowConstraints.weightx = 1; |
---|
| 3008 | +// aWindowConstraints.weighty = 1; |
---|
| 3009 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3010 | +// aWindowConstraints.weightx = 1; |
---|
| 3011 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3012 | +// // aConstraints.gridheight = 3; |
---|
| 3013 | +// aWindowConstraints.gridx = 1; |
---|
| 3014 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3015 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3016 | +// aWindowConstraints.weightx = 0; |
---|
| 3017 | +// aWindowConstraints.gridx = 4; |
---|
| 3018 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3019 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3020 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3021 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3022 | +// bigThree.validate(); |
---|
| 3023 | +// scenePanel.setVisible(true); |
---|
| 3024 | +// centralPanel.setVisible(false); |
---|
| 3025 | +// XYZPanel.setVisible(false); |
---|
| 3026 | + bigThree.ClearUI(); |
---|
| 3027 | + bigThree.add(scenePanel); |
---|
| 3028 | + bigThree.FlushUI(); |
---|
| 3029 | + |
---|
| 3030 | + cameraView.requestFocusInWindow(); |
---|
2607 | 3031 | } else |
---|
2608 | | - if (event.getSource() == sixButton) |
---|
| 3032 | + if (source == sixButton) |
---|
2609 | 3033 | { |
---|
2610 | 3034 | 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(); |
---|
| 3035 | + |
---|
| 3036 | +// bigThree.remove(scenePanel); |
---|
| 3037 | +// bigThree.remove(centralPanel); |
---|
| 3038 | +// bigThree.remove(XYZPanel); |
---|
| 3039 | +// aWindowConstraints.gridx = 0; |
---|
| 3040 | +// aWindowConstraints.gridy = 0; |
---|
| 3041 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3042 | +// // aConstraints.gridheight = 3; |
---|
| 3043 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3044 | +// aWindowConstraints.weightx = 0; |
---|
| 3045 | +// aWindowConstraints.weighty = 1; |
---|
| 3046 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3047 | +// aWindowConstraints.weightx = 1; |
---|
| 3048 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3049 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3050 | +// aWindowConstraints.gridx = 1; |
---|
| 3051 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3052 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3053 | +// aWindowConstraints.weightx = 0; |
---|
| 3054 | +// aWindowConstraints.gridx = 4; |
---|
| 3055 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3056 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3057 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3058 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3059 | +// bigThree.validate(); |
---|
| 3060 | +// scenePanel.setVisible(true); |
---|
| 3061 | +// centralPanel.setVisible(true); |
---|
| 3062 | +// XYZPanel.setVisible(false); |
---|
| 3063 | + bigThree.ClearUI(); |
---|
| 3064 | + bigThree.add(scenePanel); |
---|
| 3065 | + bigThree.add(centralPanel); |
---|
| 3066 | + bigThree.FlushUI(); |
---|
| 3067 | + |
---|
| 3068 | + cameraView.requestFocusInWindow(); |
---|
2635 | 3069 | } else |
---|
2636 | | - if (event.getSource() == sevenButton) |
---|
| 3070 | + if (source == sevenButton) |
---|
2637 | 3071 | { |
---|
2638 | 3072 | 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(); |
---|
| 3073 | + |
---|
| 3074 | +// bigThree.remove(scenePanel); |
---|
| 3075 | +// bigThree.remove(centralPanel); |
---|
| 3076 | +// bigThree.remove(XYZPanel); |
---|
| 3077 | +// aWindowConstraints.gridx = 0; |
---|
| 3078 | +// aWindowConstraints.gridy = 0; |
---|
| 3079 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3080 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3081 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3082 | +// aWindowConstraints.weightx = 0; |
---|
| 3083 | +// aWindowConstraints.weighty = 1; |
---|
| 3084 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3085 | +// aWindowConstraints.weightx = 1; |
---|
| 3086 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3087 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3088 | +// aWindowConstraints.gridx = 1; |
---|
| 3089 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3090 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3091 | +// aWindowConstraints.weightx = 0; |
---|
| 3092 | +// aWindowConstraints.gridx = 4; |
---|
| 3093 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3094 | +// // aConstraints.gridheight = 3; |
---|
| 3095 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3096 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3097 | +// bigThree.validate(); |
---|
| 3098 | +// scenePanel.setVisible(true); |
---|
| 3099 | +// centralPanel.setVisible(true); |
---|
| 3100 | +// XYZPanel.setVisible(true); |
---|
| 3101 | + bigThree.ClearUI(); |
---|
| 3102 | + bigThree.add(scenePanel); |
---|
| 3103 | + bigThree.add(centralPanel); |
---|
| 3104 | + bigThree.add(XYZPanel); |
---|
| 3105 | + bigThree.FlushUI(); |
---|
| 3106 | + |
---|
| 3107 | + cameraView.requestFocusInWindow(); |
---|
2663 | 3108 | } else |
---|
2664 | | - if (event.getSource() == rootButton) |
---|
| 3109 | + if (source == rootButton) |
---|
2665 | 3110 | { |
---|
2666 | 3111 | Object3D obj; |
---|
2667 | 3112 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2671 | 3116 | EditObject(obj); |
---|
2672 | 3117 | } |
---|
2673 | 3118 | |
---|
| 3119 | + cameraView.requestFocusInWindow(); |
---|
2674 | 3120 | refreshContents(true); |
---|
2675 | 3121 | } else |
---|
2676 | | - if (event.getSource() == closeButton) |
---|
| 3122 | + if (source == closeButton) |
---|
2677 | 3123 | { |
---|
2678 | 3124 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2679 | 3125 | cRadio ab; |
---|
.. | .. |
---|
2692 | 3138 | break; |
---|
2693 | 3139 | } |
---|
2694 | 3140 | } |
---|
| 3141 | + |
---|
| 3142 | + cameraView.requestFocusInWindow(); |
---|
2695 | 3143 | refreshContents(true); |
---|
2696 | 3144 | } else |
---|
2697 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3145 | + if (source == editItem || source == editButton) |
---|
2698 | 3146 | { |
---|
2699 | 3147 | EditSelection(false); |
---|
2700 | 3148 | } else |
---|
2701 | | - if (event.getSource() == uneditButton) |
---|
| 3149 | + if (source == uneditButton) |
---|
2702 | 3150 | { |
---|
2703 | 3151 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2704 | 3152 | { |
---|
.. | .. |
---|
2708 | 3156 | child.CloseUI(); |
---|
2709 | 3157 | listUI.remove(child); |
---|
2710 | 3158 | |
---|
2711 | | - child.editWindow = null; // ??????????? |
---|
| 3159 | + //child.editWindow = null; // ??????????? |
---|
2712 | 3160 | } |
---|
2713 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3161 | + objEditor.ctrlPanel.FlushUI(); |
---|
2714 | 3162 | //objEditor.jTree.clearSelection(); |
---|
2715 | 3163 | //objEditor.ResetSliders(); |
---|
2716 | 3164 | refreshContents(true); |
---|
2717 | 3165 | } else |
---|
2718 | | - if (event.getSource() == clearPanelButton) |
---|
| 3166 | + if (source == clearPanelButton) |
---|
2719 | 3167 | { |
---|
2720 | 3168 | assert(copy == group); |
---|
2721 | 3169 | //copy.ClearUI(); |
---|
.. | .. |
---|
2726 | 3174 | listUI.clear(); |
---|
2727 | 3175 | refreshContents(true); |
---|
2728 | 3176 | } else |
---|
2729 | | - if (event.getSource() == allParamsButton) |
---|
| 3177 | + if (source == allParamsButton) |
---|
2730 | 3178 | { |
---|
2731 | 3179 | assert(copy == group); |
---|
2732 | 3180 | |
---|
.. | .. |
---|
2747 | 3195 | |
---|
2748 | 3196 | refreshContents(true); |
---|
2749 | 3197 | } else |
---|
2750 | | - if (event.getSource() == unselectButton) |
---|
| 3198 | + if (source == unselectButton) |
---|
2751 | 3199 | { |
---|
2752 | 3200 | objEditor.jTree.clearSelection(); |
---|
2753 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 3201 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2754 | 3202 | objEditor.ResetSliders(); |
---|
2755 | 3203 | refreshContents(true); |
---|
2756 | 3204 | } else |
---|
2757 | | - if(event.getSource() instanceof cRadio) |
---|
| 3205 | + if(source instanceof cRadio) |
---|
2758 | 3206 | { |
---|
2759 | 3207 | group.parent = keepparent; |
---|
2760 | 3208 | group.attributes = 0; |
---|
2761 | 3209 | //group.editWindow = null; |
---|
2762 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3210 | + /*cRadio*/ radio = (cRadio)source; |
---|
2763 | 3211 | Object3D obj = radio.GetObject(); |
---|
2764 | 3212 | System.out.println("Edit " + obj); |
---|
2765 | 3213 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2779 | 3227 | } |
---|
2780 | 3228 | |
---|
2781 | 3229 | copy = group; |
---|
2782 | | - //CameraPane.theRenderer.object = group; |
---|
| 3230 | + //Globals.theRenderer.object = group; |
---|
2783 | 3231 | if(!useclient) |
---|
2784 | 3232 | { |
---|
2785 | 3233 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2788 | 3236 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2789 | 3237 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2790 | 3238 | cameraView.object = group; |
---|
2791 | | - cameraView.lighttouched = true; |
---|
| 3239 | + //cameraView.lighttouched = true; |
---|
| 3240 | + Globals.lighttouched = true; |
---|
2792 | 3241 | topView.object = group; |
---|
2793 | 3242 | frontView.object = group; |
---|
2794 | 3243 | sideView.object = group; |
---|
2795 | 3244 | } |
---|
2796 | | - group.editWindow = this; |
---|
| 3245 | + |
---|
| 3246 | +// fix "+" issue |
---|
| 3247 | + //group.editWindow = this; |
---|
| 3248 | + |
---|
2797 | 3249 | /* |
---|
2798 | 3250 | currentLayout = radio.layout; |
---|
2799 | 3251 | if (currentLayout == null) |
---|
.. | .. |
---|
2805 | 3257 | //group.parent = null; // ROOT |
---|
2806 | 3258 | //group.attributes = -1; |
---|
2807 | 3259 | ResetModel(); |
---|
| 3260 | + |
---|
| 3261 | + cameraView.requestFocusInWindow(); |
---|
2808 | 3262 | refreshContents(true); |
---|
2809 | | - } |
---|
| 3263 | + } else if (event.getSource() == editCameraItem) |
---|
| 3264 | + { |
---|
| 3265 | + cameraView.ProtectCamera(); |
---|
| 3266 | + cameraView.repaint(); |
---|
| 3267 | + return; |
---|
| 3268 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3269 | + { |
---|
| 3270 | + cameraView.RevertCamera(); |
---|
| 3271 | + cameraView.repaint(); |
---|
| 3272 | + return; |
---|
| 3273 | + // } else if (event.getSource() == textureButton) |
---|
| 3274 | + // { |
---|
| 3275 | + // return; // true; |
---|
| 3276 | + } |
---|
2810 | 3277 | else |
---|
2811 | 3278 | { |
---|
2812 | 3279 | //return super.action(event, arg); |
---|
.. | .. |
---|
2815 | 3282 | } |
---|
2816 | 3283 | |
---|
2817 | 3284 | boolean useclient = false; |
---|
2818 | | - cRadio radio; |
---|
2819 | 3285 | |
---|
2820 | 3286 | void ToggleRoot() |
---|
2821 | 3287 | { |
---|
.. | .. |
---|
2824 | 3290 | if (useclient) |
---|
2825 | 3291 | { |
---|
2826 | 3292 | cameraView.object = client; |
---|
2827 | | - cameraView.lighttouched = true; |
---|
| 3293 | + Globals.lighttouched = true; |
---|
2828 | 3294 | //topView.object = client; |
---|
2829 | 3295 | //frontView.object = client; |
---|
2830 | 3296 | //sideView.object = client; |
---|
.. | .. |
---|
2832 | 3298 | else |
---|
2833 | 3299 | { |
---|
2834 | 3300 | cameraView.object = group; |
---|
2835 | | - cameraView.lighttouched = true; |
---|
| 3301 | + Globals.lighttouched = true; |
---|
2836 | 3302 | //topView.object = group; |
---|
2837 | 3303 | //frontView.object = group; |
---|
2838 | 3304 | //sideView.object = group; |
---|
.. | .. |
---|
2867 | 3333 | refreshContents(); |
---|
2868 | 3334 | } |
---|
2869 | 3335 | |
---|
| 3336 | + void TransformChildren() |
---|
| 3337 | + { |
---|
| 3338 | + Object3D obj; |
---|
| 3339 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3340 | + { |
---|
| 3341 | + obj = (Object3D)e.nextElement(); |
---|
| 3342 | + obj.KeepTextureMatrices(); |
---|
| 3343 | + obj.TransformChildren(); |
---|
| 3344 | + obj.RestoreTextureMatrices(); |
---|
| 3345 | + |
---|
| 3346 | +// if (obj.parent == null) |
---|
| 3347 | +// { |
---|
| 3348 | +// System.out.println("NULL PARENT!"); |
---|
| 3349 | +// new Exception().printStackTrace(); |
---|
| 3350 | +// } |
---|
| 3351 | +// else |
---|
| 3352 | +// TouchTransform(obj); |
---|
| 3353 | +// //obj.parent.Touch(); |
---|
| 3354 | + } |
---|
| 3355 | + |
---|
| 3356 | + refreshContents(); |
---|
| 3357 | + } |
---|
2870 | 3358 | |
---|
2871 | 3359 | void ResetTransform() |
---|
2872 | 3360 | { |
---|
.. | .. |
---|
2979 | 3467 | refreshContents(); |
---|
2980 | 3468 | } |
---|
2981 | 3469 | |
---|
2982 | | - void ResetCentroid() |
---|
| 3470 | + void ResetCentroid(boolean full) |
---|
2983 | 3471 | { |
---|
2984 | 3472 | Object3D obj; |
---|
2985 | 3473 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2994 | 3482 | LA.matIdentity(Object3D.mat); |
---|
2995 | 3483 | obj.getBounds(minima, maxima, false); |
---|
2996 | 3484 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
2997 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3485 | + if (full) |
---|
| 3486 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
2998 | 3487 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
2999 | 3488 | obj.TransformMesh(Object3D.mat); |
---|
| 3489 | + |
---|
3000 | 3490 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3001 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3491 | + if (full) |
---|
| 3492 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3002 | 3493 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3494 | + |
---|
3003 | 3495 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3004 | 3496 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3005 | 3497 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3028 | 3520 | |
---|
3029 | 3521 | int size = obj.MemorySize(); |
---|
3030 | 3522 | |
---|
3031 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3523 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3524 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3032 | 3525 | } |
---|
3033 | 3526 | } |
---|
3034 | 3527 | catch (Exception e) |
---|
.. | .. |
---|
3065 | 3558 | obj = (Object3D)e.nextElement(); |
---|
3066 | 3559 | |
---|
3067 | 3560 | System.out.println("Object is: " + obj); |
---|
3068 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3561 | + Grafreed.AnalyzeObject(obj); |
---|
3069 | 3562 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3070 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3563 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3071 | 3564 | |
---|
3072 | 3565 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3073 | 3566 | } |
---|
.. | .. |
---|
3109 | 3602 | void GenNormals(boolean crease) |
---|
3110 | 3603 | { |
---|
3111 | 3604 | group.GenNormalsS(crease); |
---|
| 3605 | + |
---|
| 3606 | + refreshContents(); |
---|
| 3607 | + } |
---|
| 3608 | + |
---|
| 3609 | + void GenNormalsMESH() |
---|
| 3610 | + { |
---|
| 3611 | + group.GenNormalsMeshS(); |
---|
| 3612 | + |
---|
| 3613 | + refreshContents(); |
---|
| 3614 | + } |
---|
| 3615 | + |
---|
| 3616 | + void GenNormalsMINE() |
---|
| 3617 | + { |
---|
| 3618 | + group.selection.GenNormalsMINE(); |
---|
3112 | 3619 | |
---|
3113 | 3620 | refreshContents(); |
---|
3114 | 3621 | } |
---|
.. | .. |
---|
3157 | 3664 | |
---|
3158 | 3665 | //Object3D buffer; |
---|
3159 | 3666 | 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 | | - |
---|
| 3667 | +// BoundaryRep temprep; |
---|
| 3668 | +// Object3D nodes; |
---|
| 3669 | +// Vector<Vertex> vertices; |
---|
| 3670 | +// |
---|
| 3671 | +// cGroup buffer; |
---|
| 3672 | +// |
---|
| 3673 | +// public void Vertex(Object3D node, Vertex v) |
---|
| 3674 | +// { |
---|
| 3675 | +//// vertices.add(v); |
---|
| 3676 | +//// nodes.addElement(node); |
---|
| 3677 | +//// |
---|
| 3678 | +//// if (temprep.GetCache(v) != null) |
---|
| 3679 | +//// { |
---|
| 3680 | +//// temprep.Remove(v); |
---|
| 3681 | +//// } else |
---|
| 3682 | +//// { |
---|
| 3683 | +//// temprep.Remember(v); |
---|
| 3684 | +//// } |
---|
| 3685 | +// |
---|
| 3686 | +// //Object3D node = nodes.get(index); |
---|
| 3687 | +// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3688 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3689 | +// |
---|
| 3690 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3691 | +// |
---|
| 3692 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3693 | +// |
---|
| 3694 | +// cGroup g = new cGroup(); |
---|
| 3695 | +// |
---|
| 3696 | +// if (g.toParent == null) |
---|
| 3697 | +// { |
---|
| 3698 | +// g.toParent = LA.newMatrix(); |
---|
| 3699 | +// g.fromParent = LA.newMatrix(); |
---|
| 3700 | +// } |
---|
| 3701 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3702 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3703 | +// |
---|
| 3704 | +// g.add(GrafreeD.clipboard); |
---|
| 3705 | +// |
---|
| 3706 | +// buffer.add(g); |
---|
| 3707 | +// } |
---|
| 3708 | +// |
---|
| 3709 | +// public void Face(Object3D node, Face f) |
---|
| 3710 | +// { |
---|
| 3711 | +// |
---|
| 3712 | +// } |
---|
| 3713 | +// |
---|
| 3714 | +// void ParseVerticesOld() // ?? |
---|
| 3715 | +// { |
---|
| 3716 | +// //if (group.selection.size() != 1) |
---|
| 3717 | +// // return; |
---|
| 3718 | +// |
---|
| 3719 | +// temprep = new BoundaryRep(); |
---|
| 3720 | +// nodes = new Object3D(); |
---|
| 3721 | +// vertices = new Vector<Vertex>(); |
---|
| 3722 | +// |
---|
| 3723 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3724 | +// GrafreeD.epsequal = true; |
---|
| 3725 | +// |
---|
| 3726 | +// for (int i=0; i<group.selection.size(); i++) |
---|
| 3727 | +// { |
---|
| 3728 | +// Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3729 | +// |
---|
| 3730 | +// group.selection.get(i).Parse( |
---|
| 3731 | +//this ); |
---|
| 3732 | +// |
---|
| 3733 | +// int repsize = temprep.VertexCount(); |
---|
| 3734 | +// int tablesize = temprep.vertextable.size(); |
---|
| 3735 | +// int nodesize = nodes.size(); |
---|
| 3736 | +// |
---|
| 3737 | +// assert(vertices.size() == nodes.size()); |
---|
| 3738 | +// |
---|
| 3739 | +// temprep.vertextable.elements(); |
---|
| 3740 | +// |
---|
| 3741 | +// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet(); |
---|
| 3742 | +// |
---|
| 3743 | +// for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
| 3744 | +// { |
---|
| 3745 | +// cGroup g = new cGroup(); |
---|
| 3746 | +// |
---|
| 3747 | +// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k)); |
---|
| 3748 | +// |
---|
| 3749 | +// Object3D node = nodes.get(index); |
---|
| 3750 | +// temp.set(vertices.get(index)); // temprep.GetVertex(k)); |
---|
| 3751 | +// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3752 | +// |
---|
| 3753 | +// LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
| 3754 | +// |
---|
| 3755 | +// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z); |
---|
| 3756 | +// |
---|
| 3757 | +// if (g.toParent == null) |
---|
| 3758 | +// { |
---|
| 3759 | +// g.toParent = LA.newMatrix(); |
---|
| 3760 | +// g.fromParent = LA.newMatrix(); |
---|
| 3761 | +// } |
---|
| 3762 | +// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3763 | +// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
| 3764 | +// |
---|
| 3765 | +// g.add(GrafreeD.clipboard); |
---|
| 3766 | +// |
---|
| 3767 | +// buffer.add(g); |
---|
| 3768 | +// } |
---|
| 3769 | +// |
---|
| 3770 | +// makeSomething(buffer, i==group.selection.size()-1); |
---|
| 3771 | +// } |
---|
| 3772 | +// |
---|
| 3773 | +// GrafreeD.epsequal = epsequal; |
---|
| 3774 | +// |
---|
| 3775 | +// //buffer = null; |
---|
| 3776 | +// temprep = null; |
---|
| 3777 | +// nodes = null; |
---|
| 3778 | +// |
---|
| 3779 | +// refreshContents(); |
---|
| 3780 | +// } |
---|
| 3781 | + |
---|
3184 | 3782 | void ParseVertices() |
---|
3185 | 3783 | { |
---|
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; |
---|
| 3784 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3785 | + Grafreed.epsequal = true; |
---|
3195 | 3786 | |
---|
3196 | 3787 | for (int i=0; i<group.selection.size(); i++) |
---|
3197 | 3788 | { |
---|
3198 | | - Object3D buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
| 3789 | + final cGroup buffer = new cGroup(group.selection.get(i).name + "+"); |
---|
3199 | 3790 | |
---|
3200 | | - group.selection.get(i).Parse(this); |
---|
3201 | | - |
---|
3202 | | - int repsize = temprep.VertexCount(); |
---|
3203 | | - int tablesize = temprep.vertextable.size(); |
---|
3204 | | - int nodesize = nodes.size(); |
---|
| 3791 | + group.selection.get(i).Parse( |
---|
| 3792 | + |
---|
| 3793 | + new iParse() |
---|
| 3794 | + { |
---|
| 3795 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3796 | + { |
---|
| 3797 | + temp.set(v); |
---|
| 3798 | + LA.xformPos(temp, node.GlobalTransformInv(), temp); |
---|
3205 | 3799 | |
---|
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(); |
---|
| 3800 | + cGroup g = new cGroup(); |
---|
3211 | 3801 | |
---|
3212 | | - for (java.util.Map.Entry<Vertex,Vertex> entry : set) |
---|
3213 | | - { |
---|
3214 | | - cGroup g = new cGroup(); |
---|
| 3802 | + if (g.toParent == null) |
---|
| 3803 | + { |
---|
| 3804 | + g.toParent = LA.newMatrix(); |
---|
| 3805 | + g.fromParent = LA.newMatrix(); |
---|
| 3806 | + } |
---|
| 3807 | + LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
| 3808 | + LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3215 | 3809 | |
---|
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); |
---|
| 3810 | + g.add(Grafreed.clipboard); |
---|
3220 | 3811 | |
---|
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); |
---|
| 3812 | + buffer.add(g); |
---|
| 3813 | + } |
---|
3232 | 3814 | |
---|
3233 | | - g.add(GraphreeD.clipboard); |
---|
| 3815 | + public void Face(Object3D node, Face f) |
---|
| 3816 | + { |
---|
3234 | 3817 | |
---|
3235 | | - buffer.add(g); |
---|
3236 | | - } |
---|
| 3818 | + } |
---|
| 3819 | + } |
---|
| 3820 | + ); |
---|
3237 | 3821 | |
---|
3238 | 3822 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3239 | 3823 | } |
---|
3240 | 3824 | |
---|
3241 | | - GraphreeD.epsequal = epsequal; |
---|
3242 | | - |
---|
3243 | | - //buffer = null; |
---|
3244 | | - temprep = null; |
---|
3245 | | - nodes = null; |
---|
| 3825 | + Grafreed.epsequal = epsequal; |
---|
3246 | 3826 | |
---|
3247 | 3827 | refreshContents(); |
---|
3248 | 3828 | } |
---|
3249 | | - |
---|
| 3829 | + |
---|
| 3830 | + void TextureVertices() |
---|
| 3831 | + { |
---|
| 3832 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3833 | + { |
---|
| 3834 | + group.selection.get(i).Parse( |
---|
| 3835 | + new iParse() |
---|
| 3836 | + { |
---|
| 3837 | + public void Vertex(Object3D node, Vertex v) |
---|
| 3838 | + { |
---|
| 3839 | + cTexture tex = node.GetTextures(); |
---|
| 3840 | + String pigment = Object3D.GetPigment(tex); |
---|
| 3841 | + //String bump = Object3D.GetBump(tex); |
---|
| 3842 | + |
---|
| 3843 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3844 | + |
---|
| 3845 | + try |
---|
| 3846 | + { |
---|
| 3847 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3848 | + } |
---|
| 3849 | + catch (Exception e) |
---|
| 3850 | + { |
---|
| 3851 | + System.err.println("FAIL: " + node); |
---|
| 3852 | + } |
---|
| 3853 | + |
---|
| 3854 | + double s = v.s; |
---|
| 3855 | + |
---|
| 3856 | + if (s == 1) |
---|
| 3857 | + s = 0; |
---|
| 3858 | + |
---|
| 3859 | + double t = v.t; |
---|
| 3860 | + |
---|
| 3861 | + if (t == 1) |
---|
| 3862 | + t = 0; |
---|
| 3863 | + |
---|
| 3864 | + int indexs = (int) (texturedata.getWidth() * s); |
---|
| 3865 | + int indext = (int) (texturedata.getHeight() * t); |
---|
| 3866 | + |
---|
| 3867 | + int index = indext * texturedata.getWidth() + indexs; |
---|
| 3868 | + |
---|
| 3869 | + java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer(); |
---|
| 3870 | + |
---|
| 3871 | + int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight(); |
---|
| 3872 | + |
---|
| 3873 | + float scale = bytebuf.get(index*slide) & 0xFF; |
---|
| 3874 | + scale += bytebuf.get(index*slide+1) & 0xFF; |
---|
| 3875 | + scale += bytebuf.get(index*slide+2) & 0xFF; |
---|
| 3876 | + scale /= 3; |
---|
| 3877 | + |
---|
| 3878 | + scale /= 0xFF; |
---|
| 3879 | + // c'est quoi ca? scale /= 4; |
---|
| 3880 | + |
---|
| 3881 | + //v.AO = scale; |
---|
| 3882 | + |
---|
| 3883 | + v.x += v.norm.x * scale; |
---|
| 3884 | + v.y += v.norm.y * scale; |
---|
| 3885 | + v.z += v.norm.z * scale; |
---|
| 3886 | + } |
---|
| 3887 | + |
---|
| 3888 | + public void Face(Object3D node, Face f) |
---|
| 3889 | + { |
---|
| 3890 | + } |
---|
| 3891 | + } |
---|
| 3892 | + ); |
---|
| 3893 | + } |
---|
| 3894 | + |
---|
| 3895 | + refreshContents(); |
---|
| 3896 | + } |
---|
| 3897 | + |
---|
3250 | 3898 | void Align() |
---|
3251 | 3899 | { |
---|
| 3900 | + if (group.selection.size() == 0) |
---|
| 3901 | + return; |
---|
| 3902 | + |
---|
| 3903 | + cVector bbmin = new cVector(); |
---|
| 3904 | + cVector bbmax = new cVector(); |
---|
| 3905 | + |
---|
| 3906 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3907 | + |
---|
| 3908 | + double dx = bbmax.x - bbmin.x; |
---|
| 3909 | + double dy = bbmax.y - bbmin.y; |
---|
| 3910 | + double dz = bbmax.z - bbmin.z; |
---|
| 3911 | + |
---|
| 3912 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3913 | + |
---|
3252 | 3914 | for (int i=0; i<group.selection.size(); i++) |
---|
3253 | 3915 | { |
---|
3254 | 3916 | Object3D obj = group.selection.get(i); |
---|
3255 | 3917 | |
---|
3256 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3257 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3918 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3919 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3258 | 3920 | } |
---|
3259 | 3921 | |
---|
3260 | 3922 | refreshContents(); |
---|
.. | .. |
---|
3267 | 3929 | // ref.SaveSupports(); |
---|
3268 | 3930 | // Object3D par = ref.parent; |
---|
3269 | 3931 | // ref.parent = null; |
---|
3270 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 3932 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3271 | 3933 | // ref.parent = par; |
---|
3272 | 3934 | // ref.RestoreSupports(); |
---|
3273 | 3935 | |
---|
.. | .. |
---|
3275 | 3937 | |
---|
3276 | 3938 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3277 | 3939 | |
---|
3278 | | - boolean random = CameraPane.RANDOM; |
---|
3279 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3940 | + boolean random = CameraPane.SWITCH; |
---|
| 3941 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3280 | 3942 | lowres.linkVerticesThis(null); |
---|
3281 | 3943 | lowres.linkVerticesThis(sn); |
---|
3282 | | - CameraPane.RANDOM = random; |
---|
| 3944 | + CameraPane.SWITCH = random; |
---|
3283 | 3945 | |
---|
3284 | 3946 | System.err.flush(); |
---|
3285 | 3947 | |
---|
.. | .. |
---|
3297 | 3959 | // lowres.SaveSupports(); |
---|
3298 | 3960 | // par = lowres.parent; |
---|
3299 | 3961 | // lowres.parent = null; |
---|
3300 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 3962 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3301 | 3963 | Object3D newlow = CloneObject(lowres, false); |
---|
3302 | 3964 | newlow.name = sn.switchobject.get(i).name; |
---|
3303 | 3965 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3319 | 3981 | return; |
---|
3320 | 3982 | |
---|
3321 | 3983 | Object3D poses = group.selection.get(0); |
---|
3322 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 3984 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3323 | 3985 | |
---|
3324 | 3986 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3325 | 3987 | |
---|
.. | .. |
---|
3488 | 4150 | group.selection.RelinkToSupport(); // july 2014 |
---|
3489 | 4151 | System.out.println("DONE."); |
---|
3490 | 4152 | refreshContents(); |
---|
3491 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4153 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3492 | 4154 | } |
---|
3493 | 4155 | |
---|
3494 | 4156 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3513 | 4175 | |
---|
3514 | 4176 | void ClipMesh() |
---|
3515 | 4177 | { |
---|
3516 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 4178 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3517 | 4179 | { |
---|
3518 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 4180 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3519 | 4181 | |
---|
3520 | 4182 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3521 | 4183 | content = ((cGroup)content).get(0); |
---|
3522 | 4184 | |
---|
3523 | 4185 | // for (int i=0; i<group.selection.size(); i++) |
---|
3524 | 4186 | // { |
---|
3525 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 4187 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3526 | 4188 | // } |
---|
3527 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4189 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3528 | 4190 | } |
---|
3529 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4191 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3530 | 4192 | System.out.println("DONE."); |
---|
3531 | 4193 | refreshContents(); |
---|
3532 | 4194 | } |
---|
.. | .. |
---|
3571 | 4233 | void MarkLeaves(boolean hide) |
---|
3572 | 4234 | { |
---|
3573 | 4235 | group.selection.MarkLeaves(hide); |
---|
| 4236 | + refreshContents(); |
---|
| 4237 | + } |
---|
| 4238 | + |
---|
| 4239 | + void RewindLeaves(boolean hide) |
---|
| 4240 | + { |
---|
| 4241 | + group.selection.RewindLeaves(hide); |
---|
| 4242 | + refreshContents(); |
---|
| 4243 | + } |
---|
| 4244 | + |
---|
| 4245 | + void RandomLeaves(boolean hide) |
---|
| 4246 | + { |
---|
| 4247 | + group.selection.RandomLeaves(hide); |
---|
3574 | 4248 | refreshContents(); |
---|
3575 | 4249 | } |
---|
3576 | 4250 | |
---|
.. | .. |
---|
3659 | 4333 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3660 | 4334 | |
---|
3661 | 4335 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3662 | | - if(elem != group) |
---|
| 4336 | + if(elem != group || !newWindow) |
---|
3663 | 4337 | { |
---|
3664 | 4338 | // if (!(elem instanceof Composite)) |
---|
3665 | 4339 | // newWindow = false; |
---|
.. | .. |
---|
3749 | 4423 | //case 702: // Event.LIST_DESELECT |
---|
3750 | 4424 | group.deselectAll(); |
---|
3751 | 4425 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
3752 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
3753 | 4426 | if (tps != null) |
---|
3754 | 4427 | { |
---|
3755 | 4428 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
3758 | 4431 | |
---|
3759 | 4432 | //if (child.parent != null) |
---|
3760 | 4433 | //child.parent.addSelectee(child); |
---|
| 4434 | + objEditor.SetMaterial(child); |
---|
3761 | 4435 | group.addSelectee(child); |
---|
3762 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
3763 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
3764 | | - System.err.println("info : " + child.GetPath()); |
---|
3765 | 4436 | } |
---|
3766 | 4437 | } |
---|
3767 | | - else |
---|
3768 | | - { |
---|
3769 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3770 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3771 | | - System.err.println("info : " + group.GetPath()); |
---|
3772 | | - } |
---|
| 4438 | +// else |
---|
| 4439 | +// { |
---|
| 4440 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4441 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4442 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4443 | +// } |
---|
3773 | 4444 | |
---|
3774 | | - objEditor.SetText(); // jan 2014 |
---|
3775 | | - |
---|
3776 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4445 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
3777 | 4446 | CameraPane.flash = true; |
---|
3778 | 4447 | |
---|
3779 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4448 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
3780 | 4449 | // a camera |
---|
3781 | 4450 | { |
---|
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; |
---|
| 4451 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4452 | + { |
---|
| 4453 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4454 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4455 | + } |
---|
| 4456 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4457 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3786 | 4458 | } |
---|
3787 | 4459 | |
---|
3788 | 4460 | refreshContents(); |
---|
.. | .. |
---|
3793 | 4465 | |
---|
3794 | 4466 | freezemodel = false; |
---|
3795 | 4467 | } |
---|
| 4468 | + |
---|
| 4469 | + void refreshContents(boolean cp) |
---|
| 4470 | + { |
---|
| 4471 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4472 | + { |
---|
| 4473 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4474 | + |
---|
| 4475 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4476 | + { |
---|
| 4477 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4478 | + |
---|
| 4479 | + objEditor.AddInfo(child, this, true); |
---|
| 4480 | + System.err.println("info : " + child.GetPath()); |
---|
| 4481 | + } |
---|
| 4482 | + |
---|
| 4483 | + objEditor.SetText(); // jan 2014 |
---|
| 4484 | + } |
---|
| 4485 | + |
---|
| 4486 | + super.refreshContents(cp); |
---|
| 4487 | + } |
---|
3796 | 4488 | |
---|
3797 | 4489 | void linkSomething(Object3D thing) |
---|
3798 | 4490 | { |
---|
.. | .. |
---|
3864 | 4556 | { |
---|
3865 | 4557 | if (group.selection.isEmpty()) |
---|
3866 | 4558 | return; |
---|
3867 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4559 | + |
---|
| 4560 | + Grafreed.clipboardIsTempGroup = false; |
---|
3868 | 4561 | Composite tGroup = null; |
---|
3869 | 4562 | if (group.selection.size() > 0) // 1) |
---|
3870 | 4563 | { |
---|
3871 | 4564 | tGroup = new cGroup(); |
---|
3872 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4565 | + Grafreed.clipboardIsTempGroup = true; |
---|
3873 | 4566 | } |
---|
3874 | 4567 | |
---|
3875 | 4568 | if (cut) |
---|
3876 | 4569 | { |
---|
| 4570 | + Save(); |
---|
3877 | 4571 | //int indices[] = jList.getSelectedIndices(); |
---|
3878 | 4572 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
3879 | 4573 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
3909 | 4603 | //System.out.println("cut " + child); |
---|
3910 | 4604 | //System.out.println("parent = " + child.parent); |
---|
3911 | 4605 | // tmp.addChild(child); |
---|
3912 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4606 | + if (Grafreed.clipboardIsTempGroup) |
---|
3913 | 4607 | tGroup.add/*Child*/(tmp); |
---|
3914 | 4608 | else |
---|
3915 | | - GraphreeD.clipboard = tmp; |
---|
| 4609 | + Grafreed.clipboard = tmp; |
---|
3916 | 4610 | } |
---|
3917 | 4611 | else |
---|
3918 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4612 | + if (Grafreed.clipboardIsTempGroup) |
---|
3919 | 4613 | tGroup.add/*Child*/(child); |
---|
3920 | 4614 | else |
---|
3921 | | - GraphreeD.clipboard = child; |
---|
| 4615 | + Grafreed.clipboard = child; |
---|
3922 | 4616 | } |
---|
3923 | 4617 | |
---|
3924 | 4618 | //ResetModel(); |
---|
.. | .. |
---|
3950 | 4644 | //System.out.println("cut " + elem); |
---|
3951 | 4645 | //System.out.println("parent = " + elem.parent); |
---|
3952 | 4646 | // tmp.addChild(elem); |
---|
3953 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4647 | + if (Grafreed.clipboardIsTempGroup) |
---|
3954 | 4648 | tGroup.add/*Child*/(tmp); |
---|
3955 | 4649 | else |
---|
3956 | | - GraphreeD.clipboard = tmp; |
---|
| 4650 | + Grafreed.clipboard = tmp; |
---|
3957 | 4651 | } |
---|
3958 | 4652 | else |
---|
3959 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4653 | + if (Grafreed.clipboardIsTempGroup) |
---|
3960 | 4654 | tGroup.add/*Child*/(child); |
---|
3961 | 4655 | else |
---|
3962 | | - GraphreeD.clipboard = child; |
---|
| 4656 | + Grafreed.clipboard = child; |
---|
3963 | 4657 | } |
---|
3964 | 4658 | |
---|
3965 | 4659 | } |
---|
3966 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
3967 | | - GraphreeD.clipboard = tGroup; |
---|
| 4660 | + |
---|
| 4661 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4662 | + Grafreed.clipboard = tGroup; |
---|
| 4663 | + |
---|
3968 | 4664 | if (cut) |
---|
3969 | 4665 | { |
---|
3970 | 4666 | ResetModel(); |
---|
.. | .. |
---|
3974 | 4670 | |
---|
3975 | 4671 | void paste(boolean expand) |
---|
3976 | 4672 | { |
---|
3977 | | - // if (GraphreeD.clipboard == null) |
---|
| 4673 | + // if (GrafreeD.clipboard == null) |
---|
3978 | 4674 | // return; |
---|
3979 | 4675 | boolean first = true; |
---|
3980 | 4676 | |
---|
3981 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4677 | + if (Grafreed.clipboardIsTempGroup) |
---|
3982 | 4678 | { |
---|
3983 | 4679 | Composite temp; |
---|
3984 | 4680 | |
---|
.. | .. |
---|
3989 | 4685 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
3990 | 4686 | */ |
---|
3991 | 4687 | Object3D elem; |
---|
3992 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4688 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
3993 | 4689 | { |
---|
3994 | 4690 | Object3D child = (Object3D)e.nextElement(); |
---|
3995 | 4691 | |
---|
.. | .. |
---|
4003 | 4699 | else |
---|
4004 | 4700 | elem = child.deepCopy(); // ? |
---|
4005 | 4701 | child.parent = keepparent; |
---|
4006 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4702 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4007 | 4703 | // elem = elem.get(0); |
---|
4008 | 4704 | makeSomething(elem, true); // ?? first); |
---|
4009 | 4705 | //group.addChild(elem); |
---|
.. | .. |
---|
4023 | 4719 | //Object3D cb = Applet3D.clipboard; |
---|
4024 | 4720 | //temp.addChild(cb); |
---|
4025 | 4721 | //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()); |
---|
| 4722 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4723 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4724 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4725 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4726 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4031 | 4727 | else |
---|
4032 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4033 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4728 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4729 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4034 | 4730 | } |
---|
4035 | 4731 | |
---|
4036 | 4732 | ResetModel(); |
---|
4037 | 4733 | refreshContents(); |
---|
4038 | 4734 | } |
---|
4039 | 4735 | |
---|
4040 | | - void pasteInto(boolean copyit) |
---|
| 4736 | + void pasteInto(boolean copyit, boolean clone) |
---|
4041 | 4737 | { |
---|
4042 | | -// if (GraphreeD.clipboard == null) |
---|
| 4738 | +// if (GrafreeD.clipboard == null) |
---|
4043 | 4739 | // return; |
---|
4044 | 4740 | |
---|
4045 | 4741 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4066 | 4762 | if (copyit) |
---|
4067 | 4763 | { |
---|
4068 | 4764 | // paste(false); |
---|
4069 | | - CloneClipboard(false); // sept 2014 |
---|
| 4765 | + if (clone) |
---|
| 4766 | + { |
---|
| 4767 | + CloneClipboard(false); // sept 2014 |
---|
| 4768 | + } |
---|
| 4769 | + else |
---|
| 4770 | + { |
---|
| 4771 | + paste(false); |
---|
| 4772 | + } |
---|
4070 | 4773 | } |
---|
4071 | 4774 | else |
---|
4072 | 4775 | { |
---|
4073 | 4776 | boolean first = true; |
---|
4074 | 4777 | |
---|
4075 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4778 | + if (Grafreed.clipboardIsTempGroup) |
---|
4076 | 4779 | { |
---|
4077 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4780 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4078 | 4781 | Object3D copy; |
---|
4079 | 4782 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4080 | 4783 | { |
---|
.. | .. |
---|
4084 | 4787 | } |
---|
4085 | 4788 | } else |
---|
4086 | 4789 | { |
---|
4087 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4790 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4088 | 4791 | } |
---|
4089 | 4792 | } |
---|
4090 | 4793 | } |
---|
.. | .. |
---|
4276 | 4979 | makeSomething(csg); |
---|
4277 | 4980 | } |
---|
4278 | 4981 | |
---|
| 4982 | + void Ungroup(Object3D g) |
---|
| 4983 | + { |
---|
| 4984 | + if (g instanceof HiddenObject) |
---|
| 4985 | + { |
---|
| 4986 | + HiddenObject h = (HiddenObject) g; |
---|
| 4987 | + |
---|
| 4988 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4989 | + { |
---|
| 4990 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4991 | + } |
---|
| 4992 | + } |
---|
| 4993 | + else |
---|
| 4994 | + { |
---|
| 4995 | + for (int i=0; i<g.Size(); i++) |
---|
| 4996 | + { |
---|
| 4997 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4998 | + } |
---|
| 4999 | + } |
---|
| 5000 | + } |
---|
| 5001 | + |
---|
4279 | 5002 | void ungroup() |
---|
4280 | 5003 | { |
---|
4281 | 5004 | /* |
---|
.. | .. |
---|
4469 | 5192 | } |
---|
4470 | 5193 | */ |
---|
4471 | 5194 | |
---|
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 | 5195 | /* |
---|
4488 | 5196 | public void Callback(Object obj) |
---|
4489 | 5197 | { |
---|
.. | .. |
---|
4507 | 5215 | } |
---|
4508 | 5216 | */ |
---|
4509 | 5217 | |
---|
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 | 5218 | String GetFile(String dialogName) |
---|
4528 | 5219 | { |
---|
4529 | | - if (GraphreeD.standAlone) |
---|
| 5220 | + if (Grafreed.standAlone) |
---|
4530 | 5221 | { |
---|
4531 | 5222 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4532 | 5223 | browser.show(); |
---|
.. | .. |
---|
4590 | 5281 | cButton flashSelectionButton; |
---|
4591 | 5282 | cButton editButton; |
---|
4592 | 5283 | cButton uneditButton; |
---|
| 5284 | + JCheckBox allParamsButton; |
---|
4593 | 5285 | cButton clearpanelButton; |
---|
4594 | | - cButton allParamsButton; |
---|
4595 | 5286 | cButton unselectButton; |
---|
4596 | 5287 | |
---|
| 5288 | + cButton minButton; |
---|
| 5289 | + cButton maxButton; |
---|
| 5290 | + cButton fullButton; |
---|
| 5291 | + cButton undoButton; |
---|
| 5292 | + cButton redoButton; |
---|
| 5293 | + cButton saveButton; |
---|
| 5294 | + cButton oneStepButton; |
---|
| 5295 | + |
---|
4597 | 5296 | cButton screenfitButton; |
---|
4598 | 5297 | cButton screenfitpointButton; |
---|
4599 | 5298 | cButton snapobjectButton; |
---|
.. | .. |
---|
4604 | 5303 | cButton closeButton; |
---|
4605 | 5304 | |
---|
4606 | 5305 | 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 | 5306 | |
---|
4616 | 5307 | // |
---|
4617 | 5308 | //Composite |
---|
.. | .. |
---|
4624 | 5315 | private MenuItem lookFromItem; |
---|
4625 | 5316 | private MenuItem switchItem; |
---|
4626 | 5317 | private MenuItem cutItem; |
---|
| 5318 | + private MenuItem undoItem; |
---|
| 5319 | + private MenuItem redoItem; |
---|
4627 | 5320 | private MenuItem duplicateItem; |
---|
4628 | 5321 | private MenuItem cloneItem; |
---|
4629 | 5322 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4635 | 5328 | private MenuItem resetsupportItem; |
---|
4636 | 5329 | private MenuItem resetreferencesItem; |
---|
4637 | 5330 | private MenuItem linkverticesItem; |
---|
| 5331 | + private MenuItem relinkverticesItem; |
---|
4638 | 5332 | private MenuItem setMasterItem; |
---|
4639 | | - private MenuItem resetMeshItem; |
---|
| 5333 | + private MenuItem resetAllItem; |
---|
4640 | 5334 | private MenuItem stepAllItem; |
---|
4641 | 5335 | private MenuItem revertMeshItem; |
---|
4642 | 5336 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4647 | 5341 | private MenuItem mergeGeometriesItem; |
---|
4648 | 5342 | private MenuItem copyItem; |
---|
4649 | 5343 | private MenuItem pasteItem; |
---|
| 5344 | + private MenuItem pasteIntoItem; |
---|
4650 | 5345 | private MenuItem pasteLinkItem; |
---|
4651 | 5346 | private MenuItem pasteCloneItem; |
---|
4652 | 5347 | private MenuItem pasteExpandItem; |
---|
4653 | 5348 | private MenuItem clearItem; |
---|
4654 | 5349 | private MenuItem clearAllItem; |
---|
4655 | 5350 | private MenuItem genUVItem; |
---|
| 5351 | + private MenuItem genNormalsMESHItem; |
---|
4656 | 5352 | private MenuItem genNormalsCADItem; |
---|
4657 | 5353 | private MenuItem genNormalsORGANItem; |
---|
| 5354 | + private MenuItem genNormalsMINEItem; |
---|
4658 | 5355 | private MenuItem stripifyItem; |
---|
4659 | 5356 | private MenuItem unstripifyItem; |
---|
4660 | 5357 | private MenuItem trimItem; |
---|
.. | .. |
---|
4683 | 5380 | private MenuItem showleavesItem; |
---|
4684 | 5381 | private MenuItem markleavesItem; |
---|
4685 | 5382 | private MenuItem unmarkleavesItem; |
---|
| 5383 | + private MenuItem rewindleavesItem; |
---|
| 5384 | + private MenuItem unrewindleavesItem; |
---|
| 5385 | + private MenuItem randomleavesItem; |
---|
| 5386 | + private MenuItem unrandomleavesItem; |
---|
4686 | 5387 | |
---|
4687 | 5388 | private MenuItem flipVItem; |
---|
4688 | 5389 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
4694 | 5395 | private MenuItem panoTexturesItem; |
---|
4695 | 5396 | |
---|
4696 | 5397 | private MenuItem resetCentroidItem; |
---|
4697 | | - private MenuItem transformgeometryItem; |
---|
| 5398 | + private MenuItem resetCentroidXZItem; |
---|
4698 | 5399 | private MenuItem resetTransformItem; |
---|
| 5400 | + private MenuItem transformGeometryItem; |
---|
| 5401 | + private MenuItem transformChildrenItem; |
---|
| 5402 | + private MenuItem hideItem; |
---|
4699 | 5403 | private MenuItem grabItem; |
---|
4700 | 5404 | private MenuItem backItem; |
---|
4701 | 5405 | private MenuItem frontItem; |
---|
.. | .. |
---|
4716 | 5420 | |
---|
4717 | 5421 | private MenuItem resetParentItem; |
---|
4718 | 5422 | private MenuItem repairParentItem; |
---|
| 5423 | + private MenuItem repairShadowItem; |
---|
4719 | 5424 | private MenuItem sortbysizeItem; |
---|
4720 | 5425 | private MenuItem sortbynameItem; |
---|
4721 | 5426 | |
---|
.. | .. |
---|
4728 | 5433 | private MenuItem particleItem; |
---|
4729 | 5434 | private MenuItem ragdollItem; |
---|
4730 | 5435 | private MenuItem ragdoll2Item; |
---|
| 5436 | + private MenuItem heightFieldItem; |
---|
| 5437 | + private MenuItem textureFieldItem; |
---|
4731 | 5438 | private MenuItem gridItem; |
---|
4732 | 5439 | private MenuItem rectoidItem; |
---|
4733 | 5440 | private MenuItem ellipsoidItem; |
---|
4734 | 5441 | private MenuItem coneItem; |
---|
4735 | 5442 | private MenuItem torusItem; |
---|
4736 | 5443 | private MenuItem superItem; |
---|
| 5444 | + private MenuItem kleinItem; |
---|
4737 | 5445 | private MenuItem blobItem; |
---|
4738 | 5446 | private MenuItem latheItem; |
---|
4739 | 5447 | private MenuItem bezierItem; |
---|
4740 | | - private MenuItem checkerItem; |
---|
| 5448 | + private MenuItem overlayItem; |
---|
4741 | 5449 | private MenuItem meshItem; |
---|
4742 | 5450 | // private MenuItem meshGroupItem; |
---|
4743 | 5451 | private MenuItem springItem; |
---|
.. | .. |
---|
4746 | 5454 | private MenuItem csgItem; |
---|
4747 | 5455 | private MenuItem templateItem; |
---|
4748 | 5456 | private MenuItem textureItem; |
---|
| 5457 | + private MenuItem billboardItem; |
---|
4749 | 5458 | private MenuItem shadowXItem; |
---|
4750 | 5459 | private MenuItem shadowYItem; |
---|
4751 | 5460 | private MenuItem shadowZItem; |
---|
.. | .. |
---|
4758 | 5467 | private MenuItem doubleItem; |
---|
4759 | 5468 | private MenuItem tripleItem; |
---|
4760 | 5469 | |
---|
4761 | | - private MenuItem importGFDItem; |
---|
4762 | | - private MenuItem importVRMLX3DItem; |
---|
4763 | | - private MenuItem import3DSItem; |
---|
4764 | | - private MenuItem importOBJItem; |
---|
4765 | | - |
---|
4766 | 5470 | private MenuItem computeAOItem; |
---|
4767 | 5471 | private MenuItem recompileItem; |
---|
4768 | 5472 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
4772 | 5476 | private MenuItem analyzeItem; |
---|
4773 | 5477 | private MenuItem dumpItem; |
---|
4774 | 5478 | //boolean freezemodel = false; |
---|
| 5479 | + |
---|
| 5480 | + Menu cameraMenu; |
---|
| 5481 | + MenuItem editCameraItem; |
---|
| 5482 | + MenuItem revertCameraItem; |
---|
4775 | 5483 | } |
---|