Normand Briere
2019-06-16 372b7fd481a476cd659713a4a01bf28bf6760cbe
ObjEditor.java
....@@ -278,7 +278,7 @@
278278 frame.setMenuBar(menuBar = new MenuBar());
279279 menuBar.add(fileMenu = new Menu("File"));
280280 fileMenu.add(newItem = new MenuItem("New"));
281
- fileMenu.add(loadItem = new MenuItem("Load..."));
281
+ fileMenu.add(loadItem = new MenuItem("Open..."));
282282
283283 //oe.menuBar.add(menu = new Menu("Include"));
284284 Menu menu = new Menu("Import");
....@@ -2072,19 +2072,19 @@
20722072
20732073 void LoadObjFile(String fullname)
20742074 {
2075
- /*
2075
+ System.out.println("Loading " + fullname);
2076
+ /**/
20762077 //lastFilename = fullname;
20772078 if(loadObjThread == null)
20782079 {
2079
- loadObjThread = new LoadOBJThread();
2080
- loadObjThread.start();
2080
+ loadObjThread = new LoadOBJThread();
2081
+ loadObjThread.start();
20812082 }
20822083
20832084 loadObjThread.add(fullname);
2084
- */
2085
+ /**/
20852086
2086
- System.out.println("Loading " + fullname);
2087
- makeSomething(new FileObject(fullname, true), true);
2087
+ //makeSomething(new FileObject(fullname, true), true);
20882088 }
20892089
20902090 void LoadGFDFile(String fullname)
....@@ -2927,7 +2927,7 @@
29272927 return;
29282928 } else if (event.getSource() == toggleSwitchItem)
29292929 {
2930
- cameraView.ToggleRandom();
2930
+ cameraView.ToggleSwitch();
29312931 cameraView.repaint();
29322932 return;
29332933 } else if (event.getSource() == toggleHandleItem)
....@@ -3214,7 +3214,7 @@
32143214 objEditor.refreshContents();
32153215 }
32163216
3217
- static public byte[] Compress(Object o)
3217
+ static public byte[] Compress(Object3D o)
32183218 {
32193219 try
32203220 {
....@@ -3222,8 +3222,13 @@
32223222 java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
32233223 ObjectOutputStream out = new ObjectOutputStream(zstream);
32243224
3225
+ Object3D parent = o.parent;
3226
+ o.parent = null;
3227
+
32253228 out.writeObject(o);
32263229
3230
+ o.parent = parent;
3231
+
32273232 out.flush();
32283233
32293234 zstream.close();
....@@ -3239,6 +3244,7 @@
32393244
32403245 static public Object Uncompress(byte[] bytes)
32413246 {
3247
+ System.out.println("#bytes = " + bytes.length);
32423248 try
32433249 {
32443250 ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
....@@ -3305,12 +3311,17 @@
33053311 {
33063312 cRadio tab = GetCurrentTab();
33073313
3314
+ boolean temp = CameraPane.SWITCH;
3315
+ CameraPane.SWITCH = false;
3316
+
33083317 copy.ExtractBigData(hashtable);
33093318
33103319 //EditorFrame.m_MainFrame.requestFocusInWindow();
3311
- tab.graphs[tab.undoindex++] = (Object3D)clone(copy);
3320
+ tab.graphs[tab.undoindex++] = Compress(copy);
33123321
33133322 copy.RestoreBigData(hashtable);
3323
+
3324
+ CameraPane.SWITCH = temp;
33143325
33153326 //assert(hashtable.isEmpty());
33163327
....@@ -3341,6 +3352,9 @@
33413352
33423353 void CopyChanged(Object3D obj)
33433354 {
3355
+ boolean temp = CameraPane.SWITCH;
3356
+ CameraPane.SWITCH = false;
3357
+
33443358 copy.ExtractBigData(hashtable);
33453359
33463360 copy.clear();
....@@ -3351,6 +3365,8 @@
33513365 }
33523366
33533367 copy.RestoreBigData(hashtable);
3368
+
3369
+ CameraPane.SWITCH = temp;
33543370
33553371 //assert(hashtable.isEmpty());
33563372
....@@ -3393,7 +3409,7 @@
33933409
33943410 tab.undoindex -= 1;
33953411
3396
- CopyChanged(tab.graphs[tab.undoindex]);
3412
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
33973413 }
33983414
33993415 public void Redo()
....@@ -3408,7 +3424,7 @@
34083424
34093425 tab.undoindex += 1;
34103426
3411
- CopyChanged(tab.graphs[tab.undoindex]);
3427
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
34123428 }
34133429
34143430 void ImportGFD()