Normand Briere
2019-06-11 4113164b3be1e50251ac40d6fd65660f0a6c2e63
Compressed undo stack.
4 files modified
21 ■■■■ changed files
CameraPane.java 2 ●●● patch | view | raw | blame | history
ObjEditor.java 9 ●●●●● patch | view | raw | blame | history
Object3D.java 8 ●●●●● patch | view | raw | blame | history
cRadio.java 2 ●●● patch | view | raw | blame | history
CameraPane.java
....@@ -2265,7 +2265,7 @@
22652265 LOOKAT ^= true;
22662266 }
22672267
2268
- void ToggleRandom()
2268
+ void ToggleSwitch()
22692269 {
22702270 SWITCH ^= true;
22712271 }
ObjEditor.java
....@@ -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)
....@@ -3239,6 +3239,7 @@
32393239
32403240 static public Object Uncompress(byte[] bytes)
32413241 {
3242
+ System.out.println("#bytes = " + bytes.length);
32423243 try
32433244 {
32443245 ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
....@@ -3308,7 +3309,7 @@
33083309 copy.ExtractBigData(hashtable);
33093310
33103311 //EditorFrame.m_MainFrame.requestFocusInWindow();
3311
- tab.graphs[tab.undoindex++] = (Object3D)clone(copy);
3312
+ tab.graphs[tab.undoindex++] = Compress(copy);
33123313
33133314 copy.RestoreBigData(hashtable);
33143315
....@@ -3393,7 +3394,7 @@
33933394
33943395 tab.undoindex -= 1;
33953396
3396
- CopyChanged(tab.graphs[tab.undoindex]);
3397
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
33973398 }
33983399
33993400 public void Redo()
....@@ -3408,7 +3409,7 @@
34083409
34093410 tab.undoindex += 1;
34103411
3411
- CopyChanged(tab.graphs[tab.undoindex]);
3412
+ CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex]));
34123413 }
34133414
34143415 void ImportGFD()
Object3D.java
....@@ -166,7 +166,15 @@
166166 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
167167 {
168168 if (hashtable.containsKey(GetUUID()))
169
+ {
170
+ Object3D o = hashtable.get(GetUUID());
171
+
172
+ assert(this.bRep == o.bRep);
173
+ if (this.bRep != null)
174
+ assert(this.bRep.support == o.transientrep);
175
+
169176 return;
177
+ }
170178
171179 Object3D o = new Object3D();
172180 o.bRep = this.bRep;
cRadio.java
....@@ -35,7 +35,7 @@
3535 camera = (Camera)Grafreed.clone(c);
3636 }
3737
38
- Object3D graphs[] = new Object3D[10000];
38
+ byte[] graphs[] = new byte[10000][];
3939 int undoindex = 0;
4040
4141 Object3D object;