Normand Briere
2019-10-05 8768a855af9ccc482a9520ce708ef32e0e6e0e7d
FileObject.java
....@@ -17,15 +17,50 @@
1717 filecontent = null;
1818 }
1919
20
+ boolean HasBigData()
21
+ {
22
+ return filecontent != null;
23
+ }
24
+
25
+ void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
26
+ {
27
+ Object3D o;
28
+
29
+ if (hashtable.containsKey(GetUUID()))
30
+ {
31
+ o = hashtable.get(GetUUID());
32
+
33
+ //Grafreed.Assert(this.filecontent == ((FileObject)o).filecontent);
34
+ }
35
+ else
36
+ {
37
+ o = new Object3D("copy of " + this.name);
38
+
39
+ hashtable.put(GetUUID(), o);
40
+ }
41
+
42
+ ExtractBigData(o);
43
+ }
44
+
45
+ void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
46
+ {
47
+ if (!hashtable.containsKey(GetUUID()))
48
+ return;
49
+
50
+ Object3D o = hashtable.get(GetUUID());
51
+
52
+ RestoreBigData(o);
53
+ }
54
+
2055 boolean IsStatic()
2156 {
2257 return false; // ???? false;
2358 }
2459
25
- void Reset()
26
- {
27
- // filecontent = null;
28
- }
60
+// void Reset()
61
+// {
62
+// // filecontent = null;
63
+// }
2964
3065 void ClearUI()
3166 {
....@@ -54,9 +89,12 @@
5489 else
5590 {
5691 filecontent = ObjEditor.ReadGFD/*z*/(name);
92
+ if (filecontent != null)
93
+ {
5794 filecontent.parent = null;
5895 filecontent.fileparent = this;
5996 filecontent.RepairTexture();
97
+ }
6098 // stripify on load instead?
6199 // OK...
62100 // filecontent.Stripify(); // fine. faster and read-only anyway
....@@ -78,6 +116,23 @@
78116 this.objfile = objfile;
79117 }
80118
119
+ void ExtractBigData(Object3D o)
120
+ {
121
+ super.ExtractBigData(o);
122
+
123
+ o.savefilecontent = this.filecontent;
124
+
125
+ // filecontent is transient
126
+ this.filecontent = null;
127
+ }
128
+
129
+ void RestoreBigData(Object3D o)
130
+ {
131
+ super.RestoreBigData(o);
132
+
133
+ this.filecontent = o.savefilecontent;
134
+ }
135
+
81136 Object3D deepCopy()
82137 {
83138 FileObject e = new FileObject(name, objfile);
....@@ -85,9 +140,9 @@
85140 return e;
86141 }
87142
88
- protected void deepCopySelf(Object3D other)
143
+ protected void deepCopyNode(Object3D other)
89144 {
90
- super.deepCopySelf(other);
145
+ super.deepCopyNode(other);
91146 }
92147
93148 // void Draw(CameraPane display, Object3D /*Composite*/ root, boolean selected)