.. | .. |
---|
24 | 24 | |
---|
25 | 25 | private UUID uuid = UUID.randomUUID(); |
---|
26 | 26 | |
---|
27 | | - // TEMPORARY for mocap undo |
---|
28 | | - mocap.reader.BVHReader.BVHResult bvh; |
---|
29 | | - Object3D skeleton; |
---|
| 27 | + // TEMPORARY for mocap undo. No need to be transient. |
---|
| 28 | + mocap.reader.BVHReader.BVHResult savebvh; |
---|
| 29 | + Object3D saveskeleton; |
---|
30 | 30 | // |
---|
31 | 31 | |
---|
| 32 | + byte[] versions[] = new byte[100][]; |
---|
| 33 | + int versionindex = -1; |
---|
| 34 | + |
---|
32 | 35 | ScriptNode scriptnode; |
---|
33 | 36 | |
---|
34 | 37 | void InitOthers() |
---|
.. | .. |
---|
170 | 173 | |
---|
171 | 174 | void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
172 | 175 | { |
---|
| 176 | + Object3D o; |
---|
| 177 | + |
---|
173 | 178 | if (hashtable.containsKey(GetUUID())) |
---|
174 | 179 | { |
---|
175 | | - Object3D o = hashtable.get(GetUUID()); |
---|
| 180 | + o = hashtable.get(GetUUID()); |
---|
176 | 181 | |
---|
177 | 182 | Grafreed.Assert(this.bRep == o.bRep); |
---|
178 | | - if (this.bRep != null) |
---|
179 | | - assert(this.bRep.support == o.transientrep); |
---|
| 183 | + //if (this.bRep != null) |
---|
| 184 | + // assert(this.bRep.support == o.transientrep); |
---|
| 185 | + if (this.support != null) |
---|
| 186 | + assert(this.support.bRep == o.transientrep); |
---|
| 187 | + } |
---|
| 188 | + else |
---|
| 189 | + { |
---|
| 190 | + o = new Object3D("copy of " + this.name); |
---|
180 | 191 | |
---|
181 | | - return; |
---|
| 192 | + hashtable.put(GetUUID(), o); |
---|
182 | 193 | } |
---|
183 | 194 | |
---|
184 | | - Object3D o = new Object3D(); |
---|
185 | | - |
---|
186 | | - hashtable.put(GetUUID(), o); |
---|
187 | | - |
---|
188 | | - for (int i=0; i<Size(); i++) |
---|
| 195 | + if (!blockloop) |
---|
189 | 196 | { |
---|
190 | | - get(i).ExtractBigData(hashtable); |
---|
| 197 | + blockloop = true; |
---|
| 198 | + |
---|
| 199 | + for (int i=0; i<Size(); i++) |
---|
| 200 | + { |
---|
| 201 | + get(i).ExtractBigData(hashtable); |
---|
| 202 | + } |
---|
| 203 | + |
---|
| 204 | + blockloop = false; |
---|
191 | 205 | } |
---|
192 | 206 | |
---|
193 | 207 | ExtractBigData(o); |
---|
.. | .. |
---|
195 | 209 | |
---|
196 | 210 | void ExtractBigData(Object3D o) |
---|
197 | 211 | { |
---|
| 212 | + if (o.bRep != null) |
---|
| 213 | + Grafreed.Assert(o.bRep == this.bRep); |
---|
| 214 | + |
---|
198 | 215 | o.bRep = this.bRep; |
---|
199 | | - if (this.bRep != null) |
---|
| 216 | +// July 2019 if (this.bRep != null) |
---|
| 217 | +// { |
---|
| 218 | +// o.transientrep = this.bRep.support; |
---|
| 219 | +// o.bRep.support = null; |
---|
| 220 | +// } |
---|
| 221 | + o.selection = this.selection; |
---|
| 222 | + |
---|
| 223 | + if (this.support != null) |
---|
200 | 224 | { |
---|
201 | | - o.transientrep = this.bRep.support; |
---|
202 | | - o.bRep.support = null; |
---|
| 225 | + if (o.transientrep != null) |
---|
| 226 | + Grafreed.Assert(o.transientrep == this.support.bRep); |
---|
| 227 | + |
---|
| 228 | + o.transientrep = this.support.bRep; |
---|
| 229 | + this.support.bRep = null; |
---|
203 | 230 | } |
---|
204 | 231 | |
---|
205 | 232 | // o.support = this.support; |
---|
.. | .. |
---|
223 | 250 | |
---|
224 | 251 | RestoreBigData(o); |
---|
225 | 252 | |
---|
226 | | - hashtable.remove(GetUUID()); |
---|
| 253 | + if (blockloop) |
---|
| 254 | + return; |
---|
| 255 | + |
---|
| 256 | + blockloop = true; |
---|
| 257 | + |
---|
| 258 | + //hashtable.remove(GetUUID()); |
---|
227 | 259 | |
---|
228 | 260 | for (int i=0; i<Size(); i++) |
---|
229 | 261 | { |
---|
230 | 262 | get(i).RestoreBigData(hashtable); |
---|
231 | 263 | } |
---|
| 264 | + |
---|
| 265 | + blockloop = false; |
---|
232 | 266 | } |
---|
233 | 267 | |
---|
234 | 268 | void RestoreBigData(Object3D o) |
---|
235 | 269 | { |
---|
236 | 270 | this.bRep = o.bRep; |
---|
237 | | - if (this.bRep != null) |
---|
238 | | - this.bRep.support = o.transientrep; |
---|
| 271 | + if (this.support != null && o.transientrep != null) |
---|
| 272 | + { |
---|
| 273 | + this.support.bRep = o.transientrep; |
---|
| 274 | + } |
---|
| 275 | + |
---|
| 276 | + this.selection = o.selection; |
---|
| 277 | +// July 2019 if (this.bRep != null) |
---|
| 278 | +// this.bRep.support = o.transientrep; |
---|
239 | 279 | // this.support = o.support; |
---|
240 | 280 | // this.fileparent = o.fileparent; |
---|
241 | 281 | } |
---|
.. | .. |
---|
1367 | 1407 | toParent = LA.newMatrix(); |
---|
1368 | 1408 | fromParent = LA.newMatrix(); |
---|
1369 | 1409 | } |
---|
| 1410 | + |
---|
1370 | 1411 | LA.matCopy(other.toParent, toParent); |
---|
1371 | 1412 | LA.matCopy(other.fromParent, fromParent); |
---|
1372 | 1413 | |
---|
.. | .. |
---|
2433 | 2474 | { |
---|
2434 | 2475 | editWindow.refreshContents(); |
---|
2435 | 2476 | } |
---|
| 2477 | + else |
---|
| 2478 | + { |
---|
| 2479 | + if (manipWindow != null) |
---|
| 2480 | + { |
---|
| 2481 | + manipWindow.refreshContents(); |
---|
| 2482 | + } |
---|
| 2483 | + } |
---|
| 2484 | + |
---|
2436 | 2485 | //if (parent != null) |
---|
2437 | 2486 | //parent.refreshEditWindow(); |
---|
2438 | 2487 | } |
---|
.. | .. |
---|
4963 | 5012 | } |
---|
4964 | 5013 | } |
---|
4965 | 5014 | |
---|
| 5015 | + ObjEditor GetWindow() |
---|
| 5016 | + { |
---|
| 5017 | + if (editWindow != null) |
---|
| 5018 | + return editWindow; |
---|
| 5019 | + |
---|
| 5020 | + return manipWindow; |
---|
| 5021 | + } |
---|
| 5022 | + |
---|
4966 | 5023 | cTreePath Select(int indexcount, boolean deselect) |
---|
4967 | 5024 | { |
---|
4968 | 5025 | if (hide || dontselect) |
---|
.. | .. |
---|
4999 | 5056 | if (leaf != null) |
---|
5000 | 5057 | { |
---|
5001 | 5058 | cTreePath tp = new cTreePath(this, leaf); |
---|
5002 | | - if (editWindow != null) |
---|
| 5059 | + ObjEditor window = GetWindow(); |
---|
| 5060 | + if (window != null) |
---|
5003 | 5061 | { |
---|
5004 | 5062 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
5005 | | - editWindow.Select(tp, deselect, true); |
---|
| 5063 | + window.Select(tp, deselect, true); |
---|
5006 | 5064 | } |
---|
5007 | 5065 | |
---|
5008 | 5066 | return tp; |
---|
.. | .. |
---|
5019 | 5077 | |
---|
5020 | 5078 | if (child == null) |
---|
5021 | 5079 | continue; |
---|
| 5080 | + |
---|
5022 | 5081 | if (child.HasTransparency() && child.size() != 0) |
---|
5023 | 5082 | { |
---|
5024 | 5083 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
5028 | 5087 | if (leaf != null) |
---|
5029 | 5088 | { |
---|
5030 | 5089 | cTreePath tp = new cTreePath(this, leaf); |
---|
5031 | | - if (editWindow != null) |
---|
| 5090 | + ObjEditor window = GetWindow(); |
---|
| 5091 | + if (window != null) |
---|
5032 | 5092 | { |
---|
5033 | | - editWindow.Select(tp, deselect, true); |
---|
| 5093 | + window.Select(tp, deselect, true); |
---|
5034 | 5094 | } |
---|
5035 | 5095 | |
---|
5036 | 5096 | return tp; |
---|
.. | .. |
---|
5772 | 5832 | |
---|
5773 | 5833 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5774 | 5834 | //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5775 | | - (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
| 5835 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5776 | 5836 | { |
---|
5777 | 5837 | Globals.lighttouched = true; |
---|
5778 | 5838 | } // all panes... |
---|
.. | .. |
---|
5904 | 5964 | if (GetBRep() != null) |
---|
5905 | 5965 | { |
---|
5906 | 5966 | display.NextIndex(); |
---|
| 5967 | + |
---|
5907 | 5968 | // vertex color conflict : gl.glCallList(list); |
---|
5908 | 5969 | DrawNode(display, root, selected); |
---|
5909 | 5970 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
7261 | 7322 | // { |
---|
7262 | 7323 | // CameraPane.Ymax = spoth; |
---|
7263 | 7324 | // } |
---|
7264 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
7265 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7325 | + info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
| 7326 | + (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
7266 | 7327 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7267 | 7328 | // if (CameraPane.Xmin > boundary.x) |
---|
7268 | 7329 | // { |
---|
.. | .. |
---|
7967 | 8028 | } |
---|
7968 | 8029 | |
---|
7969 | 8030 | transient ObjEditor editWindow; |
---|
| 8031 | + transient ObjEditor manipWindow; |
---|
| 8032 | + |
---|
| 8033 | + transient boolean pinned; |
---|
| 8034 | + |
---|
7970 | 8035 | transient ObjectUI objectUI; |
---|
7971 | 8036 | public static int povDepth = 0; |
---|
7972 | 8037 | private static cVector tbMin = new cVector(); |
---|