Normand Briere
2019-06-11 5e6a6f3319f0c4c687fe71952ac9ecc17792b83a
ObjEditor.java
....@@ -1935,6 +1935,7 @@
19351935 e2.printStackTrace();
19361936 }
19371937 }
1938
+
19381939 LoadJMEThread loadThread;
19391940
19401941 class LoadJMEThread extends Thread
....@@ -1992,6 +1993,7 @@
19921993 //LoadFile0(filename, converter);
19931994 }
19941995 }
1996
+
19951997 LoadOBJThread loadObjThread;
19961998
19971999 class LoadOBJThread extends Thread
....@@ -3212,9 +3214,6 @@
32123214 objEditor.refreshContents();
32133215 }
32143216
3215
- Object3D graphs[] = new Object3D[10000];
3216
- int undoindex = 0;
3217
-
32183217 static public Object clone(Object o)
32193218 {
32203219 try
....@@ -3237,16 +3236,31 @@
32373236 }
32383237 }
32393238
3239
+ cRadio GetCurrentTab()
3240
+ {
3241
+ cRadio ab;
3242
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3243
+ {
3244
+ ab = (cRadio)e.nextElement();
3245
+ if(ab.GetObject() == client)
3246
+ {
3247
+ return ab;
3248
+ }
3249
+ }
3250
+
3251
+ return null;
3252
+ }
3253
+
32403254 public void Save()
32413255 {
3242
- if (true) return;
3256
+ cRadio tab = GetCurrentTab();
32433257
32443258 //EditorFrame.m_MainFrame.requestFocusInWindow();
3245
- graphs[undoindex++] = (Object3D)clone(copy);
3259
+ tab.graphs[tab.undoindex++] = (Object3D)clone(copy);
32463260
3247
- for (int i = undoindex; i < graphs.length; i++)
3261
+ for (int i = tab.undoindex; i < tab.graphs.length; i++)
32483262 {
3249
- graphs[i] = null;
3263
+ tab.graphs[i] = null;
32503264 }
32513265
32523266 // test save
....@@ -3254,7 +3268,7 @@
32543268 {
32553269 try
32563270 {
3257
- FileOutputStream ostream = new FileOutputStream("save" + undoindex);
3271
+ FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex);
32583272 ObjectOutputStream p = new ObjectOutputStream(ostream);
32593273
32603274 p.writeObject(copy);
....@@ -3269,48 +3283,70 @@
32693283 }
32703284 }
32713285
3286
+ void CopyChanged(Object3D obj)
3287
+ {
3288
+ copy.clear();
3289
+
3290
+ for (int i=0; i<obj.Size(); i++)
3291
+ {
3292
+ copy.add(obj.get(i));
3293
+ }
3294
+
3295
+ copy.Touch();
3296
+
3297
+ ResetModel();
3298
+ copy.HardTouch(); // recompile?
3299
+
3300
+ cRadio ab;
3301
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3302
+ {
3303
+ ab = (cRadio)e.nextElement();
3304
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3305
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3306
+ if (test != null)
3307
+ {
3308
+ test.editWindow = ab.object.editWindow;
3309
+ ab.object = test;
3310
+ }
3311
+ }
3312
+
3313
+ refreshContents();
3314
+ }
3315
+
32723316 public void Undo()
32733317 {
3274
- if (undoindex == 0)
3318
+ cRadio tab = GetCurrentTab();
3319
+
3320
+ if (tab.undoindex == 0)
32753321 {
32763322 java.awt.Toolkit.getDefaultToolkit().beep();
32773323 return;
32783324 }
32793325
3280
- if (graphs[undoindex] == null)
3326
+ if (tab.graphs[tab.undoindex] == null)
32813327 {
32823328 Save();
3283
- undoindex -= 1;
3329
+ tab.undoindex -= 1;
32843330 }
32853331
3286
- undoindex -= 1;
3332
+ tab.undoindex -= 1;
32873333
3288
- copy = graphs[undoindex];
3289
-
3290
- cameraView.object = copy;
3291
- copy.Touch();
3292
-
3293
- ResetModel();
3294
- refreshContents();
3334
+ CopyChanged(tab.graphs[tab.undoindex]);
32953335 }
32963336
32973337 public void Redo()
32983338 {
3299
- if (graphs[undoindex + 1] == null)
3339
+ cRadio tab = GetCurrentTab();
3340
+
3341
+ if (tab.graphs[tab.undoindex + 1] == null)
33003342 {
33013343 java.awt.Toolkit.getDefaultToolkit().beep();
33023344 return;
33033345 }
33043346
3305
- undoindex += 1;
3347
+ tab.undoindex += 1;
33063348
3307
- copy = graphs[undoindex];
3308
-
3309
- cameraView.object = copy;
3310
- copy.Touch();
3311
-
3312
- ResetModel();
3313
- refreshContents();
3349
+ CopyChanged(tab.graphs[tab.undoindex]);
33143350 }
33153351
33163352 void ImportGFD()