.. | .. |
---|
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 | + o.versions = this.versions; |
---|
| 223 | + o.versionindex = this.versionindex; |
---|
| 224 | + |
---|
| 225 | + if (this.support != null) |
---|
200 | 226 | { |
---|
201 | | - o.transientrep = this.bRep.support; |
---|
202 | | - o.bRep.support = null; |
---|
| 227 | + if (o.transientrep != null) |
---|
| 228 | + Grafreed.Assert(o.transientrep == this.support.bRep); |
---|
| 229 | + |
---|
| 230 | + o.transientrep = this.support.bRep; |
---|
| 231 | + this.support.bRep = null; |
---|
203 | 232 | } |
---|
204 | 233 | |
---|
205 | 234 | // o.support = this.support; |
---|
.. | .. |
---|
223 | 252 | |
---|
224 | 253 | RestoreBigData(o); |
---|
225 | 254 | |
---|
226 | | - hashtable.remove(GetUUID()); |
---|
| 255 | + if (blockloop) |
---|
| 256 | + return; |
---|
| 257 | + |
---|
| 258 | + blockloop = true; |
---|
| 259 | + |
---|
| 260 | + //hashtable.remove(GetUUID()); |
---|
227 | 261 | |
---|
228 | 262 | for (int i=0; i<Size(); i++) |
---|
229 | 263 | { |
---|
230 | 264 | get(i).RestoreBigData(hashtable); |
---|
231 | 265 | } |
---|
| 266 | + |
---|
| 267 | + blockloop = false; |
---|
232 | 268 | } |
---|
233 | 269 | |
---|
234 | 270 | void RestoreBigData(Object3D o) |
---|
235 | 271 | { |
---|
236 | 272 | this.bRep = o.bRep; |
---|
237 | | - if (this.bRep != null) |
---|
238 | | - this.bRep.support = o.transientrep; |
---|
| 273 | + if (this.support != null && o.transientrep != null) |
---|
| 274 | + { |
---|
| 275 | + this.support.bRep = o.transientrep; |
---|
| 276 | + } |
---|
| 277 | + |
---|
| 278 | + this.selection = o.selection; |
---|
| 279 | + |
---|
| 280 | + this.versions = o.versions; |
---|
| 281 | + this.versionindex = o.versionindex; |
---|
| 282 | +// July 2019 if (this.bRep != null) |
---|
| 283 | +// this.bRep.support = o.transientrep; |
---|
239 | 284 | // this.support = o.support; |
---|
240 | 285 | // this.fileparent = o.fileparent; |
---|
241 | 286 | } |
---|
.. | .. |
---|
881 | 926 | |
---|
882 | 927 | if (marked && Globals.isLIVE() && live && |
---|
883 | 928 | //TEMP21aug2018 |
---|
884 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 929 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
885 | 930 | currentframe != Globals.framecount) |
---|
886 | 931 | { |
---|
887 | 932 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
966 | 1011 | if (material == null || material.multiply) |
---|
967 | 1012 | return true; |
---|
968 | 1013 | |
---|
| 1014 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
969 | 1015 | return material.opacity > 0.99; |
---|
970 | 1016 | } |
---|
971 | 1017 | |
---|
.. | .. |
---|
1366 | 1412 | toParent = LA.newMatrix(); |
---|
1367 | 1413 | fromParent = LA.newMatrix(); |
---|
1368 | 1414 | } |
---|
| 1415 | + |
---|
1369 | 1416 | LA.matCopy(other.toParent, toParent); |
---|
1370 | 1417 | LA.matCopy(other.fromParent, fromParent); |
---|
1371 | 1418 | |
---|
.. | .. |
---|
2387 | 2434 | } |
---|
2388 | 2435 | */ |
---|
2389 | 2436 | } |
---|
| 2437 | + else |
---|
| 2438 | + { |
---|
| 2439 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2440 | + } |
---|
2390 | 2441 | } |
---|
2391 | 2442 | |
---|
2392 | 2443 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2428 | 2479 | { |
---|
2429 | 2480 | editWindow.refreshContents(); |
---|
2430 | 2481 | } |
---|
| 2482 | + else |
---|
| 2483 | + { |
---|
| 2484 | + if (manipWindow != null) |
---|
| 2485 | + { |
---|
| 2486 | + manipWindow.refreshContents(); |
---|
| 2487 | + } |
---|
| 2488 | + } |
---|
| 2489 | + |
---|
2431 | 2490 | //if (parent != null) |
---|
2432 | 2491 | //parent.refreshEditWindow(); |
---|
2433 | 2492 | } |
---|
.. | .. |
---|
4958 | 5017 | } |
---|
4959 | 5018 | } |
---|
4960 | 5019 | |
---|
| 5020 | + ObjEditor GetWindow() |
---|
| 5021 | + { |
---|
| 5022 | + if (editWindow != null) |
---|
| 5023 | + return editWindow; |
---|
| 5024 | + |
---|
| 5025 | + return manipWindow; |
---|
| 5026 | + } |
---|
| 5027 | + |
---|
4961 | 5028 | cTreePath Select(int indexcount, boolean deselect) |
---|
4962 | 5029 | { |
---|
4963 | 5030 | if (hide || dontselect) |
---|
.. | .. |
---|
4994 | 5061 | if (leaf != null) |
---|
4995 | 5062 | { |
---|
4996 | 5063 | cTreePath tp = new cTreePath(this, leaf); |
---|
4997 | | - if (editWindow != null) |
---|
| 5064 | + ObjEditor window = GetWindow(); |
---|
| 5065 | + if (window != null) |
---|
4998 | 5066 | { |
---|
4999 | 5067 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
5000 | | - editWindow.Select(tp, deselect, true); |
---|
| 5068 | + window.Select(tp, deselect, true); |
---|
5001 | 5069 | } |
---|
5002 | 5070 | |
---|
5003 | 5071 | return tp; |
---|
.. | .. |
---|
5014 | 5082 | |
---|
5015 | 5083 | if (child == null) |
---|
5016 | 5084 | continue; |
---|
| 5085 | + |
---|
5017 | 5086 | if (child.HasTransparency() && child.size() != 0) |
---|
5018 | 5087 | { |
---|
5019 | 5088 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
5023 | 5092 | if (leaf != null) |
---|
5024 | 5093 | { |
---|
5025 | 5094 | cTreePath tp = new cTreePath(this, leaf); |
---|
5026 | | - if (editWindow != null) |
---|
| 5095 | + ObjEditor window = GetWindow(); |
---|
| 5096 | + if (window != null) |
---|
5027 | 5097 | { |
---|
5028 | | - editWindow.Select(tp, deselect, true); |
---|
| 5098 | + window.Select(tp, deselect, true); |
---|
5029 | 5099 | } |
---|
5030 | 5100 | |
---|
5031 | 5101 | return tp; |
---|
.. | .. |
---|
5746 | 5816 | support = support; |
---|
5747 | 5817 | |
---|
5748 | 5818 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5749 | | - boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5819 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5750 | 5820 | |
---|
5751 | 5821 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5752 | 5822 | { |
---|
.. | .. |
---|
5767 | 5837 | |
---|
5768 | 5838 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5769 | 5839 | //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5770 | | - (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
| 5840 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5771 | 5841 | { |
---|
5772 | 5842 | Globals.lighttouched = true; |
---|
5773 | 5843 | } // all panes... |
---|
.. | .. |
---|
5899 | 5969 | if (GetBRep() != null) |
---|
5900 | 5970 | { |
---|
5901 | 5971 | display.NextIndex(); |
---|
| 5972 | + |
---|
5902 | 5973 | // vertex color conflict : gl.glCallList(list); |
---|
5903 | 5974 | DrawNode(display, root, selected); |
---|
5904 | 5975 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
6359 | 6430 | // dec 2012 |
---|
6360 | 6431 | new Exception().printStackTrace(); |
---|
6361 | 6432 | return; |
---|
| 6433 | + } |
---|
| 6434 | + |
---|
| 6435 | + if (dontselect) |
---|
| 6436 | + { |
---|
| 6437 | + //bRep.GenerateNormalsMINE(); |
---|
6362 | 6438 | } |
---|
6363 | 6439 | |
---|
6364 | 6440 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
7251 | 7327 | // { |
---|
7252 | 7328 | // CameraPane.Ymax = spoth; |
---|
7253 | 7329 | // } |
---|
7254 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
7255 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7330 | + info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
| 7331 | + (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
7256 | 7332 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7257 | 7333 | // if (CameraPane.Xmin > boundary.x) |
---|
7258 | 7334 | // { |
---|
.. | .. |
---|
7796 | 7872 | editWindow = null; |
---|
7797 | 7873 | } // ? |
---|
7798 | 7874 | } |
---|
| 7875 | + else |
---|
| 7876 | + { |
---|
| 7877 | + //editWindow.closeUI(); |
---|
| 7878 | + } |
---|
7799 | 7879 | } |
---|
7800 | 7880 | |
---|
7801 | 7881 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7953 | 8033 | } |
---|
7954 | 8034 | |
---|
7955 | 8035 | transient ObjEditor editWindow; |
---|
| 8036 | + transient ObjEditor manipWindow; |
---|
| 8037 | + |
---|
| 8038 | + transient boolean pinned; |
---|
| 8039 | + |
---|
7956 | 8040 | transient ObjectUI objectUI; |
---|
7957 | 8041 | public static int povDepth = 0; |
---|
7958 | 8042 | private static cVector tbMin = new cVector(); |
---|